From 1c50e868b01791f3df6eebe7bb321645a6b444c6 Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Mon, 24 Jun 2024 15:05:00 -0400 Subject: [PATCH 01/48] refactor: dependencies upgraded --- .github/workflows/precompile_binaries.yml | 14 +- CHANGELOG.md | 4 +- README.md | 4 +- example/ios/Podfile.lock | 4 +- example/lib/main.dart | 79 +- example/pubspec.lock | 118 +- ios/Classes/frb_generated.h | 558 +- ios/ldk_node.podspec | 2 +- lib/ldk_node.dart | 4 +- lib/src/generated/api/error.dart | 19 +- lib/src/generated/api/node.dart | 394 +- lib/src/generated/api/types.dart | 927 +- lib/src/generated/api/types.freezed.dart | 10303 +++++++++++++++++--- lib/src/generated/frb_generated.dart | 3226 ++++-- lib/src/generated/frb_generated.io.dart | 2990 +++++- lib/src/generated/frb_generated.web.dart | 1413 ++- lib/src/root.dart | 424 +- lib/src/utils/default_services.dart | 9 - lib/src/utils/exceptions.dart | 32 +- pubspec.yaml | 15 +- rust/Cargo.lock | 700 +- rust/Cargo.toml | 10 +- rust/cargokit.yaml | 7 +- rust/src/api/error.rs | 32 +- rust/src/api/mod.rs | 2 +- rust/src/api/node.rs | 450 +- rust/src/api/types.rs | 1198 ++- rust/src/frb_generated.io.rs | 1430 ++- rust/src/frb_generated.rs | 2680 ++++- rust/src/frb_generated.web.rs | 871 +- 30 files changed, 22741 insertions(+), 5178 deletions(-) delete mode 100644 lib/src/utils/default_services.dart diff --git a/.github/workflows/precompile_binaries.yml b/.github/workflows/precompile_binaries.yml index c2442a8..4ef54fd 100644 --- a/.github/workflows/precompile_binaries.yml +++ b/.github/workflows/precompile_binaries.yml @@ -1,6 +1,6 @@ on: push: - branches: [v0.2.2-dev, main] + branches: [main, v0.2.2-dev] name: Precompile Binaries @@ -13,7 +13,6 @@ jobs: os: - ubuntu-20.04 - macOS-latest - - windows-latest steps: - uses: actions/checkout@v4 - uses: actions-rs/toolchain@v1 @@ -33,17 +32,8 @@ 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') || (matrix.os == 'windows-latest') + if: (matrix.os == 'macOS-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 16f6ba8..e0a4cfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +## [0.2.3-dev] + ## [0.2.2-dev] Updated Rust and Flutter dependencies. #### APIs added @@ -117,4 +119,4 @@ This is the first release of `ldk_node`. It features support for sourcing chain `stop`- Disconnects all peers, stops all running background tasks, and shuts down Node. -`syncWallets`- Sync the `LDK & BDK` wallets with the current chain state. +`syncWallets`- Sync the `LDK & BDK` wallets with the current chain state. \ No newline at end of file diff --git a/README.md b/README.md index 8a41c4b..ba5a465 100644 --- a/README.md +++ b/README.md @@ -40,12 +40,12 @@ To use the `ldk_node` package in your project, add it as a dependency in your pr ```dart dependencies: - ldk_node: ^0.2.2-dev + ldk_node: ^0.2.3-dev ``` or add from pub.dev using `pub add` command ``` - flutter pub add ldk_node@0.2.2-dev + flutter pub add ldk_node ``` ### Examples diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 0bbacec..fdb695d 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1,6 +1,6 @@ PODS: - Flutter (1.0.0) - - ldk_node (0.2.2-dev): + - ldk_node (0.2.3-dev): - Flutter - path_provider_foundation (0.0.1): - Flutter @@ -21,7 +21,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 - ldk_node: 5b3cacf9e7a5d5ae0d5c24e133af5c37c3da338b + ldk_node: 9a905c37e1b20c9cbd3632f385d5cf2bbdc2942e path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c PODFILE CHECKSUM: 4e8f8b2be68aeea4c0d5beb6ff1e79fface1d048 diff --git a/example/lib/main.dart b/example/lib/main.dart index cee0032..5b01d7c 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -26,7 +26,7 @@ class _MyAppState extends State { String displayText = ""; ldk.SocketAddress? bobAddr; ldk.Bolt11Invoice? invoice; - ldk.ChannelId? channelId; + ldk.UserChannelId? userChannelId; // Replace this with your local esplora url String esploraUrl = @@ -63,7 +63,7 @@ class _MyAppState extends State { closeChannel() async { await aliceNode.closeChannel( - channelId: channelId!, counterpartyNodeId: bobNodeId!); + userChannelId: userChannelId!, counterpartyNodeId: bobNodeId!); } Future initAliceNode() async { @@ -108,23 +108,21 @@ class _MyAppState extends State { final res = await bobNode.nodeId(); setState(() { bobNodeId = res; - displayText = "$bobNodeId started successfully"; + displayText = "${bobNodeId!.hex} started successfully"; }); } totalOnchainBalanceSats() async { - final alice = await aliceNode.totalOnchainBalanceSats(); - final bob = await bobNode.totalOnchainBalanceSats(); + final alice = await aliceNode.listBalances(); + final bob = await bobNode.listBalances(); if (kDebugMode) { - 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()}"); + 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}"); } setState(() { - aliceBalance = alice; + aliceBalance = alice.spendableOnchainBalanceSats; }); } @@ -143,6 +141,7 @@ class _MyAppState extends State { print("======Channels========"); for (var e in res) { print("nodeId: ${aliceNodeId!.hex}"); + print("userChannelId: ${e.userChannelId.data}"); print("channelId: ${e.channelId.data}"); print("isChannelReady: ${e.isChannelReady}"); print("isUsable: ${e.isUsable}"); @@ -161,9 +160,8 @@ class _MyAppState extends State { print("======Payments========"); for (var e in res) { print("amountMsat: ${e.amountMsat}"); - print("hash: ${e.hash.data}"); - print("preimage: ${e.preimage?.data}"); - print("secret: ${e.secret!.data}"); + print("paymentId: ${e.id.field0}"); + print("status: ${e.status.name}"); } } } @@ -176,7 +174,7 @@ class _MyAppState extends State { removeLastPayment() async { final lastPayment = await listPaymentsWithFilter(false); if (lastPayment != null) { - final _ = await aliceNode.removePayment(paymentHash: lastPayment.hash); + final _ = await aliceNode.removePayment(paymentId: lastPayment.id); setState(() { displayText = "${lastPayment.hash.internal} removed"; }); @@ -184,8 +182,8 @@ class _MyAppState extends State { } Future> newOnchainAddress() async { - final alice = await aliceNode.newOnchainAddress(); - final bob = await bobNode.newOnchainAddress(); + final alice = await (await aliceNode.onChainPayment()).newAddress(); + final bob = await (await bobNode.onChainPayment()).newAddress(); if (kDebugMode) { print("alice's address: ${alice.s}"); print("bob's address: ${bob.s}"); @@ -212,7 +210,7 @@ class _MyAppState extends State { connectOpenChannel() async { final funding_amount_sat = 80000; final push_msat = (funding_amount_sat / 2) * 1000; - await aliceNode.connectOpenChannel( + userChannelId = await aliceNode.connectOpenChannel( channelAmountSats: funding_amount_sat, announceChannel: true, socketAddress: bobAddr!, @@ -221,36 +219,21 @@ class _MyAppState extends State { } receiveAndSendPayments() async { - invoice = await bobNode.receivePayment( + final bobBolt11Handler = await bobNode.bolt11Payment(); + final aliceBolt11Handler = await aliceNode.bolt11Payment(); + invoice = await bobBolt11Handler.receive( amountMsat: 2500000, description: 'asdf', expirySecs: 9217); setState(() { displayText = invoice.toString(); }); - final paymentHash = await aliceNode.sendPayment(invoice: invoice!); - final res = await aliceNode.payment(paymentHash: paymentHash); + final paymentId = await aliceBolt11Handler.send(invoice: invoice!); + final res = await aliceNode.payment(paymentId: paymentId); setState(() { - displayText = "send payment success ${res?.hash.data}"; + displayText = + "Payment status: ${res?.status.name}\n PaymentId: ${res?.id.field0}"; }); } - 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(); @@ -462,20 +445,6 @@ 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(); diff --git a/example/pubspec.lock b/example/pubspec.lock index f297b01..448ccf8 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: transitive description: name: args - sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" url: "https://pub.dev" source: hosted - version: "2.4.2" + version: "2.5.0" async: dependency: transitive description: @@ -69,10 +69,10 @@ packages: dependency: "direct main" description: name: cupertino_icons - sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 url: "https://pub.dev" source: hosted - version: "1.0.6" + version: "1.0.8" fake_async: dependency: transitive description: @@ -85,10 +85,10 @@ packages: dependency: transitive description: name: ffi - sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" + sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.2" fixnum: dependency: transitive description: @@ -114,10 +114,10 @@ packages: dependency: transitive description: name: flutter_rust_bridge - sha256: e9a8716b1ad2fc81c434f3e4bf84b86c578578678c57e568b44aea7acf210102 + sha256: f703c4b50e253e53efc604d50281bbaefe82d615856f8ae1e7625518ae252e98 url: "https://pub.dev" source: hosted - version: "2.0.0-dev.31" + version: "2.0.0" flutter_test: dependency: "direct dev" description: flutter @@ -143,10 +143,10 @@ packages: dependency: transitive description: name: http - sha256: a2bbf9d017fcced29139daa8ed2bba4ece450ab222871df93ca9eec6f80c34ba + sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.1" http_parser: dependency: transitive description: @@ -155,29 +155,45 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.2" - js: - dependency: transitive - description: - name: js - sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf - url: "https://pub.dev" - source: hosted - version: "0.7.1" json_annotation: dependency: transitive description: name: json_annotation - sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" url: "https://pub.dev" source: hosted - version: "4.8.1" + version: "4.9.0" ldk_node: dependency: "direct main" description: path: ".." relative: true source: path - version: "0.2.2-dev" + version: "0.2.3-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,58 +206,58 @@ 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: name: path_provider - sha256: b27217933eeeba8ff24845c34003b003b2b22151de3c908d0e679e8fe1aa078b + sha256: c9e7d3a4cd1410877472158bee69963a4579f78b68c65a2b7d40d1a7a88bb161 url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.3" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: "477184d672607c0a3bf68fbbf601805f92ef79c82b64b4d6eb318cbca4c48668" + sha256: bca87b0165ffd7cdb9cad8edd22d18d2201e886d9a9f19b4fb3452ea7df3a72a url: "https://pub.dev" source: hosted - version: "2.2.2" + version: "2.2.6" path_provider_foundation: dependency: transitive description: name: path_provider_foundation - sha256: "5a7999be66e000916500be4f15a3633ebceb8302719b47b9cc49ce924125350f" + sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16 url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.4.0" path_provider_linux: dependency: transitive description: @@ -270,10 +286,10 @@ packages: dependency: transitive description: name: platform - sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec" + sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65" url: "https://pub.dev" source: hosted - version: "3.1.4" + version: "3.1.5" plugin_platform_interface: dependency: transitive description: @@ -339,10 +355,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: @@ -355,10 +371,10 @@ packages: dependency: transitive description: name: uuid - sha256: cd210a09f7c18cbe5a02511718e0334de6559871052c90a90c0cca46a4aa81c8 + sha256: "814e9e88f21a176ae1359149021870e87f7cddaf633ab678a5d2b0bff7fd1ba8" url: "https://pub.dev" source: hosted - version: "4.3.3" + version: "4.4.0" vector_math: dependency: transitive description: @@ -367,22 +383,30 @@ 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: name: web - sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" url: "https://pub.dev" source: hosted - version: "0.3.0" + version: "0.5.1" win32: dependency: transitive description: name: win32 - sha256: "464f5674532865248444b4c3daca12bd9bf2d7c47f759ce2617986e7229494a8" + sha256: a79dbe579cb51ecd6d30b17e0cae4e0ea15e2c0e66f69ad4198f22a6789e94f4 url: "https://pub.dev" source: hosted - version: "5.2.0" + version: "5.5.1" xdg_directories: dependency: transitive description: @@ -392,5 +416,5 @@ packages: source: hosted version: "1.0.4" sdks: - dart: ">=3.2.0 <4.0.0" - flutter: ">=3.10.0" + dart: ">=3.4.0 <4.0.0" + flutter: ">=3.22.0" diff --git a/ios/Classes/frb_generated.h b/ios/Classes/frb_generated.h index a72914e..79ea5f8 100644 --- a/ios/Classes/frb_generated.h +++ b/ios/Classes/frb_generated.h @@ -140,13 +140,31 @@ 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_bolt_11_payment { + uintptr_t ptr; +} wire_cst_ldk_bolt_11_payment; + +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_ldk_node { uintptr_t ptr; } wire_cst_ldk_node; -typedef struct wire_cst_channel_id { +typedef struct wire_cst_user_channel_id { struct wire_cst_list_prim_u_8_strict *data; -} wire_cst_channel_id; +} wire_cst_user_channel_id; typedef struct wire_cst_MaxDustHTLCExposure_FixedLimitMsat { uint64_t field0; @@ -170,57 +188,76 @@ 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; + 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_payment_id { + struct wire_cst_list_prim_u_8_strict *field0; +} wire_cst_payment_id; + +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_ldk_on_chain_payment { + uintptr_t ptr; +} wire_cst_ldk_on_chain_payment; 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_ldk_spontaneous_payment { + uintptr_t ptr; +} wire_cst_ldk_spontaneous_payment; -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_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_ClosureReason_ProcessingError { + struct wire_cst_list_prim_u_8_strict *err; +} wire_cst_ClosureReason_ProcessingError; + +typedef union ClosureReasonKind { + struct wire_cst_ClosureReason_CounterpartyForceClosed CounterpartyForceClosed; + struct wire_cst_ClosureReason_ProcessingError ProcessingError; +} ClosureReasonKind; + +typedef struct wire_cst_closure_reason { + int32_t tag; + union ClosureReasonKind kind; +} wire_cst_closure_reason; + +typedef struct wire_cst_payment_hash { + struct wire_cst_list_prim_u_8_strict *data; +} wire_cst_payment_hash; typedef struct wire_cst_Event_PaymentSuccessful { + struct wire_cst_payment_id *payment_id; 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_id *payment_id; struct wire_cst_payment_hash *payment_hash; + int32_t *reason; } wire_cst_Event_PaymentFailed; typedef struct wire_cst_Event_PaymentReceived { + struct wire_cst_payment_id *payment_id; struct wire_cst_payment_hash *payment_hash; 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; @@ -238,13 +275,26 @@ 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 { @@ -252,6 +302,11 @@ typedef struct wire_cst_event { union EventKind kind; } wire_cst_event; +typedef struct wire_cst_lsp_fee_limits { + uint64_t *max_total_opening_fee_msat; + uint64_t *max_proportional_opening_fee_ppm_msat; +} wire_cst_lsp_fee_limits; + typedef struct wire_cst_payment_preimage { struct wire_cst_list_prim_u_8_strict *data; } wire_cst_payment_preimage; @@ -260,10 +315,38 @@ typedef struct wire_cst_payment_secret { struct wire_cst_list_prim_u_8_strict *data; } wire_cst_payment_secret; -typedef struct wire_cst_payment_details { - struct wire_cst_payment_hash hash; +typedef struct wire_cst_PaymentKind_Bolt11 { + struct wire_cst_payment_hash *hash; + struct wire_cst_payment_preimage *preimage; + struct wire_cst_payment_secret *secret; +} wire_cst_PaymentKind_Bolt11; + +typedef struct wire_cst_PaymentKind_Bolt11Jit { + struct wire_cst_payment_hash *hash; struct wire_cst_payment_preimage *preimage; struct wire_cst_payment_secret *secret; + struct wire_cst_lsp_fee_limits *lsp_fee_limits; +} wire_cst_PaymentKind_Bolt11Jit; + +typedef struct wire_cst_PaymentKind_Spontaneous { + struct wire_cst_payment_hash *hash; + struct wire_cst_payment_preimage *preimage; +} wire_cst_PaymentKind_Spontaneous; + +typedef union PaymentKindKind { + struct wire_cst_PaymentKind_Bolt11 Bolt11; + struct wire_cst_PaymentKind_Bolt11Jit Bolt11Jit; + struct wire_cst_PaymentKind_Spontaneous Spontaneous; +} PaymentKindKind; + +typedef struct wire_cst_payment_kind { + int32_t tag; + union PaymentKindKind kind; +} wire_cst_payment_kind; + +typedef struct wire_cst_payment_details { + struct wire_cst_payment_id id; + struct wire_cst_payment_kind kind; uint64_t *amount_msat; int32_t direction; int32_t status; @@ -272,12 +355,11 @@ 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_list_prim_u_8_strict *funding_txo; + struct wire_cst_out_point *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; @@ -286,6 +368,19 @@ 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 { @@ -293,6 +388,69 @@ 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; @@ -309,19 +467,130 @@ typedef struct wire_cst_list_peer_details { int32_t len; } wire_cst_list_peer_details; -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_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; + +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; + +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_NodeBuilder_build(int64_t port_, uintptr_t that); + +void frbgen_ldk_node_wire_NodeBuilder_build_with_fs_store(int64_t port_, uintptr_t that); + +void frbgen_ldk_node_wire_NodeBuilder_create_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_ldk_bolt_11_payment_receive(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + uint64_t amount_msat, + struct wire_cst_list_prim_u_8_strict *description, + uint32_t expiry_secs); + +void frbgen_ldk_node_wire_ldk_bolt_11_payment_receive_variable_amount(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + struct wire_cst_list_prim_u_8_strict *description, + uint32_t expiry_secs); + +void frbgen_ldk_node_wire_ldk_bolt_11_payment_receive_variable_amount_via_jit_channel(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *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_ldk_bolt_11_payment_receive_via_jit_channel(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *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_ldk_bolt_11_payment_send(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + struct wire_cst_bolt_11_invoice *invoice); + +void frbgen_ldk_node_wire_ldk_bolt_11_payment_send_probes(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + struct wire_cst_bolt_11_invoice *invoice); + +void frbgen_ldk_node_wire_ldk_bolt_11_payment_send_probes_using_amount(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + struct wire_cst_bolt_11_invoice *invoice, + uint64_t amount_msat); + +void frbgen_ldk_node_wire_ldk_bolt_11_payment_send_using_amount(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + struct wire_cst_bolt_11_invoice *invoice, + uint64_t amount_msat); void frbgen_ldk_node_wire_ldk_mnemonic_generate(int64_t port_); +void frbgen_ldk_node_wire_ldk_node_bolt11_payment(int64_t port_, struct wire_cst_ldk_node *ptr); + 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_user_channel_id *user_channel_id, struct wire_cst_public_key *counterparty_node_id); +void frbgen_ldk_node_wire_ldk_node_config(int64_t port_, struct wire_cst_ldk_node *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, @@ -343,7 +612,7 @@ void frbgen_ldk_node_wire_ldk_node_disconnect(int64_t port_, void frbgen_ldk_node_wire_ldk_node_event_handled(int64_t port_, struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_ldk_node_is_running(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire_ldk_node_list_balances(int64_t port_, struct wire_cst_ldk_node *that); void frbgen_ldk_node_wire_ldk_node_list_channels(int64_t port_, struct wire_cst_ldk_node *that); @@ -358,88 +627,40 @@ void frbgen_ldk_node_wire_ldk_node_list_peers(int64_t port_, struct wire_cst_ldk void frbgen_ldk_node_wire_ldk_node_listening_addresses(int64_t port_, struct wire_cst_ldk_node *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_ldk_node_next_event(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire_ldk_node_next_event_async(int64_t port_, struct wire_cst_ldk_node *that); + void frbgen_ldk_node_wire_ldk_node_node_id(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire_ldk_node_on_chain_payment(int64_t port_, struct wire_cst_ldk_node *ptr); + 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_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_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); + struct wire_cst_payment_id *payment_id); 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_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_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_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_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_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_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_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_ldk_node_send_to_onchain_address(int64_t port_, - struct wire_cst_ldk_node *that, - struct wire_cst_address *address, - uint64_t amount_sats); + struct wire_cst_payment_id *payment_id); 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_ldk_node_spendable_onchain_balance_sats(int64_t port_, - struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire_ldk_node_spontaneous_payment(int64_t port_, + struct wire_cst_ldk_node *ptr); void frbgen_ldk_node_wire_ldk_node_start(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire_ldk_node_status(int64_t port_, struct wire_cst_ldk_node *that); + void frbgen_ldk_node_wire_ldk_node_stop(int64_t port_, struct wire_cst_ldk_node *that); void frbgen_ldk_node_wire_ldk_node_sync_wallets(int64_t port_, struct wire_cst_ldk_node *that); -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_user_channel_id *user_channel_id, struct wire_cst_public_key *counterparty_node_id, struct wire_cst_channel_config *channel_config); @@ -447,19 +668,51 @@ 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); + struct wire_cst_public_key *public_key); 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_ldk_on_chain_payment_new_address(int64_t port_, + struct wire_cst_ldk_on_chain_payment *that); + +void frbgen_ldk_node_wire_ldk_on_chain_payment_send_all_to_address(int64_t port_, + struct wire_cst_ldk_on_chain_payment *that, + struct wire_cst_address *address); + +void frbgen_ldk_node_wire_ldk_on_chain_payment_send_to_address(int64_t port_, + struct wire_cst_ldk_on_chain_payment *that, + struct wire_cst_address *address, + uint64_t amount_sats); + +void frbgen_ldk_node_wire_ldk_spontaneous_payment_send(int64_t port_, + struct wire_cst_ldk_spontaneous_payment *that, + uint64_t amount_msat, + struct wire_cst_public_key *node_id); + +void frbgen_ldk_node_wire_ldk_spontaneous_payment_send_probes(int64_t port_, + struct wire_cst_ldk_spontaneous_payment *that, + uint64_t amount_msat, + struct wire_cst_public_key *node_id); -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_Node(const void *ptr); -void frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore(const void *ptr); +void frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_Node(const void *ptr); -void frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore(const void *ptr); +void frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder(const void *ptr); + +void frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder(const void *ptr); + +void frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment(const void *ptr); + +void frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment(const void *ptr); + +void frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment(const void *ptr); + +void frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment(const void *ptr); + +void frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment(const void *ptr); + +void frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment(const void *ptr); struct wire_cst_address *frbgen_ldk_node_cst_new_box_autoadd_address(void); @@ -471,6 +724,8 @@ 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); @@ -479,16 +734,32 @@ 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_ldk_bolt_11_payment *frbgen_ldk_node_cst_new_box_autoadd_ldk_bolt_11_payment(void); + struct wire_cst_ldk_mnemonic *frbgen_ldk_node_cst_new_box_autoadd_ldk_mnemonic(void); struct wire_cst_ldk_node *frbgen_ldk_node_cst_new_box_autoadd_ldk_node(void); +struct wire_cst_ldk_on_chain_payment *frbgen_ldk_node_cst_new_box_autoadd_ldk_on_chain_payment(void); + +struct wire_cst_ldk_spontaneous_payment *frbgen_ldk_node_cst_new_box_autoadd_ldk_spontaneous_payment(void); + +struct wire_cst_liquidity_source_config *frbgen_ldk_node_cst_new_box_autoadd_liquidity_source_config(void); + +struct wire_cst_lsp_fee_limits *frbgen_ldk_node_cst_new_box_autoadd_lsp_fee_limits(void); + +struct wire_cst_max_dust_htlc_exposure *frbgen_ldk_node_cst_new_box_autoadd_max_dust_htlc_exposure(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_id *frbgen_ldk_node_cst_new_box_autoadd_payment_id(void); + struct wire_cst_payment_preimage *frbgen_ldk_node_cst_new_box_autoadd_payment_preimage(void); struct wire_cst_payment_secret *frbgen_ldk_node_cst_new_box_autoadd_payment_secret(void); @@ -497,6 +768,10 @@ 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); @@ -505,10 +780,14 @@ 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); @@ -523,70 +802,97 @@ 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_ldk_bolt_11_payment); 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_ldk_on_chain_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_ldk_spontaneous_payment); + 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_lsp_fee_limits); + 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_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_id); 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_build_with_sqlite_store); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_Node); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_Node); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBuilder_build); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBuilder_build_with_fs_store); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBuilder_create_builder); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_bolt_11_payment_receive); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_bolt_11_payment_receive_variable_amount); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_bolt_11_payment_receive_variable_amount_via_jit_channel); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_bolt_11_payment_receive_via_jit_channel); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_bolt_11_payment_send); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_bolt_11_payment_send_probes); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_bolt_11_payment_send_probes_using_amount); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_bolt_11_payment_send_using_amount); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_mnemonic_generate); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_bolt11_payment); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_close_channel); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_config); 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_balances); 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_next_event_async); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_node_id); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_on_chain_payment); 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_spontaneous_payment); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_start); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_status); 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*) frbgen_ldk_node_wire_ldk_on_chain_payment_new_address); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_on_chain_payment_send_all_to_address); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_on_chain_payment_send_to_address); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_spontaneous_payment_send); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_spontaneous_payment_send_probes); dummy_var ^= ((int64_t) (void*) store_dart_post_cobject); return dummy_var; } diff --git a/ios/ldk_node.podspec b/ios/ldk_node.podspec index 696a1b2..1513dc0 100644 --- a/ios/ldk_node.podspec +++ b/ios/ldk_node.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'ldk_node' - s.version = '0.2.2-dev' + s.version = '0.2.3-dev' s.summary = 'A ready-to-go Lightning node library built using LDK and BDK.' s.homepage = 'http://example.com' s.license = { :file => '../LICENSE' } diff --git a/lib/ldk_node.dart b/lib/ldk_node.dart index d5934f7..02781e3 100644 --- a/lib/ldk_node.dart +++ b/lib/ldk_node.dart @@ -24,7 +24,5 @@ export './src/generated/api/types.dart' GossipSourceConfig, EntropySourceConfig_SeedFile; export 'src/root.dart'; -export 'src/generated/api/node.dart' - show U8Array4, U8Array12, U8Array64, U8Array32; export 'src/utils/utils.dart' - hide LdkException, mapBuilderException, mapNodeException, Frb; + hide ExceptionBase, mapBuilderException, mapNodeException, Frb; diff --git a/lib/src/generated/api/error.dart b/lib/src/generated/api/error.dart index f9b1e46..8a720f1 100644 --- a/lib/src/generated/api/error.dart +++ b/lib/src/generated/api/error.dart @@ -41,7 +41,7 @@ enum BuilderException { /// We failed to setup the logger. loggerSetupFailed, - invalidTrustedPeer, + invalidPublicKey, } enum NodeException { @@ -133,5 +133,22 @@ enum NodeException { /// There are insufficient funds to complete the given operation. insufficientFunds, + + ///A fee rate estimation update failed. feerateEstimationUpdateFailed, + + ///A liquidity request operation failed. + liquidityRequestFailed, + + ///The given operation failed due to the required liquidity source being unavailable. + liquiditySourceUnavailable, + + ///The given operation failed due to the LSP's required opening fee being too high. + liquidityFeeTooHigh, + + ///The given payment id is invalid. + invalidPaymentId, + + ///An error in decoding a message or struct. + decodeError, } diff --git a/lib/src/generated/api/node.dart b/lib/src/generated/api/node.dart index 20d548f..4593005 100644 --- a/lib/src/generated/api/node.dart +++ b/lib/src/generated/api/node.dart @@ -9,38 +9,209 @@ import 'package:collection/collection.dart'; import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; import 'types.dart'; -Future buildWithSqliteStore( - {required Config config, - ChainDataSourceConfig? chainDataSourceConfig, - EntropySourceConfig? entropySourceConfig, - GossipSourceConfig? gossipSourceConfig, - dynamic hint}) => - LdkCore.instance.api.buildWithSqliteStore( - config: config, - chainDataSourceConfig: chainDataSourceConfig, - entropySourceConfig: entropySourceConfig, - gossipSourceConfig: gossipSourceConfig, - hint: hint); - -// Rust type: RustOpaqueNom> +// Rust type: RustOpaqueNom @sealed -class NodeSqliteStore extends RustOpaque { - NodeSqliteStore.dcoDecode(List wire) +class Node extends RustOpaque { + Node.dcoDecode(List wire) : super.dcoDecode(wire, _kStaticData); + + Node.sseDecode(int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + LdkCore.instance.api.rust_arc_increment_strong_count_Node, + rustArcDecrementStrongCount: + LdkCore.instance.api.rust_arc_decrement_strong_count_Node, + rustArcDecrementStrongCountPtr: + LdkCore.instance.api.rust_arc_decrement_strong_count_NodePtr, + ); +} + +// Rust type: RustOpaqueNom> +@sealed +class NodeBuilder extends RustOpaque { + NodeBuilder.dcoDecode(List wire) : super.dcoDecode(wire, _kStaticData); - NodeSqliteStore.sseDecode(int ptr, int externalSizeOnNative) + NodeBuilder.sseDecode(int ptr, int externalSizeOnNative) : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); static final _kStaticData = RustArcStaticData( rustArcIncrementStrongCount: - LdkCore.instance.api.rust_arc_increment_strong_count_NodeSqliteStore, + LdkCore.instance.api.rust_arc_increment_strong_count_NodeBuilder, rustArcDecrementStrongCount: - LdkCore.instance.api.rust_arc_decrement_strong_count_NodeSqliteStore, + LdkCore.instance.api.rust_arc_decrement_strong_count_NodeBuilder, rustArcDecrementStrongCountPtr: - LdkCore.instance.api.rust_arc_decrement_strong_count_NodeSqliteStorePtr, + LdkCore.instance.api.rust_arc_decrement_strong_count_NodeBuilderPtr, + ); + + Future build({dynamic hint}) => + LdkCore.instance.api.nodeBuilderBuild(that: this, hint: hint); + + Future buildWithFsStore({dynamic hint}) => + LdkCore.instance.api.nodeBuilderBuildWithFsStore(that: this, hint: hint); + + static Future createBuilder( + {required Config config, + ChainDataSourceConfig? chainDataSourceConfig, + EntropySourceConfig? entropySourceConfig, + GossipSourceConfig? gossipSourceConfig, + LiquiditySourceConfig? liquiditySourceConfig, + dynamic hint}) => + LdkCore.instance.api.nodeBuilderCreateBuilder( + config: config, + chainDataSourceConfig: chainDataSourceConfig, + entropySourceConfig: entropySourceConfig, + gossipSourceConfig: gossipSourceConfig, + liquiditySourceConfig: liquiditySourceConfig, + hint: hint); +} + +// Rust type: RustOpaqueNom +@sealed +class LdkNodePaymentBolt11Payment extends RustOpaque { + LdkNodePaymentBolt11Payment.dcoDecode(List wire) + : super.dcoDecode(wire, _kStaticData); + + LdkNodePaymentBolt11Payment.sseDecode(int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: LdkCore.instance.api + .rust_arc_increment_strong_count_LdkNodePaymentBolt11Payment, + rustArcDecrementStrongCount: LdkCore.instance.api + .rust_arc_decrement_strong_count_LdkNodePaymentBolt11Payment, + rustArcDecrementStrongCountPtr: LdkCore.instance.api + .rust_arc_decrement_strong_count_LdkNodePaymentBolt11PaymentPtr, ); } +// Rust type: RustOpaqueNom +@sealed +class LdkNodePaymentOnchainPayment extends RustOpaque { + LdkNodePaymentOnchainPayment.dcoDecode(List wire) + : super.dcoDecode(wire, _kStaticData); + + LdkNodePaymentOnchainPayment.sseDecode(int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: LdkCore.instance.api + .rust_arc_increment_strong_count_LdkNodePaymentOnchainPayment, + rustArcDecrementStrongCount: LdkCore.instance.api + .rust_arc_decrement_strong_count_LdkNodePaymentOnchainPayment, + rustArcDecrementStrongCountPtr: LdkCore.instance.api + .rust_arc_decrement_strong_count_LdkNodePaymentOnchainPaymentPtr, + ); +} + +// Rust type: RustOpaqueNom +@sealed +class LdkNodePaymentSpontaneousPayment extends RustOpaque { + LdkNodePaymentSpontaneousPayment.dcoDecode(List wire) + : super.dcoDecode(wire, _kStaticData); + + LdkNodePaymentSpontaneousPayment.sseDecode(int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: LdkCore.instance.api + .rust_arc_increment_strong_count_LdkNodePaymentSpontaneousPayment, + rustArcDecrementStrongCount: LdkCore.instance.api + .rust_arc_decrement_strong_count_LdkNodePaymentSpontaneousPayment, + rustArcDecrementStrongCountPtr: LdkCore.instance.api + .rust_arc_decrement_strong_count_LdkNodePaymentSpontaneousPaymentPtr, + ); +} + +class LdkBolt11Payment { + final LdkNodePaymentBolt11Payment ptr; + + const LdkBolt11Payment({ + required this.ptr, + }); + + Future receive( + {required int amountMsat, + required String description, + required int expirySecs, + dynamic hint}) => + LdkCore.instance.api.ldkBolt11PaymentReceive( + that: this, + amountMsat: amountMsat, + description: description, + expirySecs: expirySecs, + hint: hint); + + Future receiveVariableAmount( + {required String description, + required int expirySecs, + dynamic hint}) => + LdkCore.instance.api.ldkBolt11PaymentReceiveVariableAmount( + that: this, + description: description, + expirySecs: expirySecs, + hint: hint); + + Future receiveVariableAmountViaJitChannel( + {required String description, + required int expirySecs, + int? maxProportionalLspFeeLimitPpmMsat, + dynamic hint}) => + LdkCore.instance.api.ldkBolt11PaymentReceiveVariableAmountViaJitChannel( + that: this, + description: description, + expirySecs: expirySecs, + maxProportionalLspFeeLimitPpmMsat: maxProportionalLspFeeLimitPpmMsat, + hint: hint); + + Future receiveViaJitChannel( + {required int amountMsat, + required String description, + required int expirySecs, + int? maxTotalLspFeeLimitMsat, + dynamic hint}) => + LdkCore.instance.api.ldkBolt11PaymentReceiveViaJitChannel( + that: this, + amountMsat: amountMsat, + description: description, + expirySecs: expirySecs, + maxTotalLspFeeLimitMsat: maxTotalLspFeeLimitMsat, + hint: hint); + + Future send({required Bolt11Invoice invoice, dynamic hint}) => + LdkCore.instance.api + .ldkBolt11PaymentSend(that: this, invoice: invoice, hint: hint); + + Future sendProbes({required Bolt11Invoice invoice, dynamic hint}) => + LdkCore.instance.api + .ldkBolt11PaymentSendProbes(that: this, invoice: invoice, hint: hint); + + Future sendProbesUsingAmount( + {required Bolt11Invoice invoice, + required int amountMsat, + dynamic hint}) => + LdkCore.instance.api.ldkBolt11PaymentSendProbesUsingAmount( + that: this, invoice: invoice, amountMsat: amountMsat, hint: hint); + + Future sendUsingAmount( + {required Bolt11Invoice invoice, + required int amountMsat, + dynamic hint}) => + LdkCore.instance.api.ldkBolt11PaymentSendUsingAmount( + that: this, invoice: invoice, amountMsat: amountMsat, hint: hint); + + @override + int get hashCode => ptr.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LdkBolt11Payment && + runtimeType == other.runtimeType && + ptr == other.ptr; +} + class LdkMnemonic { final String seedPhrase; @@ -63,22 +234,29 @@ class LdkMnemonic { } class LdkNode { - final NodeSqliteStore ptr; + final Node ptr; const LdkNode({ required this.ptr, }); + static Future bolt11Payment( + {required LdkNode ptr, dynamic hint}) => + LdkCore.instance.api.ldkNodeBolt11Payment(ptr: ptr, hint: hint); + Future closeChannel( - {required ChannelId channelId, + {required UserChannelId userChannelId, required PublicKey counterpartyNodeId, dynamic hint}) => LdkCore.instance.api.ldkNodeCloseChannel( that: this, - channelId: channelId, + userChannelId: userChannelId, counterpartyNodeId: counterpartyNodeId, hint: hint); + Future config({dynamic hint}) => + LdkCore.instance.api.ldkNodeConfig(that: this, hint: hint); + Future connect( {required PublicKey nodeId, required SocketAddress address, @@ -91,7 +269,7 @@ class LdkNode { persist: persist, hint: hint); - Future connectOpenChannel( + Future connectOpenChannel( {required SocketAddress socketAddress, required PublicKey nodeId, required int channelAmountSats, @@ -117,8 +295,8 @@ class LdkNode { Future eventHandled({dynamic hint}) => LdkCore.instance.api.ldkNodeEventHandled(that: this, hint: hint); - Future isRunning({dynamic hint}) => - LdkCore.instance.api.ldkNodeIsRunning(that: this, hint: hint); + Future listBalances({dynamic hint}) => + LdkCore.instance.api.ldkNodeListBalances(that: this, hint: hint); Future> listChannels({dynamic hint}) => LdkCore.instance.api.ldkNodeListChannels(that: this, hint: hint); @@ -137,119 +315,55 @@ class LdkNode { Future?> listeningAddresses({dynamic hint}) => LdkCore.instance.api.ldkNodeListeningAddresses(that: this, hint: hint); - Future
newOnchainAddress({dynamic hint}) => - LdkCore.instance.api.ldkNodeNewOnchainAddress(that: this, hint: hint); - Future nextEvent({dynamic hint}) => LdkCore.instance.api.ldkNodeNextEvent(that: this, hint: hint); + Future nextEventAsync({dynamic hint}) => + LdkCore.instance.api.ldkNodeNextEventAsync(that: this, hint: hint); + Future nodeId({dynamic hint}) => LdkCore.instance.api.ldkNodeNodeId(that: this, hint: hint); - Future payment( - {required PaymentHash paymentHash, dynamic hint}) => - 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.ldkNodeReceivePayment( - that: this, - amountMsat: amountMsat, - description: description, - expirySecs: expirySecs, - hint: hint); + static Future onChainPayment( + {required LdkNode ptr, dynamic hint}) => + LdkCore.instance.api.ldkNodeOnChainPayment(ptr: ptr, hint: hint); - Future receiveVariableAmountPayment( - {required String description, - required int expirySecs, - dynamic hint}) => - LdkCore.instance.api.ldkNodeReceiveVariableAmountPayment( - that: this, - description: description, - expirySecs: expirySecs, - hint: hint); - - Future removePayment( - {required PaymentHash paymentHash, dynamic hint}) => - LdkCore.instance.api.ldkNodeRemovePayment( - that: this, paymentHash: paymentHash, hint: hint); - - Future sendAllToOnchainAddress( - {required Address address, dynamic hint}) => - LdkCore.instance.api.ldkNodeSendAllToOnchainAddress( - that: this, address: address, hint: hint); - - Future sendPayment( - {required Bolt11Invoice invoice, dynamic hint}) => + Future payment( + {required PaymentId paymentId, dynamic hint}) => LdkCore.instance.api - .ldkNodeSendPayment(that: this, invoice: invoice, hint: hint); + .ldkNodePayment(that: this, paymentId: paymentId, hint: hint); - Future sendPaymentProbes( - {required Bolt11Invoice invoice, dynamic hint}) => + Future removePayment({required PaymentId paymentId, dynamic hint}) => LdkCore.instance.api - .ldkNodeSendPaymentProbes(that: this, invoice: invoice, hint: hint); - - Future sendPaymentProbesUsingAmount( - {required Bolt11Invoice invoice, - required int amountMsat, - dynamic hint}) => - 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.ldkNodeSendPaymentUsingAmount( - that: this, invoice: invoice, amountMsat: amountMsat, hint: hint); - - Future sendSpontaneousPayment( - {required int amountMsat, required PublicKey nodeId, dynamic hint}) => - 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.ldkNodeSendSpontaneousPaymentProbes( - that: this, amountMsat: amountMsat, nodeId: nodeId, hint: hint); - - Future sendToOnchainAddress( - {required Address address, required int amountSats, dynamic hint}) => - LdkCore.instance.api.ldkNodeSendToOnchainAddress( - that: this, address: address, amountSats: amountSats, hint: hint); + .ldkNodeRemovePayment(that: this, paymentId: paymentId, hint: hint); Future signMessage({required List msg, dynamic hint}) => LdkCore.instance.api.ldkNodeSignMessage(that: this, msg: msg, hint: hint); - Future spendableOnchainBalanceSats({dynamic hint}) => - LdkCore.instance.api - .ldkNodeSpendableOnchainBalanceSats(that: this, hint: hint); + static Future spontaneousPayment( + {required LdkNode ptr, dynamic hint}) => + LdkCore.instance.api.ldkNodeSpontaneousPayment(ptr: ptr, hint: hint); Future start({dynamic hint}) => LdkCore.instance.api.ldkNodeStart(that: this, hint: hint); + Future status({dynamic hint}) => + LdkCore.instance.api.ldkNodeStatus(that: this, hint: hint); + Future stop({dynamic hint}) => LdkCore.instance.api.ldkNodeStop(that: this, hint: hint); Future syncWallets({dynamic hint}) => LdkCore.instance.api.ldkNodeSyncWallets(that: this, hint: hint); - Future totalOnchainBalanceSats({dynamic hint}) => LdkCore.instance.api - .ldkNodeTotalOnchainBalanceSats(that: this, hint: hint); - Future updateChannelConfig( - {required ChannelId channelId, + {required UserChannelId userChannelId, required PublicKey counterpartyNodeId, required ChannelConfig channelConfig, dynamic hint}) => LdkCore.instance.api.ldkNodeUpdateChannelConfig( that: this, - channelId: channelId, + userChannelId: userChannelId, counterpartyNodeId: counterpartyNodeId, channelConfig: channelConfig, hint: hint); @@ -257,10 +371,10 @@ class LdkNode { Future verifySignature( {required List msg, required String sig, - required PublicKey pkey, + required PublicKey publicKey, dynamic hint}) => LdkCore.instance.api.ldkNodeVerifySignature( - that: this, msg: msg, sig: sig, pkey: pkey, hint: hint); + that: this, msg: msg, sig: sig, publicKey: publicKey, hint: hint); Future waitNextEvent({dynamic hint}) => LdkCore.instance.api.ldkNodeWaitNextEvent(that: this, hint: hint); @@ -274,6 +388,64 @@ class LdkNode { other is LdkNode && runtimeType == other.runtimeType && ptr == other.ptr; } +class LdkOnChainPayment { + final LdkNodePaymentOnchainPayment ptr; + + const LdkOnChainPayment({ + required this.ptr, + }); + + Future
newAddress({dynamic hint}) => + LdkCore.instance.api.ldkOnChainPaymentNewAddress(that: this, hint: hint); + + Future sendAllToAddress({required Address address, dynamic hint}) => + LdkCore.instance.api.ldkOnChainPaymentSendAllToAddress( + that: this, address: address, hint: hint); + + Future sendToAddress( + {required Address address, required int amountSats, dynamic hint}) => + LdkCore.instance.api.ldkOnChainPaymentSendToAddress( + that: this, address: address, amountSats: amountSats, hint: hint); + + @override + int get hashCode => ptr.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LdkOnChainPayment && + runtimeType == other.runtimeType && + ptr == other.ptr; +} + +class LdkSpontaneousPayment { + final LdkNodePaymentSpontaneousPayment ptr; + + const LdkSpontaneousPayment({ + required this.ptr, + }); + + Future send( + {required int amountMsat, required PublicKey nodeId, dynamic hint}) => + LdkCore.instance.api.ldkSpontaneousPaymentSend( + that: this, amountMsat: amountMsat, nodeId: nodeId, hint: hint); + + Future sendProbes( + {required int amountMsat, required PublicKey nodeId, dynamic hint}) => + LdkCore.instance.api.ldkSpontaneousPaymentSendProbes( + that: this, amountMsat: amountMsat, nodeId: nodeId, hint: hint); + + @override + int get hashCode => ptr.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LdkSpontaneousPayment && + runtimeType == other.runtimeType && + ptr == other.ptr; +} + class U8Array12 extends NonGrowableListView { static const arraySize = 12; diff --git a/lib/src/generated/api/types.dart b/lib/src/generated/api/types.dart index 412aae8..437c45f 100644 --- a/lib/src/generated/api/types.dart +++ b/lib/src/generated/api/types.dart @@ -4,7 +4,6 @@ // 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; @@ -28,6 +27,91 @@ 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 { @@ -79,7 +163,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. /// @@ -93,15 +177,13 @@ 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, - required this.maxDustHtlcExposure, + this.maxDustHtlcExposure, required this.forceCloseAvoidanceMaxFeeSatoshis, required this.acceptUnderpayingHtlcs, }); @@ -130,118 +212,146 @@ class ChannelConfig { acceptUnderpayingHtlcs == other.acceptUnderpayingHtlcs; } -/// Details of a channel, as returned by node.listChannels() -/// class ChannelDetails { - /// 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). + /// 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). + /// /// 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 String? fundingTxo; + final OutPoint? 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 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 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. /// - /// This value is not included in `outbound_capacity_msat` as it can never be spent. + /// This value is not included in `outboundCapacityMsat` as it can never be spent. /// - /// This value will be null for outbound channels until the counterparty accepts the channel. + /// This value will be `None` for outbound channels until the counterparty accepts the channel. /// final int? unspendablePunishmentReserve; - /// 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. - /// + /// The local `user_channel_id` of this channel. 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; - /// 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 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 + /// The amount does not include any pending HTLCs which are not yet 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 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 available outbound capacity for sending HTLCs to the remote peer. /// + /// 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 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 number of required confirmations on the funding transactions before the funding is + /// considered "locked". The amount is selected by the channel fundee. /// + /// 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; - /// True if the channel was initiated (and thus funded) by us. - /// + /// Returns `true` if the channel was initiated (and therefore funded) by us. final bool isOutbound; - /// 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 - /// + /// 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; - /// 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 is a strict superset of `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. /// + /// This is a strict superset of `is_channel_ready`. final bool isUsable; - /// True if this channel is (or will be) publicly-announced. - /// + /// 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; + + /// 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. + /// + /// This value is not included in [`inbound_capacity_msat`] as it can never be spent. + /// + /// [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat + final int counterpartyUnspendablePunishmentReserve; + + /// The smallest value HTLC (in msat) the remote peer will accept, for this channel. + /// + /// 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; + const ChannelDetails({ required this.channelId, required this.counterpartyNodeId, @@ -250,7 +360,6 @@ class ChannelDetails { this.unspendablePunishmentReserve, required this.userChannelId, required this.feerateSatPer1000Weight, - required this.balanceMsat, required this.outboundCapacityMsat, required this.inboundCapacityMsat, this.confirmationsRequired, @@ -259,6 +368,19 @@ 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 @@ -270,7 +392,6 @@ class ChannelDetails { unspendablePunishmentReserve.hashCode ^ userChannelId.hashCode ^ feerateSatPer1000Weight.hashCode ^ - balanceMsat.hashCode ^ outboundCapacityMsat.hashCode ^ inboundCapacityMsat.hashCode ^ confirmationsRequired.hashCode ^ @@ -278,7 +399,20 @@ class ChannelDetails { isOutbound.hashCode ^ isChannelReady.hashCode ^ isUsable.hashCode ^ - isPublic.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; @override bool operator ==(Object other) => @@ -292,7 +426,6 @@ class ChannelDetails { unspendablePunishmentReserve == other.unspendablePunishmentReserve && userChannelId == other.userChannelId && feerateSatPer1000Weight == other.feerateSatPer1000Weight && - balanceMsat == other.balanceMsat && outboundCapacityMsat == other.outboundCapacityMsat && inboundCapacityMsat == other.inboundCapacityMsat && confirmationsRequired == other.confirmationsRequired && @@ -300,7 +433,26 @@ class ChannelDetails { isOutbound == other.isOutbound && isChannelReady == other.isChannelReady && isUsable == other.isUsable && - isPublic == other.isPublic; + 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; } /// The global identifier of a channel. @@ -327,6 +479,102 @@ class ChannelId { data == other.data; } +@freezed +sealed class ClosureReason with _$ClosureReason { + const 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. + /// + /// [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel. + 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. + /// + /// This was only set in versions of LDK prior to 0.0.122. + const factory ClosureReason.legacyCooperativeClosure() = + ClosureReason_LegacyCooperativeClosure; + + /// The channel was closed after negotiating a cooperative close and we've now broadcasted + /// the cooperative close transaction. This indicates that the shutdown was initiated by our + /// counterparty. + /// + /// In rare cases where we initiated closure immediately prior to shutting down without + /// persisting, this value may be provided for channels we initiated closure for. + const factory ClosureReason.counterpartyInitiatedCooperativeClosure() = + ClosureReason_CounterpartyInitiatedCooperativeClosure; + + /// The channel was closed after negotiating a cooperative close and we've now broadcasted + /// the cooperative close transaction. This indicates that the shutdown was initiated by us. + const factory ClosureReason.locallyInitiatedCooperativeClosure() = + ClosureReason_LocallyInitiatedCooperativeClosure; + + /// 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. + /// + /// [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor + const factory ClosureReason.disconnectedPeer() = + ClosureReason_DisconnectedPeer; + + /// Closure generated from `ChannelManager::read` if the [`ChannelMonitor`] is newer than + /// the [`ChannelManager`] deserialized. + /// + /// [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor + /// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager + 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; + + /// One of our HTLCs timed out in a channel, causing us to force close the channel. + const factory ClosureReason.htlCsTimedOut() = ClosureReason_HTLCsTimedOut; +} + /// Represents the configuration of an [Node] instance. /// class Config { @@ -441,18 +689,41 @@ sealed class Event with _$Event { /// A sent payment was successful. const factory Event.paymentSuccessful({ + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + PaymentId? paymentId, + /// 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({ + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + PaymentId? paymentId, + /// 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. const factory Event.paymentReceived({ + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + PaymentId? paymentId, + /// The hash of the payment. required PaymentHash paymentHash, @@ -460,43 +731,54 @@ 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 `channelId` of the channel. + required ChannelId channelId, + + /// The `userChannelId` of the channel. + required UserChannelId userChannelId, + + /// The `temporaryChannelId` this channel used to be known by during channel establishment. + required ChannelId formerTemporaryChannelId, + + /// The `nodeId` 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 `channelId` of the channel. required ChannelId channelId, - /// The user_channel_id of the channel. + /// The `userChannelId` of the channel. required UserChannelId userChannelId, + + /// The `nodeId` 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. - required ChannelId channelId, - - /// The user_channel_id of the channel. - required UserChannelId userChannelId, - PublicKey? counterpartyNodeId, - }) = Event_ChannelClosed; - - /// A channel has been created and is pending confirmation on-chain. - const factory Event.channelPending({ - /// The channel_id of the channel. + /// The `channelId` of the channel. required ChannelId channelId, - /// The user_channel_id of the channel. + /// The `userChannelId` 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 `nodeId` of the channel counterparty. + /// + /// This will be `None` for events serialized by LDK Node v0.1.0 and prior. + PublicKey? counterpartyNodeId, - /// The outpoint of the channel's funding transaction. - required OutPoint fundingTxo, - }) = Event_ChannelPending; + /// This will be `None` for events serialized by LDK Node v0.2.1 and prior. + ClosureReason? reason, + }) = Event_ChannelClosed; } @freezed @@ -509,6 +791,153 @@ sealed class GossipSourceConfig with _$GossipSourceConfig { ) = GossipSourceConfig_RapidGossipSync; } +@freezed +sealed class LightningBalance with _$LightningBalance { + const 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. + 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 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 identifier of our channel counterparty. + required PublicKey counterpartyNodeId, + + /// The amount, in satoshis, of the output which we can claim. + required int amountSatoshis, + }) = LightningBalance_CounterpartyRevokedOutputClaimable; +} + +class LiquiditySourceConfig { + final (SocketAddress, PublicKey, String?) lsps2Service; + + const LiquiditySourceConfig({ + required this.lsps2Service, + }); + + @override + int get hashCode => lsps2Service.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LiquiditySourceConfig && + runtimeType == other.runtimeType && + lsps2Service == other.lsps2Service; +} + /// An enum representing the available verbosity levels of the logger. /// enum LogLevel { @@ -537,6 +966,36 @@ enum LogLevel { error, } +/// Limits applying to how much fee we allow an LSP to deduct from the payment amount. +class LSPFeeLimits { + /// The maximal total amount we allow any configured LSP withhold from us when forwarding the + /// payment. + final int? maxTotalOpeningFeeMsat; + + /// The maximal proportional fee, in parts-per-million millisatoshi, we allow any configured + /// LSP withhold from us when forwarding the payment. + final int? maxProportionalOpeningFeePpmMsat; + + const LSPFeeLimits({ + this.maxTotalOpeningFeeMsat, + this.maxProportionalOpeningFeePpmMsat, + }); + + @override + int get hashCode => + maxTotalOpeningFeeMsat.hashCode ^ + maxProportionalOpeningFeePpmMsat.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LSPFeeLimits && + runtimeType == other.runtimeType && + maxTotalOpeningFeeMsat == other.maxTotalOpeningFeeMsat && + maxProportionalOpeningFeePpmMsat == + other.maxProportionalOpeningFeePpmMsat; +} + @freezed sealed class MaxDustHTLCExposure with _$MaxDustHTLCExposure { const MaxDustHTLCExposure._(); @@ -572,6 +1031,88 @@ 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 { @@ -596,16 +1137,12 @@ class OutPoint { } /// Represents a payment. -/// class PaymentDetails { - /// The payment hash, i.e., the hash of the `preimage`. - final PaymentHash hash; + /// The identifier of this payment. + final PaymentId id; - /// The pre-image used by the payment. - final PaymentPreimage? preimage; - - /// The secret used by the payment. - final PaymentSecret? secret; + /// The kind of the payment. + final PaymentKind kind; /// The amount transferred. final int? amountMsat; @@ -617,9 +1154,8 @@ class PaymentDetails { final PaymentStatus status; const PaymentDetails({ - required this.hash, - this.preimage, - this.secret, + required this.id, + required this.kind, this.amountMsat, required this.direction, required this.status, @@ -627,9 +1163,8 @@ class PaymentDetails { @override int get hashCode => - hash.hashCode ^ - preimage.hashCode ^ - secret.hashCode ^ + id.hashCode ^ + kind.hashCode ^ amountMsat.hashCode ^ direction.hashCode ^ status.hashCode; @@ -639,9 +1174,8 @@ class PaymentDetails { identical(this, other) || other is PaymentDetails && runtimeType == other.runtimeType && - hash == other.hash && - preimage == other.preimage && - secret == other.secret && + id == other.id && + kind == other.kind && amountMsat == other.amountMsat && direction == other.direction && status == other.status; @@ -657,6 +1191,33 @@ 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 { @@ -677,6 +1238,78 @@ class PaymentHash { data == other.data; } +///A user-provided identifier in channelManager.sendPayment used to uniquely identify a payment and ensure idempotency in LDK. +class PaymentId { + final U8Array32 field0; + + const PaymentId({ + required this.field0, + }); + + @override + int get hashCode => field0.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is PaymentId && + runtimeType == other.runtimeType && + field0 == other.field0; +} + +@freezed +sealed class PaymentKind with _$PaymentKind { + const PaymentKind._(); + + /// An on-chain payment. + const factory PaymentKind.onchain() = PaymentKind_Onchain; + + /// A [BOLT 11] payment. + /// + /// [BOLT 11]: https://github.com/lightning/bolts/blob/master/11-payment-encoding.md + const factory PaymentKind.bolt11({ + /// The payment hash, i.e., the hash of the `preimage`. + required PaymentHash hash, + + /// The pre-image used by the payment. + PaymentPreimage? preimage, + + /// The secret used by the payment. + PaymentSecret? secret, + }) = PaymentKind_Bolt11; + + /// A [BOLT 11] payment intended to open an [LSPS 2] just-in-time channel. + /// + /// [BOLT 11]: https://github.com/lightning/bolts/blob/master/11-payment-encoding.md + /// [LSPS 2]: https://github.com/BitcoinAndLightningLayerSpecs/lsp/blob/main/LSPS2/README.md + const factory PaymentKind.bolt11Jit({ + /// The payment hash, i.e., the hash of the `preimage`. + required PaymentHash hash, + + /// The pre-image used by the payment. + PaymentPreimage? preimage, + + /// The secret used by the payment. + PaymentSecret? secret, + + /// Limits applying to how much fee we allow an LSP to deduct from the payment amount. + /// + /// Allowing them to deduct this fee from the first inbound payment will pay for the LSP's + /// channel opening fees. + /// + required LSPFeeLimits lspFeeLimits, + }) = PaymentKind_Bolt11Jit; + + /// A spontaneous ("keysend") payment. + const factory PaymentKind.spontaneous({ + /// The payment hash, i.e., the hash of the `preimage`. + required PaymentHash hash, + + /// The pre-image used by the payment. + PaymentPreimage? preimage, + }) = PaymentKind_Spontaneous; +} + /// paymentPreimage type, use to route payment between hop /// class PaymentPreimage { @@ -764,6 +1397,59 @@ class PeerDetails { isConnected == other.isConnected; } +@freezed +sealed class PendingSweepBalance with _$PendingSweepBalance { + const 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 { @@ -809,13 +1495,6 @@ 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. @@ -841,7 +1520,7 @@ class Txid { /// By default, this will be randomly generated for the user to ensure local uniqueness. /// class UserChannelId { - final int data; + final Uint8List 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 1a466c2..c936acd 100644 --- a/lib/src/generated/api/types.freezed.dart +++ b/lib/src/generated/api/types.freezed.dart @@ -230,66 +230,158 @@ abstract class ChainDataSourceConfig_Esplora extends ChainDataSourceConfig { } /// @nodoc -mixin _$EntropySourceConfig { +mixin _$ClosureReason { @optionalTypeArgs TResult when({ - required TResult Function(String field0) seedFile, - required TResult Function(U8Array64 field0) seedBytes, - required TResult Function(LdkMnemonic mnemonic, String? passphrase) - bip39Mnemonic, + required TResult Function(String peerMsg) counterpartyForceClosed, + required TResult Function() holderForceClosed, + required TResult Function() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(String field0)? seedFile, - TResult? Function(U8Array64 field0)? seedBytes, - TResult? Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult maybeWhen({ - TResult Function(String field0)? seedFile, - TResult Function(U8Array64 field0)? seedBytes, - TResult Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, 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, + required TResult Function(ClosureReason_CounterpartyForceClosed value) + counterpartyForceClosed, + required TResult Function(ClosureReason_HolderForceClosed value) + holderForceClosed, + required TResult Function(ClosureReason_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(EntropySourceConfig_SeedFile value)? seedFile, - TResult? Function(EntropySourceConfig_SeedBytes value)? seedBytes, - TResult? Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult maybeMap({ - TResult Function(EntropySourceConfig_SeedFile value)? seedFile, - TResult Function(EntropySourceConfig_SeedBytes value)? seedBytes, - TResult Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, required TResult orElse(), }) => throw _privateConstructorUsedError; } /// @nodoc -abstract class $EntropySourceConfigCopyWith<$Res> { - factory $EntropySourceConfigCopyWith( - EntropySourceConfig value, $Res Function(EntropySourceConfig) then) = - _$EntropySourceConfigCopyWithImpl<$Res, EntropySourceConfig>; +abstract class $ClosureReasonCopyWith<$Res> { + factory $ClosureReasonCopyWith( + ClosureReason value, $Res Function(ClosureReason) then) = + _$ClosureReasonCopyWithImpl<$Res, ClosureReason>; } /// @nodoc -class _$EntropySourceConfigCopyWithImpl<$Res, $Val extends EntropySourceConfig> - implements $EntropySourceConfigCopyWith<$Res> { - _$EntropySourceConfigCopyWithImpl(this._value, this._then); +class _$ClosureReasonCopyWithImpl<$Res, $Val extends ClosureReason> + implements $ClosureReasonCopyWith<$Res> { + _$ClosureReasonCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; @@ -298,34 +390,34 @@ class _$EntropySourceConfigCopyWithImpl<$Res, $Val extends EntropySourceConfig> } /// @nodoc -abstract class _$$EntropySourceConfig_SeedFileImplCopyWith<$Res> { - factory _$$EntropySourceConfig_SeedFileImplCopyWith( - _$EntropySourceConfig_SeedFileImpl value, - $Res Function(_$EntropySourceConfig_SeedFileImpl) then) = - __$$EntropySourceConfig_SeedFileImplCopyWithImpl<$Res>; +abstract class _$$ClosureReason_CounterpartyForceClosedImplCopyWith<$Res> { + factory _$$ClosureReason_CounterpartyForceClosedImplCopyWith( + _$ClosureReason_CounterpartyForceClosedImpl value, + $Res Function(_$ClosureReason_CounterpartyForceClosedImpl) then) = + __$$ClosureReason_CounterpartyForceClosedImplCopyWithImpl<$Res>; @useResult - $Res call({String field0}); + $Res call({String peerMsg}); } /// @nodoc -class __$$EntropySourceConfig_SeedFileImplCopyWithImpl<$Res> - extends _$EntropySourceConfigCopyWithImpl<$Res, - _$EntropySourceConfig_SeedFileImpl> - implements _$$EntropySourceConfig_SeedFileImplCopyWith<$Res> { - __$$EntropySourceConfig_SeedFileImplCopyWithImpl( - _$EntropySourceConfig_SeedFileImpl _value, - $Res Function(_$EntropySourceConfig_SeedFileImpl) _then) +class __$$ClosureReason_CounterpartyForceClosedImplCopyWithImpl<$Res> + extends _$ClosureReasonCopyWithImpl<$Res, + _$ClosureReason_CounterpartyForceClosedImpl> + implements _$$ClosureReason_CounterpartyForceClosedImplCopyWith<$Res> { + __$$ClosureReason_CounterpartyForceClosedImplCopyWithImpl( + _$ClosureReason_CounterpartyForceClosedImpl _value, + $Res Function(_$ClosureReason_CounterpartyForceClosedImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override $Res call({ - Object? field0 = null, + Object? peerMsg = null, }) { - return _then(_$EntropySourceConfig_SeedFileImpl( - null == field0 - ? _value.field0 - : field0 // ignore: cast_nullable_to_non_nullable + return _then(_$ClosureReason_CounterpartyForceClosedImpl( + peerMsg: null == peerMsg + ? _value.peerMsg + : peerMsg // ignore: cast_nullable_to_non_nullable as String, )); } @@ -333,67 +425,105 @@ class __$$EntropySourceConfig_SeedFileImplCopyWithImpl<$Res> /// @nodoc -class _$EntropySourceConfig_SeedFileImpl extends EntropySourceConfig_SeedFile { - const _$EntropySourceConfig_SeedFileImpl(this.field0) : super._(); +class _$ClosureReason_CounterpartyForceClosedImpl + extends ClosureReason_CounterpartyForceClosed { + const _$ClosureReason_CounterpartyForceClosedImpl({required this.peerMsg}) + : 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 field0; + final String peerMsg; @override String toString() { - return 'EntropySourceConfig.seedFile(field0: $field0)'; + return 'ClosureReason.counterpartyForceClosed(peerMsg: $peerMsg)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$EntropySourceConfig_SeedFileImpl && - (identical(other.field0, field0) || other.field0 == field0)); + other is _$ClosureReason_CounterpartyForceClosedImpl && + (identical(other.peerMsg, peerMsg) || other.peerMsg == peerMsg)); } @override - int get hashCode => Object.hash(runtimeType, field0); + int get hashCode => Object.hash(runtimeType, peerMsg); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$EntropySourceConfig_SeedFileImplCopyWith< - _$EntropySourceConfig_SeedFileImpl> - get copyWith => __$$EntropySourceConfig_SeedFileImplCopyWithImpl< - _$EntropySourceConfig_SeedFileImpl>(this, _$identity); + _$$ClosureReason_CounterpartyForceClosedImplCopyWith< + _$ClosureReason_CounterpartyForceClosedImpl> + get copyWith => __$$ClosureReason_CounterpartyForceClosedImplCopyWithImpl< + _$ClosureReason_CounterpartyForceClosedImpl>(this, _$identity); @override @optionalTypeArgs TResult when({ - required TResult Function(String field0) seedFile, - required TResult Function(U8Array64 field0) seedBytes, - required TResult Function(LdkMnemonic mnemonic, String? passphrase) - bip39Mnemonic, + required TResult Function(String peerMsg) counterpartyForceClosed, + required TResult Function() holderForceClosed, + required TResult Function() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, }) { - return seedFile(field0); + return counterpartyForceClosed(peerMsg); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(String field0)? seedFile, - TResult? Function(U8Array64 field0)? seedBytes, - TResult? Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, }) { - return seedFile?.call(field0); + return counterpartyForceClosed?.call(peerMsg); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(String field0)? seedFile, - TResult Function(U8Array64 field0)? seedBytes, - TResult Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, required TResult orElse(), }) { - if (seedFile != null) { - return seedFile(field0); + if (counterpartyForceClosed != null) { + return counterpartyForceClosed(peerMsg); } return orElse(); } @@ -401,150 +531,222 @@ class _$EntropySourceConfig_SeedFileImpl extends EntropySourceConfig_SeedFile { @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, + required TResult Function(ClosureReason_CounterpartyForceClosed value) + counterpartyForceClosed, + required TResult Function(ClosureReason_HolderForceClosed value) + holderForceClosed, + required TResult Function(ClosureReason_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, }) { - return seedFile(this); + return counterpartyForceClosed(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(EntropySourceConfig_SeedFile value)? seedFile, - TResult? Function(EntropySourceConfig_SeedBytes value)? seedBytes, - TResult? Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, }) { - return seedFile?.call(this); + return counterpartyForceClosed?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(EntropySourceConfig_SeedFile value)? seedFile, - TResult Function(EntropySourceConfig_SeedBytes value)? seedBytes, - TResult Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, required TResult orElse(), }) { - if (seedFile != null) { - return seedFile(this); + if (counterpartyForceClosed != null) { + return counterpartyForceClosed(this); } return orElse(); } } -abstract class EntropySourceConfig_SeedFile extends EntropySourceConfig { - const factory EntropySourceConfig_SeedFile(final String field0) = - _$EntropySourceConfig_SeedFileImpl; - const EntropySourceConfig_SeedFile._() : super._(); - - String get field0; +abstract class ClosureReason_CounterpartyForceClosed extends ClosureReason { + const factory ClosureReason_CounterpartyForceClosed( + {required final String peerMsg}) = + _$ClosureReason_CounterpartyForceClosedImpl; + const ClosureReason_CounterpartyForceClosed._() : 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 + String get peerMsg; @JsonKey(ignore: true) - _$$EntropySourceConfig_SeedFileImplCopyWith< - _$EntropySourceConfig_SeedFileImpl> + _$$ClosureReason_CounterpartyForceClosedImplCopyWith< + _$ClosureReason_CounterpartyForceClosedImpl> 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}); +abstract class _$$ClosureReason_HolderForceClosedImplCopyWith<$Res> { + factory _$$ClosureReason_HolderForceClosedImplCopyWith( + _$ClosureReason_HolderForceClosedImpl value, + $Res Function(_$ClosureReason_HolderForceClosedImpl) then) = + __$$ClosureReason_HolderForceClosedImplCopyWithImpl<$Res>; } /// @nodoc -class __$$EntropySourceConfig_SeedBytesImplCopyWithImpl<$Res> - extends _$EntropySourceConfigCopyWithImpl<$Res, - _$EntropySourceConfig_SeedBytesImpl> - implements _$$EntropySourceConfig_SeedBytesImplCopyWith<$Res> { - __$$EntropySourceConfig_SeedBytesImplCopyWithImpl( - _$EntropySourceConfig_SeedBytesImpl _value, - $Res Function(_$EntropySourceConfig_SeedBytesImpl) _then) +class __$$ClosureReason_HolderForceClosedImplCopyWithImpl<$Res> + extends _$ClosureReasonCopyWithImpl<$Res, + _$ClosureReason_HolderForceClosedImpl> + implements _$$ClosureReason_HolderForceClosedImplCopyWith<$Res> { + __$$ClosureReason_HolderForceClosedImplCopyWithImpl( + _$ClosureReason_HolderForceClosedImpl _value, + $Res Function(_$ClosureReason_HolderForceClosedImpl) _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 - extends EntropySourceConfig_SeedBytes { - const _$EntropySourceConfig_SeedBytesImpl(this.field0) : super._(); - - @override - final U8Array64 field0; +class _$ClosureReason_HolderForceClosedImpl + extends ClosureReason_HolderForceClosed { + const _$ClosureReason_HolderForceClosedImpl() : super._(); @override String toString() { - return 'EntropySourceConfig.seedBytes(field0: $field0)'; + return 'ClosureReason.holderForceClosed()'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$EntropySourceConfig_SeedBytesImpl && - const DeepCollectionEquality().equals(other.field0, field0)); + other is _$ClosureReason_HolderForceClosedImpl); } @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); + int get hashCode => runtimeType.hashCode; @override @optionalTypeArgs TResult when({ - required TResult Function(String field0) seedFile, - required TResult Function(U8Array64 field0) seedBytes, - required TResult Function(LdkMnemonic mnemonic, String? passphrase) - bip39Mnemonic, + required TResult Function(String peerMsg) counterpartyForceClosed, + required TResult Function() holderForceClosed, + required TResult Function() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, }) { - return seedBytes(field0); + return holderForceClosed(); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(String field0)? seedFile, - TResult? Function(U8Array64 field0)? seedBytes, - TResult? Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, }) { - return seedBytes?.call(field0); + return holderForceClosed?.call(); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(String field0)? seedFile, - TResult Function(U8Array64 field0)? seedBytes, - TResult Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, required TResult orElse(), }) { - if (seedBytes != null) { - return seedBytes(field0); + if (holderForceClosed != null) { + return holderForceClosed(); } return orElse(); } @@ -552,161 +754,208 @@ class _$EntropySourceConfig_SeedBytesImpl @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, + required TResult Function(ClosureReason_CounterpartyForceClosed value) + counterpartyForceClosed, + required TResult Function(ClosureReason_HolderForceClosed value) + holderForceClosed, + required TResult Function(ClosureReason_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, }) { - return seedBytes(this); + return holderForceClosed(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(EntropySourceConfig_SeedFile value)? seedFile, - TResult? Function(EntropySourceConfig_SeedBytes value)? seedBytes, - TResult? Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, }) { - return seedBytes?.call(this); + return holderForceClosed?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(EntropySourceConfig_SeedFile value)? seedFile, - TResult Function(EntropySourceConfig_SeedBytes value)? seedBytes, - TResult Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, required TResult orElse(), }) { - if (seedBytes != null) { - return seedBytes(this); + if (holderForceClosed != null) { + return holderForceClosed(this); } return orElse(); } } -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; +abstract class ClosureReason_HolderForceClosed extends ClosureReason { + const factory ClosureReason_HolderForceClosed() = + _$ClosureReason_HolderForceClosedImpl; + const ClosureReason_HolderForceClosed._() : super._(); } /// @nodoc -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}); +abstract class _$$ClosureReason_LegacyCooperativeClosureImplCopyWith<$Res> { + factory _$$ClosureReason_LegacyCooperativeClosureImplCopyWith( + _$ClosureReason_LegacyCooperativeClosureImpl value, + $Res Function(_$ClosureReason_LegacyCooperativeClosureImpl) then) = + __$$ClosureReason_LegacyCooperativeClosureImplCopyWithImpl<$Res>; } /// @nodoc -class __$$EntropySourceConfig_Bip39MnemonicImplCopyWithImpl<$Res> - extends _$EntropySourceConfigCopyWithImpl<$Res, - _$EntropySourceConfig_Bip39MnemonicImpl> - implements _$$EntropySourceConfig_Bip39MnemonicImplCopyWith<$Res> { - __$$EntropySourceConfig_Bip39MnemonicImplCopyWithImpl( - _$EntropySourceConfig_Bip39MnemonicImpl _value, - $Res Function(_$EntropySourceConfig_Bip39MnemonicImpl) _then) +class __$$ClosureReason_LegacyCooperativeClosureImplCopyWithImpl<$Res> + extends _$ClosureReasonCopyWithImpl<$Res, + _$ClosureReason_LegacyCooperativeClosureImpl> + implements _$$ClosureReason_LegacyCooperativeClosureImplCopyWith<$Res> { + __$$ClosureReason_LegacyCooperativeClosureImplCopyWithImpl( + _$ClosureReason_LegacyCooperativeClosureImpl _value, + $Res Function(_$ClosureReason_LegacyCooperativeClosureImpl) _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 _$EntropySourceConfig_Bip39MnemonicImpl - extends EntropySourceConfig_Bip39Mnemonic { - const _$EntropySourceConfig_Bip39MnemonicImpl( - {required this.mnemonic, this.passphrase}) - : super._(); - - @override - final LdkMnemonic mnemonic; - @override - final String? passphrase; +class _$ClosureReason_LegacyCooperativeClosureImpl + extends ClosureReason_LegacyCooperativeClosure { + const _$ClosureReason_LegacyCooperativeClosureImpl() : super._(); @override String toString() { - return 'EntropySourceConfig.bip39Mnemonic(mnemonic: $mnemonic, passphrase: $passphrase)'; + return 'ClosureReason.legacyCooperativeClosure()'; } @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)); + other is _$ClosureReason_LegacyCooperativeClosureImpl); } @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); + int get hashCode => runtimeType.hashCode; @override @optionalTypeArgs TResult when({ - required TResult Function(String field0) seedFile, - required TResult Function(U8Array64 field0) seedBytes, - required TResult Function(LdkMnemonic mnemonic, String? passphrase) - bip39Mnemonic, + required TResult Function(String peerMsg) counterpartyForceClosed, + required TResult Function() holderForceClosed, + required TResult Function() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, }) { - return bip39Mnemonic(mnemonic, passphrase); + return legacyCooperativeClosure(); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(String field0)? seedFile, - TResult? Function(U8Array64 field0)? seedBytes, - TResult? Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, }) { - return bip39Mnemonic?.call(mnemonic, passphrase); + return legacyCooperativeClosure?.call(); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(String field0)? seedFile, - TResult Function(U8Array64 field0)? seedBytes, - TResult Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, required TResult orElse(), }) { - if (bip39Mnemonic != null) { - return bip39Mnemonic(mnemonic, passphrase); + if (legacyCooperativeClosure != null) { + return legacyCooperativeClosure(); } return orElse(); } @@ -714,303 +963,218 @@ class _$EntropySourceConfig_Bip39MnemonicImpl @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, + required TResult Function(ClosureReason_CounterpartyForceClosed value) + counterpartyForceClosed, + required TResult Function(ClosureReason_HolderForceClosed value) + holderForceClosed, + required TResult Function(ClosureReason_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, }) { - return bip39Mnemonic(this); + return legacyCooperativeClosure(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(EntropySourceConfig_SeedFile value)? seedFile, - TResult? Function(EntropySourceConfig_SeedBytes value)? seedBytes, - TResult? Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, }) { - return bip39Mnemonic?.call(this); + return legacyCooperativeClosure?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(EntropySourceConfig_SeedFile value)? seedFile, - TResult Function(EntropySourceConfig_SeedBytes value)? seedBytes, - TResult Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, required TResult orElse(), }) { - if (bip39Mnemonic != null) { - return bip39Mnemonic(this); + if (legacyCooperativeClosure != null) { + return legacyCooperativeClosure(this); } return orElse(); } } -abstract class EntropySourceConfig_Bip39Mnemonic extends EntropySourceConfig { - const factory EntropySourceConfig_Bip39Mnemonic( - {required final LdkMnemonic mnemonic, - final String? passphrase}) = _$EntropySourceConfig_Bip39MnemonicImpl; - const EntropySourceConfig_Bip39Mnemonic._() : super._(); - - LdkMnemonic 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) 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, - OutPoint fundingTxo) - channelPending, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - 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, - OutPoint fundingTxo)? - channelPending, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - 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, - OutPoint fundingTxo)? - channelPending, - 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_ChannelReady value) channelReady, - required TResult Function(Event_ChannelClosed value) channelClosed, - required TResult Function(Event_ChannelPending value) channelPending, - }) => - 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_ChannelReady value)? channelReady, - TResult? Function(Event_ChannelClosed value)? channelClosed, - TResult? Function(Event_ChannelPending value)? channelPending, - }) => - 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_ChannelReady value)? channelReady, - TResult Function(Event_ChannelClosed value)? channelClosed, - TResult Function(Event_ChannelPending value)? channelPending, - 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; +abstract class ClosureReason_LegacyCooperativeClosure extends ClosureReason { + const factory ClosureReason_LegacyCooperativeClosure() = + _$ClosureReason_LegacyCooperativeClosureImpl; + const ClosureReason_LegacyCooperativeClosure._() : super._(); } /// @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}); +abstract class _$$ClosureReason_CounterpartyInitiatedCooperativeClosureImplCopyWith< + $Res> { + factory _$$ClosureReason_CounterpartyInitiatedCooperativeClosureImplCopyWith( + _$ClosureReason_CounterpartyInitiatedCooperativeClosureImpl value, + $Res Function( + _$ClosureReason_CounterpartyInitiatedCooperativeClosureImpl) + then) = + __$$ClosureReason_CounterpartyInitiatedCooperativeClosureImplCopyWithImpl< + $Res>; } /// @nodoc -class __$$Event_PaymentSuccessfulImplCopyWithImpl<$Res> - extends _$EventCopyWithImpl<$Res, _$Event_PaymentSuccessfulImpl> - implements _$$Event_PaymentSuccessfulImplCopyWith<$Res> { - __$$Event_PaymentSuccessfulImplCopyWithImpl( - _$Event_PaymentSuccessfulImpl _value, - $Res Function(_$Event_PaymentSuccessfulImpl) _then) +class __$$ClosureReason_CounterpartyInitiatedCooperativeClosureImplCopyWithImpl< + $Res> + extends _$ClosureReasonCopyWithImpl<$Res, + _$ClosureReason_CounterpartyInitiatedCooperativeClosureImpl> + implements + _$$ClosureReason_CounterpartyInitiatedCooperativeClosureImplCopyWith< + $Res> { + __$$ClosureReason_CounterpartyInitiatedCooperativeClosureImplCopyWithImpl( + _$ClosureReason_CounterpartyInitiatedCooperativeClosureImpl _value, + $Res Function(_$ClosureReason_CounterpartyInitiatedCooperativeClosureImpl) + _then) : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentHash = null, - }) { - return _then(_$Event_PaymentSuccessfulImpl( - paymentHash: null == paymentHash - ? _value.paymentHash - : paymentHash // ignore: cast_nullable_to_non_nullable - as PaymentHash, - )); - } } /// @nodoc -class _$Event_PaymentSuccessfulImpl extends Event_PaymentSuccessful { - const _$Event_PaymentSuccessfulImpl({required this.paymentHash}) : super._(); - - /// The hash of the payment. - @override - final PaymentHash paymentHash; +class _$ClosureReason_CounterpartyInitiatedCooperativeClosureImpl + extends ClosureReason_CounterpartyInitiatedCooperativeClosure { + const _$ClosureReason_CounterpartyInitiatedCooperativeClosureImpl() + : super._(); @override String toString() { - return 'Event.paymentSuccessful(paymentHash: $paymentHash)'; + return 'ClosureReason.counterpartyInitiatedCooperativeClosure()'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$Event_PaymentSuccessfulImpl && - (identical(other.paymentHash, paymentHash) || - other.paymentHash == paymentHash)); + other + is _$ClosureReason_CounterpartyInitiatedCooperativeClosureImpl); } @override - int get hashCode => Object.hash(runtimeType, paymentHash); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$Event_PaymentSuccessfulImplCopyWith<_$Event_PaymentSuccessfulImpl> - get copyWith => __$$Event_PaymentSuccessfulImplCopyWithImpl< - _$Event_PaymentSuccessfulImpl>(this, _$identity); + int get hashCode => runtimeType.hashCode; @override @optionalTypeArgs TResult when({ - 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, - OutPoint fundingTxo) - channelPending, + required TResult Function(String peerMsg) counterpartyForceClosed, + required TResult Function() holderForceClosed, + required TResult Function() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, }) { - return paymentSuccessful(paymentHash); + return counterpartyInitiatedCooperativeClosure(); } @override @optionalTypeArgs TResult? whenOrNull({ - 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, - OutPoint fundingTxo)? - channelPending, + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, }) { - return paymentSuccessful?.call(paymentHash); + return counterpartyInitiatedCooperativeClosure?.call(); } @override @optionalTypeArgs TResult maybeWhen({ - 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, - OutPoint fundingTxo)? - channelPending, + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, required TResult orElse(), }) { - if (paymentSuccessful != null) { - return paymentSuccessful(paymentHash); + if (counterpartyInitiatedCooperativeClosure != null) { + return counterpartyInitiatedCooperativeClosure(); } return orElse(); } @@ -1018,193 +1182,214 @@ class _$Event_PaymentSuccessfulImpl extends Event_PaymentSuccessful { @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_ChannelReady value) channelReady, - required TResult Function(Event_ChannelClosed value) channelClosed, - required TResult Function(Event_ChannelPending value) channelPending, + required TResult Function(ClosureReason_CounterpartyForceClosed value) + counterpartyForceClosed, + required TResult Function(ClosureReason_HolderForceClosed value) + holderForceClosed, + required TResult Function(ClosureReason_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, }) { - return paymentSuccessful(this); + return counterpartyInitiatedCooperativeClosure(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_ChannelReady value)? channelReady, - TResult? Function(Event_ChannelClosed value)? channelClosed, - TResult? Function(Event_ChannelPending value)? channelPending, + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, }) { - return paymentSuccessful?.call(this); + return counterpartyInitiatedCooperativeClosure?.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_ChannelReady value)? channelReady, - TResult Function(Event_ChannelClosed value)? channelClosed, - TResult Function(Event_ChannelPending value)? channelPending, + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, required TResult orElse(), }) { - if (paymentSuccessful != null) { - return paymentSuccessful(this); + if (counterpartyInitiatedCooperativeClosure != null) { + return counterpartyInitiatedCooperativeClosure(this); } return orElse(); } } -abstract class Event_PaymentSuccessful extends Event { - const factory Event_PaymentSuccessful( - {required final PaymentHash paymentHash}) = _$Event_PaymentSuccessfulImpl; - const Event_PaymentSuccessful._() : super._(); - - /// The hash of the payment. - PaymentHash get paymentHash; - @JsonKey(ignore: true) - _$$Event_PaymentSuccessfulImplCopyWith<_$Event_PaymentSuccessfulImpl> - get copyWith => throw _privateConstructorUsedError; +abstract class ClosureReason_CounterpartyInitiatedCooperativeClosure + extends ClosureReason { + const factory ClosureReason_CounterpartyInitiatedCooperativeClosure() = + _$ClosureReason_CounterpartyInitiatedCooperativeClosureImpl; + const ClosureReason_CounterpartyInitiatedCooperativeClosure._() : super._(); } /// @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}); +abstract class _$$ClosureReason_LocallyInitiatedCooperativeClosureImplCopyWith< + $Res> { + factory _$$ClosureReason_LocallyInitiatedCooperativeClosureImplCopyWith( + _$ClosureReason_LocallyInitiatedCooperativeClosureImpl value, + $Res Function(_$ClosureReason_LocallyInitiatedCooperativeClosureImpl) + then) = + __$$ClosureReason_LocallyInitiatedCooperativeClosureImplCopyWithImpl< + $Res>; } /// @nodoc -class __$$Event_PaymentFailedImplCopyWithImpl<$Res> - extends _$EventCopyWithImpl<$Res, _$Event_PaymentFailedImpl> - implements _$$Event_PaymentFailedImplCopyWith<$Res> { - __$$Event_PaymentFailedImplCopyWithImpl(_$Event_PaymentFailedImpl _value, - $Res Function(_$Event_PaymentFailedImpl) _then) +class __$$ClosureReason_LocallyInitiatedCooperativeClosureImplCopyWithImpl<$Res> + extends _$ClosureReasonCopyWithImpl<$Res, + _$ClosureReason_LocallyInitiatedCooperativeClosureImpl> + implements + _$$ClosureReason_LocallyInitiatedCooperativeClosureImplCopyWith<$Res> { + __$$ClosureReason_LocallyInitiatedCooperativeClosureImplCopyWithImpl( + _$ClosureReason_LocallyInitiatedCooperativeClosureImpl _value, + $Res Function(_$ClosureReason_LocallyInitiatedCooperativeClosureImpl) + _then) : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentHash = null, - }) { - return _then(_$Event_PaymentFailedImpl( - paymentHash: null == paymentHash - ? _value.paymentHash - : paymentHash // ignore: cast_nullable_to_non_nullable - as PaymentHash, - )); - } } /// @nodoc -class _$Event_PaymentFailedImpl extends Event_PaymentFailed { - const _$Event_PaymentFailedImpl({required this.paymentHash}) : super._(); - - /// The hash of the payment. - @override - final PaymentHash paymentHash; +class _$ClosureReason_LocallyInitiatedCooperativeClosureImpl + extends ClosureReason_LocallyInitiatedCooperativeClosure { + const _$ClosureReason_LocallyInitiatedCooperativeClosureImpl() : super._(); @override String toString() { - return 'Event.paymentFailed(paymentHash: $paymentHash)'; + return 'ClosureReason.locallyInitiatedCooperativeClosure()'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$Event_PaymentFailedImpl && - (identical(other.paymentHash, paymentHash) || - other.paymentHash == paymentHash)); + other is _$ClosureReason_LocallyInitiatedCooperativeClosureImpl); } @override - int get hashCode => Object.hash(runtimeType, paymentHash); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$Event_PaymentFailedImplCopyWith<_$Event_PaymentFailedImpl> get copyWith => - __$$Event_PaymentFailedImplCopyWithImpl<_$Event_PaymentFailedImpl>( - this, _$identity); + int get hashCode => runtimeType.hashCode; @override @optionalTypeArgs TResult when({ - 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, - OutPoint fundingTxo) - channelPending, + required TResult Function(String peerMsg) counterpartyForceClosed, + required TResult Function() holderForceClosed, + required TResult Function() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, }) { - return paymentFailed(paymentHash); + return locallyInitiatedCooperativeClosure(); } @override @optionalTypeArgs TResult? whenOrNull({ - 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, - OutPoint fundingTxo)? - channelPending, + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, }) { - return paymentFailed?.call(paymentHash); + return locallyInitiatedCooperativeClosure?.call(); } @override @optionalTypeArgs TResult maybeWhen({ - 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, - OutPoint fundingTxo)? - channelPending, + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, required TResult orElse(), }) { - if (paymentFailed != null) { - return paymentFailed(paymentHash); + if (locallyInitiatedCooperativeClosure != null) { + return locallyInitiatedCooperativeClosure(); } return orElse(); } @@ -1212,207 +1397,209 @@ class _$Event_PaymentFailedImpl extends Event_PaymentFailed { @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_ChannelReady value) channelReady, - required TResult Function(Event_ChannelClosed value) channelClosed, - required TResult Function(Event_ChannelPending value) channelPending, + required TResult Function(ClosureReason_CounterpartyForceClosed value) + counterpartyForceClosed, + required TResult Function(ClosureReason_HolderForceClosed value) + holderForceClosed, + required TResult Function(ClosureReason_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, }) { - return paymentFailed(this); + return locallyInitiatedCooperativeClosure(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_ChannelReady value)? channelReady, - TResult? Function(Event_ChannelClosed value)? channelClosed, - TResult? Function(Event_ChannelPending value)? channelPending, + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, }) { - return paymentFailed?.call(this); + return locallyInitiatedCooperativeClosure?.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_ChannelReady value)? channelReady, - TResult Function(Event_ChannelClosed value)? channelClosed, - TResult Function(Event_ChannelPending value)? channelPending, + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, required TResult orElse(), }) { - if (paymentFailed != null) { - return paymentFailed(this); + if (locallyInitiatedCooperativeClosure != null) { + return locallyInitiatedCooperativeClosure(this); } return orElse(); } } -abstract class Event_PaymentFailed extends Event { - const factory Event_PaymentFailed({required final PaymentHash paymentHash}) = - _$Event_PaymentFailedImpl; - const Event_PaymentFailed._() : super._(); - - /// The hash of the payment. - PaymentHash get paymentHash; - @JsonKey(ignore: true) - _$$Event_PaymentFailedImplCopyWith<_$Event_PaymentFailedImpl> get copyWith => - throw _privateConstructorUsedError; +abstract class ClosureReason_LocallyInitiatedCooperativeClosure + extends ClosureReason { + const factory ClosureReason_LocallyInitiatedCooperativeClosure() = + _$ClosureReason_LocallyInitiatedCooperativeClosureImpl; + const ClosureReason_LocallyInitiatedCooperativeClosure._() : super._(); } /// @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}); +abstract class _$$ClosureReason_CommitmentTxConfirmedImplCopyWith<$Res> { + factory _$$ClosureReason_CommitmentTxConfirmedImplCopyWith( + _$ClosureReason_CommitmentTxConfirmedImpl value, + $Res Function(_$ClosureReason_CommitmentTxConfirmedImpl) then) = + __$$ClosureReason_CommitmentTxConfirmedImplCopyWithImpl<$Res>; } /// @nodoc -class __$$Event_PaymentReceivedImplCopyWithImpl<$Res> - extends _$EventCopyWithImpl<$Res, _$Event_PaymentReceivedImpl> - implements _$$Event_PaymentReceivedImplCopyWith<$Res> { - __$$Event_PaymentReceivedImplCopyWithImpl(_$Event_PaymentReceivedImpl _value, - $Res Function(_$Event_PaymentReceivedImpl) _then) +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); - - @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 extends Event_PaymentReceived { - const _$Event_PaymentReceivedImpl( - {required this.paymentHash, required this.amountMsat}) - : super._(); - - /// The hash of the payment. - @override - final PaymentHash paymentHash; - - /// The value, in thousandths of a satoshi, that has been received. - @override - final int amountMsat; +class _$ClosureReason_CommitmentTxConfirmedImpl + extends ClosureReason_CommitmentTxConfirmed { + const _$ClosureReason_CommitmentTxConfirmedImpl() : super._(); @override String toString() { - return 'Event.paymentReceived(paymentHash: $paymentHash, amountMsat: $amountMsat)'; + return 'ClosureReason.commitmentTxConfirmed()'; } @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)); + other is _$ClosureReason_CommitmentTxConfirmedImpl); } @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); + int get hashCode => runtimeType.hashCode; @override @optionalTypeArgs TResult when({ - 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, - OutPoint fundingTxo) - channelPending, + required TResult Function(String peerMsg) counterpartyForceClosed, + required TResult Function() holderForceClosed, + required TResult Function() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, }) { - return paymentReceived(paymentHash, amountMsat); + return commitmentTxConfirmed(); } @override @optionalTypeArgs TResult? whenOrNull({ - 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, - OutPoint fundingTxo)? - channelPending, + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, }) { - return paymentReceived?.call(paymentHash, amountMsat); + return commitmentTxConfirmed?.call(); } @override @optionalTypeArgs TResult maybeWhen({ - 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, - OutPoint fundingTxo)? - channelPending, + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, required TResult orElse(), }) { - if (paymentReceived != null) { - return paymentReceived(paymentHash, amountMsat); + if (commitmentTxConfirmed != null) { + return commitmentTxConfirmed(); } return orElse(); } @@ -1420,225 +1607,208 @@ class _$Event_PaymentReceivedImpl extends Event_PaymentReceived { @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_ChannelReady value) channelReady, - required TResult Function(Event_ChannelClosed value) channelClosed, - required TResult Function(Event_ChannelPending value) channelPending, + required TResult Function(ClosureReason_CounterpartyForceClosed value) + counterpartyForceClosed, + required TResult Function(ClosureReason_HolderForceClosed value) + holderForceClosed, + required TResult Function(ClosureReason_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, }) { - return paymentReceived(this); + return commitmentTxConfirmed(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_ChannelReady value)? channelReady, - TResult? Function(Event_ChannelClosed value)? channelClosed, - TResult? Function(Event_ChannelPending value)? channelPending, + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, }) { - return paymentReceived?.call(this); + return commitmentTxConfirmed?.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_ChannelReady value)? channelReady, - TResult Function(Event_ChannelClosed value)? channelClosed, - TResult Function(Event_ChannelPending value)? channelPending, + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, required TResult orElse(), }) { - if (paymentReceived != null) { - return paymentReceived(this); + if (commitmentTxConfirmed != null) { + return commitmentTxConfirmed(this); } return orElse(); } } -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 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; +abstract class ClosureReason_CommitmentTxConfirmed extends ClosureReason { + const factory ClosureReason_CommitmentTxConfirmed() = + _$ClosureReason_CommitmentTxConfirmedImpl; + const ClosureReason_CommitmentTxConfirmed._() : super._(); } /// @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}); +abstract class _$$ClosureReason_FundingTimedOutImplCopyWith<$Res> { + factory _$$ClosureReason_FundingTimedOutImplCopyWith( + _$ClosureReason_FundingTimedOutImpl value, + $Res Function(_$ClosureReason_FundingTimedOutImpl) then) = + __$$ClosureReason_FundingTimedOutImplCopyWithImpl<$Res>; } /// @nodoc -class __$$Event_ChannelReadyImplCopyWithImpl<$Res> - extends _$EventCopyWithImpl<$Res, _$Event_ChannelReadyImpl> - implements _$$Event_ChannelReadyImplCopyWith<$Res> { - __$$Event_ChannelReadyImplCopyWithImpl(_$Event_ChannelReadyImpl _value, - $Res Function(_$Event_ChannelReadyImpl) _then) +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); - - @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 extends Event_ChannelReady { - const _$Event_ChannelReadyImpl( - {required this.channelId, - required this.userChannelId, - this.counterpartyNodeId}) - : super._(); - - /// The channel_id of the channel. - @override - final ChannelId channelId; - - /// The user_channel_id of the channel. - @override - final UserChannelId userChannelId; - @override - final PublicKey? counterpartyNodeId; +class _$ClosureReason_FundingTimedOutImpl + extends ClosureReason_FundingTimedOut { + const _$ClosureReason_FundingTimedOutImpl() : super._(); @override String toString() { - return 'Event.channelReady(channelId: $channelId, userChannelId: $userChannelId, counterpartyNodeId: $counterpartyNodeId)'; + return 'ClosureReason.fundingTimedOut()'; } @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)); + other is _$ClosureReason_FundingTimedOutImpl); } @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); + int get hashCode => runtimeType.hashCode; @override @optionalTypeArgs TResult when({ - 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, - OutPoint fundingTxo) - channelPending, + required TResult Function(String peerMsg) counterpartyForceClosed, + required TResult Function() holderForceClosed, + required TResult Function() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, }) { - return channelReady(channelId, userChannelId, counterpartyNodeId); + return fundingTimedOut(); } @override @optionalTypeArgs TResult? whenOrNull({ - 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, - OutPoint fundingTxo)? - channelPending, + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, }) { - return channelReady?.call(channelId, userChannelId, counterpartyNodeId); + return fundingTimedOut?.call(); } @override @optionalTypeArgs TResult maybeWhen({ - 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, - OutPoint fundingTxo)? - channelPending, + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, required TResult orElse(), }) { - if (channelReady != null) { - return channelReady(channelId, userChannelId, counterpartyNodeId); + if (fundingTimedOut != null) { + return fundingTimedOut(); } return orElse(); } @@ -1646,227 +1816,6409 @@ class _$Event_ChannelReadyImpl extends Event_ChannelReady { @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_ChannelReady value) channelReady, - required TResult Function(Event_ChannelClosed value) channelClosed, - required TResult Function(Event_ChannelPending value) channelPending, + required TResult Function(ClosureReason_CounterpartyForceClosed value) + counterpartyForceClosed, + required TResult Function(ClosureReason_HolderForceClosed value) + holderForceClosed, + required TResult Function(ClosureReason_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, }) { - return channelReady(this); + return fundingTimedOut(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_ChannelReady value)? channelReady, - TResult? Function(Event_ChannelClosed value)? channelClosed, - TResult? Function(Event_ChannelPending value)? channelPending, + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, }) { - return channelReady?.call(this); + return fundingTimedOut?.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_ChannelReady value)? channelReady, - TResult Function(Event_ChannelClosed value)? channelClosed, - TResult Function(Event_ChannelPending value)? channelPending, + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, required TResult orElse(), }) { - if (channelReady != null) { - return channelReady(this); + if (fundingTimedOut != null) { + return fundingTimedOut(this); } return orElse(); } } -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 channel_id of the channel. - ChannelId get channelId; - - /// The user_channel_id of the channel. - UserChannelId get userChannelId; - PublicKey? get counterpartyNodeId; - @JsonKey(ignore: true) - _$$Event_ChannelReadyImplCopyWith<_$Event_ChannelReadyImpl> get copyWith => - throw _privateConstructorUsedError; +abstract class ClosureReason_FundingTimedOut extends ClosureReason { + const factory ClosureReason_FundingTimedOut() = + _$ClosureReason_FundingTimedOutImpl; + const ClosureReason_FundingTimedOut._() : super._(); } /// @nodoc -abstract class _$$Event_ChannelClosedImplCopyWith<$Res> { - factory _$$Event_ChannelClosedImplCopyWith(_$Event_ChannelClosedImpl value, - $Res Function(_$Event_ChannelClosedImpl) then) = - __$$Event_ChannelClosedImplCopyWithImpl<$Res>; +abstract class _$$ClosureReason_ProcessingErrorImplCopyWith<$Res> { + factory _$$ClosureReason_ProcessingErrorImplCopyWith( + _$ClosureReason_ProcessingErrorImpl value, + $Res Function(_$ClosureReason_ProcessingErrorImpl) then) = + __$$ClosureReason_ProcessingErrorImplCopyWithImpl<$Res>; @useResult - $Res call( - {ChannelId channelId, - UserChannelId userChannelId, - PublicKey? counterpartyNodeId}); + $Res call({String err}); } /// @nodoc -class __$$Event_ChannelClosedImplCopyWithImpl<$Res> - extends _$EventCopyWithImpl<$Res, _$Event_ChannelClosedImpl> - implements _$$Event_ChannelClosedImplCopyWith<$Res> { - __$$Event_ChannelClosedImplCopyWithImpl(_$Event_ChannelClosedImpl _value, - $Res Function(_$Event_ChannelClosedImpl) _then) +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? channelId = null, - Object? userChannelId = null, - Object? counterpartyNodeId = freezed, + Object? err = null, }) { - 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?, + return _then(_$ClosureReason_ProcessingErrorImpl( + err: null == err + ? _value.err + : err // ignore: cast_nullable_to_non_nullable + as String, )); } } /// @nodoc -class _$Event_ChannelClosedImpl extends Event_ChannelClosed { - const _$Event_ChannelClosedImpl( - {required this.channelId, - required this.userChannelId, - this.counterpartyNodeId}) - : super._(); - - /// The channel_id of the channel. - @override - final ChannelId channelId; +class _$ClosureReason_ProcessingErrorImpl + extends ClosureReason_ProcessingError { + const _$ClosureReason_ProcessingErrorImpl({required this.err}) : super._(); - /// The user_channel_id of the channel. - @override - final UserChannelId userChannelId; + /// A developer-readable error message which we generated. @override - final PublicKey? counterpartyNodeId; + final String err; @override String toString() { - return 'Event.channelClosed(channelId: $channelId, userChannelId: $userChannelId, counterpartyNodeId: $counterpartyNodeId)'; + return 'ClosureReason.processingError(err: $err)'; } @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)); + other is _$ClosureReason_ProcessingErrorImpl && + (identical(other.err, err) || other.err == err)); } @override - int get hashCode => - Object.hash(runtimeType, channelId, userChannelId, counterpartyNodeId); + int get hashCode => Object.hash(runtimeType, err); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$Event_ChannelClosedImplCopyWith<_$Event_ChannelClosedImpl> get copyWith => - __$$Event_ChannelClosedImplCopyWithImpl<_$Event_ChannelClosedImpl>( - this, _$identity); + _$$ClosureReason_ProcessingErrorImplCopyWith< + _$ClosureReason_ProcessingErrorImpl> + get copyWith => __$$ClosureReason_ProcessingErrorImplCopyWithImpl< + _$ClosureReason_ProcessingErrorImpl>(this, _$identity); @override @optionalTypeArgs TResult when({ - 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, - OutPoint fundingTxo) - channelPending, + required TResult Function(String peerMsg) counterpartyForceClosed, + required TResult Function() holderForceClosed, + required TResult Function() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, }) { - return channelClosed(channelId, userChannelId, counterpartyNodeId); + return processingError(err); } @override @optionalTypeArgs TResult? whenOrNull({ - 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, - OutPoint fundingTxo)? - channelPending, + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, }) { - return channelClosed?.call(channelId, userChannelId, counterpartyNodeId); + return processingError?.call(err); } @override @optionalTypeArgs TResult maybeWhen({ - 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, + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + 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_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, + }) { + return processingError(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + }) { + return processingError?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + required TResult orElse(), + }) { + if (processingError != null) { + return processingError(this); + } + return orElse(); + } +} + +abstract class ClosureReason_ProcessingError extends ClosureReason { + const factory ClosureReason_ProcessingError({required final String err}) = + _$ClosureReason_ProcessingErrorImpl; + const ClosureReason_ProcessingError._() : super._(); + + /// 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 + extends ClosureReason_DisconnectedPeer { + const _$ClosureReason_DisconnectedPeerImpl() : super._(); + + @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() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, + }) { + return disconnectedPeer(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + }) { + return disconnectedPeer?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + 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_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, + }) { + return disconnectedPeer(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + }) { + return disconnectedPeer?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + required TResult orElse(), + }) { + if (disconnectedPeer != null) { + return disconnectedPeer(this); + } + return orElse(); + } +} + +abstract class ClosureReason_DisconnectedPeer extends ClosureReason { + const factory ClosureReason_DisconnectedPeer() = + _$ClosureReason_DisconnectedPeerImpl; + const ClosureReason_DisconnectedPeer._() : super._(); +} + +/// @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 + extends ClosureReason_OutdatedChannelManager { + const _$ClosureReason_OutdatedChannelManagerImpl() : super._(); + + @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() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, + }) { + return outdatedChannelManager(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + }) { + return outdatedChannelManager?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + 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_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, + }) { + return outdatedChannelManager(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + }) { + return outdatedChannelManager?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + required TResult orElse(), + }) { + if (outdatedChannelManager != null) { + return outdatedChannelManager(this); + } + return orElse(); + } +} + +abstract class ClosureReason_OutdatedChannelManager extends ClosureReason { + const factory ClosureReason_OutdatedChannelManager() = + _$ClosureReason_OutdatedChannelManagerImpl; + const ClosureReason_OutdatedChannelManager._() : super._(); +} + +/// @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 + extends ClosureReason_CounterpartyCoopClosedUnfundedChannel { + const _$ClosureReason_CounterpartyCoopClosedUnfundedChannelImpl() : super._(); + + @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() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, + }) { + return counterpartyCoopClosedUnfundedChannel(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + }) { + return counterpartyCoopClosedUnfundedChannel?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + 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_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, + }) { + return counterpartyCoopClosedUnfundedChannel(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + }) { + return counterpartyCoopClosedUnfundedChannel?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + required TResult orElse(), + }) { + if (counterpartyCoopClosedUnfundedChannel != null) { + return counterpartyCoopClosedUnfundedChannel(this); + } + return orElse(); + } +} + +abstract class ClosureReason_CounterpartyCoopClosedUnfundedChannel + extends ClosureReason { + const factory ClosureReason_CounterpartyCoopClosedUnfundedChannel() = + _$ClosureReason_CounterpartyCoopClosedUnfundedChannelImpl; + const ClosureReason_CounterpartyCoopClosedUnfundedChannel._() : super._(); +} + +/// @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 + extends ClosureReason_FundingBatchClosure { + const _$ClosureReason_FundingBatchClosureImpl() : super._(); + + @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() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, + }) { + return fundingBatchClosure(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + }) { + return fundingBatchClosure?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + 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_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, + }) { + return fundingBatchClosure(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + }) { + return fundingBatchClosure?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + required TResult orElse(), + }) { + if (fundingBatchClosure != null) { + return fundingBatchClosure(this); + } + return orElse(); + } +} + +abstract class ClosureReason_FundingBatchClosure extends ClosureReason { + const factory ClosureReason_FundingBatchClosure() = + _$ClosureReason_FundingBatchClosureImpl; + const ClosureReason_FundingBatchClosure._() : super._(); +} + +/// @nodoc +abstract class _$$ClosureReason_HTLCsTimedOutImplCopyWith<$Res> { + factory _$$ClosureReason_HTLCsTimedOutImplCopyWith( + _$ClosureReason_HTLCsTimedOutImpl value, + $Res Function(_$ClosureReason_HTLCsTimedOutImpl) then) = + __$$ClosureReason_HTLCsTimedOutImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$ClosureReason_HTLCsTimedOutImplCopyWithImpl<$Res> + extends _$ClosureReasonCopyWithImpl<$Res, _$ClosureReason_HTLCsTimedOutImpl> + implements _$$ClosureReason_HTLCsTimedOutImplCopyWith<$Res> { + __$$ClosureReason_HTLCsTimedOutImplCopyWithImpl( + _$ClosureReason_HTLCsTimedOutImpl _value, + $Res Function(_$ClosureReason_HTLCsTimedOutImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$ClosureReason_HTLCsTimedOutImpl extends ClosureReason_HTLCsTimedOut { + const _$ClosureReason_HTLCsTimedOutImpl() : super._(); + + @override + String toString() { + return 'ClosureReason.htlCsTimedOut()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ClosureReason_HTLCsTimedOutImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(String peerMsg) counterpartyForceClosed, + required TResult Function() holderForceClosed, + required TResult Function() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, + }) { + return htlCsTimedOut(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + }) { + return htlCsTimedOut?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + required TResult orElse(), + }) { + if (htlCsTimedOut != null) { + return htlCsTimedOut(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(ClosureReason_CounterpartyForceClosed value) + counterpartyForceClosed, + required TResult Function(ClosureReason_HolderForceClosed value) + holderForceClosed, + required TResult Function(ClosureReason_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, + }) { + return htlCsTimedOut(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + }) { + return htlCsTimedOut?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + required TResult orElse(), + }) { + if (htlCsTimedOut != null) { + return htlCsTimedOut(this); + } + return orElse(); + } +} + +abstract class ClosureReason_HTLCsTimedOut extends ClosureReason { + const factory ClosureReason_HTLCsTimedOut() = + _$ClosureReason_HTLCsTimedOutImpl; + const ClosureReason_HTLCsTimedOut._() : super._(); +} + +/// @nodoc +mixin _$EntropySourceConfig { + @optionalTypeArgs + TResult when({ + 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 field0)? seedFile, + TResult? Function(U8Array64 field0)? seedBytes, + TResult? Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + 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(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 extends EntropySourceConfig_SeedFile { + const _$EntropySourceConfig_SeedFileImpl(this.field0) : super._(); + + @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(LdkMnemonic mnemonic, String? passphrase) + bip39Mnemonic, + }) { + return seedFile(field0); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String field0)? seedFile, + TResult? Function(U8Array64 field0)? seedBytes, + TResult? Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + }) { + return seedFile?.call(field0); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String field0)? seedFile, + TResult Function(U8Array64 field0)? seedBytes, + TResult Function(LdkMnemonic 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 extends EntropySourceConfig { + const factory EntropySourceConfig_SeedFile(final String field0) = + _$EntropySourceConfig_SeedFileImpl; + const EntropySourceConfig_SeedFile._() : super._(); + + 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 + extends EntropySourceConfig_SeedBytes { + const _$EntropySourceConfig_SeedBytesImpl(this.field0) : super._(); + + @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(LdkMnemonic mnemonic, String? passphrase) + bip39Mnemonic, + }) { + return seedBytes(field0); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String field0)? seedFile, + TResult? Function(U8Array64 field0)? seedBytes, + TResult? Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + }) { + return seedBytes?.call(field0); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String field0)? seedFile, + TResult Function(U8Array64 field0)? seedBytes, + TResult Function(LdkMnemonic 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 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 _$$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 __$$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 _$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 '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(LdkMnemonic mnemonic, String? passphrase) + bip39Mnemonic, + }) { + return bip39Mnemonic(mnemonic, passphrase); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String field0)? seedFile, + TResult? Function(U8Array64 field0)? seedBytes, + TResult? Function(LdkMnemonic 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(LdkMnemonic 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 extends EntropySourceConfig { + const factory EntropySourceConfig_Bip39Mnemonic( + {required final LdkMnemonic mnemonic, + final String? passphrase}) = _$EntropySourceConfig_Bip39MnemonicImpl; + const EntropySourceConfig_Bip39Mnemonic._() : super._(); + + LdkMnemonic 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( + PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat) + paymentSuccessful, + required TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason) + paymentFailed, + required TResult Function( + PaymentId? paymentId, 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( + PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat)? + paymentSuccessful, + TResult? Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult? Function( + PaymentId? paymentId, 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( + PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat)? + paymentSuccessful, + TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult Function( + PaymentId? paymentId, 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({PaymentId? paymentId, 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? paymentId = freezed, + Object? paymentHash = null, + Object? feePaidMsat = freezed, + }) { + return _then(_$Event_PaymentSuccessfulImpl( + paymentId: freezed == paymentId + ? _value.paymentId + : paymentId // ignore: cast_nullable_to_non_nullable + as PaymentId?, + 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 extends Event_PaymentSuccessful { + const _$Event_PaymentSuccessfulImpl( + {this.paymentId, required this.paymentHash, this.feePaidMsat}) + : super._(); + + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + @override + final PaymentId? paymentId; + + /// 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(paymentId: $paymentId, paymentHash: $paymentHash, feePaidMsat: $feePaidMsat)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Event_PaymentSuccessfulImpl && + (identical(other.paymentId, paymentId) || + other.paymentId == paymentId) && + (identical(other.paymentHash, paymentHash) || + other.paymentHash == paymentHash) && + (identical(other.feePaidMsat, feePaidMsat) || + other.feePaidMsat == feePaidMsat)); + } + + @override + int get hashCode => + Object.hash(runtimeType, paymentId, 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( + PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat) + paymentSuccessful, + required TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason) + paymentFailed, + required TResult Function( + PaymentId? paymentId, 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(paymentId, paymentHash, feePaidMsat); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat)? + paymentSuccessful, + TResult? Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult? Function( + PaymentId? paymentId, 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(paymentId, paymentHash, feePaidMsat); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat)? + paymentSuccessful, + TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult Function( + PaymentId? paymentId, 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(paymentId, 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 extends Event { + const factory Event_PaymentSuccessful( + {final PaymentId? paymentId, + required final PaymentHash paymentHash, + final int? feePaidMsat}) = _$Event_PaymentSuccessfulImpl; + const Event_PaymentSuccessful._() : super._(); + + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + PaymentId? get paymentId; + + /// 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( + {PaymentId? paymentId, + 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? paymentId = freezed, + Object? paymentHash = null, + Object? reason = freezed, + }) { + return _then(_$Event_PaymentFailedImpl( + paymentId: freezed == paymentId + ? _value.paymentId + : paymentId // ignore: cast_nullable_to_non_nullable + as PaymentId?, + 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 extends Event_PaymentFailed { + const _$Event_PaymentFailedImpl( + {this.paymentId, required this.paymentHash, this.reason}) + : super._(); + + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + @override + final PaymentId? paymentId; + + /// 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(paymentId: $paymentId, paymentHash: $paymentHash, reason: $reason)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Event_PaymentFailedImpl && + (identical(other.paymentId, paymentId) || + other.paymentId == paymentId) && + (identical(other.paymentHash, paymentHash) || + other.paymentHash == paymentHash) && + (identical(other.reason, reason) || other.reason == reason)); + } + + @override + int get hashCode => Object.hash(runtimeType, paymentId, 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( + PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat) + paymentSuccessful, + required TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason) + paymentFailed, + required TResult Function( + PaymentId? paymentId, 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(paymentId, paymentHash, reason); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat)? + paymentSuccessful, + TResult? Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult? Function( + PaymentId? paymentId, 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(paymentId, paymentHash, reason); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat)? + paymentSuccessful, + TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult Function( + PaymentId? paymentId, 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(paymentId, 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 extends Event { + const factory Event_PaymentFailed( + {final PaymentId? paymentId, + required final PaymentHash paymentHash, + final PaymentFailureReason? reason}) = _$Event_PaymentFailedImpl; + const Event_PaymentFailed._() : super._(); + + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + PaymentId? get paymentId; + + /// 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({PaymentId? paymentId, 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? paymentId = freezed, + Object? paymentHash = null, + Object? amountMsat = null, + }) { + return _then(_$Event_PaymentReceivedImpl( + paymentId: freezed == paymentId + ? _value.paymentId + : paymentId // ignore: cast_nullable_to_non_nullable + as PaymentId?, + 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 extends Event_PaymentReceived { + const _$Event_PaymentReceivedImpl( + {this.paymentId, required this.paymentHash, required this.amountMsat}) + : super._(); + + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + @override + final PaymentId? paymentId; + + /// 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(paymentId: $paymentId, paymentHash: $paymentHash, amountMsat: $amountMsat)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Event_PaymentReceivedImpl && + (identical(other.paymentId, paymentId) || + other.paymentId == paymentId) && + (identical(other.paymentHash, paymentHash) || + other.paymentHash == paymentHash) && + (identical(other.amountMsat, amountMsat) || + other.amountMsat == amountMsat)); + } + + @override + int get hashCode => + Object.hash(runtimeType, paymentId, 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( + PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat) + paymentSuccessful, + required TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason) + paymentFailed, + required TResult Function( + PaymentId? paymentId, 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(paymentId, paymentHash, amountMsat); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat)? + paymentSuccessful, + TResult? Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult? Function( + PaymentId? paymentId, 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(paymentId, paymentHash, amountMsat); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat)? + paymentSuccessful, + TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult Function( + PaymentId? paymentId, 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(paymentId, 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 extends Event { + const factory Event_PaymentReceived( + {final PaymentId? paymentId, + required final PaymentHash paymentHash, + required final int amountMsat}) = _$Event_PaymentReceivedImpl; + const Event_PaymentReceived._() : super._(); + + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + PaymentId? get paymentId; + + /// 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 extends Event_ChannelPending { + const _$Event_ChannelPendingImpl( + {required this.channelId, + required this.userChannelId, + required this.formerTemporaryChannelId, + required this.counterpartyNodeId, + required this.fundingTxo}) + : super._(); + + /// The `channelId` of the channel. + @override + final ChannelId channelId; + + /// The `userChannelId` of the channel. + @override + final UserChannelId userChannelId; + + /// The `temporaryChannelId` this channel used to be known by during channel establishment. + @override + final ChannelId formerTemporaryChannelId; + + /// The `nodeId` 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( + PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat) + paymentSuccessful, + required TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason) + paymentFailed, + required TResult Function( + PaymentId? paymentId, 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( + PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat)? + paymentSuccessful, + TResult? Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult? Function( + PaymentId? paymentId, 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( + PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat)? + paymentSuccessful, + TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult Function( + PaymentId? paymentId, 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 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 `channelId` of the channel. + ChannelId get channelId; + + /// The `userChannelId` of the channel. + UserChannelId get userChannelId; + + /// The `temporaryChannelId` this channel used to be known by during channel establishment. + ChannelId get formerTemporaryChannelId; + + /// The `nodeId` 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 extends Event_ChannelReady { + const _$Event_ChannelReadyImpl( + {required this.channelId, + required this.userChannelId, + this.counterpartyNodeId}) + : super._(); + + /// The `channelId` of the channel. + @override + final ChannelId channelId; + + /// The `userChannelId` of the channel. + @override + final UserChannelId userChannelId; + + /// The `nodeId` 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( + PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat) + paymentSuccessful, + required TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason) + paymentFailed, + required TResult Function( + PaymentId? paymentId, 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( + PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat)? + paymentSuccessful, + TResult? Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult? Function( + PaymentId? paymentId, 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( + PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat)? + paymentSuccessful, + TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult Function( + PaymentId? paymentId, 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 extends Event { + const factory Event_ChannelReady( + {required final ChannelId channelId, + required final UserChannelId userChannelId, + final PublicKey? counterpartyNodeId}) = _$Event_ChannelReadyImpl; + const Event_ChannelReady._() : super._(); + + /// The `channelId` of the channel. + ChannelId get channelId; + + /// The `userChannelId` of the channel. + UserChannelId get userChannelId; + + /// The `nodeId` 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 extends Event_ChannelClosed { + const _$Event_ChannelClosedImpl( + {required this.channelId, + required this.userChannelId, + this.counterpartyNodeId, + this.reason}) + : super._(); + + /// The `channelId` of the channel. + @override + final ChannelId channelId; + + /// The `userChannelId` of the channel. + @override + final UserChannelId userChannelId; + + /// The `nodeId` 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( + PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat) + paymentSuccessful, + required TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason) + paymentFailed, + required TResult Function( + PaymentId? paymentId, 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( + PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat)? + paymentSuccessful, + TResult? Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult? Function( + PaymentId? paymentId, 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( + PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat)? + paymentSuccessful, + TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult Function( + PaymentId? paymentId, 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 extends Event { + const factory Event_ChannelClosed( + {required final ChannelId channelId, + required final UserChannelId userChannelId, + final PublicKey? counterpartyNodeId, + final ClosureReason? reason}) = _$Event_ChannelClosedImpl; + const Event_ChannelClosed._() : super._(); + + /// The `channelId` of the channel. + ChannelId get channelId; + + /// The `userChannelId` of the channel. + UserChannelId get userChannelId; + + /// The `nodeId` 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 + extends GossipSourceConfig_P2PNetwork { + const _$GossipSourceConfig_P2PNetworkImpl() : super._(); + + @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 extends GossipSourceConfig { + const factory GossipSourceConfig_P2PNetwork() = + _$GossipSourceConfig_P2PNetworkImpl; + const GossipSourceConfig_P2PNetwork._() : super._(); +} + +/// @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 + extends GossipSourceConfig_RapidGossipSync { + const _$GossipSourceConfig_RapidGossipSyncImpl(this.field0) : super._(); + + @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 extends GossipSourceConfig { + const factory GossipSourceConfig_RapidGossipSync(final String field0) = + _$GossipSourceConfig_RapidGossipSyncImpl; + const GossipSourceConfig_RapidGossipSync._() : super._(); + + 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; + @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( + ChannelId channelId, + 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, + }) => + 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( + ChannelId channelId, + 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, + }) => + 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( + ChannelId channelId, + 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, + 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, + }) => + 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, + }) => + 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, + 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}); +} + +/// @nodoc +class _$LightningBalanceCopyWithImpl<$Res, $Val extends LightningBalance> + implements $LightningBalanceCopyWith<$Res> { + _$LightningBalanceCopyWithImpl(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 + @useResult + $Res call( + {ChannelId channelId, PublicKey counterpartyNodeId, int amountSatoshis}); +} + +/// @nodoc +class __$$LightningBalance_ClaimableOnChannelCloseImplCopyWithImpl<$Res> + extends _$LightningBalanceCopyWithImpl<$Res, + _$LightningBalance_ClaimableOnChannelCloseImpl> + implements _$$LightningBalance_ClaimableOnChannelCloseImplCopyWith<$Res> { + __$$LightningBalance_ClaimableOnChannelCloseImplCopyWithImpl( + _$LightningBalance_ClaimableOnChannelCloseImpl _value, + $Res Function(_$LightningBalance_ClaimableOnChannelCloseImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? channelId = null, + Object? counterpartyNodeId = null, + Object? amountSatoshis = 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, + )); + } +} + +/// @nodoc + +class _$LightningBalance_ClaimableOnChannelCloseImpl + extends LightningBalance_ClaimableOnChannelClose { + const _$LightningBalance_ClaimableOnChannelCloseImpl( + {required this.channelId, + required this.counterpartyNodeId, + required this.amountSatoshis}) + : super._(); + + /// 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; + + @override + String toString() { + return 'LightningBalance.claimableOnChannelClose(channelId: $channelId, counterpartyNodeId: $counterpartyNodeId, amountSatoshis: $amountSatoshis)'; + } + + @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)); + } + + @override + int get hashCode => + Object.hash(runtimeType, channelId, counterpartyNodeId, amountSatoshis); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$LightningBalance_ClaimableOnChannelCloseImplCopyWith< + _$LightningBalance_ClaimableOnChannelCloseImpl> + get copyWith => + __$$LightningBalance_ClaimableOnChannelCloseImplCopyWithImpl< + _$LightningBalance_ClaimableOnChannelCloseImpl>(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( + ChannelId channelId, + 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, + }) { + return claimableOnChannelClose( + channelId, counterpartyNodeId, amountSatoshis); + } + + @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( + ChannelId channelId, + 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, + }) { + return claimableOnChannelClose?.call( + channelId, counterpartyNodeId, amountSatoshis); + } + + @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( + ChannelId channelId, + 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, + required TResult orElse(), + }) { + if (claimableOnChannelClose != null) { + return claimableOnChannelClose( + channelId, counterpartyNodeId, amountSatoshis); + } + return orElse(); + } + + @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, + }) { + return claimableOnChannelClose(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, + }) { + return claimableOnChannelClose?.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, + required TResult orElse(), + }) { + if (claimableOnChannelClose != null) { + return claimableOnChannelClose(this); + } + return orElse(); + } +} + +abstract class LightningBalance_ClaimableOnChannelClose + extends LightningBalance { + const factory LightningBalance_ClaimableOnChannelClose( + {required final ChannelId channelId, + required final PublicKey counterpartyNodeId, + required final int amountSatoshis}) = + _$LightningBalance_ClaimableOnChannelCloseImpl; + const LightningBalance_ClaimableOnChannelClose._() : super._(); + + @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; + @override + @JsonKey(ignore: true) + _$$LightningBalance_ClaimableOnChannelCloseImplCopyWith< + _$LightningBalance_ClaimableOnChannelCloseImpl> + 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 + @useResult + $Res call( + {ChannelId channelId, + PublicKey counterpartyNodeId, + int amountSatoshis, + int confirmationHeight}); +} + +/// @nodoc +class __$$LightningBalance_ClaimableAwaitingConfirmationsImplCopyWithImpl<$Res> + extends _$LightningBalanceCopyWithImpl<$Res, + _$LightningBalance_ClaimableAwaitingConfirmationsImpl> + implements + _$$LightningBalance_ClaimableAwaitingConfirmationsImplCopyWith<$Res> { + __$$LightningBalance_ClaimableAwaitingConfirmationsImplCopyWithImpl( + _$LightningBalance_ClaimableAwaitingConfirmationsImpl _value, + $Res Function(_$LightningBalance_ClaimableAwaitingConfirmationsImpl) + _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? channelId = null, + Object? counterpartyNodeId = null, + Object? amountSatoshis = null, + Object? confirmationHeight = 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, + )); + } +} + +/// @nodoc + +class _$LightningBalance_ClaimableAwaitingConfirmationsImpl + extends LightningBalance_ClaimableAwaitingConfirmations { + const _$LightningBalance_ClaimableAwaitingConfirmationsImpl( + {required this.channelId, + required this.counterpartyNodeId, + required this.amountSatoshis, + required this.confirmationHeight}) + : super._(); + + /// 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; + + /// The height at which an [`Event::SpendableOutputs`] event will be generated for this + /// amount. + /// + /// [`Event::SpendableOutputs`]: lightning::events::Event::SpendableOutputs + @override + final int confirmationHeight; + + @override + String toString() { + return 'LightningBalance.claimableAwaitingConfirmations(channelId: $channelId, counterpartyNodeId: $counterpartyNodeId, amountSatoshis: $amountSatoshis, confirmationHeight: $confirmationHeight)'; + } + + @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)); + } + + @override + int get hashCode => Object.hash(runtimeType, channelId, counterpartyNodeId, + amountSatoshis, confirmationHeight); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$LightningBalance_ClaimableAwaitingConfirmationsImplCopyWith< + _$LightningBalance_ClaimableAwaitingConfirmationsImpl> + get copyWith => + __$$LightningBalance_ClaimableAwaitingConfirmationsImplCopyWithImpl< + _$LightningBalance_ClaimableAwaitingConfirmationsImpl>( + 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( + ChannelId channelId, + 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, + }) { + return claimableAwaitingConfirmations( + channelId, counterpartyNodeId, amountSatoshis, confirmationHeight); + } + + @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( + ChannelId channelId, + 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, + }) { + return claimableAwaitingConfirmations?.call( + channelId, counterpartyNodeId, amountSatoshis, confirmationHeight); + } + + @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( + ChannelId channelId, + 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, + required TResult orElse(), + }) { + if (claimableAwaitingConfirmations != null) { + return claimableAwaitingConfirmations( + channelId, counterpartyNodeId, amountSatoshis, confirmationHeight); + } + return orElse(); + } + + @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, + }) { + return claimableAwaitingConfirmations(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, + }) { + return claimableAwaitingConfirmations?.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, + required TResult orElse(), + }) { + if (claimableAwaitingConfirmations != null) { + return claimableAwaitingConfirmations(this); + } + return orElse(); + } +} + +abstract class LightningBalance_ClaimableAwaitingConfirmations + extends LightningBalance { + const factory LightningBalance_ClaimableAwaitingConfirmations( + {required final ChannelId channelId, + required final PublicKey counterpartyNodeId, + required final int amountSatoshis, + required final int confirmationHeight}) = + _$LightningBalance_ClaimableAwaitingConfirmationsImpl; + const LightningBalance_ClaimableAwaitingConfirmations._() : super._(); + + @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, 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 + @JsonKey(ignore: true) + _$$LightningBalance_ClaimableAwaitingConfirmationsImplCopyWith< + _$LightningBalance_ClaimableAwaitingConfirmationsImpl> + 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 + @useResult + $Res call( + {ChannelId channelId, + PublicKey counterpartyNodeId, + int amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage}); +} + +/// @nodoc +class __$$LightningBalance_ContentiousClaimableImplCopyWithImpl<$Res> + extends _$LightningBalanceCopyWithImpl<$Res, + _$LightningBalance_ContentiousClaimableImpl> + implements _$$LightningBalance_ContentiousClaimableImplCopyWith<$Res> { + __$$LightningBalance_ContentiousClaimableImplCopyWithImpl( + _$LightningBalance_ContentiousClaimableImpl _value, + $Res Function(_$LightningBalance_ContentiousClaimableImpl) _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, + }) { + 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, + 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, + )); + } +} + +/// @nodoc + +class _$LightningBalance_ContentiousClaimableImpl + extends LightningBalance_ContentiousClaimable { + const _$LightningBalance_ContentiousClaimableImpl( + {required this.channelId, + required this.counterpartyNodeId, + required this.amountSatoshis, + required this.timeoutHeight, + required this.paymentHash, + required this.paymentPreimage}) + : super._(); + + /// 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; + + /// The payment hash that locks this HTLC. + @override + final PaymentHash paymentHash; + + /// The preimage that can be used to claim this HTLC. + @override + final PaymentPreimage paymentPreimage; + + @override + String toString() { + return 'LightningBalance.contentiousClaimable(channelId: $channelId, counterpartyNodeId: $counterpartyNodeId, amountSatoshis: $amountSatoshis, timeoutHeight: $timeoutHeight, paymentHash: $paymentHash, paymentPreimage: $paymentPreimage)'; + } + + @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) && + (identical(other.paymentHash, paymentHash) || + other.paymentHash == paymentHash) && + (identical(other.paymentPreimage, paymentPreimage) || + other.paymentPreimage == paymentPreimage)); + } + + @override + int get hashCode => Object.hash(runtimeType, channelId, counterpartyNodeId, + amountSatoshis, timeoutHeight, paymentHash, paymentPreimage); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$LightningBalance_ContentiousClaimableImplCopyWith< + _$LightningBalance_ContentiousClaimableImpl> + get copyWith => __$$LightningBalance_ContentiousClaimableImplCopyWithImpl< + _$LightningBalance_ContentiousClaimableImpl>(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( + ChannelId channelId, + 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, + }) { + return contentiousClaimable(channelId, counterpartyNodeId, amountSatoshis, + timeoutHeight, paymentHash, paymentPreimage); + } + + @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( + ChannelId channelId, + 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, + }) { + return contentiousClaimable?.call(channelId, counterpartyNodeId, + amountSatoshis, timeoutHeight, paymentHash, paymentPreimage); + } + + @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( + ChannelId channelId, + 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, + required TResult orElse(), + }) { + if (contentiousClaimable != null) { + return contentiousClaimable(channelId, counterpartyNodeId, amountSatoshis, + timeoutHeight, paymentHash, paymentPreimage); + } + return orElse(); + } + + @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, + }) { + return contentiousClaimable(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, + }) { + return contentiousClaimable?.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, + required TResult orElse(), + }) { + if (contentiousClaimable != null) { + return contentiousClaimable(this); + } + return orElse(); + } +} + +abstract class LightningBalance_ContentiousClaimable extends 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; + const LightningBalance_ContentiousClaimable._() : super._(); + + @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; + + /// The payment hash that locks this HTLC. + PaymentHash get paymentHash; + + /// The preimage that can be used to claim this HTLC. + PaymentPreimage get paymentPreimage; + @override + @JsonKey(ignore: true) + _$$LightningBalance_ContentiousClaimableImplCopyWith< + _$LightningBalance_ContentiousClaimableImpl> + 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 + @useResult + $Res call( + {ChannelId channelId, + PublicKey counterpartyNodeId, + int amountSatoshis, + int claimableHeight, + PaymentHash paymentHash}); +} + +/// @nodoc +class __$$LightningBalance_MaybeTimeoutClaimableHTLCImplCopyWithImpl<$Res> + extends _$LightningBalanceCopyWithImpl<$Res, + _$LightningBalance_MaybeTimeoutClaimableHTLCImpl> + implements _$$LightningBalance_MaybeTimeoutClaimableHTLCImplCopyWith<$Res> { + __$$LightningBalance_MaybeTimeoutClaimableHTLCImplCopyWithImpl( + _$LightningBalance_MaybeTimeoutClaimableHTLCImpl _value, + $Res Function(_$LightningBalance_MaybeTimeoutClaimableHTLCImpl) _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, + }) { + return _then(_$LightningBalance_MaybeTimeoutClaimableHTLCImpl( + 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, + 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, + )); + } +} + +/// @nodoc + +class _$LightningBalance_MaybeTimeoutClaimableHTLCImpl + extends LightningBalance_MaybeTimeoutClaimableHTLC { + const _$LightningBalance_MaybeTimeoutClaimableHTLCImpl( + {required this.channelId, + required this.counterpartyNodeId, + required this.amountSatoshis, + required this.claimableHeight, + required this.paymentHash}) + : super._(); + + /// 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 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. + @override + final int claimableHeight; + + /// The payment hash whose preimage our counterparty needs to claim this HTLC. + @override + final PaymentHash paymentHash; + + @override + String toString() { + return 'LightningBalance.maybeTimeoutClaimableHtlc(channelId: $channelId, counterpartyNodeId: $counterpartyNodeId, amountSatoshis: $amountSatoshis, claimableHeight: $claimableHeight, paymentHash: $paymentHash)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LightningBalance_MaybeTimeoutClaimableHTLCImpl && + (identical(other.channelId, channelId) || + other.channelId == channelId) && + (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)); + } + + @override + int get hashCode => Object.hash(runtimeType, channelId, counterpartyNodeId, + amountSatoshis, claimableHeight, paymentHash); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$LightningBalance_MaybeTimeoutClaimableHTLCImplCopyWith< + _$LightningBalance_MaybeTimeoutClaimableHTLCImpl> + get copyWith => + __$$LightningBalance_MaybeTimeoutClaimableHTLCImplCopyWithImpl< + _$LightningBalance_MaybeTimeoutClaimableHTLCImpl>( + 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( + ChannelId channelId, + 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, + }) { + return maybeTimeoutClaimableHtlc(channelId, counterpartyNodeId, + amountSatoshis, claimableHeight, 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( + ChannelId channelId, + 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, + }) { + return maybeTimeoutClaimableHtlc?.call(channelId, counterpartyNodeId, + amountSatoshis, claimableHeight, 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( + ChannelId channelId, + 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, + required TResult orElse(), + }) { + if (maybeTimeoutClaimableHtlc != null) { + return maybeTimeoutClaimableHtlc(channelId, counterpartyNodeId, + amountSatoshis, claimableHeight, paymentHash); + } + return orElse(); + } + + @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, + }) { + return maybeTimeoutClaimableHtlc(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, + }) { + return maybeTimeoutClaimableHtlc?.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, + required TResult orElse(), + }) { + if (maybeTimeoutClaimableHtlc != null) { + return maybeTimeoutClaimableHtlc(this); + } + return orElse(); + } +} + +abstract class LightningBalance_MaybeTimeoutClaimableHTLC + extends 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; + const LightningBalance_MaybeTimeoutClaimableHTLC._() : super._(); + + @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 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 + @JsonKey(ignore: true) + _$$LightningBalance_MaybeTimeoutClaimableHTLCImplCopyWith< + _$LightningBalance_MaybeTimeoutClaimableHTLCImpl> + 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 + @useResult + $Res call( + {ChannelId channelId, + PublicKey counterpartyNodeId, + int amountSatoshis, + int expiryHeight, + PaymentHash paymentHash}); +} + +/// @nodoc +class __$$LightningBalance_MaybePreimageClaimableHTLCImplCopyWithImpl<$Res> + extends _$LightningBalanceCopyWithImpl<$Res, + _$LightningBalance_MaybePreimageClaimableHTLCImpl> + implements + _$$LightningBalance_MaybePreimageClaimableHTLCImplCopyWith<$Res> { + __$$LightningBalance_MaybePreimageClaimableHTLCImplCopyWithImpl( + _$LightningBalance_MaybePreimageClaimableHTLCImpl _value, + $Res Function(_$LightningBalance_MaybePreimageClaimableHTLCImpl) _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, + }) { + return _then(_$LightningBalance_MaybePreimageClaimableHTLCImpl( + 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, + 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, + )); + } +} + +/// @nodoc + +class _$LightningBalance_MaybePreimageClaimableHTLCImpl + extends LightningBalance_MaybePreimageClaimableHTLC { + const _$LightningBalance_MaybePreimageClaimableHTLCImpl( + {required this.channelId, + required this.counterpartyNodeId, + required this.amountSatoshis, + required this.expiryHeight, + required this.paymentHash}) + : super._(); + + /// 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 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. + @override + final int expiryHeight; + + /// The payment hash whose preimage we need to claim this HTLC. + @override + final PaymentHash paymentHash; + + @override + String toString() { + return 'LightningBalance.maybePreimageClaimableHtlc(channelId: $channelId, counterpartyNodeId: $counterpartyNodeId, amountSatoshis: $amountSatoshis, expiryHeight: $expiryHeight, paymentHash: $paymentHash)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LightningBalance_MaybePreimageClaimableHTLCImpl && + (identical(other.channelId, channelId) || + other.channelId == channelId) && + (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)); + } + + @override + int get hashCode => Object.hash(runtimeType, channelId, counterpartyNodeId, + amountSatoshis, expiryHeight, paymentHash); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$LightningBalance_MaybePreimageClaimableHTLCImplCopyWith< + _$LightningBalance_MaybePreimageClaimableHTLCImpl> + get copyWith => + __$$LightningBalance_MaybePreimageClaimableHTLCImplCopyWithImpl< + _$LightningBalance_MaybePreimageClaimableHTLCImpl>( + 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( + ChannelId channelId, + 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, + }) { + return maybePreimageClaimableHtlc(channelId, counterpartyNodeId, + amountSatoshis, expiryHeight, 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( + ChannelId channelId, + 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, + }) { + return maybePreimageClaimableHtlc?.call(channelId, counterpartyNodeId, + amountSatoshis, expiryHeight, 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( + ChannelId channelId, + 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, + required TResult orElse(), + }) { + if (maybePreimageClaimableHtlc != null) { + return maybePreimageClaimableHtlc(channelId, counterpartyNodeId, + amountSatoshis, expiryHeight, paymentHash); + } + return orElse(); + } + + @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, + }) { + return maybePreimageClaimableHtlc(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, + }) { + return maybePreimageClaimableHtlc?.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, + required TResult orElse(), + }) { + if (maybePreimageClaimableHtlc != null) { + return maybePreimageClaimableHtlc(this); + } + return orElse(); + } +} + +abstract class LightningBalance_MaybePreimageClaimableHTLC + extends 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; + const LightningBalance_MaybePreimageClaimableHTLC._() : super._(); + + @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 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 + @JsonKey(ignore: true) + _$$LightningBalance_MaybePreimageClaimableHTLCImplCopyWith< + _$LightningBalance_MaybePreimageClaimableHTLCImpl> + 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 + @useResult + $Res call( + {ChannelId channelId, PublicKey counterpartyNodeId, int amountSatoshis}); +} + +/// @nodoc +class __$$LightningBalance_CounterpartyRevokedOutputClaimableImplCopyWithImpl< + $Res> + extends _$LightningBalanceCopyWithImpl<$Res, + _$LightningBalance_CounterpartyRevokedOutputClaimableImpl> + implements + _$$LightningBalance_CounterpartyRevokedOutputClaimableImplCopyWith< + $Res> { + __$$LightningBalance_CounterpartyRevokedOutputClaimableImplCopyWithImpl( + _$LightningBalance_CounterpartyRevokedOutputClaimableImpl _value, + $Res Function(_$LightningBalance_CounterpartyRevokedOutputClaimableImpl) + _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? channelId = null, + Object? counterpartyNodeId = null, + Object? amountSatoshis = null, + }) { + return _then(_$LightningBalance_CounterpartyRevokedOutputClaimableImpl( + 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, + )); + } +} + +/// @nodoc + +class _$LightningBalance_CounterpartyRevokedOutputClaimableImpl + extends LightningBalance_CounterpartyRevokedOutputClaimable { + const _$LightningBalance_CounterpartyRevokedOutputClaimableImpl( + {required this.channelId, + required this.counterpartyNodeId, + required this.amountSatoshis}) + : super._(); + + /// 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, in satoshis, of the output which we can claim. + @override + final int amountSatoshis; + + @override + String toString() { + return 'LightningBalance.counterpartyRevokedOutputClaimable(channelId: $channelId, counterpartyNodeId: $counterpartyNodeId, amountSatoshis: $amountSatoshis)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other + is _$LightningBalance_CounterpartyRevokedOutputClaimableImpl && + (identical(other.channelId, channelId) || + other.channelId == channelId) && + (identical(other.counterpartyNodeId, counterpartyNodeId) || + other.counterpartyNodeId == counterpartyNodeId) && + (identical(other.amountSatoshis, amountSatoshis) || + other.amountSatoshis == amountSatoshis)); + } + + @override + int get hashCode => + Object.hash(runtimeType, channelId, counterpartyNodeId, amountSatoshis); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$LightningBalance_CounterpartyRevokedOutputClaimableImplCopyWith< + _$LightningBalance_CounterpartyRevokedOutputClaimableImpl> + get copyWith => + __$$LightningBalance_CounterpartyRevokedOutputClaimableImplCopyWithImpl< + _$LightningBalance_CounterpartyRevokedOutputClaimableImpl>( + 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( + ChannelId channelId, + 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, + }) { + return counterpartyRevokedOutputClaimable( + channelId, counterpartyNodeId, amountSatoshis); + } + + @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( + ChannelId channelId, + 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, + }) { + return counterpartyRevokedOutputClaimable?.call( + channelId, counterpartyNodeId, amountSatoshis); + } + + @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( + ChannelId channelId, + 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, + required TResult orElse(), + }) { + if (counterpartyRevokedOutputClaimable != null) { + return counterpartyRevokedOutputClaimable( + channelId, counterpartyNodeId, amountSatoshis); + } + return orElse(); + } + + @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, + }) { + return counterpartyRevokedOutputClaimable(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, + }) { + return counterpartyRevokedOutputClaimable?.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, + required TResult orElse(), + }) { + if (counterpartyRevokedOutputClaimable != null) { + return counterpartyRevokedOutputClaimable(this); + } + return orElse(); + } +} + +abstract class LightningBalance_CounterpartyRevokedOutputClaimable + extends LightningBalance { + const factory LightningBalance_CounterpartyRevokedOutputClaimable( + {required final ChannelId channelId, + required final PublicKey counterpartyNodeId, + required final int amountSatoshis}) = + _$LightningBalance_CounterpartyRevokedOutputClaimableImpl; + const LightningBalance_CounterpartyRevokedOutputClaimable._() : super._(); + + @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, in satoshis, of the output which we can claim. + int get amountSatoshis; + @override + @JsonKey(ignore: true) + _$$LightningBalance_CounterpartyRevokedOutputClaimableImplCopyWith< + _$LightningBalance_CounterpartyRevokedOutputClaimableImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +mixin _$MaxDustHTLCExposure { + int get field0 => throw _privateConstructorUsedError; + @optionalTypeArgs + TResult when({ + required TResult Function(int field0) fixedLimitMsat, + required TResult Function(int field0) feeRateMultiplier, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(int field0)? fixedLimitMsat, + TResult? Function(int field0)? feeRateMultiplier, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(int field0)? fixedLimitMsat, + TResult Function(int field0)? feeRateMultiplier, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map({ + required TResult Function(MaxDustHTLCExposure_FixedLimitMsat value) + fixedLimitMsat, + required TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value) + feeRateMultiplier, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, + TResult? Function(MaxDustHTLCExposure_FeeRateMultiplier value)? + feeRateMultiplier, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap({ + TResult Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, + TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value)? + feeRateMultiplier, + 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}); +} + +/// @nodoc +class _$MaxDustHTLCExposureCopyWithImpl<$Res, $Val extends MaxDustHTLCExposure> + implements $MaxDustHTLCExposureCopyWith<$Res> { + _$MaxDustHTLCExposureCopyWithImpl(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}); +} + +/// @nodoc +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? field0 = null, + }) { + return _then(_$MaxDustHTLCExposure_FixedLimitMsatImpl( + null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as int, + )); + } +} + +/// @nodoc + +class _$MaxDustHTLCExposure_FixedLimitMsatImpl + extends MaxDustHTLCExposure_FixedLimitMsat { + const _$MaxDustHTLCExposure_FixedLimitMsatImpl(this.field0) : super._(); + + @override + final int field0; + + @override + String toString() { + return 'MaxDustHTLCExposure.fixedLimitMsat(field0: $field0)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$MaxDustHTLCExposure_FixedLimitMsatImpl && + (identical(other.field0, field0) || other.field0 == field0)); + } + + @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); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(int field0) fixedLimitMsat, + required TResult Function(int field0) feeRateMultiplier, + }) { + return fixedLimitMsat(field0); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(int field0)? fixedLimitMsat, + TResult? Function(int field0)? feeRateMultiplier, + }) { + return fixedLimitMsat?.call(field0); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(int field0)? fixedLimitMsat, + TResult Function(int field0)? feeRateMultiplier, + required TResult orElse(), + }) { + if (fixedLimitMsat != null) { + return fixedLimitMsat(field0); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(MaxDustHTLCExposure_FixedLimitMsat value) + fixedLimitMsat, + required TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value) + feeRateMultiplier, + }) { + return fixedLimitMsat(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, + TResult? Function(MaxDustHTLCExposure_FeeRateMultiplier value)? + feeRateMultiplier, + }) { + return fixedLimitMsat?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, + TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value)? + feeRateMultiplier, + required TResult orElse(), + }) { + if (fixedLimitMsat != null) { + return fixedLimitMsat(this); + } + return orElse(); + } +} + +abstract class MaxDustHTLCExposure_FixedLimitMsat extends MaxDustHTLCExposure { + const factory MaxDustHTLCExposure_FixedLimitMsat(final int field0) = + _$MaxDustHTLCExposure_FixedLimitMsatImpl; + const MaxDustHTLCExposure_FixedLimitMsat._() : super._(); + + @override + int get field0; + @override + @JsonKey(ignore: true) + _$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWith< + _$MaxDustHTLCExposure_FixedLimitMsatImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +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({int 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) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? field0 = null, + }) { + return _then(_$MaxDustHTLCExposure_FeeRateMultiplierImpl( + null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as int, + )); + } +} + +/// @nodoc + +class _$MaxDustHTLCExposure_FeeRateMultiplierImpl + extends MaxDustHTLCExposure_FeeRateMultiplier { + const _$MaxDustHTLCExposure_FeeRateMultiplierImpl(this.field0) : super._(); + + @override + final int field0; + + @override + String toString() { + return 'MaxDustHTLCExposure.feeRateMultiplier(field0: $field0)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$MaxDustHTLCExposure_FeeRateMultiplierImpl && + (identical(other.field0, field0) || other.field0 == field0)); + } + + @override + int get hashCode => Object.hash(runtimeType, field0); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWith< + _$MaxDustHTLCExposure_FeeRateMultiplierImpl> + get copyWith => __$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWithImpl< + _$MaxDustHTLCExposure_FeeRateMultiplierImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(int field0) fixedLimitMsat, + required TResult Function(int field0) feeRateMultiplier, + }) { + return feeRateMultiplier(field0); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(int field0)? fixedLimitMsat, + TResult? Function(int field0)? feeRateMultiplier, + }) { + return feeRateMultiplier?.call(field0); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(int field0)? fixedLimitMsat, + TResult Function(int field0)? feeRateMultiplier, required TResult orElse(), }) { - if (channelClosed != null) { - return channelClosed(channelId, userChannelId, counterpartyNodeId); + if (feeRateMultiplier != null) { + return feeRateMultiplier(field0); } return orElse(); } @@ -1874,260 +8226,401 @@ class _$Event_ChannelClosedImpl extends Event_ChannelClosed { @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_ChannelReady value) channelReady, - required TResult Function(Event_ChannelClosed value) channelClosed, - required TResult Function(Event_ChannelPending value) channelPending, + required TResult Function(MaxDustHTLCExposure_FixedLimitMsat value) + fixedLimitMsat, + required TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value) + feeRateMultiplier, + }) { + return feeRateMultiplier(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, + TResult? Function(MaxDustHTLCExposure_FeeRateMultiplier value)? + feeRateMultiplier, + }) { + return feeRateMultiplier?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, + TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value)? + feeRateMultiplier, + required TResult orElse(), + }) { + if (feeRateMultiplier != null) { + return feeRateMultiplier(this); + } + return orElse(); + } +} + +abstract class MaxDustHTLCExposure_FeeRateMultiplier + extends MaxDustHTLCExposure { + const factory MaxDustHTLCExposure_FeeRateMultiplier(final int field0) = + _$MaxDustHTLCExposure_FeeRateMultiplierImpl; + const MaxDustHTLCExposure_FeeRateMultiplier._() : super._(); + + @override + int get field0; + @override + @JsonKey(ignore: true) + _$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWith< + _$MaxDustHTLCExposure_FeeRateMultiplierImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +mixin _$PaymentKind { + @optionalTypeArgs + TResult when({ + required TResult Function() onchain, + required TResult Function( + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt11, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits) + bolt11Jit, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage) + spontaneous, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? onchain, + TResult? Function( + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? onchain, + TResult Function( + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map({ + required TResult Function(PaymentKind_Onchain value) onchain, + required TResult Function(PaymentKind_Bolt11 value) bolt11, + required TResult Function(PaymentKind_Bolt11Jit value) bolt11Jit, + required TResult Function(PaymentKind_Spontaneous value) spontaneous, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(PaymentKind_Onchain value)? onchain, + TResult? Function(PaymentKind_Bolt11 value)? bolt11, + TResult? Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult? Function(PaymentKind_Spontaneous value)? spontaneous, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap({ + TResult Function(PaymentKind_Onchain value)? onchain, + TResult Function(PaymentKind_Bolt11 value)? bolt11, + TResult Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult Function(PaymentKind_Spontaneous value)? spontaneous, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $PaymentKindCopyWith<$Res> { + factory $PaymentKindCopyWith( + PaymentKind value, $Res Function(PaymentKind) then) = + _$PaymentKindCopyWithImpl<$Res, PaymentKind>; +} + +/// @nodoc +class _$PaymentKindCopyWithImpl<$Res, $Val extends PaymentKind> + implements $PaymentKindCopyWith<$Res> { + _$PaymentKindCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; +} + +/// @nodoc +abstract class _$$PaymentKind_OnchainImplCopyWith<$Res> { + factory _$$PaymentKind_OnchainImplCopyWith(_$PaymentKind_OnchainImpl value, + $Res Function(_$PaymentKind_OnchainImpl) then) = + __$$PaymentKind_OnchainImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$PaymentKind_OnchainImplCopyWithImpl<$Res> + extends _$PaymentKindCopyWithImpl<$Res, _$PaymentKind_OnchainImpl> + implements _$$PaymentKind_OnchainImplCopyWith<$Res> { + __$$PaymentKind_OnchainImplCopyWithImpl(_$PaymentKind_OnchainImpl _value, + $Res Function(_$PaymentKind_OnchainImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$PaymentKind_OnchainImpl extends PaymentKind_Onchain { + const _$PaymentKind_OnchainImpl() : super._(); + + @override + String toString() { + return 'PaymentKind.onchain()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$PaymentKind_OnchainImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() onchain, + required TResult Function( + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt11, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits) + bolt11Jit, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage) + spontaneous, + }) { + return onchain(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? onchain, + TResult? Function( + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + }) { + return onchain?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? onchain, + TResult Function( + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + required TResult orElse(), + }) { + if (onchain != null) { + return onchain(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(PaymentKind_Onchain value) onchain, + required TResult Function(PaymentKind_Bolt11 value) bolt11, + required TResult Function(PaymentKind_Bolt11Jit value) bolt11Jit, + required TResult Function(PaymentKind_Spontaneous value) spontaneous, }) { - return channelClosed(this); + return onchain(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_ChannelReady value)? channelReady, - TResult? Function(Event_ChannelClosed value)? channelClosed, - TResult? Function(Event_ChannelPending value)? channelPending, + TResult? Function(PaymentKind_Onchain value)? onchain, + TResult? Function(PaymentKind_Bolt11 value)? bolt11, + TResult? Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult? Function(PaymentKind_Spontaneous value)? spontaneous, }) { - return channelClosed?.call(this); + return onchain?.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_ChannelReady value)? channelReady, - TResult Function(Event_ChannelClosed value)? channelClosed, - TResult Function(Event_ChannelPending value)? channelPending, + TResult Function(PaymentKind_Onchain value)? onchain, + TResult Function(PaymentKind_Bolt11 value)? bolt11, + TResult Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult Function(PaymentKind_Spontaneous value)? spontaneous, required TResult orElse(), }) { - if (channelClosed != null) { - return channelClosed(this); + if (onchain != null) { + return onchain(this); } return orElse(); } } -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 channel_id of the channel. - ChannelId get channelId; - - /// The user_channel_id of the channel. - UserChannelId get userChannelId; - PublicKey? get counterpartyNodeId; - @JsonKey(ignore: true) - _$$Event_ChannelClosedImplCopyWith<_$Event_ChannelClosedImpl> get copyWith => - throw _privateConstructorUsedError; +abstract class PaymentKind_Onchain extends PaymentKind { + const factory PaymentKind_Onchain() = _$PaymentKind_OnchainImpl; + const PaymentKind_Onchain._() : super._(); } /// @nodoc -abstract class _$$Event_ChannelPendingImplCopyWith<$Res> { - factory _$$Event_ChannelPendingImplCopyWith(_$Event_ChannelPendingImpl value, - $Res Function(_$Event_ChannelPendingImpl) then) = - __$$Event_ChannelPendingImplCopyWithImpl<$Res>; +abstract class _$$PaymentKind_Bolt11ImplCopyWith<$Res> { + factory _$$PaymentKind_Bolt11ImplCopyWith(_$PaymentKind_Bolt11Impl value, + $Res Function(_$PaymentKind_Bolt11Impl) then) = + __$$PaymentKind_Bolt11ImplCopyWithImpl<$Res>; @useResult $Res call( - {ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo}); + {PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret}); } /// @nodoc -class __$$Event_ChannelPendingImplCopyWithImpl<$Res> - extends _$EventCopyWithImpl<$Res, _$Event_ChannelPendingImpl> - implements _$$Event_ChannelPendingImplCopyWith<$Res> { - __$$Event_ChannelPendingImplCopyWithImpl(_$Event_ChannelPendingImpl _value, - $Res Function(_$Event_ChannelPendingImpl) _then) +class __$$PaymentKind_Bolt11ImplCopyWithImpl<$Res> + extends _$PaymentKindCopyWithImpl<$Res, _$PaymentKind_Bolt11Impl> + implements _$$PaymentKind_Bolt11ImplCopyWith<$Res> { + __$$PaymentKind_Bolt11ImplCopyWithImpl(_$PaymentKind_Bolt11Impl _value, + $Res Function(_$PaymentKind_Bolt11Impl) _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, + Object? hash = null, + Object? preimage = freezed, + Object? secret = freezed, + }) { + return _then(_$PaymentKind_Bolt11Impl( + hash: null == hash + ? _value.hash + : hash // ignore: cast_nullable_to_non_nullable + as PaymentHash, + preimage: freezed == preimage + ? _value.preimage + : preimage // ignore: cast_nullable_to_non_nullable + as PaymentPreimage?, + secret: freezed == secret + ? _value.secret + : secret // ignore: cast_nullable_to_non_nullable + as PaymentSecret?, )); } } /// @nodoc -class _$Event_ChannelPendingImpl extends Event_ChannelPending { - const _$Event_ChannelPendingImpl( - {required this.channelId, - required this.userChannelId, - required this.formerTemporaryChannelId, - required this.counterpartyNodeId, - required this.fundingTxo}) +class _$PaymentKind_Bolt11Impl extends PaymentKind_Bolt11 { + const _$PaymentKind_Bolt11Impl( + {required this.hash, this.preimage, this.secret}) : super._(); - /// 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. + /// The payment hash, i.e., the hash of the `preimage`. @override - final ChannelId formerTemporaryChannelId; + final PaymentHash hash; - /// The node_id of the channel counterparty. + /// The pre-image used by the payment. @override - final PublicKey counterpartyNodeId; + final PaymentPreimage? preimage; - /// The outpoint of the channel's funding transaction. + /// The secret used by the payment. @override - final OutPoint fundingTxo; + final PaymentSecret? secret; @override String toString() { - return 'Event.channelPending(channelId: $channelId, userChannelId: $userChannelId, formerTemporaryChannelId: $formerTemporaryChannelId, counterpartyNodeId: $counterpartyNodeId, fundingTxo: $fundingTxo)'; + return 'PaymentKind.bolt11(hash: $hash, preimage: $preimage, secret: $secret)'; } @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)); + other is _$PaymentKind_Bolt11Impl && + (identical(other.hash, hash) || other.hash == hash) && + (identical(other.preimage, preimage) || + other.preimage == preimage) && + (identical(other.secret, secret) || other.secret == secret)); } @override - int get hashCode => Object.hash(runtimeType, channelId, userChannelId, - formerTemporaryChannelId, counterpartyNodeId, fundingTxo); + int get hashCode => Object.hash(runtimeType, hash, preimage, secret); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$Event_ChannelPendingImplCopyWith<_$Event_ChannelPendingImpl> - get copyWith => - __$$Event_ChannelPendingImplCopyWithImpl<_$Event_ChannelPendingImpl>( - this, _$identity); + _$$PaymentKind_Bolt11ImplCopyWith<_$PaymentKind_Bolt11Impl> get copyWith => + __$$PaymentKind_Bolt11ImplCopyWithImpl<_$PaymentKind_Bolt11Impl>( + this, _$identity); @override @optionalTypeArgs TResult when({ - 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() onchain, required TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo) - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt11, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits) + bolt11Jit, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage) + spontaneous, }) { - return channelPending(channelId, userChannelId, formerTemporaryChannelId, - counterpartyNodeId, fundingTxo); + return bolt11(hash, preimage, secret); } @override @optionalTypeArgs TResult? whenOrNull({ - 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()? onchain, TResult? Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, }) { - return channelPending?.call(channelId, userChannelId, - formerTemporaryChannelId, counterpartyNodeId, fundingTxo); + return bolt11?.call(hash, preimage, secret); } @override @optionalTypeArgs TResult maybeWhen({ - 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()? onchain, TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, required TResult orElse(), }) { - if (channelPending != null) { - return channelPending(channelId, userChannelId, formerTemporaryChannelId, - counterpartyNodeId, fundingTxo); + if (bolt11 != null) { + return bolt11(hash, preimage, secret); } return orElse(); } @@ -2135,204 +8628,217 @@ class _$Event_ChannelPendingImpl extends Event_ChannelPending { @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_ChannelReady value) channelReady, - required TResult Function(Event_ChannelClosed value) channelClosed, - required TResult Function(Event_ChannelPending value) channelPending, + required TResult Function(PaymentKind_Onchain value) onchain, + required TResult Function(PaymentKind_Bolt11 value) bolt11, + required TResult Function(PaymentKind_Bolt11Jit value) bolt11Jit, + required TResult Function(PaymentKind_Spontaneous value) spontaneous, }) { - return channelPending(this); + return bolt11(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_ChannelReady value)? channelReady, - TResult? Function(Event_ChannelClosed value)? channelClosed, - TResult? Function(Event_ChannelPending value)? channelPending, + TResult? Function(PaymentKind_Onchain value)? onchain, + TResult? Function(PaymentKind_Bolt11 value)? bolt11, + TResult? Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult? Function(PaymentKind_Spontaneous value)? spontaneous, }) { - return channelPending?.call(this); + return bolt11?.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_ChannelReady value)? channelReady, - TResult Function(Event_ChannelClosed value)? channelClosed, - TResult Function(Event_ChannelPending value)? channelPending, + TResult Function(PaymentKind_Onchain value)? onchain, + TResult Function(PaymentKind_Bolt11 value)? bolt11, + TResult Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult Function(PaymentKind_Spontaneous value)? spontaneous, required TResult orElse(), }) { - if (channelPending != null) { - return channelPending(this); + if (bolt11 != null) { + return bolt11(this); } return orElse(); } } -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 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 -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; -} +abstract class PaymentKind_Bolt11 extends PaymentKind { + const factory PaymentKind_Bolt11( + {required final PaymentHash hash, + final PaymentPreimage? preimage, + final PaymentSecret? secret}) = _$PaymentKind_Bolt11Impl; + const PaymentKind_Bolt11._() : super._(); -/// @nodoc -abstract class $GossipSourceConfigCopyWith<$Res> { - factory $GossipSourceConfigCopyWith( - GossipSourceConfig value, $Res Function(GossipSourceConfig) then) = - _$GossipSourceConfigCopyWithImpl<$Res, GossipSourceConfig>; -} + /// The payment hash, i.e., the hash of the `preimage`. + PaymentHash get hash; -/// @nodoc -class _$GossipSourceConfigCopyWithImpl<$Res, $Val extends GossipSourceConfig> - implements $GossipSourceConfigCopyWith<$Res> { - _$GossipSourceConfigCopyWithImpl(this._value, this._then); + /// The pre-image used by the payment. + PaymentPreimage? get preimage; - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; + /// The secret used by the payment. + PaymentSecret? get secret; + @JsonKey(ignore: true) + _$$PaymentKind_Bolt11ImplCopyWith<_$PaymentKind_Bolt11Impl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$GossipSourceConfig_P2PNetworkImplCopyWith<$Res> { - factory _$$GossipSourceConfig_P2PNetworkImplCopyWith( - _$GossipSourceConfig_P2PNetworkImpl value, - $Res Function(_$GossipSourceConfig_P2PNetworkImpl) then) = - __$$GossipSourceConfig_P2PNetworkImplCopyWithImpl<$Res>; +abstract class _$$PaymentKind_Bolt11JitImplCopyWith<$Res> { + factory _$$PaymentKind_Bolt11JitImplCopyWith( + _$PaymentKind_Bolt11JitImpl value, + $Res Function(_$PaymentKind_Bolt11JitImpl) then) = + __$$PaymentKind_Bolt11JitImplCopyWithImpl<$Res>; + @useResult + $Res call( + {PaymentHash hash, + PaymentPreimage? preimage, + PaymentSecret? secret, + LSPFeeLimits lspFeeLimits}); } /// @nodoc -class __$$GossipSourceConfig_P2PNetworkImplCopyWithImpl<$Res> - extends _$GossipSourceConfigCopyWithImpl<$Res, - _$GossipSourceConfig_P2PNetworkImpl> - implements _$$GossipSourceConfig_P2PNetworkImplCopyWith<$Res> { - __$$GossipSourceConfig_P2PNetworkImplCopyWithImpl( - _$GossipSourceConfig_P2PNetworkImpl _value, - $Res Function(_$GossipSourceConfig_P2PNetworkImpl) _then) +class __$$PaymentKind_Bolt11JitImplCopyWithImpl<$Res> + extends _$PaymentKindCopyWithImpl<$Res, _$PaymentKind_Bolt11JitImpl> + implements _$$PaymentKind_Bolt11JitImplCopyWith<$Res> { + __$$PaymentKind_Bolt11JitImplCopyWithImpl(_$PaymentKind_Bolt11JitImpl _value, + $Res Function(_$PaymentKind_Bolt11JitImpl) _then) : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? hash = null, + Object? preimage = freezed, + Object? secret = freezed, + Object? lspFeeLimits = null, + }) { + return _then(_$PaymentKind_Bolt11JitImpl( + hash: null == hash + ? _value.hash + : hash // ignore: cast_nullable_to_non_nullable + as PaymentHash, + preimage: freezed == preimage + ? _value.preimage + : preimage // ignore: cast_nullable_to_non_nullable + as PaymentPreimage?, + secret: freezed == secret + ? _value.secret + : secret // ignore: cast_nullable_to_non_nullable + as PaymentSecret?, + lspFeeLimits: null == lspFeeLimits + ? _value.lspFeeLimits + : lspFeeLimits // ignore: cast_nullable_to_non_nullable + as LSPFeeLimits, + )); + } } /// @nodoc -class _$GossipSourceConfig_P2PNetworkImpl - extends GossipSourceConfig_P2PNetwork { - const _$GossipSourceConfig_P2PNetworkImpl() : super._(); +class _$PaymentKind_Bolt11JitImpl extends PaymentKind_Bolt11Jit { + const _$PaymentKind_Bolt11JitImpl( + {required this.hash, + this.preimage, + this.secret, + required this.lspFeeLimits}) + : super._(); + + /// The payment hash, i.e., the hash of the `preimage`. + @override + final PaymentHash hash; + + /// The pre-image used by the payment. + @override + final PaymentPreimage? preimage; + + /// The secret used by the payment. + @override + final PaymentSecret? secret; + + /// Limits applying to how much fee we allow an LSP to deduct from the payment amount. + /// + /// Allowing them to deduct this fee from the first inbound payment will pay for the LSP's + /// channel opening fees. + /// + @override + final LSPFeeLimits lspFeeLimits; @override String toString() { - return 'GossipSourceConfig.p2PNetwork()'; + return 'PaymentKind.bolt11Jit(hash: $hash, preimage: $preimage, secret: $secret, lspFeeLimits: $lspFeeLimits)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$GossipSourceConfig_P2PNetworkImpl); + other is _$PaymentKind_Bolt11JitImpl && + (identical(other.hash, hash) || other.hash == hash) && + (identical(other.preimage, preimage) || + other.preimage == preimage) && + (identical(other.secret, secret) || other.secret == secret) && + (identical(other.lspFeeLimits, lspFeeLimits) || + other.lspFeeLimits == lspFeeLimits)); } @override - int get hashCode => runtimeType.hashCode; + int get hashCode => + Object.hash(runtimeType, hash, preimage, secret, lspFeeLimits); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$PaymentKind_Bolt11JitImplCopyWith<_$PaymentKind_Bolt11JitImpl> + get copyWith => __$$PaymentKind_Bolt11JitImplCopyWithImpl< + _$PaymentKind_Bolt11JitImpl>(this, _$identity); @override @optionalTypeArgs TResult when({ - required TResult Function() p2PNetwork, - required TResult Function(String field0) rapidGossipSync, + required TResult Function() onchain, + required TResult Function( + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt11, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits) + bolt11Jit, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage) + spontaneous, }) { - return p2PNetwork(); + return bolt11Jit(hash, preimage, secret, lspFeeLimits); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function()? p2PNetwork, - TResult? Function(String field0)? rapidGossipSync, + TResult? Function()? onchain, + TResult? Function( + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, }) { - return p2PNetwork?.call(); + return bolt11Jit?.call(hash, preimage, secret, lspFeeLimits); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function()? p2PNetwork, - TResult Function(String field0)? rapidGossipSync, + TResult Function()? onchain, + TResult Function( + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, required TResult orElse(), }) { - if (p2PNetwork != null) { - return p2PNetwork(); + if (bolt11Jit != null) { + return bolt11Jit(hash, preimage, secret, lspFeeLimits); } return orElse(); } @@ -2340,137 +8846,192 @@ class _$GossipSourceConfig_P2PNetworkImpl @override @optionalTypeArgs TResult map({ - required TResult Function(GossipSourceConfig_P2PNetwork value) p2PNetwork, - required TResult Function(GossipSourceConfig_RapidGossipSync value) - rapidGossipSync, + required TResult Function(PaymentKind_Onchain value) onchain, + required TResult Function(PaymentKind_Bolt11 value) bolt11, + required TResult Function(PaymentKind_Bolt11Jit value) bolt11Jit, + required TResult Function(PaymentKind_Spontaneous value) spontaneous, }) { - return p2PNetwork(this); + return bolt11Jit(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(GossipSourceConfig_P2PNetwork value)? p2PNetwork, - TResult? Function(GossipSourceConfig_RapidGossipSync value)? - rapidGossipSync, + TResult? Function(PaymentKind_Onchain value)? onchain, + TResult? Function(PaymentKind_Bolt11 value)? bolt11, + TResult? Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult? Function(PaymentKind_Spontaneous value)? spontaneous, }) { - return p2PNetwork?.call(this); + return bolt11Jit?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(GossipSourceConfig_P2PNetwork value)? p2PNetwork, - TResult Function(GossipSourceConfig_RapidGossipSync value)? rapidGossipSync, + TResult Function(PaymentKind_Onchain value)? onchain, + TResult Function(PaymentKind_Bolt11 value)? bolt11, + TResult Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult Function(PaymentKind_Spontaneous value)? spontaneous, required TResult orElse(), }) { - if (p2PNetwork != null) { - return p2PNetwork(this); + if (bolt11Jit != null) { + return bolt11Jit(this); } return orElse(); } } -abstract class GossipSourceConfig_P2PNetwork extends GossipSourceConfig { - const factory GossipSourceConfig_P2PNetwork() = - _$GossipSourceConfig_P2PNetworkImpl; - const GossipSourceConfig_P2PNetwork._() : super._(); +abstract class PaymentKind_Bolt11Jit extends PaymentKind { + const factory PaymentKind_Bolt11Jit( + {required final PaymentHash hash, + final PaymentPreimage? preimage, + final PaymentSecret? secret, + required final LSPFeeLimits lspFeeLimits}) = _$PaymentKind_Bolt11JitImpl; + const PaymentKind_Bolt11Jit._() : super._(); + + /// The payment hash, i.e., the hash of the `preimage`. + PaymentHash get hash; + + /// The pre-image used by the payment. + PaymentPreimage? get preimage; + + /// The secret used by the payment. + PaymentSecret? get secret; + + /// Limits applying to how much fee we allow an LSP to deduct from the payment amount. + /// + /// Allowing them to deduct this fee from the first inbound payment will pay for the LSP's + /// channel opening fees. + /// + LSPFeeLimits get lspFeeLimits; + @JsonKey(ignore: true) + _$$PaymentKind_Bolt11JitImplCopyWith<_$PaymentKind_Bolt11JitImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$GossipSourceConfig_RapidGossipSyncImplCopyWith<$Res> { - factory _$$GossipSourceConfig_RapidGossipSyncImplCopyWith( - _$GossipSourceConfig_RapidGossipSyncImpl value, - $Res Function(_$GossipSourceConfig_RapidGossipSyncImpl) then) = - __$$GossipSourceConfig_RapidGossipSyncImplCopyWithImpl<$Res>; +abstract class _$$PaymentKind_SpontaneousImplCopyWith<$Res> { + factory _$$PaymentKind_SpontaneousImplCopyWith( + _$PaymentKind_SpontaneousImpl value, + $Res Function(_$PaymentKind_SpontaneousImpl) then) = + __$$PaymentKind_SpontaneousImplCopyWithImpl<$Res>; @useResult - $Res call({String field0}); + $Res call({PaymentHash hash, PaymentPreimage? preimage}); } /// @nodoc -class __$$GossipSourceConfig_RapidGossipSyncImplCopyWithImpl<$Res> - extends _$GossipSourceConfigCopyWithImpl<$Res, - _$GossipSourceConfig_RapidGossipSyncImpl> - implements _$$GossipSourceConfig_RapidGossipSyncImplCopyWith<$Res> { - __$$GossipSourceConfig_RapidGossipSyncImplCopyWithImpl( - _$GossipSourceConfig_RapidGossipSyncImpl _value, - $Res Function(_$GossipSourceConfig_RapidGossipSyncImpl) _then) +class __$$PaymentKind_SpontaneousImplCopyWithImpl<$Res> + extends _$PaymentKindCopyWithImpl<$Res, _$PaymentKind_SpontaneousImpl> + implements _$$PaymentKind_SpontaneousImplCopyWith<$Res> { + __$$PaymentKind_SpontaneousImplCopyWithImpl( + _$PaymentKind_SpontaneousImpl _value, + $Res Function(_$PaymentKind_SpontaneousImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override $Res call({ - Object? field0 = null, + Object? hash = null, + Object? preimage = freezed, }) { - return _then(_$GossipSourceConfig_RapidGossipSyncImpl( - null == field0 - ? _value.field0 - : field0 // ignore: cast_nullable_to_non_nullable - as String, + return _then(_$PaymentKind_SpontaneousImpl( + hash: null == hash + ? _value.hash + : hash // ignore: cast_nullable_to_non_nullable + as PaymentHash, + preimage: freezed == preimage + ? _value.preimage + : preimage // ignore: cast_nullable_to_non_nullable + as PaymentPreimage?, )); } } /// @nodoc -class _$GossipSourceConfig_RapidGossipSyncImpl - extends GossipSourceConfig_RapidGossipSync { - const _$GossipSourceConfig_RapidGossipSyncImpl(this.field0) : super._(); +class _$PaymentKind_SpontaneousImpl extends PaymentKind_Spontaneous { + const _$PaymentKind_SpontaneousImpl({required this.hash, this.preimage}) + : super._(); + /// The payment hash, i.e., the hash of the `preimage`. @override - final String field0; + final PaymentHash hash; + + /// The pre-image used by the payment. + @override + final PaymentPreimage? preimage; @override String toString() { - return 'GossipSourceConfig.rapidGossipSync(field0: $field0)'; + return 'PaymentKind.spontaneous(hash: $hash, preimage: $preimage)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$GossipSourceConfig_RapidGossipSyncImpl && - (identical(other.field0, field0) || other.field0 == field0)); + other is _$PaymentKind_SpontaneousImpl && + (identical(other.hash, hash) || other.hash == hash) && + (identical(other.preimage, preimage) || + other.preimage == preimage)); } @override - int get hashCode => Object.hash(runtimeType, field0); + int get hashCode => Object.hash(runtimeType, hash, preimage); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$GossipSourceConfig_RapidGossipSyncImplCopyWith< - _$GossipSourceConfig_RapidGossipSyncImpl> - get copyWith => __$$GossipSourceConfig_RapidGossipSyncImplCopyWithImpl< - _$GossipSourceConfig_RapidGossipSyncImpl>(this, _$identity); + _$$PaymentKind_SpontaneousImplCopyWith<_$PaymentKind_SpontaneousImpl> + get copyWith => __$$PaymentKind_SpontaneousImplCopyWithImpl< + _$PaymentKind_SpontaneousImpl>(this, _$identity); @override @optionalTypeArgs TResult when({ - required TResult Function() p2PNetwork, - required TResult Function(String field0) rapidGossipSync, + required TResult Function() onchain, + required TResult Function( + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt11, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits) + bolt11Jit, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage) + spontaneous, }) { - return rapidGossipSync(field0); + return spontaneous(hash, preimage); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function()? p2PNetwork, - TResult? Function(String field0)? rapidGossipSync, + TResult? Function()? onchain, + TResult? Function( + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, }) { - return rapidGossipSync?.call(field0); + return spontaneous?.call(hash, preimage); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function()? p2PNetwork, - TResult Function(String field0)? rapidGossipSync, + TResult Function()? onchain, + TResult Function( + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, required TResult orElse(), }) { - if (rapidGossipSync != null) { - return rapidGossipSync(field0); + if (spontaneous != null) { + return spontaneous(hash, preimage); } return orElse(); } @@ -2478,164 +9039,450 @@ class _$GossipSourceConfig_RapidGossipSyncImpl @override @optionalTypeArgs TResult map({ - required TResult Function(GossipSourceConfig_P2PNetwork value) p2PNetwork, - required TResult Function(GossipSourceConfig_RapidGossipSync value) - rapidGossipSync, + required TResult Function(PaymentKind_Onchain value) onchain, + required TResult Function(PaymentKind_Bolt11 value) bolt11, + required TResult Function(PaymentKind_Bolt11Jit value) bolt11Jit, + required TResult Function(PaymentKind_Spontaneous value) spontaneous, }) { - return rapidGossipSync(this); + return spontaneous(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(GossipSourceConfig_P2PNetwork value)? p2PNetwork, - TResult? Function(GossipSourceConfig_RapidGossipSync value)? - rapidGossipSync, + TResult? Function(PaymentKind_Onchain value)? onchain, + TResult? Function(PaymentKind_Bolt11 value)? bolt11, + TResult? Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult? Function(PaymentKind_Spontaneous value)? spontaneous, }) { - return rapidGossipSync?.call(this); + return spontaneous?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(GossipSourceConfig_P2PNetwork value)? p2PNetwork, - TResult Function(GossipSourceConfig_RapidGossipSync value)? rapidGossipSync, + TResult Function(PaymentKind_Onchain value)? onchain, + TResult Function(PaymentKind_Bolt11 value)? bolt11, + TResult Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult Function(PaymentKind_Spontaneous value)? spontaneous, required TResult orElse(), }) { - if (rapidGossipSync != null) { - return rapidGossipSync(this); + if (spontaneous != null) { + return spontaneous(this); } return orElse(); } } -abstract class GossipSourceConfig_RapidGossipSync extends GossipSourceConfig { - const factory GossipSourceConfig_RapidGossipSync(final String field0) = - _$GossipSourceConfig_RapidGossipSyncImpl; - const GossipSourceConfig_RapidGossipSync._() : super._(); +abstract class PaymentKind_Spontaneous extends PaymentKind { + const factory PaymentKind_Spontaneous( + {required final PaymentHash hash, + final PaymentPreimage? preimage}) = _$PaymentKind_SpontaneousImpl; + const PaymentKind_Spontaneous._() : super._(); - String get field0; + /// The payment hash, i.e., the hash of the `preimage`. + PaymentHash get hash; + + /// The pre-image used by the payment. + PaymentPreimage? get preimage; @JsonKey(ignore: true) - _$$GossipSourceConfig_RapidGossipSyncImplCopyWith< - _$GossipSourceConfig_RapidGossipSyncImpl> + _$$PaymentKind_SpontaneousImplCopyWith<_$PaymentKind_SpontaneousImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -mixin _$MaxDustHTLCExposure { - int get field0 => throw _privateConstructorUsedError; +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(int field0) fixedLimitMsat, - required TResult Function(int field0) feeRateMultiplier, + 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(int field0)? fixedLimitMsat, - TResult? Function(int field0)? feeRateMultiplier, + 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 + extends PendingSweepBalance_PendingBroadcast { + const _$PendingSweepBalance_PendingBroadcastImpl( + {this.channelId, required this.amountSatoshis}) + : super._(); + + /// 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 + @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 + @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 @optionalTypeArgs TResult maybeWhen({ - TResult Function(int field0)? fixedLimitMsat, - TResult Function(int field0)? feeRateMultiplier, + 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; + }) { + if (pendingBroadcast != null) { + return pendingBroadcast(channelId, amountSatoshis); + } + return orElse(); + } + + @override @optionalTypeArgs TResult map({ - required TResult Function(MaxDustHTLCExposure_FixedLimitMsat value) - fixedLimitMsat, - required TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value) - feeRateMultiplier, - }) => - throw _privateConstructorUsedError; + 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 @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, - TResult? Function(MaxDustHTLCExposure_FeeRateMultiplier value)? - feeRateMultiplier, - }) => - throw _privateConstructorUsedError; + TResult? Function(PendingSweepBalance_PendingBroadcast value)? + pendingBroadcast, + TResult? Function(PendingSweepBalance_BroadcastAwaitingConfirmation value)? + broadcastAwaitingConfirmation, + TResult? Function(PendingSweepBalance_AwaitingThresholdConfirmations value)? + awaitingThresholdConfirmations, + }) { + return pendingBroadcast?.call(this); + } + + @override @optionalTypeArgs TResult maybeMap({ - TResult Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, - TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value)? - feeRateMultiplier, + 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) - $MaxDustHTLCExposureCopyWith get copyWith => - throw _privateConstructorUsedError; + }) { + if (pendingBroadcast != null) { + return pendingBroadcast(this); + } + return orElse(); + } } -/// @nodoc -abstract class $MaxDustHTLCExposureCopyWith<$Res> { - factory $MaxDustHTLCExposureCopyWith( - MaxDustHTLCExposure value, $Res Function(MaxDustHTLCExposure) then) = - _$MaxDustHTLCExposureCopyWithImpl<$Res, MaxDustHTLCExposure>; - @useResult - $Res call({int field0}); -} +abstract class PendingSweepBalance_PendingBroadcast + extends PendingSweepBalance { + const factory PendingSweepBalance_PendingBroadcast( + {final ChannelId? channelId, required final int amountSatoshis}) = + _$PendingSweepBalance_PendingBroadcastImpl; + const PendingSweepBalance_PendingBroadcast._() : super._(); -/// @nodoc -class _$MaxDustHTLCExposureCopyWithImpl<$Res, $Val extends MaxDustHTLCExposure> - implements $MaxDustHTLCExposureCopyWith<$Res> { - _$MaxDustHTLCExposureCopyWithImpl(this._value, this._then); + @override - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; + /// The identifier of the channel this balance belongs to. + ChannelId? get channelId; + @override - @pragma('vm:prefer-inline') + /// The amount, in satoshis, of the output being swept. + int get amountSatoshis; @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); - } + @JsonKey(ignore: true) + _$$PendingSweepBalance_PendingBroadcastImplCopyWith< + _$PendingSweepBalance_PendingBroadcastImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWith<$Res> - implements $MaxDustHTLCExposureCopyWith<$Res> { - factory _$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWith( - _$MaxDustHTLCExposure_FixedLimitMsatImpl value, - $Res Function(_$MaxDustHTLCExposure_FixedLimitMsatImpl) then) = - __$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWithImpl<$Res>; +abstract class _$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWith< + $Res> implements $PendingSweepBalanceCopyWith<$Res> { + factory _$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWith( + _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl value, + $Res Function(_$PendingSweepBalance_BroadcastAwaitingConfirmationImpl) + then) = + __$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWithImpl< + $Res>; @override @useResult - $Res call({int field0}); + $Res call( + {ChannelId? channelId, + int latestBroadcastHeight, + Txid latestSpendingTxid, + int amountSatoshis}); } /// @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 __$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWithImpl< + $Res> + extends _$PendingSweepBalanceCopyWithImpl<$Res, + _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl> + implements + _$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWith<$Res> { + __$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWithImpl( + _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl _value, + $Res Function(_$PendingSweepBalance_BroadcastAwaitingConfirmationImpl) + _then) : super(_value, _then); @pragma('vm:prefer-inline') @override $Res call({ - Object? field0 = null, + Object? channelId = freezed, + Object? latestBroadcastHeight = null, + Object? latestSpendingTxid = null, + Object? amountSatoshis = null, }) { - return _then(_$MaxDustHTLCExposure_FixedLimitMsatImpl( - null == field0 - ? _value.field0 - : field0 // ignore: cast_nullable_to_non_nullable + 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 as int, )); } @@ -2643,64 +9490,121 @@ class __$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWithImpl<$Res> /// @nodoc -class _$MaxDustHTLCExposure_FixedLimitMsatImpl - extends MaxDustHTLCExposure_FixedLimitMsat { - const _$MaxDustHTLCExposure_FixedLimitMsatImpl(this.field0) : super._(); +class _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl + extends PendingSweepBalance_BroadcastAwaitingConfirmation { + const _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl( + {this.channelId, + required this.latestBroadcastHeight, + required this.latestSpendingTxid, + required this.amountSatoshis}) + : super._(); + /// The identifier of the channel this balance belongs to. @override - final int field0; + 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; + + /// The amount, in satoshis, of the output being swept. + @override + final int amountSatoshis; @override String toString() { - return 'MaxDustHTLCExposure.fixedLimitMsat(field0: $field0)'; + return 'PendingSweepBalance.broadcastAwaitingConfirmation(channelId: $channelId, latestBroadcastHeight: $latestBroadcastHeight, latestSpendingTxid: $latestSpendingTxid, amountSatoshis: $amountSatoshis)'; } @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 _$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)); } @override - int get hashCode => Object.hash(runtimeType, field0); + int get hashCode => Object.hash(runtimeType, channelId, latestBroadcastHeight, + latestSpendingTxid, amountSatoshis); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWith< - _$MaxDustHTLCExposure_FixedLimitMsatImpl> - get copyWith => __$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWithImpl< - _$MaxDustHTLCExposure_FixedLimitMsatImpl>(this, _$identity); + _$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWith< + _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl> + get copyWith => + __$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWithImpl< + _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl>( + this, _$identity); @override @optionalTypeArgs TResult when({ - required TResult Function(int field0) fixedLimitMsat, - required TResult Function(int field0) feeRateMultiplier, + 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 fixedLimitMsat(field0); + return broadcastAwaitingConfirmation( + channelId, latestBroadcastHeight, latestSpendingTxid, amountSatoshis); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(int field0)? fixedLimitMsat, - TResult? Function(int field0)? feeRateMultiplier, + 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 fixedLimitMsat?.call(field0); + return broadcastAwaitingConfirmation?.call( + channelId, latestBroadcastHeight, latestSpendingTxid, amountSatoshis); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(int field0)? fixedLimitMsat, - TResult Function(int field0)? feeRateMultiplier, + 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(), }) { - if (fixedLimitMsat != null) { - return fixedLimitMsat(field0); + if (broadcastAwaitingConfirmation != null) { + return broadcastAwaitingConfirmation( + channelId, latestBroadcastHeight, latestSpendingTxid, amountSatoshis); } return orElse(); } @@ -2708,84 +9612,143 @@ class _$MaxDustHTLCExposure_FixedLimitMsatImpl @override @optionalTypeArgs TResult map({ - required TResult Function(MaxDustHTLCExposure_FixedLimitMsat value) - fixedLimitMsat, - required TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value) - feeRateMultiplier, + required TResult Function(PendingSweepBalance_PendingBroadcast value) + pendingBroadcast, + required TResult Function( + PendingSweepBalance_BroadcastAwaitingConfirmation value) + broadcastAwaitingConfirmation, + required TResult Function( + PendingSweepBalance_AwaitingThresholdConfirmations value) + awaitingThresholdConfirmations, }) { - return fixedLimitMsat(this); + return broadcastAwaitingConfirmation(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, - TResult? Function(MaxDustHTLCExposure_FeeRateMultiplier value)? - feeRateMultiplier, + TResult? Function(PendingSweepBalance_PendingBroadcast value)? + pendingBroadcast, + TResult? Function(PendingSweepBalance_BroadcastAwaitingConfirmation value)? + broadcastAwaitingConfirmation, + TResult? Function(PendingSweepBalance_AwaitingThresholdConfirmations value)? + awaitingThresholdConfirmations, }) { - return fixedLimitMsat?.call(this); + return broadcastAwaitingConfirmation?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, - TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value)? - feeRateMultiplier, + TResult Function(PendingSweepBalance_PendingBroadcast value)? + pendingBroadcast, + TResult Function(PendingSweepBalance_BroadcastAwaitingConfirmation value)? + broadcastAwaitingConfirmation, + TResult Function(PendingSweepBalance_AwaitingThresholdConfirmations value)? + awaitingThresholdConfirmations, required TResult orElse(), }) { - if (fixedLimitMsat != null) { - return fixedLimitMsat(this); + if (broadcastAwaitingConfirmation != null) { + return broadcastAwaitingConfirmation(this); } return orElse(); } } -abstract class MaxDustHTLCExposure_FixedLimitMsat extends MaxDustHTLCExposure { - const factory MaxDustHTLCExposure_FixedLimitMsat(final int field0) = - _$MaxDustHTLCExposure_FixedLimitMsatImpl; - const MaxDustHTLCExposure_FixedLimitMsat._() : super._(); +abstract class PendingSweepBalance_BroadcastAwaitingConfirmation + extends PendingSweepBalance { + const factory PendingSweepBalance_BroadcastAwaitingConfirmation( + {final ChannelId? channelId, + required final int latestBroadcastHeight, + required final Txid latestSpendingTxid, + required final int amountSatoshis}) = + _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl; + const PendingSweepBalance_BroadcastAwaitingConfirmation._() : super._(); @override - int get field0; + + /// 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; + + /// 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; @override @JsonKey(ignore: true) - _$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWith< - _$MaxDustHTLCExposure_FixedLimitMsatImpl> + _$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWith< + _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWith<$Res> - implements $MaxDustHTLCExposureCopyWith<$Res> { - factory _$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWith( - _$MaxDustHTLCExposure_FeeRateMultiplierImpl value, - $Res Function(_$MaxDustHTLCExposure_FeeRateMultiplierImpl) then) = - __$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWithImpl<$Res>; +abstract class _$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWith< + $Res> implements $PendingSweepBalanceCopyWith<$Res> { + factory _$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWith( + _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl value, + $Res Function( + _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl) + then) = + __$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWithImpl< + $Res>; @override @useResult - $Res call({int field0}); + $Res call( + {ChannelId? channelId, + Txid latestSpendingTxid, + String confirmationHash, + int confirmationHeight, + int amountSatoshis}); } /// @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 __$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWithImpl< + $Res> + extends _$PendingSweepBalanceCopyWithImpl<$Res, + _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl> + implements + _$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWith< + $Res> { + __$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWithImpl( + _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl _value, + $Res Function(_$PendingSweepBalance_AwaitingThresholdConfirmationsImpl) + _then) : super(_value, _then); @pragma('vm:prefer-inline') @override $Res call({ - Object? field0 = null, - }) { - return _then(_$MaxDustHTLCExposure_FeeRateMultiplierImpl( - null == field0 - ? _value.field0 - : field0 // ignore: cast_nullable_to_non_nullable + 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 as int, )); } @@ -2793,64 +9756,128 @@ class __$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWithImpl<$Res> /// @nodoc -class _$MaxDustHTLCExposure_FeeRateMultiplierImpl - extends MaxDustHTLCExposure_FeeRateMultiplier { - const _$MaxDustHTLCExposure_FeeRateMultiplierImpl(this.field0) : super._(); +class _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl + extends PendingSweepBalance_AwaitingThresholdConfirmations { + const _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl( + {this.channelId, + required this.latestSpendingTxid, + required this.confirmationHash, + required this.confirmationHeight, + required this.amountSatoshis}) + : super._(); + /// The identifier of the channel this balance belongs to. @override - final int field0; + 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; + + /// The amount, in satoshis, of the output being swept. + @override + final int amountSatoshis; @override String toString() { - return 'MaxDustHTLCExposure.feeRateMultiplier(field0: $field0)'; + return 'PendingSweepBalance.awaitingThresholdConfirmations(channelId: $channelId, latestSpendingTxid: $latestSpendingTxid, confirmationHash: $confirmationHash, confirmationHeight: $confirmationHeight, amountSatoshis: $amountSatoshis)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$MaxDustHTLCExposure_FeeRateMultiplierImpl && - (identical(other.field0, field0) || other.field0 == field0)); + 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)); } @override - int get hashCode => Object.hash(runtimeType, field0); + int get hashCode => Object.hash(runtimeType, channelId, latestSpendingTxid, + confirmationHash, confirmationHeight, amountSatoshis); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWith< - _$MaxDustHTLCExposure_FeeRateMultiplierImpl> - get copyWith => __$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWithImpl< - _$MaxDustHTLCExposure_FeeRateMultiplierImpl>(this, _$identity); + _$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWith< + _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl> + get copyWith => + __$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWithImpl< + _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl>( + this, _$identity); @override @optionalTypeArgs TResult when({ - required TResult Function(int field0) fixedLimitMsat, - required TResult Function(int field0) feeRateMultiplier, + 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 feeRateMultiplier(field0); + return awaitingThresholdConfirmations(channelId, latestSpendingTxid, + confirmationHash, confirmationHeight, amountSatoshis); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(int field0)? fixedLimitMsat, - TResult? Function(int field0)? feeRateMultiplier, + 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 feeRateMultiplier?.call(field0); + return awaitingThresholdConfirmations?.call(channelId, latestSpendingTxid, + confirmationHash, confirmationHeight, amountSatoshis); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(int field0)? fixedLimitMsat, - TResult Function(int field0)? feeRateMultiplier, + 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(), }) { - if (feeRateMultiplier != null) { - return feeRateMultiplier(field0); + if (awaitingThresholdConfirmations != null) { + return awaitingThresholdConfirmations(channelId, latestSpendingTxid, + confirmationHash, confirmationHeight, amountSatoshis); } return orElse(); } @@ -2858,51 +9885,81 @@ class _$MaxDustHTLCExposure_FeeRateMultiplierImpl @override @optionalTypeArgs TResult map({ - required TResult Function(MaxDustHTLCExposure_FixedLimitMsat value) - fixedLimitMsat, - required TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value) - feeRateMultiplier, + required TResult Function(PendingSweepBalance_PendingBroadcast value) + pendingBroadcast, + required TResult Function( + PendingSweepBalance_BroadcastAwaitingConfirmation value) + broadcastAwaitingConfirmation, + required TResult Function( + PendingSweepBalance_AwaitingThresholdConfirmations value) + awaitingThresholdConfirmations, }) { - return feeRateMultiplier(this); + return awaitingThresholdConfirmations(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, - TResult? Function(MaxDustHTLCExposure_FeeRateMultiplier value)? - feeRateMultiplier, + TResult? Function(PendingSweepBalance_PendingBroadcast value)? + pendingBroadcast, + TResult? Function(PendingSweepBalance_BroadcastAwaitingConfirmation value)? + broadcastAwaitingConfirmation, + TResult? Function(PendingSweepBalance_AwaitingThresholdConfirmations value)? + awaitingThresholdConfirmations, }) { - return feeRateMultiplier?.call(this); + return awaitingThresholdConfirmations?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, - TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value)? - feeRateMultiplier, + TResult Function(PendingSweepBalance_PendingBroadcast value)? + pendingBroadcast, + TResult Function(PendingSweepBalance_BroadcastAwaitingConfirmation value)? + broadcastAwaitingConfirmation, + TResult Function(PendingSweepBalance_AwaitingThresholdConfirmations value)? + awaitingThresholdConfirmations, required TResult orElse(), }) { - if (feeRateMultiplier != null) { - return feeRateMultiplier(this); + if (awaitingThresholdConfirmations != null) { + return awaitingThresholdConfirmations(this); } return orElse(); } } -abstract class MaxDustHTLCExposure_FeeRateMultiplier - extends MaxDustHTLCExposure { - const factory MaxDustHTLCExposure_FeeRateMultiplier(final int field0) = - _$MaxDustHTLCExposure_FeeRateMultiplierImpl; - const MaxDustHTLCExposure_FeeRateMultiplier._() : super._(); +abstract class PendingSweepBalance_AwaitingThresholdConfirmations + extends 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; + const PendingSweepBalance_AwaitingThresholdConfirmations._() : super._(); @override - int get field0; + + /// 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; + + /// 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; @override @JsonKey(ignore: true) - _$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWith< - _$MaxDustHTLCExposure_FeeRateMultiplierImpl> + _$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWith< + _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/generated/frb_generated.dart b/lib/src/generated/frb_generated.dart index 4e2953e..df00a7e 100644 --- a/lib/src/generated/frb_generated.dart +++ b/lib/src/generated/frb_generated.dart @@ -64,21 +64,82 @@ class LdkCore extends BaseEntrypoint { } abstract class LdkCoreApi extends BaseApi { - Future buildWithSqliteStore( + Future nodeBuilderBuild({required NodeBuilder that, dynamic hint}); + + Future nodeBuilderBuildWithFsStore( + {required NodeBuilder that, dynamic hint}); + + Future nodeBuilderCreateBuilder( {required Config config, ChainDataSourceConfig? chainDataSourceConfig, EntropySourceConfig? entropySourceConfig, GossipSourceConfig? gossipSourceConfig, + LiquiditySourceConfig? liquiditySourceConfig, + dynamic hint}); + + Future ldkBolt11PaymentReceive( + {required LdkBolt11Payment that, + required int amountMsat, + required String description, + required int expirySecs, + dynamic hint}); + + Future ldkBolt11PaymentReceiveVariableAmount( + {required LdkBolt11Payment that, + required String description, + required int expirySecs, + dynamic hint}); + + Future ldkBolt11PaymentReceiveVariableAmountViaJitChannel( + {required LdkBolt11Payment that, + required String description, + required int expirySecs, + int? maxProportionalLspFeeLimitPpmMsat, + dynamic hint}); + + Future ldkBolt11PaymentReceiveViaJitChannel( + {required LdkBolt11Payment that, + required int amountMsat, + required String description, + required int expirySecs, + int? maxTotalLspFeeLimitMsat, + dynamic hint}); + + Future ldkBolt11PaymentSend( + {required LdkBolt11Payment that, + required Bolt11Invoice invoice, + dynamic hint}); + + Future ldkBolt11PaymentSendProbes( + {required LdkBolt11Payment that, + required Bolt11Invoice invoice, + dynamic hint}); + + Future ldkBolt11PaymentSendProbesUsingAmount( + {required LdkBolt11Payment that, + required Bolt11Invoice invoice, + required int amountMsat, + dynamic hint}); + + Future ldkBolt11PaymentSendUsingAmount( + {required LdkBolt11Payment that, + required Bolt11Invoice invoice, + required int amountMsat, dynamic hint}); Future ldkMnemonicGenerate({dynamic hint}); + Future ldkNodeBolt11Payment( + {required LdkNode ptr, dynamic hint}); + Future ldkNodeCloseChannel( {required LdkNode that, - required ChannelId channelId, + required UserChannelId userChannelId, required PublicKey counterpartyNodeId, dynamic hint}); + Future ldkNodeConfig({required LdkNode that, dynamic hint}); + Future ldkNodeConnect( {required LdkNode that, required PublicKey nodeId, @@ -86,7 +147,7 @@ abstract class LdkCoreApi extends BaseApi { required bool persist, dynamic hint}); - Future ldkNodeConnectOpenChannel( + Future ldkNodeConnectOpenChannel( {required LdkNode that, required SocketAddress socketAddress, required PublicKey nodeId, @@ -103,7 +164,8 @@ abstract class LdkCoreApi extends BaseApi { Future ldkNodeEventHandled({required LdkNode that, dynamic hint}); - Future ldkNodeIsRunning({required LdkNode that, dynamic hint}); + Future ldkNodeListBalances( + {required LdkNode that, dynamic hint}); Future> ldkNodeListChannels( {required LdkNode that, dynamic hint}); @@ -122,116 +184,117 @@ abstract class LdkCoreApi extends BaseApi { Future?> ldkNodeListeningAddresses( {required LdkNode that, dynamic hint}); - Future
ldkNodeNewOnchainAddress( - {required LdkNode that, dynamic hint}); - Future ldkNodeNextEvent({required LdkNode that, dynamic hint}); + Future ldkNodeNextEventAsync({required LdkNode that, dynamic hint}); + Future ldkNodeNodeId({required LdkNode that, dynamic hint}); + Future ldkNodeOnChainPayment( + {required LdkNode ptr, dynamic hint}); + Future ldkNodePayment( - {required LdkNode that, required PaymentHash paymentHash, dynamic hint}); + {required LdkNode that, required PaymentId paymentId, dynamic hint}); - Future ldkNodeReceivePayment( - {required LdkNode that, - required int amountMsat, - required String description, - required int expirySecs, - dynamic hint}); + Future ldkNodeRemovePayment( + {required LdkNode that, required PaymentId paymentId, dynamic hint}); - Future ldkNodeReceiveVariableAmountPayment( - {required LdkNode that, - required String description, - required int expirySecs, - dynamic hint}); + Future ldkNodeSignMessage( + {required LdkNode that, required List msg, dynamic hint}); - Future ldkNodeRemovePayment( - {required LdkNode that, required PaymentHash paymentHash, dynamic hint}); + Future ldkNodeSpontaneousPayment( + {required LdkNode ptr, dynamic hint}); - Future ldkNodeSendAllToOnchainAddress( - {required LdkNode that, required Address address, dynamic hint}); + Future ldkNodeStart({required LdkNode that, dynamic hint}); - Future ldkNodeSendPayment( - {required LdkNode that, required Bolt11Invoice invoice, dynamic hint}); + Future ldkNodeStatus({required LdkNode that, dynamic hint}); - Future ldkNodeSendPaymentProbes( - {required LdkNode that, required Bolt11Invoice invoice, dynamic hint}); + Future ldkNodeStop({required LdkNode that, dynamic hint}); - Future ldkNodeSendPaymentProbesUsingAmount( + Future ldkNodeSyncWallets({required LdkNode that, dynamic hint}); + + Future ldkNodeUpdateChannelConfig( {required LdkNode that, - required Bolt11Invoice invoice, - required int amountMsat, + required UserChannelId userChannelId, + required PublicKey counterpartyNodeId, + required ChannelConfig channelConfig, dynamic hint}); - Future ldkNodeSendPaymentUsingAmount( + Future ldkNodeVerifySignature( {required LdkNode that, - required Bolt11Invoice invoice, - required int amountMsat, + required List msg, + required String sig, + required PublicKey publicKey, dynamic hint}); - Future ldkNodeSendSpontaneousPayment( - {required LdkNode that, + Future ldkNodeWaitNextEvent({required LdkNode that, dynamic hint}); + + Future
ldkOnChainPaymentNewAddress( + {required LdkOnChainPayment that, dynamic hint}); + + Future ldkOnChainPaymentSendAllToAddress( + {required LdkOnChainPayment that, + required Address address, + dynamic hint}); + + Future ldkOnChainPaymentSendToAddress( + {required LdkOnChainPayment that, + required Address address, + required int amountSats, + dynamic hint}); + + Future ldkSpontaneousPaymentSend( + {required LdkSpontaneousPayment that, required int amountMsat, required PublicKey nodeId, dynamic hint}); - Future ldkNodeSendSpontaneousPaymentProbes( - {required LdkNode that, + Future ldkSpontaneousPaymentSendProbes( + {required LdkSpontaneousPayment that, required int amountMsat, required PublicKey nodeId, dynamic hint}); - Future ldkNodeSendToOnchainAddress( - {required LdkNode that, - required Address address, - required int amountSats, - dynamic hint}); + RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_Node; - Future ldkNodeSignMessage( - {required LdkNode that, required List msg, dynamic hint}); + RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_Node; - Future ldkNodeSpendableOnchainBalanceSats( - {required LdkNode that, dynamic hint}); + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_NodePtr; - Future ldkNodeStart({required LdkNode that, dynamic hint}); + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_NodeBuilder; - Future ldkNodeStop({required LdkNode that, dynamic hint}); + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_NodeBuilder; - Future ldkNodeSyncWallets({required LdkNode that, dynamic hint}); + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_NodeBuilderPtr; - Future ldkNodeTotalOnchainBalanceSats( - {required LdkNode that, dynamic hint}); + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_LdkNodePaymentBolt11Payment; - Future ldkNodeUpdateChannelConfig( - {required LdkNode that, - required ChannelId channelId, - required PublicKey counterpartyNodeId, - required ChannelConfig channelConfig, - dynamic hint}); + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_LdkNodePaymentBolt11Payment; - Future ldkNodeVerifySignature( - {required LdkNode that, - required List msg, - required String sig, - required PublicKey pkey, - dynamic hint}); + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_LdkNodePaymentBolt11PaymentPtr; - Future ldkNodeWaitNextEvent({required LdkNode that, dynamic hint}); + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_LdkNodePaymentOnchainPayment; - Future socketAddressAsString( - {required SocketAddress that, dynamic hint}); + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_LdkNodePaymentOnchainPayment; - Future socketAddressFromStr( - {required String address, dynamic hint}); + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_LdkNodePaymentOnchainPaymentPtr; RustArcIncrementStrongCountFnType - get rust_arc_increment_strong_count_NodeSqliteStore; + get rust_arc_increment_strong_count_LdkNodePaymentSpontaneousPayment; RustArcDecrementStrongCountFnType - get rust_arc_decrement_strong_count_NodeSqliteStore; + get rust_arc_decrement_strong_count_LdkNodePaymentSpontaneousPayment; CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_NodeSqliteStorePtr; + get rust_arc_decrement_strong_count_LdkNodePaymentSpontaneousPaymentPtr; } class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { @@ -243,11 +306,64 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { }); @override - Future buildWithSqliteStore( + Future nodeBuilderBuild({required NodeBuilder that, dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + that); + return wire.wire_NodeBuilder_build(port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_ldk_node, + decodeErrorData: dco_decode_builder_exception, + ), + constMeta: kNodeBuilderBuildConstMeta, + argValues: [that], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kNodeBuilderBuildConstMeta => const TaskConstMeta( + debugName: "NodeBuilder_build", + argNames: ["that"], + ); + + @override + Future nodeBuilderBuildWithFsStore( + {required NodeBuilder that, dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + that); + return wire.wire_NodeBuilder_build_with_fs_store(port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_ldk_node, + decodeErrorData: dco_decode_builder_exception, + ), + constMeta: kNodeBuilderBuildWithFsStoreConstMeta, + argValues: [that], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kNodeBuilderBuildWithFsStoreConstMeta => + const TaskConstMeta( + debugName: "NodeBuilder_build_with_fs_store", + argNames: ["that"], + ); + + @override + Future nodeBuilderCreateBuilder( {required Config config, ChainDataSourceConfig? chainDataSourceConfig, EntropySourceConfig? entropySourceConfig, GossipSourceConfig? gossipSourceConfig, + LiquiditySourceConfig? liquiditySourceConfig, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { @@ -258,32 +374,311 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { entropySourceConfig); var arg3 = cst_encode_opt_box_autoadd_gossip_source_config(gossipSourceConfig); - return wire.wire_build_with_sqlite_store(port_, arg0, arg1, arg2, arg3); + var arg4 = cst_encode_opt_box_autoadd_liquidity_source_config( + liquiditySourceConfig); + return wire.wire_NodeBuilder_create_builder( + port_, arg0, arg1, arg2, arg3, arg4); }, codec: DcoCodec( - decodeSuccessData: dco_decode_ldk_node, + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder, decodeErrorData: dco_decode_builder_exception, ), - constMeta: kBuildWithSqliteStoreConstMeta, - argValues: [ - config, - chainDataSourceConfig, - entropySourceConfig, - gossipSourceConfig - ], + constMeta: kNodeBuilderCreateBuilderConstMeta, + argValues: [ + config, + chainDataSourceConfig, + entropySourceConfig, + gossipSourceConfig, + liquiditySourceConfig + ], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kNodeBuilderCreateBuilderConstMeta => const TaskConstMeta( + debugName: "NodeBuilder_create_builder", + argNames: [ + "config", + "chainDataSourceConfig", + "entropySourceConfig", + "gossipSourceConfig", + "liquiditySourceConfig" + ], + ); + + @override + Future ldkBolt11PaymentReceive( + {required LdkBolt11Payment that, + required int amountMsat, + required String description, + required int expirySecs, + dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); + var arg1 = cst_encode_u_64(amountMsat); + var arg2 = cst_encode_String(description); + var arg3 = cst_encode_u_32(expirySecs); + return wire.wire_ldk_bolt_11_payment_receive( + port_, arg0, arg1, arg2, arg3); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_bolt_11_invoice, + decodeErrorData: dco_decode_node_exception, + ), + constMeta: kLdkBolt11PaymentReceiveConstMeta, + argValues: [that, amountMsat, description, expirySecs], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kLdkBolt11PaymentReceiveConstMeta => const TaskConstMeta( + debugName: "ldk_bolt_11_payment_receive", + argNames: ["that", "amountMsat", "description", "expirySecs"], + ); + + @override + Future ldkBolt11PaymentReceiveVariableAmount( + {required LdkBolt11Payment that, + required String description, + required int expirySecs, + dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); + var arg1 = cst_encode_String(description); + var arg2 = cst_encode_u_32(expirySecs); + return wire.wire_ldk_bolt_11_payment_receive_variable_amount( + port_, arg0, arg1, arg2); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_bolt_11_invoice, + decodeErrorData: dco_decode_node_exception, + ), + constMeta: kLdkBolt11PaymentReceiveVariableAmountConstMeta, + argValues: [that, description, expirySecs], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kLdkBolt11PaymentReceiveVariableAmountConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_receive_variable_amount", + argNames: ["that", "description", "expirySecs"], + ); + + @override + Future ldkBolt11PaymentReceiveVariableAmountViaJitChannel( + {required LdkBolt11Payment that, + required String description, + required int expirySecs, + int? maxProportionalLspFeeLimitPpmMsat, + dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(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_ldk_bolt_11_payment_receive_variable_amount_via_jit_channel( + port_, arg0, arg1, arg2, arg3); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_bolt_11_invoice, + decodeErrorData: dco_decode_node_exception, + ), + constMeta: kLdkBolt11PaymentReceiveVariableAmountViaJitChannelConstMeta, + argValues: [ + that, + description, + expirySecs, + maxProportionalLspFeeLimitPpmMsat + ], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta + get kLdkBolt11PaymentReceiveVariableAmountViaJitChannelConstMeta => + const TaskConstMeta( + debugName: + "ldk_bolt_11_payment_receive_variable_amount_via_jit_channel", + argNames: [ + "that", + "description", + "expirySecs", + "maxProportionalLspFeeLimitPpmMsat" + ], + ); + + @override + Future ldkBolt11PaymentReceiveViaJitChannel( + {required LdkBolt11Payment 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_ldk_bolt_11_payment(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_ldk_bolt_11_payment_receive_via_jit_channel( + port_, arg0, arg1, arg2, arg3, arg4); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_bolt_11_invoice, + decodeErrorData: dco_decode_node_exception, + ), + constMeta: kLdkBolt11PaymentReceiveViaJitChannelConstMeta, + argValues: [ + that, + amountMsat, + description, + expirySecs, + maxTotalLspFeeLimitMsat + ], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kLdkBolt11PaymentReceiveViaJitChannelConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_receive_via_jit_channel", + argNames: [ + "that", + "amountMsat", + "description", + "expirySecs", + "maxTotalLspFeeLimitMsat" + ], + ); + + @override + Future ldkBolt11PaymentSend( + {required LdkBolt11Payment that, + required Bolt11Invoice invoice, + dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); + var arg1 = cst_encode_box_autoadd_bolt_11_invoice(invoice); + return wire.wire_ldk_bolt_11_payment_send(port_, arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_payment_id, + decodeErrorData: dco_decode_node_exception, + ), + constMeta: kLdkBolt11PaymentSendConstMeta, + argValues: [that, invoice], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kLdkBolt11PaymentSendConstMeta => const TaskConstMeta( + debugName: "ldk_bolt_11_payment_send", + argNames: ["that", "invoice"], + ); + + @override + Future ldkBolt11PaymentSendProbes( + {required LdkBolt11Payment that, + required Bolt11Invoice invoice, + dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); + var arg1 = cst_encode_box_autoadd_bolt_11_invoice(invoice); + return wire.wire_ldk_bolt_11_payment_send_probes(port_, arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_node_exception, + ), + constMeta: kLdkBolt11PaymentSendProbesConstMeta, + argValues: [that, invoice], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kLdkBolt11PaymentSendProbesConstMeta => const TaskConstMeta( + debugName: "ldk_bolt_11_payment_send_probes", + argNames: ["that", "invoice"], + ); + + @override + Future ldkBolt11PaymentSendProbesUsingAmount( + {required LdkBolt11Payment that, + required Bolt11Invoice invoice, + required int amountMsat, + dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); + var arg1 = cst_encode_box_autoadd_bolt_11_invoice(invoice); + var arg2 = cst_encode_u_64(amountMsat); + return wire.wire_ldk_bolt_11_payment_send_probes_using_amount( + port_, arg0, arg1, arg2); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_node_exception, + ), + constMeta: kLdkBolt11PaymentSendProbesUsingAmountConstMeta, + argValues: [that, invoice, amountMsat], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kLdkBolt11PaymentSendProbesUsingAmountConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_send_probes_using_amount", + argNames: ["that", "invoice", "amountMsat"], + ); + + @override + Future ldkBolt11PaymentSendUsingAmount( + {required LdkBolt11Payment that, + required Bolt11Invoice invoice, + required int amountMsat, + dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); + var arg1 = cst_encode_box_autoadd_bolt_11_invoice(invoice); + var arg2 = cst_encode_u_64(amountMsat); + return wire.wire_ldk_bolt_11_payment_send_using_amount( + port_, arg0, arg1, arg2); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_payment_id, + decodeErrorData: dco_decode_node_exception, + ), + constMeta: kLdkBolt11PaymentSendUsingAmountConstMeta, + argValues: [that, invoice, amountMsat], apiImpl: this, hint: hint, )); } - TaskConstMeta get kBuildWithSqliteStoreConstMeta => const TaskConstMeta( - debugName: "build_with_sqlite_store", - argNames: [ - "config", - "chainDataSourceConfig", - "entropySourceConfig", - "gossipSourceConfig" - ], + TaskConstMeta get kLdkBolt11PaymentSendUsingAmountConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_send_using_amount", + argNames: ["that", "invoice", "amountMsat"], ); @override @@ -308,16 +703,40 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { argNames: [], ); + @override + Future ldkNodeBolt11Payment( + {required LdkNode ptr, dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(ptr); + return wire.wire_ldk_node_bolt11_payment(port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_ldk_bolt_11_payment, + decodeErrorData: null, + ), + constMeta: kLdkNodeBolt11PaymentConstMeta, + argValues: [ptr], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kLdkNodeBolt11PaymentConstMeta => const TaskConstMeta( + debugName: "ldk_node_bolt11_payment", + argNames: ["ptr"], + ); + @override Future ldkNodeCloseChannel( {required LdkNode that, - required ChannelId channelId, + required UserChannelId userChannelId, required PublicKey counterpartyNodeId, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); - var arg1 = cst_encode_box_autoadd_channel_id(channelId); + var arg1 = cst_encode_box_autoadd_user_channel_id(userChannelId); var arg2 = cst_encode_box_autoadd_public_key(counterpartyNodeId); return wire.wire_ldk_node_close_channel(port_, arg0, arg1, arg2); }, @@ -326,7 +745,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { decodeErrorData: dco_decode_node_exception, ), constMeta: kLdkNodeCloseChannelConstMeta, - argValues: [that, channelId, counterpartyNodeId], + argValues: [that, userChannelId, counterpartyNodeId], apiImpl: this, hint: hint, )); @@ -334,7 +753,30 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { TaskConstMeta get kLdkNodeCloseChannelConstMeta => const TaskConstMeta( debugName: "ldk_node_close_channel", - argNames: ["that", "channelId", "counterpartyNodeId"], + argNames: ["that", "userChannelId", "counterpartyNodeId"], + ); + + @override + Future ldkNodeConfig({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_config(port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_config, + decodeErrorData: null, + ), + constMeta: kLdkNodeConfigConstMeta, + argValues: [that], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kLdkNodeConfigConstMeta => const TaskConstMeta( + debugName: "ldk_node_config", + argNames: ["that"], ); @override @@ -369,7 +811,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { ); @override - Future ldkNodeConnectOpenChannel( + Future ldkNodeConnectOpenChannel( {required LdkNode that, required SocketAddress socketAddress, required PublicKey nodeId, @@ -391,7 +833,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { port_, arg0, arg1, arg2, arg3, arg4, arg5, arg6); }, codec: DcoCodec( - decodeSuccessData: dco_decode_unit, + decodeSuccessData: dco_decode_user_channel_id, decodeErrorData: dco_decode_node_exception, ), constMeta: kLdkNodeConnectOpenChannelConstMeta, @@ -473,25 +915,26 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { ); @override - Future ldkNodeIsRunning({required LdkNode that, dynamic hint}) { + Future ldkNodeListBalances( + {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_is_running(port_, arg0); + return wire.wire_ldk_node_list_balances(port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_bool, - decodeErrorData: null, + decodeSuccessData: dco_decode_balance_details, + decodeErrorData: dco_decode_node_exception, ), - constMeta: kLdkNodeIsRunningConstMeta, + constMeta: kLdkNodeListBalancesConstMeta, argValues: [that], apiImpl: this, hint: hint, )); } - TaskConstMeta get kLdkNodeIsRunningConstMeta => const TaskConstMeta( - debugName: "ldk_node_is_running", + TaskConstMeta get kLdkNodeListBalancesConstMeta => const TaskConstMeta( + debugName: "ldk_node_list_balances", argNames: ["that"], ); @@ -596,442 +1039,170 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { ); @override - Future?> ldkNodeListeningAddresses( - {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_listening_addresses(port_, arg0); - }, - codec: DcoCodec( - decodeSuccessData: dco_decode_opt_list_socket_address, - decodeErrorData: null, - ), - constMeta: kLdkNodeListeningAddressesConstMeta, - argValues: [that], - apiImpl: this, - hint: hint, - )); - } - - TaskConstMeta get kLdkNodeListeningAddressesConstMeta => const TaskConstMeta( - debugName: "ldk_node_listening_addresses", - argNames: ["that"], - ); - - @override - Future
ldkNodeNewOnchainAddress( - {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_new_onchain_address(port_, arg0); - }, - codec: DcoCodec( - decodeSuccessData: dco_decode_address, - decodeErrorData: dco_decode_node_exception, - ), - constMeta: kLdkNodeNewOnchainAddressConstMeta, - argValues: [that], - apiImpl: this, - hint: hint, - )); - } - - TaskConstMeta get kLdkNodeNewOnchainAddressConstMeta => const TaskConstMeta( - debugName: "ldk_node_new_onchain_address", - argNames: ["that"], - ); - - @override - Future ldkNodeNextEvent({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_next_event(port_, arg0); - }, - codec: DcoCodec( - decodeSuccessData: dco_decode_opt_box_autoadd_event, - decodeErrorData: null, - ), - constMeta: kLdkNodeNextEventConstMeta, - argValues: [that], - apiImpl: this, - hint: hint, - )); - } - - TaskConstMeta get kLdkNodeNextEventConstMeta => const TaskConstMeta( - debugName: "ldk_node_next_event", - argNames: ["that"], - ); - - @override - Future ldkNodeNodeId({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_node_id(port_, arg0); - }, - codec: DcoCodec( - decodeSuccessData: dco_decode_public_key, - decodeErrorData: null, - ), - constMeta: kLdkNodeNodeIdConstMeta, - argValues: [that], - apiImpl: this, - hint: hint, - )); - } - - TaskConstMeta get kLdkNodeNodeIdConstMeta => const TaskConstMeta( - debugName: "ldk_node_node_id", - argNames: ["that"], - ); - - @override - Future ldkNodePayment( - {required LdkNode that, required PaymentHash paymentHash, dynamic hint}) { - return handler.executeNormal(NormalTask( - callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - var arg1 = cst_encode_box_autoadd_payment_hash(paymentHash); - return wire.wire_ldk_node_payment(port_, arg0, arg1); - }, - codec: DcoCodec( - decodeSuccessData: dco_decode_opt_box_autoadd_payment_details, - decodeErrorData: null, - ), - constMeta: kLdkNodePaymentConstMeta, - argValues: [that, paymentHash], - apiImpl: this, - hint: hint, - )); - } - - TaskConstMeta get kLdkNodePaymentConstMeta => const TaskConstMeta( - debugName: "ldk_node_payment", - argNames: ["that", "paymentHash"], - ); - - @override - 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_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_ldk_node_receive_payment( - port_, arg0, arg1, arg2, arg3); - }, - codec: DcoCodec( - decodeSuccessData: dco_decode_bolt_11_invoice, - decodeErrorData: dco_decode_node_exception, - ), - constMeta: kLdkNodeReceivePaymentConstMeta, - argValues: [that, amountMsat, description, expirySecs], - apiImpl: this, - hint: hint, - )); - } - - TaskConstMeta get kLdkNodeReceivePaymentConstMeta => const TaskConstMeta( - debugName: "ldk_node_receive_payment", - argNames: ["that", "amountMsat", "description", "expirySecs"], - ); - - @override - 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_ldk_node(that); - var arg1 = cst_encode_String(description); - var arg2 = cst_encode_u_32(expirySecs); - 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_exception, - ), - constMeta: kLdkNodeReceiveVariableAmountPaymentConstMeta, - argValues: [that, description, expirySecs], - apiImpl: this, - hint: hint, - )); - } - - TaskConstMeta get kLdkNodeReceiveVariableAmountPaymentConstMeta => - const TaskConstMeta( - debugName: "ldk_node_receive_variable_amount_payment", - argNames: ["that", "description", "expirySecs"], - ); - - @override - Future ldkNodeRemovePayment( - {required LdkNode that, required PaymentHash paymentHash, dynamic hint}) { - return handler.executeNormal(NormalTask( - callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - var arg1 = cst_encode_box_autoadd_payment_hash(paymentHash); - return wire.wire_ldk_node_remove_payment(port_, arg0, arg1); - }, - codec: DcoCodec( - decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, - ), - constMeta: kLdkNodeRemovePaymentConstMeta, - argValues: [that, paymentHash], - apiImpl: this, - hint: hint, - )); - } - - TaskConstMeta get kLdkNodeRemovePaymentConstMeta => const TaskConstMeta( - debugName: "ldk_node_remove_payment", - argNames: ["that", "paymentHash"], - ); - - @override - Future ldkNodeSendAllToOnchainAddress( - {required LdkNode that, required Address address, dynamic hint}) { - return handler.executeNormal(NormalTask( - callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - var arg1 = cst_encode_box_autoadd_address(address); - return wire.wire_ldk_node_send_all_to_onchain_address( - port_, arg0, arg1); - }, - codec: DcoCodec( - decodeSuccessData: dco_decode_txid, - decodeErrorData: dco_decode_node_exception, - ), - constMeta: kLdkNodeSendAllToOnchainAddressConstMeta, - argValues: [that, address], - apiImpl: this, - hint: hint, - )); - } - - TaskConstMeta get kLdkNodeSendAllToOnchainAddressConstMeta => - const TaskConstMeta( - debugName: "ldk_node_send_all_to_onchain_address", - argNames: ["that", "address"], - ); - - @override - Future ldkNodeSendPayment( - {required LdkNode that, required Bolt11Invoice invoice, dynamic hint}) { + Future?> ldkNodeListeningAddresses( + {required LdkNode that, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); - var arg1 = cst_encode_box_autoadd_bolt_11_invoice(invoice); - return wire.wire_ldk_node_send_payment(port_, arg0, arg1); + return wire.wire_ldk_node_listening_addresses(port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_payment_hash, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_opt_list_socket_address, + decodeErrorData: null, ), - constMeta: kLdkNodeSendPaymentConstMeta, - argValues: [that, invoice], + constMeta: kLdkNodeListeningAddressesConstMeta, + argValues: [that], apiImpl: this, hint: hint, )); } - TaskConstMeta get kLdkNodeSendPaymentConstMeta => const TaskConstMeta( - debugName: "ldk_node_send_payment", - argNames: ["that", "invoice"], + TaskConstMeta get kLdkNodeListeningAddressesConstMeta => const TaskConstMeta( + debugName: "ldk_node_listening_addresses", + argNames: ["that"], ); @override - Future ldkNodeSendPaymentProbes( - {required LdkNode that, required Bolt11Invoice invoice, dynamic hint}) { + Future ldkNodeNextEvent({required LdkNode that, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); - var arg1 = cst_encode_box_autoadd_bolt_11_invoice(invoice); - return wire.wire_ldk_node_send_payment_probes(port_, arg0, arg1); + return wire.wire_ldk_node_next_event(port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_opt_box_autoadd_event, + decodeErrorData: null, ), - constMeta: kLdkNodeSendPaymentProbesConstMeta, - argValues: [that, invoice], + constMeta: kLdkNodeNextEventConstMeta, + argValues: [that], apiImpl: this, hint: hint, )); } - TaskConstMeta get kLdkNodeSendPaymentProbesConstMeta => const TaskConstMeta( - debugName: "ldk_node_send_payment_probes", - argNames: ["that", "invoice"], + TaskConstMeta get kLdkNodeNextEventConstMeta => const TaskConstMeta( + debugName: "ldk_node_next_event", + argNames: ["that"], ); @override - Future ldkNodeSendPaymentProbesUsingAmount( - {required LdkNode that, - required Bolt11Invoice invoice, - required int amountMsat, - dynamic hint}) { + Future ldkNodeNextEventAsync({required LdkNode that, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { 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_ldk_node_send_payment_probes_using_amount( - port_, arg0, arg1, arg2); + return wire.wire_ldk_node_next_event_async(port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_event, + decodeErrorData: null, ), - constMeta: kLdkNodeSendPaymentProbesUsingAmountConstMeta, - argValues: [that, invoice, amountMsat], + constMeta: kLdkNodeNextEventAsyncConstMeta, + argValues: [that], apiImpl: this, hint: hint, )); } - TaskConstMeta get kLdkNodeSendPaymentProbesUsingAmountConstMeta => - const TaskConstMeta( - debugName: "ldk_node_send_payment_probes_using_amount", - argNames: ["that", "invoice", "amountMsat"], + TaskConstMeta get kLdkNodeNextEventAsyncConstMeta => const TaskConstMeta( + debugName: "ldk_node_next_event_async", + argNames: ["that"], ); @override - Future ldkNodeSendPaymentUsingAmount( - {required LdkNode that, - required Bolt11Invoice invoice, - required int amountMsat, - dynamic hint}) { + Future ldkNodeNodeId({required LdkNode that, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { 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_ldk_node_send_payment_using_amount( - port_, arg0, arg1, arg2); + return wire.wire_ldk_node_node_id(port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_payment_hash, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_public_key, + decodeErrorData: null, ), - constMeta: kLdkNodeSendPaymentUsingAmountConstMeta, - argValues: [that, invoice, amountMsat], + constMeta: kLdkNodeNodeIdConstMeta, + argValues: [that], apiImpl: this, hint: hint, )); } - TaskConstMeta get kLdkNodeSendPaymentUsingAmountConstMeta => - const TaskConstMeta( - debugName: "ldk_node_send_payment_using_amount", - argNames: ["that", "invoice", "amountMsat"], + TaskConstMeta get kLdkNodeNodeIdConstMeta => const TaskConstMeta( + debugName: "ldk_node_node_id", + argNames: ["that"], ); @override - Future ldkNodeSendSpontaneousPayment( - {required LdkNode that, - required int amountMsat, - required PublicKey nodeId, - dynamic hint}) { + Future ldkNodeOnChainPayment( + {required LdkNode ptr, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - 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_ldk_node_send_spontaneous_payment( - port_, arg0, arg1, arg2); + var arg0 = cst_encode_box_autoadd_ldk_node(ptr); + return wire.wire_ldk_node_on_chain_payment(port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_payment_hash, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_ldk_on_chain_payment, + decodeErrorData: null, ), - constMeta: kLdkNodeSendSpontaneousPaymentConstMeta, - argValues: [that, amountMsat, nodeId], + constMeta: kLdkNodeOnChainPaymentConstMeta, + argValues: [ptr], apiImpl: this, hint: hint, )); } - TaskConstMeta get kLdkNodeSendSpontaneousPaymentConstMeta => - const TaskConstMeta( - debugName: "ldk_node_send_spontaneous_payment", - argNames: ["that", "amountMsat", "nodeId"], + TaskConstMeta get kLdkNodeOnChainPaymentConstMeta => const TaskConstMeta( + debugName: "ldk_node_on_chain_payment", + argNames: ["ptr"], ); @override - Future ldkNodeSendSpontaneousPaymentProbes( - {required LdkNode that, - required int amountMsat, - required PublicKey nodeId, - dynamic hint}) { + Future ldkNodePayment( + {required LdkNode that, required PaymentId paymentId, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { 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_ldk_node_send_spontaneous_payment_probes( - port_, arg0, arg1, arg2); + var arg1 = cst_encode_box_autoadd_payment_id(paymentId); + return wire.wire_ldk_node_payment(port_, arg0, arg1); }, codec: DcoCodec( - decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_opt_box_autoadd_payment_details, + decodeErrorData: null, ), - constMeta: kLdkNodeSendSpontaneousPaymentProbesConstMeta, - argValues: [that, amountMsat, nodeId], + constMeta: kLdkNodePaymentConstMeta, + argValues: [that, paymentId], apiImpl: this, hint: hint, )); } - TaskConstMeta get kLdkNodeSendSpontaneousPaymentProbesConstMeta => - const TaskConstMeta( - debugName: "ldk_node_send_spontaneous_payment_probes", - argNames: ["that", "amountMsat", "nodeId"], + TaskConstMeta get kLdkNodePaymentConstMeta => const TaskConstMeta( + debugName: "ldk_node_payment", + argNames: ["that", "paymentId"], ); @override - Future ldkNodeSendToOnchainAddress( - {required LdkNode that, - required Address address, - required int amountSats, - dynamic hint}) { + Future ldkNodeRemovePayment( + {required LdkNode that, required PaymentId paymentId, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { 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_ldk_node_send_to_onchain_address( - port_, arg0, arg1, arg2); + var arg1 = cst_encode_box_autoadd_payment_id(paymentId); + return wire.wire_ldk_node_remove_payment(port_, arg0, arg1); }, codec: DcoCodec( - decodeSuccessData: dco_decode_txid, + decodeSuccessData: dco_decode_unit, decodeErrorData: dco_decode_node_exception, ), - constMeta: kLdkNodeSendToOnchainAddressConstMeta, - argValues: [that, address, amountSats], + constMeta: kLdkNodeRemovePaymentConstMeta, + argValues: [that, paymentId], apiImpl: this, hint: hint, )); } - TaskConstMeta get kLdkNodeSendToOnchainAddressConstMeta => - const TaskConstMeta( - debugName: "ldk_node_send_to_onchain_address", - argNames: ["that", "address", "amountSats"], + TaskConstMeta get kLdkNodeRemovePaymentConstMeta => const TaskConstMeta( + debugName: "ldk_node_remove_payment", + argNames: ["that", "paymentId"], ); @override @@ -1060,28 +1231,27 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { ); @override - Future ldkNodeSpendableOnchainBalanceSats( - {required LdkNode that, dynamic hint}) { + Future ldkNodeSpontaneousPayment( + {required LdkNode ptr, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_spendable_onchain_balance_sats(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_node(ptr); + return wire.wire_ldk_node_spontaneous_payment(port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_u_64, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_ldk_spontaneous_payment, + decodeErrorData: null, ), - constMeta: kLdkNodeSpendableOnchainBalanceSatsConstMeta, - argValues: [that], + constMeta: kLdkNodeSpontaneousPaymentConstMeta, + argValues: [ptr], apiImpl: this, hint: hint, )); } - TaskConstMeta get kLdkNodeSpendableOnchainBalanceSatsConstMeta => - const TaskConstMeta( - debugName: "ldk_node_spendable_onchain_balance_sats", - argNames: ["that"], + TaskConstMeta get kLdkNodeSpontaneousPaymentConstMeta => const TaskConstMeta( + debugName: "ldk_node_spontaneous_payment", + argNames: ["ptr"], ); @override @@ -1108,87 +1278,85 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { ); @override - Future ldkNodeStop({required LdkNode that, dynamic hint}) { + Future ldkNodeStatus({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_stop(port_, arg0); + return wire.wire_ldk_node_status(port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_node_status, + decodeErrorData: null, ), - constMeta: kLdkNodeStopConstMeta, + constMeta: kLdkNodeStatusConstMeta, argValues: [that], apiImpl: this, hint: hint, )); } - TaskConstMeta get kLdkNodeStopConstMeta => const TaskConstMeta( - debugName: "ldk_node_stop", + TaskConstMeta get kLdkNodeStatusConstMeta => const TaskConstMeta( + debugName: "ldk_node_status", argNames: ["that"], ); @override - Future ldkNodeSyncWallets({required LdkNode that, dynamic hint}) { + Future ldkNodeStop({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_sync_wallets(port_, arg0); + return wire.wire_ldk_node_stop(port_, arg0); }, codec: DcoCodec( decodeSuccessData: dco_decode_unit, decodeErrorData: dco_decode_node_exception, ), - constMeta: kLdkNodeSyncWalletsConstMeta, + constMeta: kLdkNodeStopConstMeta, argValues: [that], apiImpl: this, hint: hint, )); } - TaskConstMeta get kLdkNodeSyncWalletsConstMeta => const TaskConstMeta( - debugName: "ldk_node_sync_wallets", + TaskConstMeta get kLdkNodeStopConstMeta => const TaskConstMeta( + debugName: "ldk_node_stop", argNames: ["that"], ); @override - Future ldkNodeTotalOnchainBalanceSats( - {required LdkNode that, dynamic hint}) { + Future ldkNodeSyncWallets({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); + return wire.wire_ldk_node_sync_wallets(port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_u_64, + decodeSuccessData: dco_decode_unit, decodeErrorData: dco_decode_node_exception, ), - constMeta: kLdkNodeTotalOnchainBalanceSatsConstMeta, + constMeta: kLdkNodeSyncWalletsConstMeta, argValues: [that], apiImpl: this, hint: hint, )); } - TaskConstMeta get kLdkNodeTotalOnchainBalanceSatsConstMeta => - const TaskConstMeta( - debugName: "ldk_node_total_onchain_balance_sats", + TaskConstMeta get kLdkNodeSyncWalletsConstMeta => const TaskConstMeta( + debugName: "ldk_node_sync_wallets", argNames: ["that"], ); @override Future ldkNodeUpdateChannelConfig( {required LdkNode that, - required ChannelId channelId, + required UserChannelId userChannelId, required PublicKey counterpartyNodeId, required ChannelConfig channelConfig, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); - var arg1 = cst_encode_box_autoadd_channel_id(channelId); + var arg1 = cst_encode_box_autoadd_user_channel_id(userChannelId); var arg2 = cst_encode_box_autoadd_public_key(counterpartyNodeId); var arg3 = cst_encode_box_autoadd_channel_config(channelConfig); return wire.wire_ldk_node_update_channel_config( @@ -1199,7 +1367,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { decodeErrorData: dco_decode_node_exception, ), constMeta: kLdkNodeUpdateChannelConfigConstMeta, - argValues: [that, channelId, counterpartyNodeId, channelConfig], + argValues: [that, userChannelId, counterpartyNodeId, channelConfig], apiImpl: this, hint: hint, )); @@ -1207,7 +1375,12 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { TaskConstMeta get kLdkNodeUpdateChannelConfigConstMeta => const TaskConstMeta( debugName: "ldk_node_update_channel_config", - argNames: ["that", "channelId", "counterpartyNodeId", "channelConfig"], + argNames: [ + "that", + "userChannelId", + "counterpartyNodeId", + "channelConfig" + ], ); @override @@ -1215,14 +1388,14 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { {required LdkNode that, required List msg, required String sig, - required PublicKey pkey, + required PublicKey publicKey, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { 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); + var arg3 = cst_encode_box_autoadd_public_key(publicKey); return wire.wire_ldk_node_verify_signature( port_, arg0, arg1, arg2, arg3); }, @@ -1231,7 +1404,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { decodeErrorData: dco_decode_node_exception, ), constMeta: kLdkNodeVerifySignatureConstMeta, - argValues: [that, msg, sig, pkey], + argValues: [that, msg, sig, publicKey], apiImpl: this, hint: hint, )); @@ -1239,7 +1412,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { TaskConstMeta get kLdkNodeVerifySignatureConstMeta => const TaskConstMeta( debugName: "ldk_node_verify_signature", - argNames: ["that", "msg", "sig", "pkey"], + argNames: ["that", "msg", "sig", "publicKey"], ); @override @@ -1266,65 +1439,229 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { ); @override - Future socketAddressAsString( - {required SocketAddress that, dynamic hint}) { + Future
ldkOnChainPaymentNewAddress( + {required LdkOnChainPayment that, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_socket_address(that); - return wire.wire_socket_address_as_string(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_on_chain_payment(that); + return wire.wire_ldk_on_chain_payment_new_address(port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_String, - decodeErrorData: null, + decodeSuccessData: dco_decode_address, + decodeErrorData: dco_decode_node_exception, ), - constMeta: kSocketAddressAsStringConstMeta, + constMeta: kLdkOnChainPaymentNewAddressConstMeta, argValues: [that], apiImpl: this, hint: hint, )); } - TaskConstMeta get kSocketAddressAsStringConstMeta => const TaskConstMeta( - debugName: "socket_address_as_string", + TaskConstMeta get kLdkOnChainPaymentNewAddressConstMeta => + const TaskConstMeta( + debugName: "ldk_on_chain_payment_new_address", 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, - )); - } + @override + Future ldkOnChainPaymentSendAllToAddress( + {required LdkOnChainPayment that, + required Address address, + dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_on_chain_payment(that); + var arg1 = cst_encode_box_autoadd_address(address); + return wire.wire_ldk_on_chain_payment_send_all_to_address( + port_, arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_txid, + decodeErrorData: dco_decode_node_exception, + ), + constMeta: kLdkOnChainPaymentSendAllToAddressConstMeta, + argValues: [that, address], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kLdkOnChainPaymentSendAllToAddressConstMeta => + const TaskConstMeta( + debugName: "ldk_on_chain_payment_send_all_to_address", + argNames: ["that", "address"], + ); + + @override + Future ldkOnChainPaymentSendToAddress( + {required LdkOnChainPayment that, + required Address address, + required int amountSats, + dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_on_chain_payment(that); + var arg1 = cst_encode_box_autoadd_address(address); + var arg2 = cst_encode_u_64(amountSats); + return wire.wire_ldk_on_chain_payment_send_to_address( + port_, arg0, arg1, arg2); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_txid, + decodeErrorData: dco_decode_node_exception, + ), + constMeta: kLdkOnChainPaymentSendToAddressConstMeta, + argValues: [that, address, amountSats], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kLdkOnChainPaymentSendToAddressConstMeta => + const TaskConstMeta( + debugName: "ldk_on_chain_payment_send_to_address", + argNames: ["that", "address", "amountSats"], + ); + + @override + Future ldkSpontaneousPaymentSend( + {required LdkSpontaneousPayment that, + required int amountMsat, + required PublicKey nodeId, + dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_spontaneous_payment(that); + var arg1 = cst_encode_u_64(amountMsat); + var arg2 = cst_encode_box_autoadd_public_key(nodeId); + return wire.wire_ldk_spontaneous_payment_send(port_, arg0, arg1, arg2); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_payment_id, + decodeErrorData: dco_decode_node_exception, + ), + constMeta: kLdkSpontaneousPaymentSendConstMeta, + argValues: [that, amountMsat, nodeId], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kLdkSpontaneousPaymentSendConstMeta => const TaskConstMeta( + debugName: "ldk_spontaneous_payment_send", + argNames: ["that", "amountMsat", "nodeId"], + ); + + @override + Future ldkSpontaneousPaymentSendProbes( + {required LdkSpontaneousPayment that, + required int amountMsat, + required PublicKey nodeId, + dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_spontaneous_payment(that); + var arg1 = cst_encode_u_64(amountMsat); + var arg2 = cst_encode_box_autoadd_public_key(nodeId); + return wire.wire_ldk_spontaneous_payment_send_probes( + port_, arg0, arg1, arg2); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_node_exception, + ), + constMeta: kLdkSpontaneousPaymentSendProbesConstMeta, + argValues: [that, amountMsat, nodeId], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kLdkSpontaneousPaymentSendProbesConstMeta => + const TaskConstMeta( + debugName: "ldk_spontaneous_payment_send_probes", + argNames: ["that", "amountMsat", "nodeId"], + ); + + RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_Node => + wire.rust_arc_increment_strong_count_RustOpaque_Node; + + RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_Node => + wire.rust_arc_decrement_strong_count_RustOpaque_Node; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_NodeBuilder => wire + .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_NodeBuilder => wire + .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_LdkNodePaymentBolt11Payment => wire + .rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_LdkNodePaymentBolt11Payment => wire + .rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_LdkNodePaymentOnchainPayment => wire + .rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment; - TaskConstMeta get kSocketAddressFromStrConstMeta => const TaskConstMeta( - debugName: "socket_address_from_str", - argNames: ["address"], - ); + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_LdkNodePaymentOnchainPayment => wire + .rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment; RustArcIncrementStrongCountFnType - get rust_arc_increment_strong_count_NodeSqliteStore => - wire.rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore; + get rust_arc_increment_strong_count_LdkNodePaymentSpontaneousPayment => wire + .rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment; RustArcDecrementStrongCountFnType - get rust_arc_decrement_strong_count_NodeSqliteStore => - wire.rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore; + get rust_arc_decrement_strong_count_LdkNodePaymentSpontaneousPayment => wire + .rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment; + + @protected + NodeBuilder + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return NodeBuilder.dcoDecode(raw as List); + } + + @protected + Node dco_decode_RustOpaque_Node(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Node.dcoDecode(raw as List); + } + + @protected + NodeBuilder + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return NodeBuilder.dcoDecode(raw as List); + } + + @protected + LdkNodePaymentBolt11Payment + dco_decode_RustOpaque_ldk_nodepaymentBolt11Payment(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return LdkNodePaymentBolt11Payment.dcoDecode(raw as List); + } + + @protected + LdkNodePaymentOnchainPayment + dco_decode_RustOpaque_ldk_nodepaymentOnchainPayment(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return LdkNodePaymentOnchainPayment.dcoDecode(raw as List); + } @protected - NodeSqliteStore dco_decode_RustOpaque_NodeSqliteStore(dynamic raw) { + LdkNodePaymentSpontaneousPayment + dco_decode_RustOpaque_ldk_nodepaymentSpontaneousPayment(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return NodeSqliteStore.dcoDecode(raw as List); + return LdkNodePaymentSpontaneousPayment.dcoDecode(raw as List); } @protected @@ -1344,6 +1681,34 @@ 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 @@ -1392,6 +1757,12 @@ 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 @@ -1417,6 +1788,12 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return dco_decode_gossip_source_config(raw); } + @protected + LdkBolt11Payment dco_decode_box_autoadd_ldk_bolt_11_payment(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_ldk_bolt_11_payment(raw); + } + @protected LdkMnemonic dco_decode_box_autoadd_ldk_mnemonic(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1429,6 +1806,39 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return dco_decode_ldk_node(raw); } + @protected + LdkOnChainPayment dco_decode_box_autoadd_ldk_on_chain_payment(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_ldk_on_chain_payment(raw); + } + + @protected + LdkSpontaneousPayment dco_decode_box_autoadd_ldk_spontaneous_payment( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_ldk_spontaneous_payment(raw); + } + + @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 + LSPFeeLimits dco_decode_box_autoadd_lsp_fee_limits(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_lsp_fee_limits(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 OutPoint dco_decode_box_autoadd_out_point(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1441,12 +1851,25 @@ 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 return dco_decode_payment_hash(raw); } + @protected + PaymentId dco_decode_box_autoadd_payment_id(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_payment_id(raw); + } + @protected PaymentPreimage dco_decode_box_autoadd_payment_preimage(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1471,6 +1894,18 @@ 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 @@ -1518,7 +1953,8 @@ 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_max_dust_htlc_exposure(arr[3]), + maxDustHtlcExposure: + dco_decode_opt_box_autoadd_max_dust_htlc_exposure(arr[3]), forceCloseAvoidanceMaxFeeSatoshis: dco_decode_u_64(arr[4]), acceptUnderpayingHtlcs: dco_decode_bool(arr[5]), ); @@ -1528,25 +1964,42 @@ 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 != 16) - throw Exception('unexpected arr length: expect 16 but see ${arr.length}'); + if (arr.length != 28) + throw Exception('unexpected arr length: expect 28 but see ${arr.length}'); return ChannelDetails( channelId: dco_decode_channel_id(arr[0]), counterpartyNodeId: dco_decode_public_key(arr[1]), - fundingTxo: dco_decode_opt_String(arr[2]), + fundingTxo: dco_decode_opt_box_autoadd_out_point(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]), - 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]), + 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]), ); } @@ -1561,6 +2014,45 @@ 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_LegacyCooperativeClosure(); + case 3: + return ClosureReason_CounterpartyInitiatedCooperativeClosure(); + case 4: + return ClosureReason_LocallyInitiatedCooperativeClosure(); + case 5: + return ClosureReason_CommitmentTxConfirmed(); + case 6: + return ClosureReason_FundingTimedOut(); + case 7: + return ClosureReason_ProcessingError( + err: dco_decode_String(raw[1]), + ); + case 8: + return ClosureReason_DisconnectedPeer(); + case 9: + return ClosureReason_OutdatedChannelManager(); + case 10: + return ClosureReason_CounterpartyCoopClosedUnfundedChannel(); + case 11: + return ClosureReason_FundingBatchClosure(); + case 12: + return ClosureReason_HTLCsTimedOut(); + default: + throw Exception("unreachable"); + } + } + @protected Config dco_decode_config(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1610,36 +2102,42 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { switch (raw[0]) { case 0: return Event_PaymentSuccessful( - paymentHash: dco_decode_box_autoadd_payment_hash(raw[1]), + paymentId: dco_decode_opt_box_autoadd_payment_id(raw[1]), + paymentHash: dco_decode_box_autoadd_payment_hash(raw[2]), + feePaidMsat: dco_decode_opt_box_autoadd_u_64(raw[3]), ); case 1: return Event_PaymentFailed( - paymentHash: dco_decode_box_autoadd_payment_hash(raw[1]), + paymentId: dco_decode_opt_box_autoadd_payment_id(raw[1]), + paymentHash: dco_decode_box_autoadd_payment_hash(raw[2]), + reason: dco_decode_opt_box_autoadd_payment_failure_reason(raw[3]), ); case 2: return Event_PaymentReceived( - paymentHash: dco_decode_box_autoadd_payment_hash(raw[1]), - amountMsat: dco_decode_u_64(raw[2]), + paymentId: dco_decode_opt_box_autoadd_payment_id(raw[1]), + paymentHash: dco_decode_box_autoadd_payment_hash(raw[2]), + amountMsat: dco_decode_u_64(raw[3]), ); case 3: - return Event_ChannelReady( + 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]), + 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]), ); case 4: - return Event_ChannelClosed( + return Event_ChannelReady( 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_ChannelPending( + return Event_ChannelClosed( 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]), + reason: dco_decode_opt_box_autoadd_closure_reason(raw[4]), ); default: throw Exception("unreachable"); @@ -1667,6 +2165,17 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return raw as int; } + @protected + LdkBolt11Payment dco_decode_ldk_bolt_11_payment(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 LdkBolt11Payment( + ptr: dco_decode_RustOpaque_ldk_nodepaymentBolt11Payment(arr[0]), + ); + } + @protected LdkMnemonic dco_decode_ldk_mnemonic(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1685,7 +2194,94 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { if (arr.length != 1) throw Exception('unexpected arr length: expect 1 but see ${arr.length}'); return LdkNode( - ptr: dco_decode_RustOpaque_NodeSqliteStore(arr[0]), + ptr: dco_decode_RustOpaque_Node(arr[0]), + ); + } + + @protected + LdkOnChainPayment dco_decode_ldk_on_chain_payment(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 LdkOnChainPayment( + ptr: dco_decode_RustOpaque_ldk_nodepaymentOnchainPayment(arr[0]), + ); + } + + @protected + LdkSpontaneousPayment dco_decode_ldk_spontaneous_payment(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 LdkSpontaneousPayment( + ptr: dco_decode_RustOpaque_ldk_nodepaymentSpontaneousPayment(arr[0]), + ); + } + + @protected + LightningBalance dco_decode_lightning_balance(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"); + } + } + + @protected + LiquiditySourceConfig dco_decode_liquidity_source_config(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]), ); } @@ -1695,6 +2291,12 @@ 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 @@ -1707,6 +2309,14 @@ 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 @@ -1737,6 +2347,18 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return LogLevel.values[raw as int]; } + @protected + LSPFeeLimits dco_decode_lsp_fee_limits(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 LSPFeeLimits( + maxTotalOpeningFeeMsat: dco_decode_opt_box_autoadd_u_64(arr[0]), + maxProportionalOpeningFeePpmMsat: dco_decode_opt_box_autoadd_u_64(arr[1]), + ); + } + @protected MaxDustHTLCExposure dco_decode_max_dust_htlc_exposure(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1766,6 +2388,26 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return NodeException.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]), + ); + } + @protected String? dco_decode_opt_String(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1787,6 +2429,18 @@ 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) { @@ -1811,12 +2465,51 @@ 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 + PaymentId? dco_decode_opt_box_autoadd_payment_id(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw == null ? null : dco_decode_box_autoadd_payment_id(raw); + } + @protected PaymentPreimage? dco_decode_opt_box_autoadd_payment_preimage(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1835,6 +2528,12 @@ 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 @@ -1869,22 +2568,27 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { PaymentDetails dco_decode_payment_details(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs final arr = raw as List; - if (arr.length != 6) - throw Exception('unexpected arr length: expect 6 but see ${arr.length}'); + if (arr.length != 5) + throw Exception('unexpected arr length: expect 5 but see ${arr.length}'); return PaymentDetails( - hash: dco_decode_payment_hash(arr[0]), - preimage: dco_decode_opt_box_autoadd_payment_preimage(arr[1]), - secret: dco_decode_opt_box_autoadd_payment_secret(arr[2]), - amountMsat: dco_decode_opt_box_autoadd_u_64(arr[3]), - direction: dco_decode_payment_direction(arr[4]), - status: dco_decode_payment_status(arr[5]), + id: dco_decode_payment_id(arr[0]), + kind: dco_decode_payment_kind(arr[1]), + amountMsat: dco_decode_opt_box_autoadd_u_64(arr[2]), + direction: dco_decode_payment_direction(arr[3]), + status: dco_decode_payment_status(arr[4]), ); } @protected - PaymentDirection dco_decode_payment_direction(dynamic raw) { + PaymentDirection dco_decode_payment_direction(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + 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 PaymentDirection.values[raw as int]; + return PaymentFailureReason.values[raw as int]; } @protected @@ -1898,6 +2602,46 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { ); } + @protected + PaymentId dco_decode_payment_id(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 PaymentId( + field0: dco_decode_u_8_array_32(arr[0]), + ); + } + + @protected + PaymentKind dco_decode_payment_kind(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + switch (raw[0]) { + case 0: + return PaymentKind_Onchain(); + case 1: + return PaymentKind_Bolt11( + hash: dco_decode_box_autoadd_payment_hash(raw[1]), + preimage: dco_decode_opt_box_autoadd_payment_preimage(raw[2]), + secret: dco_decode_opt_box_autoadd_payment_secret(raw[3]), + ); + case 2: + return PaymentKind_Bolt11Jit( + hash: dco_decode_box_autoadd_payment_hash(raw[1]), + preimage: dco_decode_opt_box_autoadd_payment_preimage(raw[2]), + secret: dco_decode_opt_box_autoadd_payment_secret(raw[3]), + lspFeeLimits: dco_decode_box_autoadd_lsp_fee_limits(raw[4]), + ); + case 3: + return PaymentKind_Spontaneous( + hash: dco_decode_box_autoadd_payment_hash(raw[1]), + preimage: dco_decode_opt_box_autoadd_payment_preimage(raw[2]), + ); + default: + throw Exception("unreachable"); + } + } + @protected PaymentPreimage dco_decode_payment_preimage(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1939,6 +2683,35 @@ 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 @@ -1950,6 +2723,21 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { ); } + @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]), + ); + } + @protected SocketAddress dco_decode_socket_address(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -2063,7 +2851,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_u_64(arr[0]), + data: dco_decode_list_prim_u_8_strict(arr[0]), ); } @@ -2074,10 +2862,54 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - NodeSqliteStore sse_decode_RustOpaque_NodeSqliteStore( - SseDeserializer deserializer) { + NodeBuilder + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return NodeBuilder.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Node sse_decode_RustOpaque_Node(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return Node.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + NodeBuilder + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return NodeBuilder.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + LdkNodePaymentBolt11Payment + sse_decode_RustOpaque_ldk_nodepaymentBolt11Payment( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return LdkNodePaymentBolt11Payment.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + LdkNodePaymentOnchainPayment + sse_decode_RustOpaque_ldk_nodepaymentOnchainPayment( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return LdkNodePaymentOnchainPayment.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + LdkNodePaymentSpontaneousPayment + sse_decode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return NodeSqliteStore.sseDecode( + return LdkNodePaymentSpontaneousPayment.sseDecode( sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); } @@ -2095,6 +2927,32 @@ 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 @@ -2141,6 +2999,13 @@ 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 @@ -2167,6 +3032,13 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return (sse_decode_gossip_source_config(deserializer)); } + @protected + LdkBolt11Payment sse_decode_box_autoadd_ldk_bolt_11_payment( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_ldk_bolt_11_payment(deserializer)); + } + @protected LdkMnemonic sse_decode_box_autoadd_ldk_mnemonic( SseDeserializer deserializer) { @@ -2180,6 +3052,41 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return (sse_decode_ldk_node(deserializer)); } + @protected + LdkOnChainPayment sse_decode_box_autoadd_ldk_on_chain_payment( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_ldk_on_chain_payment(deserializer)); + } + + @protected + LdkSpontaneousPayment sse_decode_box_autoadd_ldk_spontaneous_payment( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_ldk_spontaneous_payment(deserializer)); + } + + @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 + LSPFeeLimits sse_decode_box_autoadd_lsp_fee_limits( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_lsp_fee_limits(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 OutPoint sse_decode_box_autoadd_out_point(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -2193,6 +3100,13 @@ 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) { @@ -2200,6 +3114,12 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return (sse_decode_payment_hash(deserializer)); } + @protected + PaymentId sse_decode_box_autoadd_payment_id(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_payment_id(deserializer)); + } + @protected PaymentPreimage sse_decode_box_autoadd_payment_preimage( SseDeserializer deserializer) { @@ -2227,6 +3147,18 @@ 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 @@ -2275,7 +3207,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_max_dust_htlc_exposure(deserializer); + sse_decode_opt_box_autoadd_max_dust_htlc_exposure(deserializer); var var_forceCloseAvoidanceMaxFeeSatoshis = sse_decode_u_64(deserializer); var var_acceptUnderpayingHtlcs = sse_decode_bool(deserializer); return ChannelConfig( @@ -2294,13 +3226,12 @@ 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_String(deserializer); + var var_fundingTxo = sse_decode_opt_box_autoadd_out_point(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 = @@ -2310,6 +3241,27 @@ 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, @@ -2318,7 +3270,6 @@ 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, @@ -2326,7 +3277,26 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { isOutbound: var_isOutbound, isChannelReady: var_isChannelReady, isUsable: var_isUsable, - isPublic: var_isPublic); + 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); } @protected @@ -2336,6 +3306,45 @@ 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_LegacyCooperativeClosure(); + case 3: + return ClosureReason_CounterpartyInitiatedCooperativeClosure(); + case 4: + return ClosureReason_LocallyInitiatedCooperativeClosure(); + case 5: + return ClosureReason_CommitmentTxConfirmed(); + case 6: + return ClosureReason_FundingTimedOut(); + case 7: + var var_err = sse_decode_String(deserializer); + return ClosureReason_ProcessingError(err: var_err); + case 8: + return ClosureReason_DisconnectedPeer(); + case 9: + return ClosureReason_OutdatedChannelManager(); + case 10: + return ClosureReason_CounterpartyCoopClosedUnfundedChannel(); + case 11: + return ClosureReason_FundingBatchClosure(); + case 12: + return ClosureReason_HTLCsTimedOut(); + default: + throw UnimplementedError(''); + } + } + @protected Config sse_decode_config(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -2395,33 +3404,52 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { var tag_ = sse_decode_i_32(deserializer); switch (tag_) { case 0: + var var_paymentId = sse_decode_opt_box_autoadd_payment_id(deserializer); var var_paymentHash = sse_decode_box_autoadd_payment_hash(deserializer); - return Event_PaymentSuccessful(paymentHash: var_paymentHash); + var var_feePaidMsat = sse_decode_opt_box_autoadd_u_64(deserializer); + return Event_PaymentSuccessful( + paymentId: var_paymentId, + paymentHash: var_paymentHash, + feePaidMsat: var_feePaidMsat); case 1: + var var_paymentId = sse_decode_opt_box_autoadd_payment_id(deserializer); var var_paymentHash = sse_decode_box_autoadd_payment_hash(deserializer); - return Event_PaymentFailed(paymentHash: var_paymentHash); + var var_reason = + sse_decode_opt_box_autoadd_payment_failure_reason(deserializer); + return Event_PaymentFailed( + paymentId: var_paymentId, + paymentHash: var_paymentHash, + reason: var_reason); case 2: + var var_paymentId = sse_decode_opt_box_autoadd_payment_id(deserializer); var var_paymentHash = sse_decode_box_autoadd_payment_hash(deserializer); var var_amountMsat = sse_decode_u_64(deserializer); return Event_PaymentReceived( - paymentHash: var_paymentHash, amountMsat: var_amountMsat); + paymentId: var_paymentId, + paymentHash: var_paymentHash, + amountMsat: var_amountMsat); case 3: 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); - return Event_ChannelReady( + 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, - counterpartyNodeId: var_counterpartyNodeId); + formerTemporaryChannelId: var_formerTemporaryChannelId, + counterpartyNodeId: var_counterpartyNodeId, + fundingTxo: var_fundingTxo); 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_ChannelClosed( + return Event_ChannelReady( channelId: var_channelId, userChannelId: var_userChannelId, counterpartyNodeId: var_counterpartyNodeId); @@ -2429,17 +3457,15 @@ 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); + var var_reason = + sse_decode_opt_box_autoadd_closure_reason(deserializer); + return Event_ChannelClosed( channelId: var_channelId, userChannelId: var_userChannelId, - formerTemporaryChannelId: var_formerTemporaryChannelId, counterpartyNodeId: var_counterpartyNodeId, - fundingTxo: var_fundingTxo); + reason: var_reason); default: throw UnimplementedError(''); } @@ -2468,6 +3494,15 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return deserializer.buffer.getInt32(); } + @protected + LdkBolt11Payment sse_decode_ldk_bolt_11_payment( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_ptr = + sse_decode_RustOpaque_ldk_nodepaymentBolt11Payment(deserializer); + return LdkBolt11Payment(ptr: var_ptr); + } + @protected LdkMnemonic sse_decode_ldk_mnemonic(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -2478,19 +3513,141 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { @protected LdkNode sse_decode_ldk_node(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - var var_ptr = sse_decode_RustOpaque_NodeSqliteStore(deserializer); + var var_ptr = sse_decode_RustOpaque_Node(deserializer); return LdkNode(ptr: var_ptr); } @protected - List sse_decode_list_channel_details( + LdkOnChainPayment sse_decode_ldk_on_chain_payment( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_ptr = + sse_decode_RustOpaque_ldk_nodepaymentOnchainPayment(deserializer); + return LdkOnChainPayment(ptr: var_ptr); + } + + @protected + LdkSpontaneousPayment sse_decode_ldk_spontaneous_payment( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_ptr = + sse_decode_RustOpaque_ldk_nodepaymentSpontaneousPayment(deserializer); + return LdkSpontaneousPayment(ptr: var_ptr); + } + + @protected + LightningBalance sse_decode_lightning_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_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(''); + } + } + + @protected + LiquiditySourceConfig sse_decode_liquidity_source_config( + 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); + } + + @protected + List sse_decode_list_channel_details( + 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_channel_details(deserializer)); + } + 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_ = []; + var ans_ = []; for (var idx_ = 0; idx_ < len_; ++idx_) { - ans_.add(sse_decode_channel_details(deserializer)); + ans_.add(sse_decode_lightning_balance(deserializer)); } return ans_; } @@ -2520,6 +3677,19 @@ 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 @@ -2566,6 +3736,18 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return LogLevel.values[inner]; } + @protected + LSPFeeLimits sse_decode_lsp_fee_limits(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_maxTotalOpeningFeeMsat = + sse_decode_opt_box_autoadd_u_64(deserializer); + var var_maxProportionalOpeningFeePpmMsat = + sse_decode_opt_box_autoadd_u_64(deserializer); + return LSPFeeLimits( + maxTotalOpeningFeeMsat: var_maxTotalOpeningFeeMsat, + maxProportionalOpeningFeePpmMsat: var_maxProportionalOpeningFeePpmMsat); + } + @protected MaxDustHTLCExposure sse_decode_max_dust_htlc_exposure( SseDeserializer deserializer) { @@ -2598,6 +3780,35 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return NodeException.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); + } + @protected String? sse_decode_opt_String(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -2633,6 +3844,30 @@ 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) { @@ -2668,6 +3903,41 @@ 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) { @@ -2680,6 +3950,30 @@ 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 + PaymentId? sse_decode_opt_box_autoadd_payment_id( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + if (sse_decode_bool(deserializer)) { + return (sse_decode_box_autoadd_payment_id(deserializer)); + } else { + return null; + } + } + @protected PaymentPreimage? sse_decode_opt_box_autoadd_payment_preimage( SseDeserializer deserializer) { @@ -2716,6 +4010,17 @@ 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 @@ -2761,17 +4066,14 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { @protected PaymentDetails sse_decode_payment_details(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - var var_hash = sse_decode_payment_hash(deserializer); - var var_preimage = - sse_decode_opt_box_autoadd_payment_preimage(deserializer); - var var_secret = sse_decode_opt_box_autoadd_payment_secret(deserializer); + var var_id = sse_decode_payment_id(deserializer); + var var_kind = sse_decode_payment_kind(deserializer); var var_amountMsat = sse_decode_opt_box_autoadd_u_64(deserializer); var var_direction = sse_decode_payment_direction(deserializer); var var_status = sse_decode_payment_status(deserializer); return PaymentDetails( - hash: var_hash, - preimage: var_preimage, - secret: var_secret, + id: var_id, + kind: var_kind, amountMsat: var_amountMsat, direction: var_direction, status: var_status); @@ -2784,6 +4086,14 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return PaymentDirection.values[inner]; } + @protected + PaymentFailureReason sse_decode_payment_failure_reason( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var inner = sse_decode_i_32(deserializer); + return PaymentFailureReason.values[inner]; + } + @protected PaymentHash sse_decode_payment_hash(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -2791,6 +4101,52 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return PaymentHash(data: var_data); } + @protected + PaymentId sse_decode_payment_id(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_field0 = sse_decode_u_8_array_32(deserializer); + return PaymentId(field0: var_field0); + } + + @protected + PaymentKind sse_decode_payment_kind(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + var tag_ = sse_decode_i_32(deserializer); + switch (tag_) { + case 0: + return PaymentKind_Onchain(); + case 1: + var var_hash = sse_decode_box_autoadd_payment_hash(deserializer); + var var_preimage = + sse_decode_opt_box_autoadd_payment_preimage(deserializer); + var var_secret = + sse_decode_opt_box_autoadd_payment_secret(deserializer); + return PaymentKind_Bolt11( + hash: var_hash, preimage: var_preimage, secret: var_secret); + case 2: + var var_hash = sse_decode_box_autoadd_payment_hash(deserializer); + var var_preimage = + sse_decode_opt_box_autoadd_payment_preimage(deserializer); + var var_secret = + sse_decode_opt_box_autoadd_payment_secret(deserializer); + var var_lspFeeLimits = + sse_decode_box_autoadd_lsp_fee_limits(deserializer); + return PaymentKind_Bolt11Jit( + hash: var_hash, + preimage: var_preimage, + secret: var_secret, + lspFeeLimits: var_lspFeeLimits); + case 3: + var var_hash = sse_decode_box_autoadd_payment_hash(deserializer); + var var_preimage = + sse_decode_opt_box_autoadd_payment_preimage(deserializer); + return PaymentKind_Spontaneous(hash: var_hash, preimage: var_preimage); + default: + throw UnimplementedError(''); + } + } + @protected PaymentPreimage sse_decode_payment_preimage(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -2822,6 +4178,45 @@ 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 @@ -2829,6 +4224,17 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return PublicKey(hex: var_hex); } + @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); + } + @protected SocketAddress sse_decode_socket_address(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -2939,7 +4345,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_u_64(deserializer); + var var_data = sse_decode_list_prim_u_8_strict(deserializer); return UserChannelId(data: var_data); } @@ -2950,7 +4356,47 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - int cst_encode_RustOpaque_NodeSqliteStore(NodeSqliteStore raw) { + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + NodeBuilder raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: true); + } + + @protected + int cst_encode_RustOpaque_Node(Node raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + NodeBuilder raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + int cst_encode_RustOpaque_ldk_nodepaymentBolt11Payment( + LdkNodePaymentBolt11Payment raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + int cst_encode_RustOpaque_ldk_nodepaymentOnchainPayment( + LdkNodePaymentOnchainPayment raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + int cst_encode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + LdkNodePaymentSpontaneousPayment raw) { // Codec=Cst (C-struct based), see doc to use other codecs // ignore: invalid_use_of_internal_member return raw.cstEncode(); @@ -2998,6 +4444,12 @@ 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 @@ -3035,8 +4487,44 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - void sse_encode_RustOpaque_NodeSqliteStore( - NodeSqliteStore self, SseSerializer serializer) { + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + NodeBuilder self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: true), serializer); + } + + @protected + void sse_encode_RustOpaque_Node(Node self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + NodeBuilder self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void sse_encode_RustOpaque_ldk_nodepaymentBolt11Payment( + LdkNodePaymentBolt11Payment self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void sse_encode_RustOpaque_ldk_nodepaymentOnchainPayment( + LdkNodePaymentOnchainPayment self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void sse_encode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + LdkNodePaymentSpontaneousPayment self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_usize(self.sseEncode(move: null), serializer); } @@ -3053,6 +4541,25 @@ 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) { @@ -3100,6 +4607,13 @@ 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 @@ -3120,23 +4634,65 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - void sse_encode_box_autoadd_gossip_source_config( - GossipSourceConfig self, SseSerializer serializer) { + void sse_encode_box_autoadd_gossip_source_config( + GossipSourceConfig self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_gossip_source_config(self, serializer); + } + + @protected + void sse_encode_box_autoadd_ldk_bolt_11_payment( + LdkBolt11Payment self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_ldk_bolt_11_payment(self, serializer); + } + + @protected + void sse_encode_box_autoadd_ldk_mnemonic( + LdkMnemonic self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_ldk_mnemonic(self, serializer); + } + + @protected + void sse_encode_box_autoadd_ldk_node(LdkNode self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_ldk_node(self, serializer); + } + + @protected + void sse_encode_box_autoadd_ldk_on_chain_payment( + LdkOnChainPayment self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_ldk_on_chain_payment(self, serializer); + } + + @protected + void sse_encode_box_autoadd_ldk_spontaneous_payment( + LdkSpontaneousPayment self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_ldk_spontaneous_payment(self, serializer); + } + + @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_gossip_source_config(self, serializer); + sse_encode_liquidity_source_config(self, serializer); } @protected - void sse_encode_box_autoadd_ldk_mnemonic( - LdkMnemonic self, SseSerializer serializer) { + void sse_encode_box_autoadd_lsp_fee_limits( + LSPFeeLimits self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_ldk_mnemonic(self, serializer); + sse_encode_lsp_fee_limits(self, serializer); } @protected - void sse_encode_box_autoadd_ldk_node(LdkNode self, SseSerializer serializer) { + 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_ldk_node(self, serializer); + sse_encode_max_dust_htlc_exposure(self, serializer); } @protected @@ -3153,6 +4709,13 @@ 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) { @@ -3160,6 +4723,13 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_payment_hash(self, serializer); } + @protected + void sse_encode_box_autoadd_payment_id( + PaymentId self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_payment_id(self, serializer); + } + @protected void sse_encode_box_autoadd_payment_preimage( PaymentPreimage self, SseSerializer serializer) { @@ -3188,6 +4758,18 @@ 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 @@ -3231,7 +4813,8 @@ 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_max_dust_htlc_exposure(self.maxDustHtlcExposure, serializer); + sse_encode_opt_box_autoadd_max_dust_htlc_exposure( + self.maxDustHtlcExposure, serializer); sse_encode_u_64(self.forceCloseAvoidanceMaxFeeSatoshis, serializer); sse_encode_bool(self.acceptUnderpayingHtlcs, serializer); } @@ -3242,13 +4825,12 @@ 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_String(self.fundingTxo, serializer); + sse_encode_opt_box_autoadd_out_point(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); @@ -3257,6 +4839,24 @@ 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 @@ -3265,6 +4865,41 @@ 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_LegacyCooperativeClosure(): + sse_encode_i_32(2, serializer); + case ClosureReason_CounterpartyInitiatedCooperativeClosure(): + sse_encode_i_32(3, serializer); + case ClosureReason_LocallyInitiatedCooperativeClosure(): + sse_encode_i_32(4, serializer); + case ClosureReason_CommitmentTxConfirmed(): + sse_encode_i_32(5, serializer); + case ClosureReason_FundingTimedOut(): + sse_encode_i_32(6, serializer); + case ClosureReason_ProcessingError(err: final err): + sse_encode_i_32(7, serializer); + sse_encode_String(err, serializer); + case ClosureReason_DisconnectedPeer(): + sse_encode_i_32(8, serializer); + case ClosureReason_OutdatedChannelManager(): + sse_encode_i_32(9, serializer); + case ClosureReason_CounterpartyCoopClosedUnfundedChannel(): + sse_encode_i_32(10, serializer); + case ClosureReason_FundingBatchClosure(): + sse_encode_i_32(11, serializer); + case ClosureReason_HTLCsTimedOut(): + sse_encode_i_32(12, serializer); + } + } + @protected void sse_encode_config(Config self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -3306,29 +4941,47 @@ 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): + case Event_PaymentSuccessful( + paymentId: final paymentId, + paymentHash: final paymentHash, + feePaidMsat: final feePaidMsat + ): sse_encode_i_32(0, serializer); + sse_encode_opt_box_autoadd_payment_id(paymentId, serializer); sse_encode_box_autoadd_payment_hash(paymentHash, serializer); - case Event_PaymentFailed(paymentHash: final paymentHash): + sse_encode_opt_box_autoadd_u_64(feePaidMsat, serializer); + case Event_PaymentFailed( + paymentId: final paymentId, + paymentHash: final paymentHash, + reason: final reason + ): sse_encode_i_32(1, serializer); + sse_encode_opt_box_autoadd_payment_id(paymentId, serializer); sse_encode_box_autoadd_payment_hash(paymentHash, serializer); + sse_encode_opt_box_autoadd_payment_failure_reason(reason, serializer); case Event_PaymentReceived( + paymentId: final paymentId, paymentHash: final paymentHash, amountMsat: final amountMsat ): sse_encode_i_32(2, serializer); + sse_encode_opt_box_autoadd_payment_id(paymentId, serializer); sse_encode_box_autoadd_payment_hash(paymentHash, serializer); sse_encode_u_64(amountMsat, serializer); - case Event_ChannelReady( + case Event_ChannelPending( channelId: final channelId, userChannelId: final userChannelId, - counterpartyNodeId: final counterpartyNodeId + formerTemporaryChannelId: final formerTemporaryChannelId, + counterpartyNodeId: final counterpartyNodeId, + fundingTxo: final fundingTxo ): 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_opt_box_autoadd_public_key(counterpartyNodeId, serializer); - case Event_ChannelClosed( + 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( channelId: final channelId, userChannelId: final userChannelId, counterpartyNodeId: final counterpartyNodeId @@ -3337,19 +4990,17 @@ 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_ChannelPending( + case Event_ChannelClosed( channelId: final channelId, userChannelId: final userChannelId, - formerTemporaryChannelId: final formerTemporaryChannelId, counterpartyNodeId: final counterpartyNodeId, - fundingTxo: final fundingTxo + reason: final reason ): 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_box_autoadd_channel_id(formerTemporaryChannelId, serializer); - sse_encode_box_autoadd_public_key(counterpartyNodeId, serializer); - sse_encode_box_autoadd_out_point(fundingTxo, serializer); + sse_encode_opt_box_autoadd_public_key(counterpartyNodeId, serializer); + sse_encode_opt_box_autoadd_closure_reason(reason, serializer); } } @@ -3372,6 +5023,13 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { serializer.buffer.putInt32(self); } + @protected + void sse_encode_ldk_bolt_11_payment( + LdkBolt11Payment self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_RustOpaque_ldk_nodepaymentBolt11Payment(self.ptr, serializer); + } + @protected void sse_encode_ldk_mnemonic(LdkMnemonic self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -3381,7 +5039,108 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { @protected void sse_encode_ldk_node(LdkNode self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_RustOpaque_NodeSqliteStore(self.ptr, serializer); + sse_encode_RustOpaque_Node(self.ptr, serializer); + } + + @protected + void sse_encode_ldk_on_chain_payment( + LdkOnChainPayment self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_RustOpaque_ldk_nodepaymentOnchainPayment(self.ptr, serializer); + } + + @protected + void sse_encode_ldk_spontaneous_payment( + LdkSpontaneousPayment self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + self.ptr, serializer); + } + + @protected + void sse_encode_lightning_balance( + LightningBalance 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); + } + } + + @protected + void sse_encode_liquidity_source_config( + LiquiditySourceConfig 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); } @protected @@ -3394,6 +5153,16 @@ 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) { @@ -3414,6 +5183,16 @@ 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) { @@ -3457,6 +5236,14 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_i_32(self.index, serializer); } + @protected + void sse_encode_lsp_fee_limits(LSPFeeLimits self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_opt_box_autoadd_u_64(self.maxTotalOpeningFeeMsat, serializer); + sse_encode_opt_box_autoadd_u_64( + self.maxProportionalOpeningFeePpmMsat, serializer); + } + @protected void sse_encode_max_dust_htlc_exposure( MaxDustHTLCExposure self, SseSerializer serializer) { @@ -3483,6 +5270,23 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { 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 @@ -3515,6 +5319,28 @@ 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) { @@ -3547,6 +5373,39 @@ 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) { @@ -3558,6 +5417,28 @@ 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_id( + PaymentId? 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_id(self, serializer); + } + } + @protected void sse_encode_opt_box_autoadd_payment_preimage( PaymentPreimage? self, SseSerializer serializer) { @@ -3591,6 +5472,16 @@ 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 @@ -3633,9 +5524,8 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { void sse_encode_payment_details( PaymentDetails self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_payment_hash(self.hash, serializer); - sse_encode_opt_box_autoadd_payment_preimage(self.preimage, serializer); - sse_encode_opt_box_autoadd_payment_secret(self.secret, serializer); + sse_encode_payment_id(self.id, serializer); + sse_encode_payment_kind(self.kind, serializer); sse_encode_opt_box_autoadd_u_64(self.amountMsat, serializer); sse_encode_payment_direction(self.direction, serializer); sse_encode_payment_status(self.status, serializer); @@ -3648,12 +5538,58 @@ 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 sse_encode_u_8_array_32(self.data, serializer); } + @protected + void sse_encode_payment_id(PaymentId self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_u_8_array_32(self.field0, serializer); + } + + @protected + void sse_encode_payment_kind(PaymentKind self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + switch (self) { + case PaymentKind_Onchain(): + sse_encode_i_32(0, serializer); + case PaymentKind_Bolt11( + hash: final hash, + preimage: final preimage, + secret: final secret + ): + sse_encode_i_32(1, serializer); + sse_encode_box_autoadd_payment_hash(hash, serializer); + sse_encode_opt_box_autoadd_payment_preimage(preimage, serializer); + sse_encode_opt_box_autoadd_payment_secret(secret, serializer); + case PaymentKind_Bolt11Jit( + hash: final hash, + preimage: final preimage, + secret: final secret, + lspFeeLimits: final lspFeeLimits + ): + sse_encode_i_32(2, serializer); + sse_encode_box_autoadd_payment_hash(hash, serializer); + sse_encode_opt_box_autoadd_payment_preimage(preimage, serializer); + sse_encode_opt_box_autoadd_payment_secret(secret, serializer); + sse_encode_box_autoadd_lsp_fee_limits(lspFeeLimits, serializer); + case PaymentKind_Spontaneous(hash: final hash, preimage: final preimage): + sse_encode_i_32(3, serializer); + sse_encode_box_autoadd_payment_hash(hash, serializer); + sse_encode_opt_box_autoadd_payment_preimage(preimage, serializer); + } + } + @protected void sse_encode_payment_preimage( PaymentPreimage self, SseSerializer serializer) { @@ -3681,12 +5617,60 @@ 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.hex, 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); + } + @protected void sse_encode_socket_address(SocketAddress self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -3789,7 +5773,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_u_64(self.data, serializer); + sse_encode_list_prim_u_8_strict(self.data, serializer); } @protected diff --git a/lib/src/generated/frb_generated.io.dart b/lib/src/generated/frb_generated.io.dart index f729196..f16e549 100644 --- a/lib/src/generated/frb_generated.io.dart +++ b/lib/src/generated/frb_generated.io.dart @@ -20,12 +20,49 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { required super.portManager, }); + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_NodePtr => + wire._rust_arc_decrement_strong_count_RustOpaque_NodePtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_NodeBuilderPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilderPtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_LdkNodePaymentBolt11PaymentPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11PaymentPtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_LdkNodePaymentOnchainPaymentPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPaymentPtr; + CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_NodeSqliteStorePtr => - wire._rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStorePtr; + get rust_arc_decrement_strong_count_LdkNodePaymentSpontaneousPaymentPtr => + wire._rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPaymentPtr; + + @protected + NodeBuilder + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + dynamic raw); + + @protected + Node dco_decode_RustOpaque_Node(dynamic raw); + + @protected + NodeBuilder + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + dynamic raw); + + @protected + LdkNodePaymentBolt11Payment + dco_decode_RustOpaque_ldk_nodepaymentBolt11Payment(dynamic raw); + + @protected + LdkNodePaymentOnchainPayment + dco_decode_RustOpaque_ldk_nodepaymentOnchainPayment(dynamic raw); @protected - NodeSqliteStore dco_decode_RustOpaque_NodeSqliteStore(dynamic raw); + LdkNodePaymentSpontaneousPayment + dco_decode_RustOpaque_ldk_nodepaymentSpontaneousPayment(dynamic raw); @protected String dco_decode_String(dynamic raw); @@ -33,6 +70,12 @@ 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); @@ -55,6 +98,9 @@ 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); @@ -67,21 +113,49 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected GossipSourceConfig dco_decode_box_autoadd_gossip_source_config(dynamic raw); + @protected + LdkBolt11Payment dco_decode_box_autoadd_ldk_bolt_11_payment(dynamic raw); + @protected LdkMnemonic dco_decode_box_autoadd_ldk_mnemonic(dynamic raw); @protected LdkNode dco_decode_box_autoadd_ldk_node(dynamic raw); + @protected + LdkOnChainPayment dco_decode_box_autoadd_ldk_on_chain_payment(dynamic raw); + + @protected + LdkSpontaneousPayment dco_decode_box_autoadd_ldk_spontaneous_payment( + dynamic raw); + + @protected + LiquiditySourceConfig dco_decode_box_autoadd_liquidity_source_config( + dynamic raw); + + @protected + LSPFeeLimits dco_decode_box_autoadd_lsp_fee_limits(dynamic raw); + + @protected + MaxDustHTLCExposure dco_decode_box_autoadd_max_dust_htlc_exposure( + dynamic raw); + @protected OutPoint dco_decode_box_autoadd_out_point(dynamic raw); @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); + @protected + PaymentId dco_decode_box_autoadd_payment_id(dynamic raw); + @protected PaymentPreimage dco_decode_box_autoadd_payment_preimage(dynamic raw); @@ -94,6 +168,12 @@ 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); @@ -118,6 +198,9 @@ 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); @@ -133,21 +216,42 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected int dco_decode_i_32(dynamic raw); + @protected + LdkBolt11Payment dco_decode_ldk_bolt_11_payment(dynamic raw); + @protected LdkMnemonic dco_decode_ldk_mnemonic(dynamic raw); @protected LdkNode dco_decode_ldk_node(dynamic raw); + @protected + LdkOnChainPayment dco_decode_ldk_on_chain_payment(dynamic raw); + + @protected + LdkSpontaneousPayment dco_decode_ldk_spontaneous_payment(dynamic raw); + + @protected + LightningBalance dco_decode_lightning_balance(dynamic raw); + + @protected + LiquiditySourceConfig dco_decode_liquidity_source_config(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); @@ -163,6 +267,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected LogLevel dco_decode_log_level(dynamic raw); + @protected + LSPFeeLimits dco_decode_lsp_fee_limits(dynamic raw); + @protected MaxDustHTLCExposure dco_decode_max_dust_htlc_exposure(dynamic raw); @@ -172,6 +279,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected NodeException dco_decode_node_exception(dynamic raw); + @protected + NodeStatus dco_decode_node_status(dynamic raw); + @protected String? dco_decode_opt_String(dynamic raw); @@ -182,6 +292,12 @@ 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); @@ -193,9 +309,27 @@ 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 + PaymentId? dco_decode_opt_box_autoadd_payment_id(dynamic raw); + @protected PaymentPreimage? dco_decode_opt_box_autoadd_payment_preimage(dynamic raw); @@ -205,6 +339,9 @@ 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); @@ -223,9 +360,18 @@ 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); + @protected + PaymentId dco_decode_payment_id(dynamic raw); + + @protected + PaymentKind dco_decode_payment_kind(dynamic raw); + @protected PaymentPreimage dco_decode_payment_preimage(dynamic raw); @@ -238,9 +384,16 @@ 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); @@ -284,8 +437,32 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { int dco_decode_usize(dynamic raw); @protected - NodeSqliteStore sse_decode_RustOpaque_NodeSqliteStore( - SseDeserializer deserializer); + NodeBuilder + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + SseDeserializer deserializer); + + @protected + Node sse_decode_RustOpaque_Node(SseDeserializer deserializer); + + @protected + NodeBuilder + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + SseDeserializer deserializer); + + @protected + LdkNodePaymentBolt11Payment + sse_decode_RustOpaque_ldk_nodepaymentBolt11Payment( + SseDeserializer deserializer); + + @protected + LdkNodePaymentOnchainPayment + sse_decode_RustOpaque_ldk_nodepaymentOnchainPayment( + SseDeserializer deserializer); + + @protected + LdkNodePaymentSpontaneousPayment + sse_decode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + SseDeserializer deserializer); @protected String sse_decode_String(SseDeserializer deserializer); @@ -293,6 +470,12 @@ 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); @@ -317,6 +500,10 @@ 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); @@ -331,12 +518,36 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { GossipSourceConfig sse_decode_box_autoadd_gossip_source_config( SseDeserializer deserializer); + @protected + LdkBolt11Payment sse_decode_box_autoadd_ldk_bolt_11_payment( + SseDeserializer deserializer); + @protected LdkMnemonic sse_decode_box_autoadd_ldk_mnemonic(SseDeserializer deserializer); @protected LdkNode sse_decode_box_autoadd_ldk_node(SseDeserializer deserializer); + @protected + LdkOnChainPayment sse_decode_box_autoadd_ldk_on_chain_payment( + SseDeserializer deserializer); + + @protected + LdkSpontaneousPayment sse_decode_box_autoadd_ldk_spontaneous_payment( + SseDeserializer deserializer); + + @protected + LiquiditySourceConfig sse_decode_box_autoadd_liquidity_source_config( + SseDeserializer deserializer); + + @protected + LSPFeeLimits sse_decode_box_autoadd_lsp_fee_limits( + SseDeserializer deserializer); + + @protected + MaxDustHTLCExposure sse_decode_box_autoadd_max_dust_htlc_exposure( + SseDeserializer deserializer); + @protected OutPoint sse_decode_box_autoadd_out_point(SseDeserializer deserializer); @@ -344,9 +555,16 @@ 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); + @protected + PaymentId sse_decode_box_autoadd_payment_id(SseDeserializer deserializer); + @protected PaymentPreimage sse_decode_box_autoadd_payment_preimage( SseDeserializer deserializer); @@ -362,6 +580,12 @@ 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); @@ -388,6 +612,9 @@ 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); @@ -405,16 +632,38 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected int sse_decode_i_32(SseDeserializer deserializer); + @protected + LdkBolt11Payment sse_decode_ldk_bolt_11_payment(SseDeserializer deserializer); + @protected LdkMnemonic sse_decode_ldk_mnemonic(SseDeserializer deserializer); @protected LdkNode sse_decode_ldk_node(SseDeserializer deserializer); + @protected + LdkOnChainPayment sse_decode_ldk_on_chain_payment( + SseDeserializer deserializer); + + @protected + LdkSpontaneousPayment sse_decode_ldk_spontaneous_payment( + SseDeserializer deserializer); + + @protected + LightningBalance sse_decode_lightning_balance(SseDeserializer deserializer); + + @protected + LiquiditySourceConfig sse_decode_liquidity_source_config( + 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); @@ -422,6 +671,10 @@ 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); @@ -438,6 +691,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected LogLevel sse_decode_log_level(SseDeserializer deserializer); + @protected + LSPFeeLimits sse_decode_lsp_fee_limits(SseDeserializer deserializer); + @protected MaxDustHTLCExposure sse_decode_max_dust_htlc_exposure( SseDeserializer deserializer); @@ -448,6 +704,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected NodeException sse_decode_node_exception(SseDeserializer deserializer); + @protected + NodeStatus sse_decode_node_status(SseDeserializer deserializer); + @protected String? sse_decode_opt_String(SseDeserializer deserializer); @@ -459,6 +718,14 @@ 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); @@ -470,10 +737,29 @@ 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 + PaymentId? sse_decode_opt_box_autoadd_payment_id( + SseDeserializer deserializer); + @protected PaymentPreimage? sse_decode_opt_box_autoadd_payment_preimage( SseDeserializer deserializer); @@ -486,6 +772,9 @@ 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); @@ -505,9 +794,19 @@ 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); + @protected + PaymentId sse_decode_payment_id(SseDeserializer deserializer); + + @protected + PaymentKind sse_decode_payment_kind(SseDeserializer deserializer); + @protected PaymentPreimage sse_decode_payment_preimage(SseDeserializer deserializer); @@ -520,9 +819,18 @@ 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); @@ -616,6 +924,15 @@ 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 @@ -650,6 +967,15 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ptr; } + @protected + ffi.Pointer + cst_encode_box_autoadd_ldk_bolt_11_payment(LdkBolt11Payment raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_ldk_bolt_11_payment(); + cst_api_fill_to_wire_ldk_bolt_11_payment(raw, ptr.ref); + return ptr; + } + @protected ffi.Pointer cst_encode_box_autoadd_ldk_mnemonic( LdkMnemonic raw) { @@ -667,6 +993,53 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ptr; } + @protected + ffi.Pointer + cst_encode_box_autoadd_ldk_on_chain_payment(LdkOnChainPayment raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_ldk_on_chain_payment(); + cst_api_fill_to_wire_ldk_on_chain_payment(raw, ptr.ref); + return ptr; + } + + @protected + ffi.Pointer + cst_encode_box_autoadd_ldk_spontaneous_payment( + LdkSpontaneousPayment raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_ldk_spontaneous_payment(); + cst_api_fill_to_wire_ldk_spontaneous_payment(raw, ptr.ref); + return ptr; + } + + @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_lsp_fee_limits( + LSPFeeLimits raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_lsp_fee_limits(); + cst_api_fill_to_wire_lsp_fee_limits(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_out_point( OutPoint raw) { @@ -685,6 +1058,14 @@ 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) { @@ -694,6 +1075,15 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ptr; } + @protected + ffi.Pointer cst_encode_box_autoadd_payment_id( + PaymentId raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_payment_id(); + cst_api_fill_to_wire_payment_id(raw, ptr.ref); + return ptr; + } + @protected ffi.Pointer cst_encode_box_autoadd_payment_preimage(PaymentPreimage raw) { @@ -730,6 +1120,20 @@ 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 @@ -763,10 +1167,21 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { } @protected - ffi.Pointer cst_encode_list_payment_details( - List raw) { + 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_payment_details(raw.length); + 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) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ans = wire.cst_new_list_payment_details(raw.length); for (var i = 0; i < raw.length; ++i) { cst_api_fill_to_wire_payment_details(raw[i], ans.ref.ptr[i]); } @@ -784,6 +1199,17 @@ 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) { @@ -850,6 +1276,22 @@ 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( @@ -875,6 +1317,33 @@ 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) { @@ -884,6 +1353,22 @@ 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_id( + PaymentId? raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw == null ? ffi.nullptr : cst_encode_box_autoadd_payment_id(raw); + } + @protected ffi.Pointer cst_encode_opt_box_autoadd_payment_preimage(PaymentPreimage? raw) { @@ -909,6 +1394,12 @@ 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 @@ -984,6 +1475,29 @@ 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) { @@ -1021,6 +1535,12 @@ 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) { @@ -1047,6 +1567,13 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { cst_api_fill_to_wire_gossip_source_config(apiObj, wireObj.ref); } + @protected + void cst_api_fill_to_wire_box_autoadd_ldk_bolt_11_payment( + LdkBolt11Payment apiObj, + ffi.Pointer wireObj) { + cst_api_fill_to_wire_ldk_bolt_11_payment(apiObj, wireObj.ref); + } + @protected void cst_api_fill_to_wire_box_autoadd_ldk_mnemonic( LdkMnemonic apiObj, ffi.Pointer wireObj) { @@ -1059,6 +1586,40 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { cst_api_fill_to_wire_ldk_node(apiObj, wireObj.ref); } + @protected + void cst_api_fill_to_wire_box_autoadd_ldk_on_chain_payment( + LdkOnChainPayment apiObj, + ffi.Pointer wireObj) { + cst_api_fill_to_wire_ldk_on_chain_payment(apiObj, wireObj.ref); + } + + @protected + void cst_api_fill_to_wire_box_autoadd_ldk_spontaneous_payment( + LdkSpontaneousPayment apiObj, + ffi.Pointer wireObj) { + cst_api_fill_to_wire_ldk_spontaneous_payment(apiObj, wireObj.ref); + } + + @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_lsp_fee_limits( + LSPFeeLimits apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_lsp_fee_limits(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_out_point( OutPoint apiObj, ffi.Pointer wireObj) { @@ -1077,6 +1638,12 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { cst_api_fill_to_wire_payment_hash(apiObj, wireObj.ref); } + @protected + void cst_api_fill_to_wire_box_autoadd_payment_id( + PaymentId apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_payment_id(apiObj, wireObj.ref); + } + @protected void cst_api_fill_to_wire_box_autoadd_payment_preimage( PaymentPreimage apiObj, ffi.Pointer wireObj) { @@ -1101,6 +1668,12 @@ 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) { @@ -1126,8 +1699,9 @@ 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); - cst_api_fill_to_wire_max_dust_htlc_exposure( - apiObj.maxDustHtlcExposure, wireObj.max_dust_htlc_exposure); + wireObj.max_dust_htlc_exposure = + cst_encode_opt_box_autoadd_max_dust_htlc_exposure( + apiObj.maxDustHtlcExposure); wireObj.force_close_avoidance_max_fee_satoshis = cst_encode_u_64(apiObj.forceCloseAvoidanceMaxFeeSatoshis); wireObj.accept_underpaying_htlcs = @@ -1140,7 +1714,8 @@ 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_String(apiObj.fundingTxo); + wireObj.funding_txo = + cst_encode_opt_box_autoadd_out_point(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); @@ -1148,7 +1723,6 @@ 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); @@ -1160,6 +1734,36 @@ 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 @@ -1168,6 +1772,67 @@ 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_LegacyCooperativeClosure) { + wireObj.tag = 2; + return; + } + if (apiObj is ClosureReason_CounterpartyInitiatedCooperativeClosure) { + wireObj.tag = 3; + return; + } + if (apiObj is ClosureReason_LocallyInitiatedCooperativeClosure) { + wireObj.tag = 4; + return; + } + if (apiObj is ClosureReason_CommitmentTxConfirmed) { + wireObj.tag = 5; + return; + } + if (apiObj is ClosureReason_FundingTimedOut) { + wireObj.tag = 6; + return; + } + if (apiObj is ClosureReason_ProcessingError) { + var pre_err = cst_encode_String(apiObj.err); + wireObj.tag = 7; + wireObj.kind.ProcessingError.err = pre_err; + return; + } + if (apiObj is ClosureReason_DisconnectedPeer) { + wireObj.tag = 8; + return; + } + if (apiObj is ClosureReason_OutdatedChannelManager) { + wireObj.tag = 9; + return; + } + if (apiObj is ClosureReason_CounterpartyCoopClosedUnfundedChannel) { + wireObj.tag = 10; + return; + } + if (apiObj is ClosureReason_FundingBatchClosure) { + wireObj.tag = 11; + return; + } + if (apiObj is ClosureReason_HTLCsTimedOut) { + wireObj.tag = 12; + return; + } + } + @protected void cst_api_fill_to_wire_config(Config apiObj, wire_cst_config wireObj) { wireObj.storage_dir_path = cst_encode_String(apiObj.storageDirPath); @@ -1218,70 +1883,87 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected void cst_api_fill_to_wire_event(Event apiObj, wire_cst_event wireObj) { if (apiObj is Event_PaymentSuccessful) { + var pre_payment_id = + cst_encode_opt_box_autoadd_payment_id(apiObj.paymentId); 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_id = pre_payment_id; 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_id = + cst_encode_opt_box_autoadd_payment_id(apiObj.paymentId); 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_id = pre_payment_id; wireObj.kind.PaymentFailed.payment_hash = pre_payment_hash; + wireObj.kind.PaymentFailed.reason = pre_reason; return; } if (apiObj is Event_PaymentReceived) { + var pre_payment_id = + cst_encode_opt_box_autoadd_payment_id(apiObj.paymentId); var pre_payment_hash = cst_encode_box_autoadd_payment_hash(apiObj.paymentHash); var pre_amount_msat = cst_encode_u_64(apiObj.amountMsat); wireObj.tag = 2; + wireObj.kind.PaymentReceived.payment_id = pre_payment_id; wireObj.kind.PaymentReceived.payment_hash = pre_payment_hash; wireObj.kind.PaymentReceived.amount_msat = pre_amount_msat; return; } - if (apiObj is Event_ChannelReady) { + 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); + cst_encode_box_autoadd_public_key(apiObj.counterpartyNodeId); + var pre_funding_txo = cst_encode_box_autoadd_out_point(apiObj.fundingTxo); wireObj.tag = 3; - 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.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; return; } - if (apiObj is Event_ChannelClosed) { + 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_counterparty_node_id = cst_encode_opt_box_autoadd_public_key(apiObj.counterpartyNodeId); wireObj.tag = 4; - 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; + 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_ChannelPending) { + 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_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); + var pre_reason = cst_encode_opt_box_autoadd_closure_reason(apiObj.reason); wireObj.tag = 5; - 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 = + 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; - wireObj.kind.ChannelPending.funding_txo = pre_funding_txo; + wireObj.kind.ChannelClosed.reason = pre_reason; return; } } @@ -1301,6 +1983,13 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { } } + @protected + void cst_api_fill_to_wire_ldk_bolt_11_payment( + LdkBolt11Payment apiObj, wire_cst_ldk_bolt_11_payment wireObj) { + wireObj.ptr = + cst_encode_RustOpaque_ldk_nodepaymentBolt11Payment(apiObj.ptr); + } + @protected void cst_api_fill_to_wire_ldk_mnemonic( LdkMnemonic apiObj, wire_cst_ldk_mnemonic wireObj) { @@ -1310,7 +1999,143 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected void cst_api_fill_to_wire_ldk_node( LdkNode apiObj, wire_cst_ldk_node wireObj) { - wireObj.ptr = cst_encode_RustOpaque_NodeSqliteStore(apiObj.ptr); + wireObj.ptr = cst_encode_RustOpaque_Node(apiObj.ptr); + } + + @protected + void cst_api_fill_to_wire_ldk_on_chain_payment( + LdkOnChainPayment apiObj, wire_cst_ldk_on_chain_payment wireObj) { + wireObj.ptr = + cst_encode_RustOpaque_ldk_nodepaymentOnchainPayment(apiObj.ptr); + } + + @protected + void cst_api_fill_to_wire_ldk_spontaneous_payment( + LdkSpontaneousPayment apiObj, wire_cst_ldk_spontaneous_payment wireObj) { + wireObj.ptr = + cst_encode_RustOpaque_ldk_nodepaymentSpontaneousPayment(apiObj.ptr); + } + + @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; + } + } + + @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); + } + + @protected + void cst_api_fill_to_wire_lsp_fee_limits( + LSPFeeLimits apiObj, wire_cst_lsp_fee_limits wireObj) { + wireObj.max_total_opening_fee_msat = + cst_encode_opt_box_autoadd_u_64(apiObj.maxTotalOpeningFeeMsat); + wireObj.max_proportional_opening_fee_ppm_msat = + cst_encode_opt_box_autoadd_u_64( + apiObj.maxProportionalOpeningFeePpmMsat); } @protected @@ -1330,6 +2155,28 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { } } + @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) { @@ -1340,10 +2187,8 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected void cst_api_fill_to_wire_payment_details( PaymentDetails apiObj, wire_cst_payment_details wireObj) { - cst_api_fill_to_wire_payment_hash(apiObj.hash, wireObj.hash); - wireObj.preimage = - cst_encode_opt_box_autoadd_payment_preimage(apiObj.preimage); - wireObj.secret = cst_encode_opt_box_autoadd_payment_secret(apiObj.secret); + cst_api_fill_to_wire_payment_id(apiObj.id, wireObj.id); + cst_api_fill_to_wire_payment_kind(apiObj.kind, wireObj.kind); wireObj.amount_msat = cst_encode_opt_box_autoadd_u_64(apiObj.amountMsat); wireObj.direction = cst_encode_payment_direction(apiObj.direction); wireObj.status = cst_encode_payment_status(apiObj.status); @@ -1355,6 +2200,55 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { wireObj.data = cst_encode_u_8_array_32(apiObj.data); } + @protected + void cst_api_fill_to_wire_payment_id( + PaymentId apiObj, wire_cst_payment_id wireObj) { + wireObj.field0 = cst_encode_u_8_array_32(apiObj.field0); + } + + @protected + void cst_api_fill_to_wire_payment_kind( + PaymentKind apiObj, wire_cst_payment_kind wireObj) { + if (apiObj is PaymentKind_Onchain) { + wireObj.tag = 0; + return; + } + if (apiObj is PaymentKind_Bolt11) { + var pre_hash = cst_encode_box_autoadd_payment_hash(apiObj.hash); + var pre_preimage = + cst_encode_opt_box_autoadd_payment_preimage(apiObj.preimage); + var pre_secret = cst_encode_opt_box_autoadd_payment_secret(apiObj.secret); + wireObj.tag = 1; + wireObj.kind.Bolt11.hash = pre_hash; + wireObj.kind.Bolt11.preimage = pre_preimage; + wireObj.kind.Bolt11.secret = pre_secret; + return; + } + if (apiObj is PaymentKind_Bolt11Jit) { + var pre_hash = cst_encode_box_autoadd_payment_hash(apiObj.hash); + var pre_preimage = + cst_encode_opt_box_autoadd_payment_preimage(apiObj.preimage); + var pre_secret = cst_encode_opt_box_autoadd_payment_secret(apiObj.secret); + var pre_lsp_fee_limits = + cst_encode_box_autoadd_lsp_fee_limits(apiObj.lspFeeLimits); + wireObj.tag = 2; + wireObj.kind.Bolt11Jit.hash = pre_hash; + wireObj.kind.Bolt11Jit.preimage = pre_preimage; + wireObj.kind.Bolt11Jit.secret = pre_secret; + wireObj.kind.Bolt11Jit.lsp_fee_limits = pre_lsp_fee_limits; + return; + } + if (apiObj is PaymentKind_Spontaneous) { + var pre_hash = cst_encode_box_autoadd_payment_hash(apiObj.hash); + var pre_preimage = + cst_encode_opt_box_autoadd_payment_preimage(apiObj.preimage); + wireObj.tag = 3; + wireObj.kind.Spontaneous.hash = pre_hash; + wireObj.kind.Spontaneous.preimage = pre_preimage; + return; + } + } + @protected void cst_api_fill_to_wire_payment_preimage( PaymentPreimage apiObj, wire_cst_payment_preimage wireObj) { @@ -1376,11 +2270,72 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { } @protected - void cst_api_fill_to_wire_public_key( - PublicKey apiObj, wire_cst_public_key wireObj) { + 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 = cst_encode_String(apiObj.hex); } + @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); + } + @protected void cst_api_fill_to_wire_socket_address( SocketAddress apiObj, wire_cst_socket_address wireObj) { @@ -1436,11 +2391,31 @@ 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_u_64(apiObj.data); + wireObj.data = cst_encode_list_prim_u_8_strict(apiObj.data); } @protected - int cst_encode_RustOpaque_NodeSqliteStore(NodeSqliteStore raw); + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + NodeBuilder raw); + + @protected + int cst_encode_RustOpaque_Node(Node raw); + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + NodeBuilder raw); + + @protected + int cst_encode_RustOpaque_ldk_nodepaymentBolt11Payment( + LdkNodePaymentBolt11Payment raw); + + @protected + int cst_encode_RustOpaque_ldk_nodepaymentOnchainPayment( + LdkNodePaymentOnchainPayment raw); + + @protected + int cst_encode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + LdkNodePaymentSpontaneousPayment raw); @protected bool cst_encode_bool(bool raw); @@ -1463,6 +2438,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @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); @@ -1482,8 +2460,29 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { int cst_encode_usize(int raw); @protected - void sse_encode_RustOpaque_NodeSqliteStore( - NodeSqliteStore self, SseSerializer serializer); + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + NodeBuilder self, SseSerializer serializer); + + @protected + void sse_encode_RustOpaque_Node(Node self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + NodeBuilder self, SseSerializer serializer); + + @protected + void sse_encode_RustOpaque_ldk_nodepaymentBolt11Payment( + LdkNodePaymentBolt11Payment self, SseSerializer serializer); + + @protected + void sse_encode_RustOpaque_ldk_nodepaymentOnchainPayment( + LdkNodePaymentOnchainPayment self, SseSerializer serializer); + + @protected + void sse_encode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + LdkNodePaymentSpontaneousPayment self, SseSerializer serializer); @protected void sse_encode_String(String self, SseSerializer serializer); @@ -1491,6 +2490,13 @@ 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); @@ -1516,6 +2522,10 @@ 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); @@ -1530,6 +2540,10 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_box_autoadd_gossip_source_config( GossipSourceConfig self, SseSerializer serializer); + @protected + void sse_encode_box_autoadd_ldk_bolt_11_payment( + LdkBolt11Payment self, SseSerializer serializer); + @protected void sse_encode_box_autoadd_ldk_mnemonic( LdkMnemonic self, SseSerializer serializer); @@ -1537,6 +2551,26 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected void sse_encode_box_autoadd_ldk_node(LdkNode self, SseSerializer serializer); + @protected + void sse_encode_box_autoadd_ldk_on_chain_payment( + LdkOnChainPayment self, SseSerializer serializer); + + @protected + void sse_encode_box_autoadd_ldk_spontaneous_payment( + LdkSpontaneousPayment self, SseSerializer serializer); + + @protected + void sse_encode_box_autoadd_liquidity_source_config( + LiquiditySourceConfig self, SseSerializer serializer); + + @protected + void sse_encode_box_autoadd_lsp_fee_limits( + LSPFeeLimits self, SseSerializer serializer); + + @protected + void sse_encode_box_autoadd_max_dust_htlc_exposure( + MaxDustHTLCExposure self, SseSerializer serializer); + @protected void sse_encode_box_autoadd_out_point( OutPoint self, SseSerializer serializer); @@ -1545,10 +2579,18 @@ 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); + @protected + void sse_encode_box_autoadd_payment_id( + PaymentId self, SseSerializer serializer); + @protected void sse_encode_box_autoadd_payment_preimage( PaymentPreimage self, SseSerializer serializer); @@ -1565,6 +2607,12 @@ 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); @@ -1593,6 +2641,9 @@ 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); @@ -1610,16 +2661,40 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected void sse_encode_i_32(int self, SseSerializer serializer); + @protected + void sse_encode_ldk_bolt_11_payment( + LdkBolt11Payment self, SseSerializer serializer); + @protected void sse_encode_ldk_mnemonic(LdkMnemonic self, SseSerializer serializer); @protected void sse_encode_ldk_node(LdkNode self, SseSerializer serializer); + @protected + void sse_encode_ldk_on_chain_payment( + LdkOnChainPayment self, SseSerializer serializer); + + @protected + void sse_encode_ldk_spontaneous_payment( + LdkSpontaneousPayment self, SseSerializer serializer); + + @protected + void sse_encode_lightning_balance( + LightningBalance self, SseSerializer serializer); + + @protected + void sse_encode_liquidity_source_config( + LiquiditySourceConfig 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); @@ -1628,6 +2703,10 @@ 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); @@ -1646,6 +2725,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected void sse_encode_log_level(LogLevel self, SseSerializer serializer); + @protected + void sse_encode_lsp_fee_limits(LSPFeeLimits self, SseSerializer serializer); + @protected void sse_encode_max_dust_htlc_exposure( MaxDustHTLCExposure self, SseSerializer serializer); @@ -1656,6 +2738,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected void sse_encode_node_exception(NodeException self, SseSerializer serializer); + @protected + void sse_encode_node_status(NodeStatus self, SseSerializer serializer); + @protected void sse_encode_opt_String(String? self, SseSerializer serializer); @@ -1667,6 +2752,14 @@ 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); @@ -1678,10 +2771,30 @@ 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_id( + PaymentId? self, SseSerializer serializer); + @protected void sse_encode_opt_box_autoadd_payment_preimage( PaymentPreimage? self, SseSerializer serializer); @@ -1694,6 +2807,9 @@ 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); @@ -1715,9 +2831,19 @@ 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); + @protected + void sse_encode_payment_id(PaymentId self, SseSerializer serializer); + + @protected + void sse_encode_payment_kind(PaymentKind self, SseSerializer serializer); + @protected void sse_encode_payment_preimage( PaymentPreimage self, SseSerializer serializer); @@ -1731,9 +2857,17 @@ 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); @@ -1818,186 +2952,489 @@ class LdkCoreWire implements BaseWire { late final _store_dart_post_cobject = _store_dart_post_cobjectPtr .asFunction(); - void wire_build_with_sqlite_store( + void wire_NodeBuilder_build( + int port_, + int that, + ) { + return _wire_NodeBuilder_build( + port_, + that, + ); + } + + late final _wire_NodeBuilder_buildPtr = + _lookup>( + 'frbgen_ldk_node_wire_NodeBuilder_build'); + late final _wire_NodeBuilder_build = + _wire_NodeBuilder_buildPtr.asFunction(); + + void wire_NodeBuilder_build_with_fs_store( + int port_, + int that, + ) { + return _wire_NodeBuilder_build_with_fs_store( + port_, + that, + ); + } + + late final _wire_NodeBuilder_build_with_fs_storePtr = + _lookup>( + 'frbgen_ldk_node_wire_NodeBuilder_build_with_fs_store'); + late final _wire_NodeBuilder_build_with_fs_store = + _wire_NodeBuilder_build_with_fs_storePtr + .asFunction(); + + void wire_NodeBuilder_create_builder( 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, ) { - return _wire_build_with_sqlite_store( + return _wire_NodeBuilder_create_builder( port_, config, chain_data_source_config, entropy_source_config, gossip_source_config, + liquidity_source_config, ); } - late final _wire_build_with_sqlite_storePtr = _lookup< + late final _wire_NodeBuilder_create_builderPtr = _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< + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire_NodeBuilder_create_builder'); + late final _wire_NodeBuilder_create_builder = + _wire_NodeBuilder_create_builderPtr.asFunction< void Function( int, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer)>(); - void wire_ldk_mnemonic_generate( + void wire_ldk_bolt_11_payment_receive( int port_, + ffi.Pointer that, + int amount_msat, + ffi.Pointer description, + int expiry_secs, ) { - return _wire_ldk_mnemonic_generate( + return _wire_ldk_bolt_11_payment_receive( port_, + that, + amount_msat, + description, + expiry_secs, ); } - late final _wire_ldk_mnemonic_generatePtr = - _lookup>( - 'frbgen_ldk_node_wire_ldk_mnemonic_generate'); - late final _wire_ldk_mnemonic_generate = - _wire_ldk_mnemonic_generatePtr.asFunction(); + late final _wire_ldk_bolt_11_payment_receivePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Uint64, + ffi.Pointer, + ffi.Uint32)>>('frbgen_ldk_node_wire_ldk_bolt_11_payment_receive'); + late final _wire_ldk_bolt_11_payment_receive = + _wire_ldk_bolt_11_payment_receivePtr.asFunction< + void Function(int, ffi.Pointer, int, + ffi.Pointer, int)>(); - void wire_ldk_node_close_channel( + void wire_ldk_bolt_11_payment_receive_variable_amount( int port_, - ffi.Pointer that, - ffi.Pointer channel_id, - ffi.Pointer counterparty_node_id, + ffi.Pointer that, + ffi.Pointer description, + int expiry_secs, ) { - return _wire_ldk_node_close_channel( + return _wire_ldk_bolt_11_payment_receive_variable_amount( port_, that, - channel_id, - counterparty_node_id, + description, + expiry_secs, ); } - late final _wire_ldk_node_close_channelPtr = _lookup< + late final _wire_ldk_bolt_11_payment_receive_variable_amountPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Int64, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>( - '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, + ffi.Uint32)>>( + 'frbgen_ldk_node_wire_ldk_bolt_11_payment_receive_variable_amount'); + late final _wire_ldk_bolt_11_payment_receive_variable_amount = + _wire_ldk_bolt_11_payment_receive_variable_amountPtr.asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer, int)>(); - void wire_ldk_node_connect( + void wire_ldk_bolt_11_payment_receive_variable_amount_via_jit_channel( int port_, - ffi.Pointer that, - ffi.Pointer node_id, - ffi.Pointer address, - bool persist, + ffi.Pointer that, + ffi.Pointer description, + int expiry_secs, + ffi.Pointer max_proportional_lsp_fee_limit_ppm_msat, ) { - return _wire_ldk_node_connect( + return _wire_ldk_bolt_11_payment_receive_variable_amount_via_jit_channel( port_, that, - node_id, - address, - persist, + description, + expiry_secs, + max_proportional_lsp_fee_limit_ppm_msat, ); } - late final _wire_ldk_node_connectPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Int64, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - 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, - bool)>(); + late final _wire_ldk_bolt_11_payment_receive_variable_amount_via_jit_channelPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Uint32, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire_ldk_bolt_11_payment_receive_variable_amount_via_jit_channel'); + late final _wire_ldk_bolt_11_payment_receive_variable_amount_via_jit_channel = + _wire_ldk_bolt_11_payment_receive_variable_amount_via_jit_channelPtr + .asFunction< + void Function( + int, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); - void wire_ldk_node_connect_open_channel( + void wire_ldk_bolt_11_payment_receive_via_jit_channel( int port_, - 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, + ffi.Pointer that, + int amount_msat, + ffi.Pointer description, + int expiry_secs, + ffi.Pointer max_total_lsp_fee_limit_msat, ) { - return _wire_ldk_node_connect_open_channel( + return _wire_ldk_bolt_11_payment_receive_via_jit_channel( port_, that, - socket_address, - node_id, - channel_amount_sats, - push_to_counterparty_msat, - announce_channel, - channel_config, + amount_msat, + description, + expiry_secs, + max_total_lsp_fee_limit_msat, ); } - late final _wire_ldk_node_connect_open_channelPtr = _lookup< + late final _wire_ldk_bolt_11_payment_receive_via_jit_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_ldk_node_connect_open_channel'); - late final _wire_ldk_node_connect_open_channel = - _wire_ldk_node_connect_open_channelPtr.asFunction< + ffi.Pointer, + ffi.Uint32, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire_ldk_bolt_11_payment_receive_via_jit_channel'); + late final _wire_ldk_bolt_11_payment_receive_via_jit_channel = + _wire_ldk_bolt_11_payment_receive_via_jit_channelPtr.asFunction< void Function( int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int, - ffi.Pointer, - bool, - ffi.Pointer)>(); + ffi.Pointer, + int, + ffi.Pointer)>(); - void wire_ldk_node_disconnect( + void wire_ldk_bolt_11_payment_send( int port_, - ffi.Pointer that, - ffi.Pointer counterparty_node_id, + ffi.Pointer that, + ffi.Pointer invoice, ) { - return _wire_ldk_node_disconnect( + return _wire_ldk_bolt_11_payment_send( port_, that, - counterparty_node_id, + invoice, ); } - late final _wire_ldk_node_disconnectPtr = _lookup< + late final _wire_ldk_bolt_11_payment_sendPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - 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_ldk_node_event_handled( - int port_, + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire_ldk_bolt_11_payment_send'); + late final _wire_ldk_bolt_11_payment_send = + _wire_ldk_bolt_11_payment_sendPtr.asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer)>(); + + void wire_ldk_bolt_11_payment_send_probes( + int port_, + ffi.Pointer that, + ffi.Pointer invoice, + ) { + return _wire_ldk_bolt_11_payment_send_probes( + port_, + that, + invoice, + ); + } + + late final _wire_ldk_bolt_11_payment_send_probesPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire_ldk_bolt_11_payment_send_probes'); + late final _wire_ldk_bolt_11_payment_send_probes = + _wire_ldk_bolt_11_payment_send_probesPtr.asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer)>(); + + void wire_ldk_bolt_11_payment_send_probes_using_amount( + int port_, + ffi.Pointer that, + ffi.Pointer invoice, + int amount_msat, + ) { + return _wire_ldk_bolt_11_payment_send_probes_using_amount( + port_, + that, + invoice, + amount_msat, + ); + } + + late final _wire_ldk_bolt_11_payment_send_probes_using_amountPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Uint64)>>( + 'frbgen_ldk_node_wire_ldk_bolt_11_payment_send_probes_using_amount'); + late final _wire_ldk_bolt_11_payment_send_probes_using_amount = + _wire_ldk_bolt_11_payment_send_probes_using_amountPtr.asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer, int)>(); + + void wire_ldk_bolt_11_payment_send_using_amount( + int port_, + ffi.Pointer that, + ffi.Pointer invoice, + int amount_msat, + ) { + return _wire_ldk_bolt_11_payment_send_using_amount( + port_, + that, + invoice, + amount_msat, + ); + } + + late final _wire_ldk_bolt_11_payment_send_using_amountPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Uint64)>>( + 'frbgen_ldk_node_wire_ldk_bolt_11_payment_send_using_amount'); + late final _wire_ldk_bolt_11_payment_send_using_amount = + _wire_ldk_bolt_11_payment_send_using_amountPtr.asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer, int)>(); + + void wire_ldk_mnemonic_generate( + int port_, + ) { + return _wire_ldk_mnemonic_generate( + port_, + ); + } + + late final _wire_ldk_mnemonic_generatePtr = + _lookup>( + 'frbgen_ldk_node_wire_ldk_mnemonic_generate'); + late final _wire_ldk_mnemonic_generate = + _wire_ldk_mnemonic_generatePtr.asFunction(); + + void wire_ldk_node_bolt11_payment( + int port_, + ffi.Pointer ptr, + ) { + return _wire_ldk_node_bolt11_payment( + port_, + ptr, + ); + } + + late final _wire_ldk_node_bolt11_paymentPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire_ldk_node_bolt11_payment'); + late final _wire_ldk_node_bolt11_payment = _wire_ldk_node_bolt11_paymentPtr + .asFunction)>(); + + void wire_ldk_node_close_channel( + int port_, + ffi.Pointer that, + ffi.Pointer user_channel_id, + ffi.Pointer counterparty_node_id, + ) { + return _wire_ldk_node_close_channel( + port_, + that, + user_channel_id, + counterparty_node_id, + ); + } + + late final _wire_ldk_node_close_channelPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + '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)>(); + + void wire_ldk_node_config( + int port_, + ffi.Pointer that, + ) { + return _wire_ldk_node_config( + port_, + that, + ); + } + + late final _wire_ldk_node_configPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire_ldk_node_config'); + late final _wire_ldk_node_config = _wire_ldk_node_configPtr + .asFunction)>(); + + void wire_ldk_node_connect( + int port_, + ffi.Pointer that, + ffi.Pointer node_id, + ffi.Pointer address, + bool persist, + ) { + return _wire_ldk_node_connect( + port_, + that, + node_id, + address, + persist, + ); + } + + late final _wire_ldk_node_connectPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + 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, + bool)>(); + + void wire_ldk_node_connect_open_channel( + int port_, + 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_ldk_node_connect_open_channel( + port_, + that, + socket_address, + node_id, + channel_amount_sats, + push_to_counterparty_msat, + announce_channel, + channel_config, + ); + } + + late final _wire_ldk_node_connect_open_channelPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Uint64, + ffi.Pointer, + ffi.Bool, + ffi.Pointer)>>( + '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, + int, + ffi.Pointer, + bool, + ffi.Pointer)>(); + + void wire_ldk_node_disconnect( + int port_, + ffi.Pointer that, + ffi.Pointer counterparty_node_id, + ) { + return _wire_ldk_node_disconnect( + port_, + that, + counterparty_node_id, + ); + } + + late final _wire_ldk_node_disconnectPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Int64, ffi.Pointer, + 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_ldk_node_event_handled( + int port_, ffi.Pointer that, ) { return _wire_ldk_node_event_handled( @@ -2013,21 +3450,21 @@ class LdkCoreWire implements BaseWire { late final _wire_ldk_node_event_handled = _wire_ldk_node_event_handledPtr .asFunction)>(); - void wire_ldk_node_is_running( + void wire_ldk_node_list_balances( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_is_running( + return _wire_ldk_node_list_balances( port_, that, ); } - late final _wire_ldk_node_is_runningPtr = _lookup< + late final _wire_ldk_node_list_balancesPtr = _lookup< ffi.NativeFunction< 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 + 'frbgen_ldk_node_wire_ldk_node_list_balances'); + late final _wire_ldk_node_list_balances = _wire_ldk_node_list_balancesPtr .asFunction)>(); void wire_ldk_node_list_channels( @@ -2120,40 +3557,40 @@ class LdkCoreWire implements BaseWire { _wire_ldk_node_listening_addressesPtr .asFunction)>(); - void wire_ldk_node_new_onchain_address( + void wire_ldk_node_next_event( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_new_onchain_address( + return _wire_ldk_node_next_event( port_, that, ); } - late final _wire_ldk_node_new_onchain_addressPtr = _lookup< + late final _wire_ldk_node_next_eventPtr = _lookup< ffi.NativeFunction< 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)>(); + 'frbgen_ldk_node_wire_ldk_node_next_event'); + late final _wire_ldk_node_next_event = _wire_ldk_node_next_eventPtr + .asFunction)>(); - void wire_ldk_node_next_event( + void wire_ldk_node_next_event_async( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_next_event( + return _wire_ldk_node_next_event_async( port_, that, ); } - late final _wire_ldk_node_next_eventPtr = _lookup< + late final _wire_ldk_node_next_event_asyncPtr = _lookup< ffi.NativeFunction< 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)>(); + 'frbgen_ldk_node_wire_ldk_node_next_event_async'); + late final _wire_ldk_node_next_event_async = + _wire_ldk_node_next_event_asyncPtr + .asFunction)>(); void wire_ldk_node_node_id( int port_, @@ -2172,287 +3609,66 @@ class LdkCoreWire implements BaseWire { late final _wire_ldk_node_node_id = _wire_ldk_node_node_idPtr .asFunction)>(); + void wire_ldk_node_on_chain_payment( + int port_, + ffi.Pointer ptr, + ) { + return _wire_ldk_node_on_chain_payment( + port_, + ptr, + ); + } + + late final _wire_ldk_node_on_chain_paymentPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire_ldk_node_on_chain_payment'); + late final _wire_ldk_node_on_chain_payment = + _wire_ldk_node_on_chain_paymentPtr + .asFunction)>(); + void wire_ldk_node_payment( int port_, ffi.Pointer that, - ffi.Pointer payment_hash, + ffi.Pointer payment_id, ) { return _wire_ldk_node_payment( port_, that, - payment_hash, + payment_id, ); } late final _wire_ldk_node_paymentPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Int64, ffi.Pointer, - ffi.Pointer)>>( + 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)>(); + ffi.Pointer)>(); - void wire_ldk_node_receive_payment( + void wire_ldk_node_remove_payment( int port_, ffi.Pointer that, - int amount_msat, - ffi.Pointer description, - int expiry_secs, + ffi.Pointer payment_id, ) { - return _wire_ldk_node_receive_payment( + return _wire_ldk_node_remove_payment( port_, that, - amount_msat, - description, - expiry_secs, - ); - } - - late final _wire_ldk_node_receive_paymentPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Int64, - ffi.Pointer, - ffi.Uint64, - ffi.Pointer, - 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_ldk_node_receive_variable_amount_payment( - int port_, - ffi.Pointer that, - ffi.Pointer description, - int expiry_secs, - ) { - return _wire_ldk_node_receive_variable_amount_payment( - port_, - that, - description, - expiry_secs, - ); - } - - late final _wire_ldk_node_receive_variable_amount_paymentPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - ffi.Pointer, ffi.Uint32)>>( - '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_ldk_node_remove_payment( - int port_, - ffi.Pointer that, - ffi.Pointer payment_hash, - ) { - return _wire_ldk_node_remove_payment( - port_, - that, - payment_hash, + payment_id, ); } late final _wire_ldk_node_remove_paymentPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Int64, ffi.Pointer, - ffi.Pointer)>>( + 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_ldk_node_send_all_to_onchain_address( - int port_, - ffi.Pointer that, - ffi.Pointer address, - ) { - return _wire_ldk_node_send_all_to_onchain_address( - port_, - that, - address, - ); - } - - late final _wire_ldk_node_send_all_to_onchain_addressPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - 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_ldk_node_send_payment( - int port_, - ffi.Pointer that, - ffi.Pointer invoice, - ) { - return _wire_ldk_node_send_payment( - port_, - that, - invoice, - ); - } - - late final _wire_ldk_node_send_paymentPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - 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_ldk_node_send_payment_probes( - int port_, - ffi.Pointer that, - ffi.Pointer invoice, - ) { - return _wire_ldk_node_send_payment_probes( - port_, - that, - invoice, - ); - } - - late final _wire_ldk_node_send_payment_probesPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - 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_ldk_node_send_payment_probes_using_amount( - int port_, - ffi.Pointer that, - ffi.Pointer invoice, - int amount_msat, - ) { - return _wire_ldk_node_send_payment_probes_using_amount( - port_, - that, - invoice, - amount_msat, - ); - } - - late final _wire_ldk_node_send_payment_probes_using_amountPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - ffi.Pointer, ffi.Uint64)>>( - '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_ldk_node_send_payment_using_amount( - int port_, - ffi.Pointer that, - ffi.Pointer invoice, - int amount_msat, - ) { - return _wire_ldk_node_send_payment_using_amount( - port_, - that, - invoice, - amount_msat, - ); - } - - late final _wire_ldk_node_send_payment_using_amountPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - ffi.Pointer, ffi.Uint64)>>( - '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_ldk_node_send_spontaneous_payment( - int port_, - ffi.Pointer that, - int amount_msat, - ffi.Pointer node_id, - ) { - return _wire_ldk_node_send_spontaneous_payment( - port_, - that, - amount_msat, - node_id, - ); - } - - late final _wire_ldk_node_send_spontaneous_paymentPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - ffi.Uint64, ffi.Pointer)>>( - '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_ldk_node_send_spontaneous_payment_probes( - int port_, - ffi.Pointer that, - int amount_msat, - ffi.Pointer node_id, - ) { - return _wire_ldk_node_send_spontaneous_payment_probes( - port_, - that, - amount_msat, - node_id, - ); - } - - late final _wire_ldk_node_send_spontaneous_payment_probesPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - ffi.Uint64, ffi.Pointer)>>( - '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_ldk_node_send_to_onchain_address( - int port_, - ffi.Pointer that, - ffi.Pointer address, - int amount_sats, - ) { - return _wire_ldk_node_send_to_onchain_address( - port_, - that, - address, - amount_sats, - ); - } - - late final _wire_ldk_node_send_to_onchain_addressPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - ffi.Pointer, ffi.Uint64)>>( - '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)>(); + ffi.Pointer)>(); void wire_ldk_node_sign_message( int port_, @@ -2476,22 +3692,22 @@ class LdkCoreWire implements BaseWire { void Function(int, ffi.Pointer, ffi.Pointer)>(); - void wire_ldk_node_spendable_onchain_balance_sats( + void wire_ldk_node_spontaneous_payment( int port_, - ffi.Pointer that, + ffi.Pointer ptr, ) { - return _wire_ldk_node_spendable_onchain_balance_sats( + return _wire_ldk_node_spontaneous_payment( port_, - that, + ptr, ); } - late final _wire_ldk_node_spendable_onchain_balance_satsPtr = _lookup< + late final _wire_ldk_node_spontaneous_paymentPtr = _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 + 'frbgen_ldk_node_wire_ldk_node_spontaneous_payment'); + late final _wire_ldk_node_spontaneous_payment = + _wire_ldk_node_spontaneous_paymentPtr .asFunction)>(); void wire_ldk_node_start( @@ -2511,69 +3727,68 @@ class LdkCoreWire implements BaseWire { late final _wire_ldk_node_start = _wire_ldk_node_startPtr .asFunction)>(); - void wire_ldk_node_stop( + void wire_ldk_node_status( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_stop( + return _wire_ldk_node_status( port_, that, ); } - late final _wire_ldk_node_stopPtr = _lookup< + late final _wire_ldk_node_statusPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Int64, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_ldk_node_stop'); - late final _wire_ldk_node_stop = _wire_ldk_node_stopPtr + 'frbgen_ldk_node_wire_ldk_node_status'); + late final _wire_ldk_node_status = _wire_ldk_node_statusPtr .asFunction)>(); - void wire_ldk_node_sync_wallets( + void wire_ldk_node_stop( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_sync_wallets( + return _wire_ldk_node_stop( port_, that, ); } - late final _wire_ldk_node_sync_walletsPtr = _lookup< + late final _wire_ldk_node_stopPtr = _lookup< ffi.NativeFunction< 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 + 'frbgen_ldk_node_wire_ldk_node_stop'); + late final _wire_ldk_node_stop = _wire_ldk_node_stopPtr .asFunction)>(); - void wire_ldk_node_total_onchain_balance_sats( + void wire_ldk_node_sync_wallets( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_total_onchain_balance_sats( + return _wire_ldk_node_sync_wallets( port_, that, ); } - late final _wire_ldk_node_total_onchain_balance_satsPtr = _lookup< + late final _wire_ldk_node_sync_walletsPtr = _lookup< ffi.NativeFunction< 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)>(); + 'frbgen_ldk_node_wire_ldk_node_sync_wallets'); + late final _wire_ldk_node_sync_wallets = _wire_ldk_node_sync_walletsPtr + .asFunction)>(); void wire_ldk_node_update_channel_config( int port_, ffi.Pointer that, - ffi.Pointer channel_id, + ffi.Pointer user_channel_id, ffi.Pointer counterparty_node_id, ffi.Pointer channel_config, ) { return _wire_ldk_node_update_channel_config( port_, that, - channel_id, + user_channel_id, counterparty_node_id, channel_config, ); @@ -2584,7 +3799,7 @@ class LdkCoreWire implements BaseWire { ffi.Void Function( ffi.Int64, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer)>>( 'frbgen_ldk_node_wire_ldk_node_update_channel_config'); @@ -2593,7 +3808,7 @@ class LdkCoreWire implements BaseWire { void Function( int, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -2602,14 +3817,14 @@ class LdkCoreWire implements BaseWire { ffi.Pointer that, ffi.Pointer msg, ffi.Pointer sig, - ffi.Pointer pkey, + ffi.Pointer public_key, ) { return _wire_ldk_node_verify_signature( port_, that, msg, sig, - pkey, + public_key, ); } @@ -2648,84 +3863,295 @@ class LdkCoreWire implements BaseWire { late final _wire_ldk_node_wait_next_event = _wire_ldk_node_wait_next_eventPtr .asFunction)>(); - void wire_socket_address_as_string( + void wire_ldk_on_chain_payment_new_address( + int port_, + ffi.Pointer that, + ) { + return _wire_ldk_on_chain_payment_new_address( + port_, + that, + ); + } + + late final _wire_ldk_on_chain_payment_new_addressPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire_ldk_on_chain_payment_new_address'); + late final _wire_ldk_on_chain_payment_new_address = + _wire_ldk_on_chain_payment_new_addressPtr.asFunction< + void Function(int, ffi.Pointer)>(); + + void wire_ldk_on_chain_payment_send_all_to_address( int port_, - ffi.Pointer that, + ffi.Pointer that, + ffi.Pointer address, ) { - return _wire_socket_address_as_string( + return _wire_ldk_on_chain_payment_send_all_to_address( port_, that, + address, ); } - late final _wire_socket_address_as_stringPtr = _lookup< + late final _wire_ldk_on_chain_payment_send_all_to_addressPtr = _lookup< ffi.NativeFunction< ffi.Void Function( - 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)>(); + ffi.Int64, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire_ldk_on_chain_payment_send_all_to_address'); + late final _wire_ldk_on_chain_payment_send_all_to_address = + _wire_ldk_on_chain_payment_send_all_to_addressPtr.asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer)>(); - void wire_socket_address_from_str( + void wire_ldk_on_chain_payment_send_to_address( int port_, - ffi.Pointer address, + ffi.Pointer that, + ffi.Pointer address, + int amount_sats, ) { - return _wire_socket_address_from_str( + return _wire_ldk_on_chain_payment_send_to_address( port_, + that, address, + amount_sats, + ); + } + + late final _wire_ldk_on_chain_payment_send_to_addressPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Uint64)>>( + 'frbgen_ldk_node_wire_ldk_on_chain_payment_send_to_address'); + late final _wire_ldk_on_chain_payment_send_to_address = + _wire_ldk_on_chain_payment_send_to_addressPtr.asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer, int)>(); + + void wire_ldk_spontaneous_payment_send( + int port_, + ffi.Pointer that, + int amount_msat, + ffi.Pointer node_id, + ) { + return _wire_ldk_spontaneous_payment_send( + port_, + that, + amount_msat, + node_id, + ); + } + + late final _wire_ldk_spontaneous_payment_sendPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Uint64, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire_ldk_spontaneous_payment_send'); + late final _wire_ldk_spontaneous_payment_send = + _wire_ldk_spontaneous_payment_sendPtr.asFunction< + void Function(int, ffi.Pointer, int, + ffi.Pointer)>(); + + void wire_ldk_spontaneous_payment_send_probes( + int port_, + ffi.Pointer that, + int amount_msat, + ffi.Pointer node_id, + ) { + return _wire_ldk_spontaneous_payment_send_probes( + port_, + that, + amount_msat, + node_id, ); } - late final _wire_socket_address_from_strPtr = _lookup< + late final _wire_ldk_spontaneous_payment_send_probesPtr = _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)>(); + ffi.Int64, + ffi.Pointer, + ffi.Uint64, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire_ldk_spontaneous_payment_send_probes'); + late final _wire_ldk_spontaneous_payment_send_probes = + _wire_ldk_spontaneous_payment_send_probesPtr.asFunction< + void Function(int, ffi.Pointer, int, + ffi.Pointer)>(); - void rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore( + void rust_arc_increment_strong_count_RustOpaque_Node( ffi.Pointer ptr, ) { - return _rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore( + return _rust_arc_increment_strong_count_RustOpaque_Node( ptr, ); } - late final _rust_arc_increment_strong_count_RustOpaque_NodeSqliteStorePtr = + late final _rust_arc_increment_strong_count_RustOpaque_NodePtr = _lookup)>>( - 'frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore'); - late final _rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore = - _rust_arc_increment_strong_count_RustOpaque_NodeSqliteStorePtr + 'frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_Node'); + late final _rust_arc_increment_strong_count_RustOpaque_Node = + _rust_arc_increment_strong_count_RustOpaque_NodePtr .asFunction)>(); - void rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore( + void rust_arc_decrement_strong_count_RustOpaque_Node( ffi.Pointer ptr, ) { - return _rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore( + return _rust_arc_decrement_strong_count_RustOpaque_Node( ptr, ); } - late final _rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStorePtr = + late final _rust_arc_decrement_strong_count_RustOpaque_NodePtr = _lookup)>>( - 'frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore'); - late final _rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore = - _rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStorePtr + 'frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_Node'); + late final _rust_arc_decrement_strong_count_RustOpaque_Node = + _rust_arc_decrement_strong_count_RustOpaque_NodePtr .asFunction)>(); - ffi.Pointer cst_new_box_autoadd_address() { - return _cst_new_box_autoadd_address(); + void + rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + ptr, + ); } - late final _cst_new_box_autoadd_addressPtr = - _lookup Function()>>( - 'frbgen_ldk_node_cst_new_box_autoadd_address'); - late final _cst_new_box_autoadd_address = _cst_new_box_autoadd_addressPtr - .asFunction Function()>(); + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilderPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder'); + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder = + _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilderPtr + .asFunction)>(); - ffi.Pointer cst_new_box_autoadd_bolt_11_invoice() { + void + rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilderPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder'); + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder = + _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilderPtr + .asFunction)>(); + + void rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11PaymentPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment'); + late final _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment = + _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11PaymentPtr + .asFunction)>(); + + void rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11PaymentPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment'); + late final _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment = + _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11PaymentPtr + .asFunction)>(); + + void rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPaymentPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment'); + late final _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment = + _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPaymentPtr + .asFunction)>(); + + void rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPaymentPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment'); + late final _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment = + _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPaymentPtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPaymentPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment'); + late final _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment = + _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPaymentPtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPaymentPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment'); + late final _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment = + _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPaymentPtr + .asFunction)>(); + + ffi.Pointer cst_new_box_autoadd_address() { + return _cst_new_box_autoadd_address(); + } + + late final _cst_new_box_autoadd_addressPtr = + _lookup Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_address'); + late final _cst_new_box_autoadd_address = _cst_new_box_autoadd_addressPtr + .asFunction Function()>(); + + ffi.Pointer cst_new_box_autoadd_bolt_11_invoice() { return _cst_new_box_autoadd_bolt_11_invoice(); } @@ -2771,6 +4197,17 @@ 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(); } @@ -2817,6 +4254,19 @@ class LdkCoreWire implements BaseWire { _cst_new_box_autoadd_gossip_source_configPtr .asFunction Function()>(); + ffi.Pointer + cst_new_box_autoadd_ldk_bolt_11_payment() { + return _cst_new_box_autoadd_ldk_bolt_11_payment(); + } + + late final _cst_new_box_autoadd_ldk_bolt_11_paymentPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_ldk_bolt_11_payment'); + late final _cst_new_box_autoadd_ldk_bolt_11_payment = + _cst_new_box_autoadd_ldk_bolt_11_paymentPtr + .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_ldk_mnemonic() { return _cst_new_box_autoadd_ldk_mnemonic(); } @@ -2838,6 +4288,69 @@ class LdkCoreWire implements BaseWire { late final _cst_new_box_autoadd_ldk_node = _cst_new_box_autoadd_ldk_nodePtr .asFunction Function()>(); + ffi.Pointer + cst_new_box_autoadd_ldk_on_chain_payment() { + return _cst_new_box_autoadd_ldk_on_chain_payment(); + } + + late final _cst_new_box_autoadd_ldk_on_chain_paymentPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_ldk_on_chain_payment'); + late final _cst_new_box_autoadd_ldk_on_chain_payment = + _cst_new_box_autoadd_ldk_on_chain_paymentPtr + .asFunction Function()>(); + + ffi.Pointer + cst_new_box_autoadd_ldk_spontaneous_payment() { + return _cst_new_box_autoadd_ldk_spontaneous_payment(); + } + + late final _cst_new_box_autoadd_ldk_spontaneous_paymentPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_ldk_spontaneous_payment'); + late final _cst_new_box_autoadd_ldk_spontaneous_payment = + _cst_new_box_autoadd_ldk_spontaneous_paymentPtr.asFunction< + ffi.Pointer 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_lsp_fee_limits() { + return _cst_new_box_autoadd_lsp_fee_limits(); + } + + late final _cst_new_box_autoadd_lsp_fee_limitsPtr = _lookup< + ffi.NativeFunction Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_lsp_fee_limits'); + late final _cst_new_box_autoadd_lsp_fee_limits = + _cst_new_box_autoadd_lsp_fee_limitsPtr + .asFunction 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_out_point() { return _cst_new_box_autoadd_out_point(); } @@ -2859,6 +4372,21 @@ 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(); } @@ -2870,6 +4398,17 @@ class LdkCoreWire implements BaseWire { _cst_new_box_autoadd_payment_hashPtr .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_payment_id() { + return _cst_new_box_autoadd_payment_id(); + } + + late final _cst_new_box_autoadd_payment_idPtr = + _lookup Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_payment_id'); + late final _cst_new_box_autoadd_payment_id = + _cst_new_box_autoadd_payment_idPtr + .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_payment_preimage() { return _cst_new_box_autoadd_payment_preimage(); @@ -2916,6 +4455,30 @@ 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, ) { @@ -2970,6 +4533,22 @@ 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, ) { @@ -3000,6 +4579,24 @@ 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, ) { @@ -3252,12 +4849,34 @@ 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_bolt_11_payment extends ffi.Struct { + @ffi.UintPtr() + external int ptr; +} + +final class wire_cst_bolt_11_invoice extends ffi.Struct { + external ffi.Pointer signed_raw_invoice; +} + final class wire_cst_ldk_node extends ffi.Struct { @ffi.UintPtr() external int ptr; } -final class wire_cst_channel_id extends ffi.Struct { +final class wire_cst_user_channel_id extends ffi.Struct { external ffi.Pointer data; } @@ -3294,7 +4913,7 @@ final class wire_cst_channel_config extends ffi.Struct { @ffi.Uint16() external int cltv_expiry_delta; - external wire_cst_max_dust_htlc_exposure max_dust_htlc_exposure; + external ffi.Pointer max_dust_htlc_exposure; @ffi.Uint64() external int force_close_avoidance_max_fee_satoshis; @@ -3303,59 +4922,84 @@ final class wire_cst_channel_config extends ffi.Struct { external bool accept_underpaying_htlcs; } -final class wire_cst_payment_hash extends ffi.Struct { - external ffi.Pointer data; +final class wire_cst_payment_id extends ffi.Struct { + external ffi.Pointer field0; +} + +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_ldk_on_chain_payment extends ffi.Struct { + @ffi.UintPtr() + external int ptr; } 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_ldk_spontaneous_payment extends ffi.Struct { + @ffi.UintPtr() + external int ptr; } -final class wire_cst_list_prim_u_8_loose extends ffi.Struct { - external ffi.Pointer ptr; +final class wire_cst_channel_id extends ffi.Struct { + external ffi.Pointer data; +} - @ffi.Int32() - external int len; +final class wire_cst_ClosureReason_CounterpartyForceClosed extends ffi.Struct { + external ffi.Pointer peer_msg; } -final class wire_cst_Event_PaymentSuccessful extends ffi.Struct { - external ffi.Pointer payment_hash; +final class wire_cst_ClosureReason_ProcessingError extends ffi.Struct { + external ffi.Pointer err; } -final class wire_cst_Event_PaymentFailed extends ffi.Struct { - external ffi.Pointer payment_hash; +final class ClosureReasonKind extends ffi.Union { + external wire_cst_ClosureReason_CounterpartyForceClosed + CounterpartyForceClosed; + + external wire_cst_ClosureReason_ProcessingError ProcessingError; } -final class wire_cst_Event_PaymentReceived extends ffi.Struct { - external ffi.Pointer payment_hash; +final class wire_cst_closure_reason extends ffi.Struct { + @ffi.Int32() + external int tag; - @ffi.Uint64() - external int amount_msat; + external ClosureReasonKind kind; } -final class wire_cst_user_channel_id extends ffi.Struct { - @ffi.Uint64() - external int data; +final class wire_cst_payment_hash extends ffi.Struct { + external ffi.Pointer data; } -final class wire_cst_Event_ChannelReady extends ffi.Struct { - external ffi.Pointer channel_id; +final class wire_cst_Event_PaymentSuccessful extends ffi.Struct { + external ffi.Pointer payment_id; - external ffi.Pointer user_channel_id; + external ffi.Pointer payment_hash; - external ffi.Pointer counterparty_node_id; + external ffi.Pointer fee_paid_msat; } -final class wire_cst_Event_ChannelClosed extends ffi.Struct { - external ffi.Pointer channel_id; +final class wire_cst_Event_PaymentFailed extends ffi.Struct { + external ffi.Pointer payment_id; - external ffi.Pointer user_channel_id; + external ffi.Pointer payment_hash; - external ffi.Pointer counterparty_node_id; + external ffi.Pointer reason; +} + +final class wire_cst_Event_PaymentReceived extends ffi.Struct { + external ffi.Pointer payment_id; + + external ffi.Pointer payment_hash; + + @ffi.Uint64() + external int amount_msat; } final class wire_cst_txid extends ffi.Struct { @@ -3381,6 +5025,24 @@ final class wire_cst_Event_ChannelPending extends ffi.Struct { external ffi.Pointer funding_txo; } +final class wire_cst_Event_ChannelReady extends ffi.Struct { + external ffi.Pointer channel_id; + + external ffi.Pointer user_channel_id; + + external ffi.Pointer counterparty_node_id; +} + +final class wire_cst_Event_ChannelClosed extends ffi.Struct { + external ffi.Pointer channel_id; + + external ffi.Pointer user_channel_id; + + external ffi.Pointer counterparty_node_id; + + external ffi.Pointer reason; +} + final class EventKind extends ffi.Union { external wire_cst_Event_PaymentSuccessful PaymentSuccessful; @@ -3388,11 +5050,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 { @@ -3402,6 +5064,12 @@ final class wire_cst_event extends ffi.Struct { external EventKind kind; } +final class wire_cst_lsp_fee_limits extends ffi.Struct { + external ffi.Pointer max_total_opening_fee_msat; + + external ffi.Pointer max_proportional_opening_fee_ppm_msat; +} + final class wire_cst_payment_preimage extends ffi.Struct { external ffi.Pointer data; } @@ -3410,12 +5078,49 @@ final class wire_cst_payment_secret extends ffi.Struct { external ffi.Pointer data; } -final class wire_cst_payment_details extends ffi.Struct { - external wire_cst_payment_hash hash; +final class wire_cst_PaymentKind_Bolt11 extends ffi.Struct { + external ffi.Pointer hash; external ffi.Pointer preimage; external ffi.Pointer secret; +} + +final class wire_cst_PaymentKind_Bolt11Jit extends ffi.Struct { + external ffi.Pointer hash; + + external ffi.Pointer preimage; + + external ffi.Pointer secret; + + external ffi.Pointer lsp_fee_limits; +} + +final class wire_cst_PaymentKind_Spontaneous extends ffi.Struct { + external ffi.Pointer hash; + + external ffi.Pointer preimage; +} + +final class PaymentKindKind extends ffi.Union { + external wire_cst_PaymentKind_Bolt11 Bolt11; + + external wire_cst_PaymentKind_Bolt11Jit Bolt11Jit; + + external wire_cst_PaymentKind_Spontaneous Spontaneous; +} + +final class wire_cst_payment_kind extends ffi.Struct { + @ffi.Int32() + external int tag; + + external PaymentKindKind kind; +} + +final class wire_cst_payment_details extends ffi.Struct { + external wire_cst_payment_id id; + + external wire_cst_payment_kind kind; external ffi.Pointer amount_msat; @@ -3431,7 +5136,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; @@ -3443,9 +5148,6 @@ 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; @@ -3467,6 +5169,38 @@ 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 { @@ -3476,6 +5210,118 @@ 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; @@ -3498,3 +5344,105 @@ 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 7aa410c..8d37fc4 100644 --- a/lib/src/generated/frb_generated.web.dart +++ b/lib/src/generated/frb_generated.web.dart @@ -19,12 +19,49 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { required super.portManager, }); + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_NodePtr => + wire.rust_arc_decrement_strong_count_RustOpaque_Node; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_NodeBuilderPtr => wire + .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_LdkNodePaymentBolt11PaymentPtr => wire + .rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_LdkNodePaymentOnchainPaymentPtr => wire + .rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment; + CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_NodeSqliteStorePtr => - wire.rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore; + get rust_arc_decrement_strong_count_LdkNodePaymentSpontaneousPaymentPtr => + wire.rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment; + + @protected + NodeBuilder + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + dynamic raw); + + @protected + Node dco_decode_RustOpaque_Node(dynamic raw); + + @protected + NodeBuilder + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + dynamic raw); + + @protected + LdkNodePaymentBolt11Payment + dco_decode_RustOpaque_ldk_nodepaymentBolt11Payment(dynamic raw); + + @protected + LdkNodePaymentOnchainPayment + dco_decode_RustOpaque_ldk_nodepaymentOnchainPayment(dynamic raw); @protected - NodeSqliteStore dco_decode_RustOpaque_NodeSqliteStore(dynamic raw); + LdkNodePaymentSpontaneousPayment + dco_decode_RustOpaque_ldk_nodepaymentSpontaneousPayment(dynamic raw); @protected String dco_decode_String(dynamic raw); @@ -32,6 +69,12 @@ 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); @@ -54,6 +97,9 @@ 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); @@ -66,21 +112,49 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected GossipSourceConfig dco_decode_box_autoadd_gossip_source_config(dynamic raw); + @protected + LdkBolt11Payment dco_decode_box_autoadd_ldk_bolt_11_payment(dynamic raw); + @protected LdkMnemonic dco_decode_box_autoadd_ldk_mnemonic(dynamic raw); @protected LdkNode dco_decode_box_autoadd_ldk_node(dynamic raw); + @protected + LdkOnChainPayment dco_decode_box_autoadd_ldk_on_chain_payment(dynamic raw); + + @protected + LdkSpontaneousPayment dco_decode_box_autoadd_ldk_spontaneous_payment( + dynamic raw); + + @protected + LiquiditySourceConfig dco_decode_box_autoadd_liquidity_source_config( + dynamic raw); + + @protected + LSPFeeLimits dco_decode_box_autoadd_lsp_fee_limits(dynamic raw); + + @protected + MaxDustHTLCExposure dco_decode_box_autoadd_max_dust_htlc_exposure( + dynamic raw); + @protected OutPoint dco_decode_box_autoadd_out_point(dynamic raw); @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); + @protected + PaymentId dco_decode_box_autoadd_payment_id(dynamic raw); + @protected PaymentPreimage dco_decode_box_autoadd_payment_preimage(dynamic raw); @@ -93,6 +167,12 @@ 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); @@ -117,6 +197,9 @@ 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); @@ -132,21 +215,42 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected int dco_decode_i_32(dynamic raw); + @protected + LdkBolt11Payment dco_decode_ldk_bolt_11_payment(dynamic raw); + @protected LdkMnemonic dco_decode_ldk_mnemonic(dynamic raw); @protected LdkNode dco_decode_ldk_node(dynamic raw); + @protected + LdkOnChainPayment dco_decode_ldk_on_chain_payment(dynamic raw); + + @protected + LdkSpontaneousPayment dco_decode_ldk_spontaneous_payment(dynamic raw); + + @protected + LightningBalance dco_decode_lightning_balance(dynamic raw); + + @protected + LiquiditySourceConfig dco_decode_liquidity_source_config(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); @@ -162,6 +266,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected LogLevel dco_decode_log_level(dynamic raw); + @protected + LSPFeeLimits dco_decode_lsp_fee_limits(dynamic raw); + @protected MaxDustHTLCExposure dco_decode_max_dust_htlc_exposure(dynamic raw); @@ -171,6 +278,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected NodeException dco_decode_node_exception(dynamic raw); + @protected + NodeStatus dco_decode_node_status(dynamic raw); + @protected String? dco_decode_opt_String(dynamic raw); @@ -181,6 +291,12 @@ 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); @@ -192,9 +308,27 @@ 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 + PaymentId? dco_decode_opt_box_autoadd_payment_id(dynamic raw); + @protected PaymentPreimage? dco_decode_opt_box_autoadd_payment_preimage(dynamic raw); @@ -204,6 +338,9 @@ 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); @@ -222,9 +359,18 @@ 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); + @protected + PaymentId dco_decode_payment_id(dynamic raw); + + @protected + PaymentKind dco_decode_payment_kind(dynamic raw); + @protected PaymentPreimage dco_decode_payment_preimage(dynamic raw); @@ -237,9 +383,16 @@ 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); @@ -283,8 +436,32 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { int dco_decode_usize(dynamic raw); @protected - NodeSqliteStore sse_decode_RustOpaque_NodeSqliteStore( - SseDeserializer deserializer); + NodeBuilder + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + SseDeserializer deserializer); + + @protected + Node sse_decode_RustOpaque_Node(SseDeserializer deserializer); + + @protected + NodeBuilder + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + SseDeserializer deserializer); + + @protected + LdkNodePaymentBolt11Payment + sse_decode_RustOpaque_ldk_nodepaymentBolt11Payment( + SseDeserializer deserializer); + + @protected + LdkNodePaymentOnchainPayment + sse_decode_RustOpaque_ldk_nodepaymentOnchainPayment( + SseDeserializer deserializer); + + @protected + LdkNodePaymentSpontaneousPayment + sse_decode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + SseDeserializer deserializer); @protected String sse_decode_String(SseDeserializer deserializer); @@ -292,6 +469,12 @@ 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); @@ -316,6 +499,10 @@ 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); @@ -330,12 +517,36 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { GossipSourceConfig sse_decode_box_autoadd_gossip_source_config( SseDeserializer deserializer); + @protected + LdkBolt11Payment sse_decode_box_autoadd_ldk_bolt_11_payment( + SseDeserializer deserializer); + @protected LdkMnemonic sse_decode_box_autoadd_ldk_mnemonic(SseDeserializer deserializer); @protected LdkNode sse_decode_box_autoadd_ldk_node(SseDeserializer deserializer); + @protected + LdkOnChainPayment sse_decode_box_autoadd_ldk_on_chain_payment( + SseDeserializer deserializer); + + @protected + LdkSpontaneousPayment sse_decode_box_autoadd_ldk_spontaneous_payment( + SseDeserializer deserializer); + + @protected + LiquiditySourceConfig sse_decode_box_autoadd_liquidity_source_config( + SseDeserializer deserializer); + + @protected + LSPFeeLimits sse_decode_box_autoadd_lsp_fee_limits( + SseDeserializer deserializer); + + @protected + MaxDustHTLCExposure sse_decode_box_autoadd_max_dust_htlc_exposure( + SseDeserializer deserializer); + @protected OutPoint sse_decode_box_autoadd_out_point(SseDeserializer deserializer); @@ -343,9 +554,16 @@ 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); + @protected + PaymentId sse_decode_box_autoadd_payment_id(SseDeserializer deserializer); + @protected PaymentPreimage sse_decode_box_autoadd_payment_preimage( SseDeserializer deserializer); @@ -361,6 +579,12 @@ 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); @@ -387,6 +611,9 @@ 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); @@ -404,16 +631,38 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected int sse_decode_i_32(SseDeserializer deserializer); + @protected + LdkBolt11Payment sse_decode_ldk_bolt_11_payment(SseDeserializer deserializer); + @protected LdkMnemonic sse_decode_ldk_mnemonic(SseDeserializer deserializer); @protected LdkNode sse_decode_ldk_node(SseDeserializer deserializer); + @protected + LdkOnChainPayment sse_decode_ldk_on_chain_payment( + SseDeserializer deserializer); + + @protected + LdkSpontaneousPayment sse_decode_ldk_spontaneous_payment( + SseDeserializer deserializer); + + @protected + LightningBalance sse_decode_lightning_balance(SseDeserializer deserializer); + + @protected + LiquiditySourceConfig sse_decode_liquidity_source_config( + 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); @@ -421,6 +670,10 @@ 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); @@ -437,6 +690,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected LogLevel sse_decode_log_level(SseDeserializer deserializer); + @protected + LSPFeeLimits sse_decode_lsp_fee_limits(SseDeserializer deserializer); + @protected MaxDustHTLCExposure sse_decode_max_dust_htlc_exposure( SseDeserializer deserializer); @@ -447,6 +703,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected NodeException sse_decode_node_exception(SseDeserializer deserializer); + @protected + NodeStatus sse_decode_node_status(SseDeserializer deserializer); + @protected String? sse_decode_opt_String(SseDeserializer deserializer); @@ -458,6 +717,14 @@ 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); @@ -469,10 +736,29 @@ 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 + PaymentId? sse_decode_opt_box_autoadd_payment_id( + SseDeserializer deserializer); + @protected PaymentPreimage? sse_decode_opt_box_autoadd_payment_preimage( SseDeserializer deserializer); @@ -485,6 +771,9 @@ 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); @@ -504,9 +793,19 @@ 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); + @protected + PaymentId sse_decode_payment_id(SseDeserializer deserializer); + + @protected + PaymentKind sse_decode_payment_kind(SseDeserializer deserializer); + @protected PaymentPreimage sse_decode_payment_preimage(SseDeserializer deserializer); @@ -519,9 +818,18 @@ 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); @@ -576,6 +884,25 @@ 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 @@ -613,6 +940,12 @@ 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 @@ -639,6 +972,13 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return cst_encode_gossip_source_config(raw); } + @protected + List cst_encode_box_autoadd_ldk_bolt_11_payment( + LdkBolt11Payment raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return cst_encode_ldk_bolt_11_payment(raw); + } + @protected List cst_encode_box_autoadd_ldk_mnemonic(LdkMnemonic raw) { // Codec=Cst (C-struct based), see doc to use other codecs @@ -651,6 +991,40 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return cst_encode_ldk_node(raw); } + @protected + List cst_encode_box_autoadd_ldk_on_chain_payment( + LdkOnChainPayment raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return cst_encode_ldk_on_chain_payment(raw); + } + + @protected + List cst_encode_box_autoadd_ldk_spontaneous_payment( + LdkSpontaneousPayment raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return cst_encode_ldk_spontaneous_payment(raw); + } + + @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_lsp_fee_limits(LSPFeeLimits raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return cst_encode_lsp_fee_limits(raw); + } + + @protected + List cst_encode_box_autoadd_max_dust_htlc_exposure( + MaxDustHTLCExposure raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return cst_encode_max_dust_htlc_exposure(raw); + } + @protected List cst_encode_box_autoadd_out_point(OutPoint raw) { // Codec=Cst (C-struct based), see doc to use other codecs @@ -663,12 +1037,24 @@ 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 return cst_encode_payment_hash(raw); } + @protected + List cst_encode_box_autoadd_payment_id(PaymentId raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return cst_encode_payment_id(raw); + } + @protected List cst_encode_box_autoadd_payment_preimage(PaymentPreimage raw) { // Codec=Cst (C-struct based), see doc to use other codecs @@ -693,6 +1079,18 @@ 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 @@ -728,7 +1126,8 @@ 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_max_dust_htlc_exposure(raw.maxDustHtlcExposure), + cst_encode_opt_box_autoadd_max_dust_htlc_exposure( + raw.maxDustHtlcExposure), cst_encode_u_64(raw.forceCloseAvoidanceMaxFeeSatoshis), cst_encode_bool(raw.acceptUnderpayingHtlcs) ]; @@ -740,12 +1139,11 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return [ cst_encode_channel_id(raw.channelId), cst_encode_public_key(raw.counterpartyNodeId), - cst_encode_opt_String(raw.fundingTxo), + cst_encode_opt_box_autoadd_out_point(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), @@ -753,7 +1151,23 @@ 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_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) ]; } @@ -764,9 +1178,55 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { } @protected - List cst_encode_config(Config raw) { + List cst_encode_closure_reason(ClosureReason raw) { // Codec=Cst (C-struct based), see doc to use other codecs - return [ + if (raw is ClosureReason_CounterpartyForceClosed) { + return [0, cst_encode_String(raw.peerMsg)]; + } + if (raw is ClosureReason_HolderForceClosed) { + return [1]; + } + if (raw is ClosureReason_LegacyCooperativeClosure) { + return [2]; + } + if (raw is ClosureReason_CounterpartyInitiatedCooperativeClosure) { + return [3]; + } + if (raw is ClosureReason_LocallyInitiatedCooperativeClosure) { + return [4]; + } + if (raw is ClosureReason_CommitmentTxConfirmed) { + return [5]; + } + if (raw is ClosureReason_FundingTimedOut) { + return [6]; + } + if (raw is ClosureReason_ProcessingError) { + return [7, cst_encode_String(raw.err)]; + } + if (raw is ClosureReason_DisconnectedPeer) { + return [8]; + } + if (raw is ClosureReason_OutdatedChannelManager) { + return [9]; + } + if (raw is ClosureReason_CounterpartyCoopClosedUnfundedChannel) { + return [10]; + } + if (raw is ClosureReason_FundingBatchClosure) { + return [11]; + } + if (raw is ClosureReason_HTLCsTimedOut) { + return [12]; + } + + throw Exception('unreachable'); + } + + @protected + List cst_encode_config(Config raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return [ cst_encode_String(raw.storageDirPath), cst_encode_opt_String(raw.logDirPath), cst_encode_network(raw.network), @@ -805,27 +1265,40 @@ 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)]; + return [ + 0, + cst_encode_opt_box_autoadd_payment_id(raw.paymentId), + cst_encode_box_autoadd_payment_hash(raw.paymentHash), + cst_encode_opt_box_autoadd_u_64(raw.feePaidMsat) + ]; } if (raw is Event_PaymentFailed) { - return [1, cst_encode_box_autoadd_payment_hash(raw.paymentHash)]; + return [ + 1, + cst_encode_opt_box_autoadd_payment_id(raw.paymentId), + cst_encode_box_autoadd_payment_hash(raw.paymentHash), + cst_encode_opt_box_autoadd_payment_failure_reason(raw.reason) + ]; } if (raw is Event_PaymentReceived) { return [ 2, + cst_encode_opt_box_autoadd_payment_id(raw.paymentId), cst_encode_box_autoadd_payment_hash(raw.paymentHash), cst_encode_u_64(raw.amountMsat) ]; } - if (raw is Event_ChannelReady) { + if (raw is Event_ChannelPending) { return [ 3, 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_box_autoadd_channel_id(raw.formerTemporaryChannelId), + cst_encode_box_autoadd_public_key(raw.counterpartyNodeId), + cst_encode_box_autoadd_out_point(raw.fundingTxo) ]; } - if (raw is Event_ChannelClosed) { + if (raw is Event_ChannelReady) { return [ 4, cst_encode_box_autoadd_channel_id(raw.channelId), @@ -833,14 +1306,13 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { cst_encode_opt_box_autoadd_public_key(raw.counterpartyNodeId) ]; } - if (raw is Event_ChannelPending) { + if (raw is Event_ChannelClosed) { return [ 5, 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), + cst_encode_opt_box_autoadd_closure_reason(raw.reason) ]; } @@ -860,6 +1332,12 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { throw Exception('unreachable'); } + @protected + List cst_encode_ldk_bolt_11_payment(LdkBolt11Payment raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return [cst_encode_RustOpaque_ldk_nodepaymentBolt11Payment(raw.ptr)]; + } + @protected List cst_encode_ldk_mnemonic(LdkMnemonic raw) { // Codec=Cst (C-struct based), see doc to use other codecs @@ -869,7 +1347,90 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected List cst_encode_ldk_node(LdkNode raw) { // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_RustOpaque_NodeSqliteStore(raw.ptr)]; + return [cst_encode_RustOpaque_Node(raw.ptr)]; + } + + @protected + List cst_encode_ldk_on_chain_payment(LdkOnChainPayment raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return [cst_encode_RustOpaque_ldk_nodepaymentOnchainPayment(raw.ptr)]; + } + + @protected + List cst_encode_ldk_spontaneous_payment(LdkSpontaneousPayment raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return [cst_encode_RustOpaque_ldk_nodepaymentSpontaneousPayment(raw.ptr)]; + } + + @protected + List cst_encode_lightning_balance(LightningBalance 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'); + } + + @protected + List cst_encode_liquidity_source_config(LiquiditySourceConfig raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return [ + cst_encode_record_socket_address_public_key_opt_string(raw.lsps2Service) + ]; } @protected @@ -878,6 +1439,12 @@ 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 @@ -890,6 +1457,13 @@ 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 @@ -914,6 +1488,15 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return raw.map(cst_encode_socket_address).toList(); } + @protected + List cst_encode_lsp_fee_limits(LSPFeeLimits raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return [ + cst_encode_opt_box_autoadd_u_64(raw.maxTotalOpeningFeeMsat), + cst_encode_opt_box_autoadd_u_64(raw.maxProportionalOpeningFeePpmMsat) + ]; + } + @protected List cst_encode_max_dust_htlc_exposure(MaxDustHTLCExposure raw) { // Codec=Cst (C-struct based), see doc to use other codecs @@ -927,6 +1510,22 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { throw Exception('unreachable'); } + @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 @@ -948,6 +1547,18 @@ 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) { @@ -972,6 +1583,30 @@ 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) { @@ -979,6 +1614,21 @@ 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_id(PaymentId? raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw == null ? null : cst_encode_box_autoadd_payment_id(raw); + } + @protected List? cst_encode_opt_box_autoadd_payment_preimage( PaymentPreimage? raw) { @@ -998,6 +1648,12 @@ 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 @@ -1026,9 +1682,8 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { List cst_encode_payment_details(PaymentDetails raw) { // Codec=Cst (C-struct based), see doc to use other codecs return [ - cst_encode_payment_hash(raw.hash), - cst_encode_opt_box_autoadd_payment_preimage(raw.preimage), - cst_encode_opt_box_autoadd_payment_secret(raw.secret), + cst_encode_payment_id(raw.id), + cst_encode_payment_kind(raw.kind), cst_encode_opt_box_autoadd_u_64(raw.amountMsat), cst_encode_payment_direction(raw.direction), cst_encode_payment_status(raw.status) @@ -1041,6 +1696,46 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return [cst_encode_u_8_array_32(raw.data)]; } + @protected + List cst_encode_payment_id(PaymentId raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return [cst_encode_u_8_array_32(raw.field0)]; + } + + @protected + List cst_encode_payment_kind(PaymentKind raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + if (raw is PaymentKind_Onchain) { + return [0]; + } + if (raw is PaymentKind_Bolt11) { + return [ + 1, + cst_encode_box_autoadd_payment_hash(raw.hash), + cst_encode_opt_box_autoadd_payment_preimage(raw.preimage), + cst_encode_opt_box_autoadd_payment_secret(raw.secret) + ]; + } + if (raw is PaymentKind_Bolt11Jit) { + return [ + 2, + cst_encode_box_autoadd_payment_hash(raw.hash), + cst_encode_opt_box_autoadd_payment_preimage(raw.preimage), + cst_encode_opt_box_autoadd_payment_secret(raw.secret), + cst_encode_box_autoadd_lsp_fee_limits(raw.lspFeeLimits) + ]; + } + if (raw is PaymentKind_Spontaneous) { + return [ + 3, + cst_encode_box_autoadd_payment_hash(raw.hash), + cst_encode_opt_box_autoadd_payment_preimage(raw.preimage) + ]; + } + + throw Exception('unreachable'); + } + @protected List cst_encode_payment_preimage(PaymentPreimage raw) { // Codec=Cst (C-struct based), see doc to use other codecs @@ -1063,12 +1758,56 @@ 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.hex)]; } + @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) + ]; + } + @protected List cst_encode_socket_address(SocketAddress raw) { // Codec=Cst (C-struct based), see doc to use other codecs @@ -1142,11 +1881,31 @@ 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_u_64(raw.data)]; + return [cst_encode_list_prim_u_8_strict(raw.data)]; } @protected - int cst_encode_RustOpaque_NodeSqliteStore(NodeSqliteStore raw); + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + NodeBuilder raw); + + @protected + int cst_encode_RustOpaque_Node(Node raw); + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + NodeBuilder raw); + + @protected + int cst_encode_RustOpaque_ldk_nodepaymentBolt11Payment( + LdkNodePaymentBolt11Payment raw); + + @protected + int cst_encode_RustOpaque_ldk_nodepaymentOnchainPayment( + LdkNodePaymentOnchainPayment raw); + + @protected + int cst_encode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + LdkNodePaymentSpontaneousPayment raw); @protected bool cst_encode_bool(bool raw); @@ -1169,6 +1928,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @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); @@ -1188,8 +1950,29 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { int cst_encode_usize(int raw); @protected - void sse_encode_RustOpaque_NodeSqliteStore( - NodeSqliteStore self, SseSerializer serializer); + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + NodeBuilder self, SseSerializer serializer); + + @protected + void sse_encode_RustOpaque_Node(Node self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + NodeBuilder self, SseSerializer serializer); + + @protected + void sse_encode_RustOpaque_ldk_nodepaymentBolt11Payment( + LdkNodePaymentBolt11Payment self, SseSerializer serializer); + + @protected + void sse_encode_RustOpaque_ldk_nodepaymentOnchainPayment( + LdkNodePaymentOnchainPayment self, SseSerializer serializer); + + @protected + void sse_encode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + LdkNodePaymentSpontaneousPayment self, SseSerializer serializer); @protected void sse_encode_String(String self, SseSerializer serializer); @@ -1197,6 +1980,13 @@ 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); @@ -1222,6 +2012,10 @@ 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); @@ -1236,6 +2030,10 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_box_autoadd_gossip_source_config( GossipSourceConfig self, SseSerializer serializer); + @protected + void sse_encode_box_autoadd_ldk_bolt_11_payment( + LdkBolt11Payment self, SseSerializer serializer); + @protected void sse_encode_box_autoadd_ldk_mnemonic( LdkMnemonic self, SseSerializer serializer); @@ -1243,6 +2041,26 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected void sse_encode_box_autoadd_ldk_node(LdkNode self, SseSerializer serializer); + @protected + void sse_encode_box_autoadd_ldk_on_chain_payment( + LdkOnChainPayment self, SseSerializer serializer); + + @protected + void sse_encode_box_autoadd_ldk_spontaneous_payment( + LdkSpontaneousPayment self, SseSerializer serializer); + + @protected + void sse_encode_box_autoadd_liquidity_source_config( + LiquiditySourceConfig self, SseSerializer serializer); + + @protected + void sse_encode_box_autoadd_lsp_fee_limits( + LSPFeeLimits self, SseSerializer serializer); + + @protected + void sse_encode_box_autoadd_max_dust_htlc_exposure( + MaxDustHTLCExposure self, SseSerializer serializer); + @protected void sse_encode_box_autoadd_out_point( OutPoint self, SseSerializer serializer); @@ -1251,10 +2069,18 @@ 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); + @protected + void sse_encode_box_autoadd_payment_id( + PaymentId self, SseSerializer serializer); + @protected void sse_encode_box_autoadd_payment_preimage( PaymentPreimage self, SseSerializer serializer); @@ -1271,6 +2097,12 @@ 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); @@ -1299,6 +2131,9 @@ 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); @@ -1316,16 +2151,40 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected void sse_encode_i_32(int self, SseSerializer serializer); + @protected + void sse_encode_ldk_bolt_11_payment( + LdkBolt11Payment self, SseSerializer serializer); + @protected void sse_encode_ldk_mnemonic(LdkMnemonic self, SseSerializer serializer); @protected void sse_encode_ldk_node(LdkNode self, SseSerializer serializer); + @protected + void sse_encode_ldk_on_chain_payment( + LdkOnChainPayment self, SseSerializer serializer); + + @protected + void sse_encode_ldk_spontaneous_payment( + LdkSpontaneousPayment self, SseSerializer serializer); + + @protected + void sse_encode_lightning_balance( + LightningBalance self, SseSerializer serializer); + + @protected + void sse_encode_liquidity_source_config( + LiquiditySourceConfig 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); @@ -1334,6 +2193,10 @@ 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); @@ -1352,6 +2215,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected void sse_encode_log_level(LogLevel self, SseSerializer serializer); + @protected + void sse_encode_lsp_fee_limits(LSPFeeLimits self, SseSerializer serializer); + @protected void sse_encode_max_dust_htlc_exposure( MaxDustHTLCExposure self, SseSerializer serializer); @@ -1362,6 +2228,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected void sse_encode_node_exception(NodeException self, SseSerializer serializer); + @protected + void sse_encode_node_status(NodeStatus self, SseSerializer serializer); + @protected void sse_encode_opt_String(String? self, SseSerializer serializer); @@ -1373,6 +2242,14 @@ 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); @@ -1384,10 +2261,30 @@ 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_id( + PaymentId? self, SseSerializer serializer); + @protected void sse_encode_opt_box_autoadd_payment_preimage( PaymentPreimage? self, SseSerializer serializer); @@ -1400,6 +2297,9 @@ 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); @@ -1421,9 +2321,19 @@ 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); + @protected + void sse_encode_payment_id(PaymentId self, SseSerializer serializer); + + @protected + void sse_encode_payment_kind(PaymentKind self, SseSerializer serializer); + @protected void sse_encode_payment_preimage( PaymentPreimage self, SseSerializer serializer); @@ -1437,9 +2347,17 @@ 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); @@ -1488,26 +2406,97 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { class LdkCoreWire implements BaseWire { LdkCoreWire.fromExternalLibrary(ExternalLibrary lib); - void wire_build_with_sqlite_store( + void wire_NodeBuilder_build(NativePortType port_, Object that) => + wasmModule.wire_NodeBuilder_build(port_, that); + + void wire_NodeBuilder_build_with_fs_store( + NativePortType port_, Object that) => + wasmModule.wire_NodeBuilder_build_with_fs_store(port_, that); + + void wire_NodeBuilder_create_builder( NativePortType port_, List config, List? chain_data_source_config, List? entropy_source_config, - List? gossip_source_config) => - wasmModule.wire_build_with_sqlite_store( + List? gossip_source_config, + List? liquidity_source_config) => + wasmModule.wire_NodeBuilder_create_builder( port_, config, chain_data_source_config, entropy_source_config, - gossip_source_config); + gossip_source_config, + liquidity_source_config); + + void wire_ldk_bolt_11_payment_receive( + NativePortType port_, + List that, + Object amount_msat, + String description, + int expiry_secs) => + wasmModule.wire_ldk_bolt_11_payment_receive( + port_, that, amount_msat, description, expiry_secs); + + void wire_ldk_bolt_11_payment_receive_variable_amount(NativePortType port_, + List that, String description, int expiry_secs) => + wasmModule.wire_ldk_bolt_11_payment_receive_variable_amount( + port_, that, description, expiry_secs); + + void wire_ldk_bolt_11_payment_receive_variable_amount_via_jit_channel( + NativePortType port_, + List that, + String description, + int expiry_secs, + Object? max_proportional_lsp_fee_limit_ppm_msat) => + wasmModule + .wire_ldk_bolt_11_payment_receive_variable_amount_via_jit_channel( + port_, + that, + description, + expiry_secs, + max_proportional_lsp_fee_limit_ppm_msat); + + void wire_ldk_bolt_11_payment_receive_via_jit_channel( + NativePortType port_, + List that, + Object amount_msat, + String description, + int expiry_secs, + Object? max_total_lsp_fee_limit_msat) => + wasmModule.wire_ldk_bolt_11_payment_receive_via_jit_channel(port_, that, + amount_msat, description, expiry_secs, max_total_lsp_fee_limit_msat); + + void wire_ldk_bolt_11_payment_send( + NativePortType port_, List that, List invoice) => + wasmModule.wire_ldk_bolt_11_payment_send(port_, that, invoice); + + void wire_ldk_bolt_11_payment_send_probes( + NativePortType port_, List that, List invoice) => + wasmModule.wire_ldk_bolt_11_payment_send_probes(port_, that, invoice); + + void wire_ldk_bolt_11_payment_send_probes_using_amount(NativePortType port_, + List that, List invoice, Object amount_msat) => + wasmModule.wire_ldk_bolt_11_payment_send_probes_using_amount( + port_, that, invoice, amount_msat); + + void wire_ldk_bolt_11_payment_send_using_amount(NativePortType port_, + List that, List invoice, Object amount_msat) => + wasmModule.wire_ldk_bolt_11_payment_send_using_amount( + port_, that, invoice, amount_msat); void wire_ldk_mnemonic_generate(NativePortType port_) => wasmModule.wire_ldk_mnemonic_generate(port_); + void wire_ldk_node_bolt11_payment(NativePortType port_, List ptr) => + wasmModule.wire_ldk_node_bolt11_payment(port_, ptr); + void wire_ldk_node_close_channel(NativePortType port_, List that, - List channel_id, List counterparty_node_id) => + List user_channel_id, List counterparty_node_id) => wasmModule.wire_ldk_node_close_channel( - port_, that, channel_id, counterparty_node_id); + port_, that, user_channel_id, counterparty_node_id); + + void wire_ldk_node_config(NativePortType port_, List that) => + wasmModule.wire_ldk_node_config(port_, that); void wire_ldk_node_connect(NativePortType port_, List that, List node_id, List address, bool persist) => @@ -1539,8 +2528,8 @@ class LdkCoreWire implements BaseWire { void wire_ldk_node_event_handled(NativePortType port_, List that) => wasmModule.wire_ldk_node_event_handled(port_, that); - void wire_ldk_node_is_running(NativePortType port_, List that) => - wasmModule.wire_ldk_node_is_running(port_, that); + void wire_ldk_node_list_balances(NativePortType port_, List that) => + wasmModule.wire_ldk_node_list_balances(port_, that); void wire_ldk_node_list_channels(NativePortType port_, List that) => wasmModule.wire_ldk_node_list_channels(port_, that); @@ -1560,126 +2549,143 @@ class LdkCoreWire implements BaseWire { NativePortType port_, List that) => wasmModule.wire_ldk_node_listening_addresses(port_, that); - void wire_ldk_node_new_onchain_address( - NativePortType port_, List that) => - wasmModule.wire_ldk_node_new_onchain_address(port_, that); - void wire_ldk_node_next_event(NativePortType port_, List that) => wasmModule.wire_ldk_node_next_event(port_, that); + void wire_ldk_node_next_event_async( + NativePortType port_, List that) => + wasmModule.wire_ldk_node_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_ldk_node_payment(NativePortType port_, List that, - List payment_hash) => - wasmModule.wire_ldk_node_payment(port_, that, payment_hash); + void wire_ldk_node_on_chain_payment( + NativePortType port_, List ptr) => + wasmModule.wire_ldk_node_on_chain_payment(port_, ptr); - void wire_ldk_node_receive_payment(NativePortType port_, List that, - Object amount_msat, String description, int expiry_secs) => - wasmModule.wire_ldk_node_receive_payment( - port_, that, amount_msat, description, expiry_secs); + void wire_ldk_node_payment( + NativePortType port_, List that, List payment_id) => + wasmModule.wire_ldk_node_payment(port_, that, payment_id); - void wire_ldk_node_receive_variable_amount_payment(NativePortType port_, - List that, String description, int expiry_secs) => - wasmModule.wire_ldk_node_receive_variable_amount_payment( - port_, that, description, expiry_secs); - - void wire_ldk_node_remove_payment(NativePortType port_, List that, - List payment_hash) => - wasmModule.wire_ldk_node_remove_payment(port_, that, payment_hash); - - void wire_ldk_node_send_all_to_onchain_address( - NativePortType port_, List that, List address) => - wasmModule.wire_ldk_node_send_all_to_onchain_address( - port_, that, address); - - void wire_ldk_node_send_payment( - NativePortType port_, List that, List invoice) => - wasmModule.wire_ldk_node_send_payment(port_, that, invoice); - - void wire_ldk_node_send_payment_probes( - NativePortType port_, List that, List invoice) => - wasmModule.wire_ldk_node_send_payment_probes(port_, that, invoice); - - void wire_ldk_node_send_payment_probes_using_amount(NativePortType port_, - List that, List invoice, Object amount_msat) => - wasmModule.wire_ldk_node_send_payment_probes_using_amount( - port_, that, invoice, amount_msat); - - void wire_ldk_node_send_payment_using_amount(NativePortType port_, - List that, List invoice, Object amount_msat) => - wasmModule.wire_ldk_node_send_payment_using_amount( - port_, that, invoice, amount_msat); - - void wire_ldk_node_send_spontaneous_payment(NativePortType port_, - List that, Object amount_msat, List node_id) => - wasmModule.wire_ldk_node_send_spontaneous_payment( - port_, that, amount_msat, node_id); - - void wire_ldk_node_send_spontaneous_payment_probes(NativePortType port_, - List that, Object amount_msat, List node_id) => - wasmModule.wire_ldk_node_send_spontaneous_payment_probes( - port_, that, amount_msat, node_id); - - void wire_ldk_node_send_to_onchain_address(NativePortType port_, - List that, List address, Object amount_sats) => - wasmModule.wire_ldk_node_send_to_onchain_address( - port_, that, address, amount_sats); + void wire_ldk_node_remove_payment( + NativePortType port_, List that, List payment_id) => + wasmModule.wire_ldk_node_remove_payment(port_, that, payment_id); void wire_ldk_node_sign_message( NativePortType port_, List that, List 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_ldk_node_spontaneous_payment( + NativePortType port_, List ptr) => + wasmModule.wire_ldk_node_spontaneous_payment(port_, ptr); void wire_ldk_node_start(NativePortType port_, List that) => wasmModule.wire_ldk_node_start(port_, that); + void wire_ldk_node_status(NativePortType port_, List that) => + wasmModule.wire_ldk_node_status(port_, that); + void wire_ldk_node_stop(NativePortType port_, List that) => wasmModule.wire_ldk_node_stop(port_, that); void wire_ldk_node_sync_wallets(NativePortType port_, List that) => wasmModule.wire_ldk_node_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_ldk_node_update_channel_config( NativePortType port_, List that, - List channel_id, + List user_channel_id, List counterparty_node_id, List channel_config) => wasmModule.wire_ldk_node_update_channel_config( - port_, that, channel_id, counterparty_node_id, channel_config); + port_, that, user_channel_id, counterparty_node_id, channel_config); void wire_ldk_node_verify_signature(NativePortType port_, List that, - List msg, String sig, List pkey) => - wasmModule.wire_ldk_node_verify_signature(port_, that, msg, sig, pkey); + List msg, String sig, List public_key) => + wasmModule.wire_ldk_node_verify_signature( + port_, that, msg, sig, public_key); void wire_ldk_node_wait_next_event( NativePortType port_, List that) => wasmModule.wire_ldk_node_wait_next_event(port_, that); - void wire_socket_address_as_string( + void wire_ldk_on_chain_payment_new_address( NativePortType port_, List that) => - wasmModule.wire_socket_address_as_string(port_, that); + wasmModule.wire_ldk_on_chain_payment_new_address(port_, that); - void wire_socket_address_from_str(NativePortType port_, String address) => - wasmModule.wire_socket_address_from_str(port_, address); + void wire_ldk_on_chain_payment_send_all_to_address( + NativePortType port_, List that, List address) => + wasmModule.wire_ldk_on_chain_payment_send_all_to_address( + port_, that, address); + + void wire_ldk_on_chain_payment_send_to_address(NativePortType port_, + List that, List address, Object amount_sats) => + wasmModule.wire_ldk_on_chain_payment_send_to_address( + port_, that, address, amount_sats); + + void wire_ldk_spontaneous_payment_send(NativePortType port_, + List that, Object amount_msat, List node_id) => + wasmModule.wire_ldk_spontaneous_payment_send( + port_, that, amount_msat, node_id); + + void wire_ldk_spontaneous_payment_send_probes(NativePortType port_, + List that, Object amount_msat, List node_id) => + wasmModule.wire_ldk_spontaneous_payment_send_probes( + port_, that, amount_msat, node_id); + + void rust_arc_increment_strong_count_RustOpaque_Node(dynamic ptr) => + wasmModule.rust_arc_increment_strong_count_RustOpaque_Node(ptr); + + void rust_arc_decrement_strong_count_RustOpaque_Node(dynamic ptr) => + wasmModule.rust_arc_decrement_strong_count_RustOpaque_Node(ptr); + + void rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + dynamic ptr) => + wasmModule + .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + ptr); + + void rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + dynamic ptr) => + wasmModule + .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + ptr); + + void rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( + dynamic ptr) => + wasmModule + .rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( + ptr); + + void rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( + dynamic ptr) => + wasmModule + .rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( + ptr); + + void rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( + dynamic ptr) => + wasmModule + .rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( + ptr); + + void rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( + dynamic ptr) => + wasmModule + .rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( + ptr); - void rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore( + void rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( dynamic ptr) => wasmModule - .rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore(ptr); + .rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( + ptr); - void rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore( + void rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( dynamic ptr) => wasmModule - .rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore(ptr); + .rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( + ptr); } @JS('wasm_bindgen') @@ -1694,21 +2700,76 @@ class LdkCoreWasmModule implements WasmModule { @override external LdkCoreWasmModule bind(dynamic thisArg, String moduleName); - external void wire_build_with_sqlite_store( + external void wire_NodeBuilder_build(NativePortType port_, Object that); + + external void wire_NodeBuilder_build_with_fs_store( + NativePortType port_, Object that); + + external void wire_NodeBuilder_create_builder( NativePortType port_, List config, List? chain_data_source_config, List? entropy_source_config, - List? gossip_source_config); + List? gossip_source_config, + List? liquidity_source_config); + + external void wire_ldk_bolt_11_payment_receive( + NativePortType port_, + List that, + Object amount_msat, + String description, + int expiry_secs); + + external void wire_ldk_bolt_11_payment_receive_variable_amount( + NativePortType port_, + List that, + String description, + int expiry_secs); + + external void + wire_ldk_bolt_11_payment_receive_variable_amount_via_jit_channel( + NativePortType port_, + List that, + String description, + int expiry_secs, + Object? max_proportional_lsp_fee_limit_ppm_msat); + + external void wire_ldk_bolt_11_payment_receive_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_ldk_bolt_11_payment_send( + NativePortType port_, List that, List invoice); + + external void wire_ldk_bolt_11_payment_send_probes( + NativePortType port_, List that, List invoice); + + external void wire_ldk_bolt_11_payment_send_probes_using_amount( + NativePortType port_, + List that, + List invoice, + Object amount_msat); + + external void wire_ldk_bolt_11_payment_send_using_amount(NativePortType port_, + List that, List invoice, Object amount_msat); external void wire_ldk_mnemonic_generate(NativePortType port_); + external void wire_ldk_node_bolt11_payment( + NativePortType port_, List ptr); + external void wire_ldk_node_close_channel( NativePortType port_, List that, - List channel_id, + List user_channel_id, List counterparty_node_id); + external void wire_ldk_node_config(NativePortType port_, List that); + external void wire_ldk_node_connect(NativePortType port_, List that, List node_id, List address, bool persist); @@ -1728,7 +2789,7 @@ class LdkCoreWasmModule implements WasmModule { external void wire_ldk_node_event_handled( NativePortType port_, List that); - external void wire_ldk_node_is_running( + external void wire_ldk_node_list_balances( NativePortType port_, List that); external void wire_ldk_node_list_channels( @@ -1746,101 +2807,99 @@ class LdkCoreWasmModule implements WasmModule { external void wire_ldk_node_listening_addresses( NativePortType port_, List that); - external void wire_ldk_node_new_onchain_address( + external void wire_ldk_node_next_event( NativePortType port_, List that); - external void wire_ldk_node_next_event( + external void wire_ldk_node_next_event_async( NativePortType port_, List that); external void wire_ldk_node_node_id(NativePortType port_, List that); - external void wire_ldk_node_payment( - NativePortType port_, List that, List payment_hash); + external void wire_ldk_node_on_chain_payment( + NativePortType port_, List ptr); - external void wire_ldk_node_receive_payment( - NativePortType port_, - List that, - Object amount_msat, - String description, - int expiry_secs); - - external void wire_ldk_node_receive_variable_amount_payment( - NativePortType port_, - List that, - String description, - int expiry_secs); + external void wire_ldk_node_payment( + NativePortType port_, List that, List payment_id); external void wire_ldk_node_remove_payment( - NativePortType port_, List that, List payment_hash); - - external void wire_ldk_node_send_all_to_onchain_address( - NativePortType port_, List that, List address); - - external void wire_ldk_node_send_payment( - NativePortType port_, List that, List invoice); - - external void wire_ldk_node_send_payment_probes( - NativePortType port_, List that, List invoice); - - external void wire_ldk_node_send_payment_probes_using_amount( - NativePortType port_, - List that, - List invoice, - Object amount_msat); - - external void wire_ldk_node_send_payment_using_amount(NativePortType port_, - List that, List invoice, Object amount_msat); - - external void wire_ldk_node_send_spontaneous_payment(NativePortType port_, - List that, Object amount_msat, List node_id); - - external void wire_ldk_node_send_spontaneous_payment_probes( - NativePortType port_, - List that, - Object amount_msat, - List node_id); - - external void wire_ldk_node_send_to_onchain_address(NativePortType port_, - List that, List address, Object amount_sats); + NativePortType port_, List that, List payment_id); external void wire_ldk_node_sign_message( NativePortType port_, List that, List msg); - external void wire_ldk_node_spendable_onchain_balance_sats( - NativePortType port_, List that); + external void wire_ldk_node_spontaneous_payment( + NativePortType port_, List ptr); external void wire_ldk_node_start(NativePortType port_, List that); + external void wire_ldk_node_status(NativePortType port_, List that); + external void wire_ldk_node_stop(NativePortType port_, List that); external void wire_ldk_node_sync_wallets( NativePortType port_, List that); - external void wire_ldk_node_total_onchain_balance_sats( - NativePortType port_, List that); - external void wire_ldk_node_update_channel_config( NativePortType port_, List that, - List channel_id, + List user_channel_id, List counterparty_node_id, List channel_config); external void wire_ldk_node_verify_signature(NativePortType port_, - List that, List msg, String sig, List pkey); + List that, List msg, String sig, List public_key); external void wire_ldk_node_wait_next_event( NativePortType port_, List that); - external void wire_socket_address_as_string( + external void wire_ldk_on_chain_payment_new_address( NativePortType port_, List that); - external void wire_socket_address_from_str( - NativePortType port_, String address); + external void wire_ldk_on_chain_payment_send_all_to_address( + NativePortType port_, List that, List address); + + external void wire_ldk_on_chain_payment_send_to_address(NativePortType port_, + List that, List address, Object amount_sats); + + external void wire_ldk_spontaneous_payment_send(NativePortType port_, + List that, Object amount_msat, List node_id); + + external void wire_ldk_spontaneous_payment_send_probes(NativePortType port_, + List that, Object amount_msat, List node_id); + + external void rust_arc_increment_strong_count_RustOpaque_Node(dynamic ptr); + + external void rust_arc_decrement_strong_count_RustOpaque_Node(dynamic ptr); + + external void + rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + dynamic ptr); + + external void + rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + dynamic ptr); + + external void + rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( + dynamic ptr); + + external void + rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( + dynamic ptr); + + external void + rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( + dynamic ptr); + + external void + rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( + dynamic ptr); - external void rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore( - dynamic ptr); + external void + rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( + dynamic ptr); - external void rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore( - dynamic ptr); + external void + rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( + dynamic ptr); } diff --git a/lib/src/root.dart b/lib/src/root.dart index fa2461a..defa30e 100644 --- a/lib/src/root.dart +++ b/lib/src/root.dart @@ -1,6 +1,5 @@ import 'package:ldk_node/src/generated/api/error.dart' as error; import 'package:ldk_node/src/generated/api/types.dart' as types; -import 'package:ldk_node/src/utils/default_services.dart'; import 'package:ldk_node/src/utils/utils.dart'; import 'package:path_provider/path_provider.dart'; @@ -56,9 +55,19 @@ class Node extends LdkNode { } } - // Confirm the last retrieved event handled. + ///Returns the status of the Node. + @override + Future status({hint}) async { + try { + return await super.status(); + } on error.NodeException catch (e) { + throw mapNodeException(e); + } + } + + /// Blocks until the next event is available. /// - /// **Note:** This **MUST** be called after each event has been handled. + /// **Note:** this will always return the same event until handling is confirmed via `node.eventHandled()`. @override Future eventHandled({hint}) async { try { @@ -68,9 +77,9 @@ class Node extends LdkNode { } } - /// Blocks until the next event is available. + // Confirm the last retrieved event handled. /// - /// **Note:** this will always return the same event until handling is confirmed via `node.eventHandled()`. + /// **Note:** This **MUST** be called after each event has been handled. @override Future nextEvent({hint}) async { try { @@ -94,31 +103,33 @@ class Node extends LdkNode { } } - /// Returns our own node id + ///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()`. @override - Future nodeId({hint}) async { + Future nextEventAsync({hint}) async { try { - return await super.nodeId(); + return await super.nextEventAsync(); } on error.NodeException catch (e) { throw mapNodeException(e); } } - /// Returns our listening address + /// Returns our own node id @override - Future?> listeningAddresses({hint}) async { + Future nodeId({hint}) async { try { - return await super.listeningAddresses(); + return await super.nodeId(); } on error.NodeException catch (e) { throw mapNodeException(e); } } - /// Retrieve a new on-chain/funding address. + /// Returns our listening address @override - Future newOnchainAddress({hint}) async { + Future?> listeningAddresses({hint}) async { try { - return await super.newOnchainAddress(); + return await super.listeningAddresses(); } on error.NodeException catch (e) { throw mapNodeException(e); } @@ -126,42 +137,19 @@ class Node extends LdkNode { /// Retrieve the currently spendable on-chain balance in satoshis. @override - Future spendableOnchainBalanceSats({hint}) async { - try { - return await super.spendableOnchainBalanceSats(); - } on error.NodeException catch (e) { - throw mapNodeException(e); - } - } - - /// Retrieve the current total on-chain balance in satoshis. - @override - Future totalOnchainBalanceSats({hint}) async { + Future listBalances({hint}) { try { - return await super.totalOnchainBalanceSats(); + return super.listBalances(); } on error.NodeException catch (e) { throw mapNodeException(e); } } - /// Send an on-chain payment to the given address. + ///Returns the config with which the Node was initialized. @override - Future sendToOnchainAddress( - {required types.Address address, required int amountSats, hint}) async { + Future config({hint}) { try { - return await super - .sendToOnchainAddress(address: address, amountSats: amountSats); - } on error.NodeException catch (e) { - throw mapNodeException(e); - } - } - - /// Send an on-chain payment to the given address, draining all the available funds. - @override - Future sendAllToOnchainAddress( - {required types.Address address, hint}) async { - try { - return await super.sendAllToOnchainAddress(address: address); + return super.config(); } on error.NodeException catch (e) { throw mapNodeException(e); } @@ -220,7 +208,7 @@ class Node extends LdkNode { /// /// Returns a temporary channel id. @override - Future connectOpenChannel( + Future connectOpenChannel( {required types.SocketAddress socketAddress, required types.PublicKey nodeId, required int channelAmountSats, @@ -229,7 +217,7 @@ class Node extends LdkNode { int? pushToCounterpartyMsat, hint}) async { try { - await super.connectOpenChannel( + return await super.connectOpenChannel( socketAddress: socketAddress, nodeId: nodeId, pushToCounterpartyMsat: pushToCounterpartyMsat, @@ -256,11 +244,11 @@ class Node extends LdkNode { @override Future closeChannel( {required types.PublicKey counterpartyNodeId, - required types.ChannelId channelId, + required types.UserChannelId userChannelId, hint}) async { try { await super.closeChannel( - channelId: channelId, + userChannelId: userChannelId, counterpartyNodeId: counterpartyNodeId, ); } on error.NodeException catch (e) { @@ -273,12 +261,12 @@ class Node extends LdkNode { @override Future updateChannelConfig( {required types.PublicKey counterpartyNodeId, - required types.ChannelId channelId, + required types.UserChannelId userChannelId, required types.ChannelConfig channelConfig, hint}) async { try { await super.updateChannelConfig( - channelId: channelId, + userChannelId: userChannelId, counterpartyNodeId: counterpartyNodeId, channelConfig: channelConfig, ); @@ -287,209 +275,273 @@ class Node extends LdkNode { } } - /// Send a payement given an invoice. + /// Retrieve the details of a specific payment with the given hash. + /// + /// Returns `PaymentDetails` if the payment was known and `null` otherwise. @override - Future sendPayment( - {required types.Bolt11Invoice invoice, hint}) async { + Future payment( + {required types.PaymentId paymentId, hint}) async { try { - return await super.sendPayment(invoice: invoice); + return await super.payment(paymentId: paymentId); } on error.NodeException catch (e) { throw mapNodeException(e); } } - /// Send a payment given an invoice and an amount in millisatoshi. - /// - /// This will fail if the amount given is less than the value required by the given invoice. - /// - /// This can be used to pay a so-called "zero-amount" invoice, i.e., an invoice that leaves the - /// amount paid to be determined by the user. + ///Remove the payment with the given hash from the store. @override - Future sendPaymentUsingAmount( - {required types.Bolt11Invoice invoice, - required int amountMsat, - hint}) async { + Future removePayment({required types.PaymentId paymentId, hint}) async { try { - return await super - .sendPaymentUsingAmount(invoice: invoice, amountMsat: amountMsat); + return await super.removePayment(paymentId: paymentId); } on error.NodeException catch (e) { throw mapNodeException(e); } } - /// Send a spontaneous, aka. "keysend", payment + ///Retrieves all payments that match the given predicate. @override - Future sendSpontaneousPayment( - {required types.PublicKey nodeId, required int amountMsat, hint}) async { + Future> listPaymentsWithFilter( + {required types.PaymentDirection paymentDirection, hint}) async { try { return await super - .sendSpontaneousPayment(amountMsat: amountMsat, nodeId: nodeId); + .listPaymentsWithFilter(paymentDirection: paymentDirection); } on error.NodeException catch (e) { throw mapNodeException(e); } } - ///Sends payment probes over all paths of a route that would be used to pay the given amount to the given node_id. + ///Retrieves all payments. @override - Future sendSpontaneousPaymentProbes( - {required types.PublicKey nodeId, required int amountMsat, hint}) async { + Future> listPayments({hint}) async { try { - return await super - .sendSpontaneousPaymentProbes(amountMsat: amountMsat, nodeId: nodeId); + return super.listPayments(); } on error.NodeException catch (e) { throw mapNodeException(e); } } - // Sends payment probes over all paths of a route that would be used to pay the given invoice. - /// - /// This may be used to send "pre-flight" probes, i.e., to train our scorer before conducting - /// the actual payment. Note this is only useful if there likely is sufficient time for the - /// probe to settle before sending out the actual payment, e.g., when waiting for user - /// confirmation in a wallet UI. - /// - /// Otherwise, there is a chance the probe could take up some liquidity needed to complete the - /// actual payment. Users should therefore be cautious and might avoid sending probes if - /// liquidity is scarce and/or they don't expect the probe to return before they send the - /// payment. To mitigate this issue, channels with available liquidity less than the required - /// amount times "config.probingLiquidityLimitMultiplier" won't be used to send - /// pre-flight probes. + ///Retrieves a list of known peers. + @override + Future> listPeers({hint}) async { + try { + return await super.listPeers(); + } on error.NodeException catch (e) { + throw mapNodeException(e); + } + } + + /// Creates a digital ECDSA signature of a message with the node's secret key. /// + /// A receiver knowing the corresponding [types.PublicKey] (e.g. the node’s id) and the message + /// can be sure that the signature was generated by the caller. + /// Signatures are EC recoverable, meaning that given the message and the + /// signature the PublicKey of the signer can be extracted. @override - Future sendPaymentProbes( - {required types.Bolt11Invoice invoice, hint}) async { + Future signMessage({required List msg, hint}) async { try { - return await super.sendPaymentProbes(invoice: invoice); + return await super.signMessage(msg: msg); } on error.NodeException catch (e) { throw mapNodeException(e); } } + /// Verifies that the given ECDSA signature was created for the given message with the + /// secret key corresponding to the given public key. @override - Future sendPaymentProbesUsingAmount( - {required types.Bolt11Invoice invoice, - required int amountMsat, + Future verifySignature( + {required List msg, + required String sig, + required types.PublicKey publicKey, hint}) async { try { - return await super.sendPaymentProbesUsingAmount( - invoice: invoice, amountMsat: amountMsat); + return await super + .verifySignature(msg: msg, sig: sig, publicKey: publicKey); + } on error.NodeException catch (e) { + throw mapNodeException(e); + } + } + + Future bolt11Payment() async { + try { + final res = await LdkNode.bolt11Payment(ptr: this); + return Bolt11Payment._(ptr: res.ptr); } on error.NodeException catch (e) { throw mapNodeException(e); } } - /// Returns a payable invoice that can be used to request and receive a payment of the amount - /// given. + Future onChainPayment() async { + try { + final res = await LdkNode.onChainPayment(ptr: this); + return OnChainPayment._(ptr: res.ptr); + } on error.NodeException catch (e) { + throw mapNodeException(e); + } + } + + Future spontaneousPayment() async { + try { + final res = await LdkNode.spontaneousPayment(ptr: this); + return SpontaneousPayment._(ptr: res.ptr); + } on error.NodeException catch (e) { + throw mapNodeException(e); + } + } +} + +class SpontaneousPayment extends LdkSpontaneousPayment { + SpontaneousPayment._({required super.ptr}); @override - Future receivePayment( + Future sendProbes( + {required int amountMsat, required types.PublicKey nodeId, hint}) { + try { + return super.sendProbes(amountMsat: amountMsat, nodeId: nodeId); + } on error.NodeException catch (e) { + throw mapNodeException(e); + } + } + + @override + Future send( {required int amountMsat, - required int expirySecs, - required String description, - hint}) async { + required types.PublicKey nodeId, + dynamic hint}) { try { - return await super.receivePayment( - amountMsat: amountMsat, - description: description, - expirySecs: expirySecs); + return super.send(amountMsat: amountMsat, nodeId: nodeId); } on error.NodeException catch (e) { throw mapNodeException(e); } } +} - /// Returns a payable invoice that can be used to request and receive a payment for which the - /// amount is to be determined by the user, also known as a "zero-amount" invoice. +class OnChainPayment extends LdkOnChainPayment { + OnChainPayment._({required super.ptr}); @override - Future receiveVariableAmountPayment( - {required int expirySecs, required String description, hint}) async { + Future newAddress({hint}) { try { - return await super.receiveVariableAmountPayment( - description: description, expirySecs: expirySecs); + return super.newAddress(); } on error.NodeException catch (e) { throw mapNodeException(e); } } - /// Retrieve the details of a specific payment with the given hash. - /// - /// Returns `PaymentDetails` if the payment was known and `null` otherwise. @override - Future payment( - {required types.PaymentHash paymentHash, hint}) async { + Future sendAllToAddress({required types.Address address, hint}) { try { - return await super.payment(paymentHash: paymentHash); + return super.sendAllToAddress(address: address); } on error.NodeException catch (e) { throw mapNodeException(e); } } - ///Remove the payment with the given hash from the store. @override - Future removePayment( - {required types.PaymentHash paymentHash, hint}) async { + Future sendToAddress( + {required types.Address address, required int amountSats, hint}) { try { - return await super.removePayment(paymentHash: paymentHash); + return super.sendToAddress(address: address, amountSats: amountSats); } on error.NodeException catch (e) { throw mapNodeException(e); } } +} - ///Retrieves all payments that match the given predicate. +class Bolt11Payment extends LdkBolt11Payment { + Bolt11Payment._({required super.ptr}); @override - Future> listPaymentsWithFilter( - {required types.PaymentDirection paymentDirection, hint}) async { + Future receive( + {required int amountMsat, + required String description, + required int expirySecs, + hint}) { try { - return await super - .listPaymentsWithFilter(paymentDirection: paymentDirection); + return super.receive( + amountMsat: amountMsat, + description: description, + expirySecs: expirySecs); } on error.NodeException catch (e) { throw mapNodeException(e); } } - ///Retrieves all payments. @override - Future> listPayments({hint}) async { + Future receiveVariableAmount( + {required String description, required int expirySecs, hint}) { try { - return super.listPayments(); + return super.receiveVariableAmount( + description: description, expirySecs: expirySecs); } on error.NodeException catch (e) { throw mapNodeException(e); } } - ///Retrieves a list of known peers. @override - Future> listPeers({hint}) async { + Future receiveVariableAmountViaJitChannel( + {required String description, + required int expirySecs, + int? maxProportionalLspFeeLimitPpmMsat, + hint}) { try { - return await super.listPeers(); + return super.receiveVariableAmountViaJitChannel( + description: description, + expirySecs: expirySecs, + maxProportionalLspFeeLimitPpmMsat: maxProportionalLspFeeLimitPpmMsat); } on error.NodeException catch (e) { throw mapNodeException(e); } } - /// Creates a digital ECDSA signature of a message with the node's secret key. - /// - /// A receiver knowing the corresponding [types.PublicKey] (e.g. the node’s id) and the message - /// can be sure that the signature was generated by the caller. - /// Signatures are EC recoverable, meaning that given the message and the - /// signature the PublicKey of the signer can be extracted. @override - Future signMessage({required List msg, hint}) async { + Future receiveViaJitChannel( + {required int amountMsat, + required String description, + required int expirySecs, + int? maxTotalLspFeeLimitMsat, + hint}) { try { - return await super.signMessage(msg: msg); + return super.receiveViaJitChannel( + description: description, + expirySecs: expirySecs, + maxTotalLspFeeLimitMsat: maxTotalLspFeeLimitMsat, + amountMsat: amountMsat); } on error.NodeException catch (e) { throw mapNodeException(e); } } - /// Verifies that the given ECDSA signature was created for the given message with the - /// secret key corresponding to the given public key. @override - Future verifySignature( - {required List msg, - required String sig, - required types.PublicKey pkey, - hint}) async { + Future send({required types.Bolt11Invoice invoice, hint}) { + try { + return super.send(invoice: invoice); + } on error.NodeException catch (e) { + throw mapNodeException(e); + } + } + + @override + Future sendProbes({required types.Bolt11Invoice invoice, hint}) { try { - return await super.verifySignature(msg: msg, sig: sig, pkey: pkey); + return super.sendProbes(invoice: invoice); + } on error.NodeException catch (e) { + throw mapNodeException(e); + } + } + + @override + Future sendProbesUsingAmount( + {required types.Bolt11Invoice invoice, required int amountMsat, hint}) { + try { + return super + .sendProbesUsingAmount(invoice: invoice, amountMsat: amountMsat); + } on error.NodeException catch (e) { + throw mapNodeException(e); + } + } + + @override + Future sendUsingAmount( + {required types.Bolt11Invoice invoice, required int amountMsat, hint}) { + try { + return super.sendUsingAmount(invoice: invoice, amountMsat: amountMsat); } on error.NodeException catch (e) { throw mapNodeException(e); } @@ -509,6 +561,7 @@ class Builder { types.EntropySourceConfig? _entropySource; types.ChainDataSourceConfig? _chainDataSourceConfig; types.GossipSourceConfig? _gossipSourceConfig; + types.LiquiditySourceConfig? _liquiditySourceConfig; /// Creates a new builder instance from an [Config]. /// @@ -535,30 +588,6 @@ class Builder { probingLiquidityLimitMultiplier: 3)); } - /// Creates a new builder instance with default services configured for testnet. - /// - factory Builder.testnet({types.Config? config}) { - final Builder builder = - config != null ? Builder.fromConfig(config: config) : Builder(); - - return builder - .setNetwork(types.Network.testnet) - .setEsploraServer(DefaultServicesTestnet.esploraServerUrl) - .setGossipSourceRgs(DefaultServicesTestnet.rgsServerUrl); - } - - /// Creates a new builder instance with default services configured for mutinynet. - /// - factory Builder.mutinynet({types.Config? config}) { - final Builder builder = - config != null ? Builder.fromConfig(config: config) : Builder(); - - return builder - .setNetwork(types.Network.signet) - .setEsploraServer(DefaultServicesMutinynet.esploraServerUrl) - .setGossipSourceRgs(DefaultServicesMutinynet.rgsServerUrl); - } - /// Configures the [Node] instance to source its wallet entropy from a seed file on disk. /// /// If the given file does not exist a new random seed file will be generated and @@ -635,6 +664,22 @@ 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. /// @@ -647,17 +692,38 @@ class Builder { final nodePath = "${directory.path}/ldk_cache/"; _config!.storageDirPath = nodePath; } - final res = await buildWithSqliteStore( - config: _config!, - entropySourceConfig: _entropySource, - chainDataSourceConfig: _chainDataSourceConfig, - gossipSourceConfig: _gossipSourceConfig, - ); + final builder = await NodeBuilder.createBuilder( + config: _config ?? Builder()._config!, + chainDataSourceConfig: _chainDataSourceConfig, + entropySourceConfig: _entropySource, + liquiditySourceConfig: _liquiditySourceConfig, + gossipSourceConfig: _gossipSourceConfig); + final res = await builder.build(); + return Node._(ptr: res.ptr); + } on error.BuilderException catch (e) { + throw mapBuilderException(e); + } + } + + ///Builds a Node instance with a FilesystemStore backend and according to the options previously configured. + Future buildWithFsStore() async { + try { + await Frb.verifyInit(); + if (_config!.storageDirPath == '') { + final directory = await getApplicationDocumentsDirectory(); + final nodePath = "${directory.path}/ldk_cache/"; + _config!.storageDirPath = nodePath; + } + final builder = await NodeBuilder.createBuilder( + config: _config ?? Builder()._config!, + chainDataSourceConfig: _chainDataSourceConfig, + entropySourceConfig: _entropySource, + liquiditySourceConfig: _liquiditySourceConfig, + gossipSourceConfig: _gossipSourceConfig); + final res = await builder.buildWithFsStore(); return Node._(ptr: res.ptr); } on error.BuilderException catch (e) { throw mapBuilderException(e); - } on error.NodeException catch (e) { - throw mapNodeException(e); } } } diff --git a/lib/src/utils/default_services.dart b/lib/src/utils/default_services.dart deleted file mode 100644 index 21ac712..0000000 --- a/lib/src/utils/default_services.dart +++ /dev/null @@ -1,9 +0,0 @@ -class DefaultServicesTestnet { - static const String esploraServerUrl = 'https://testnet.ltbl.io/api'; - static const String rgsServerUrl = 'https://testnet.ltbl.io/snapshot'; -} - -class DefaultServicesMutinynet { - static const String esploraServerUrl = 'https://mutinynet.ltbl.io/api'; - static const String rgsServerUrl = 'https://mutinynet.ltbl.io/snapshot'; -} diff --git a/lib/src/utils/exceptions.dart b/lib/src/utils/exceptions.dart index 7e681b9..a191ac0 100644 --- a/lib/src/utils/exceptions.dart +++ b/lib/src/utils/exceptions.dart @@ -1,19 +1,19 @@ import '../generated/api/error.dart' as bridge; -abstract class LdkException implements Exception { +abstract class ExceptionBase implements Exception { String? message; - LdkException({this.message}); + ExceptionBase({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 LdkException { +class NodeException extends ExceptionBase { NodeException({super.message}); } -class BuilderException extends LdkException { +class BuilderException extends ExceptionBase { BuilderException({super.message}); } @@ -39,6 +39,7 @@ BuilderException mapBuilderException(bridge.BuilderException e) { return BuilderException(message: "Failed to setup onchain wallet."); case bridge.BuilderException.loggerSetupFailed: return BuilderException(message: "Failed to setup the logger."); + case bridge.BuilderException.invalidChannelMonitor: return BuilderException( message: "Failed to watch a deserialized ChannelMonitor."); @@ -48,9 +49,10 @@ BuilderException mapBuilderException(bridge.BuilderException e) { case bridge.BuilderException.kvStoreSetupFailed: return BuilderException(message: "Failed to setup KVStore."); case bridge.BuilderException.socketAddressParseError: - return BuilderException(message: "Failed to parse socket address"); - case bridge.BuilderException.invalidTrustedPeer: - return BuilderException(message: "Invalid trusted peer"); + return BuilderException(message: "Invalid SocketAddress."); + + case bridge.BuilderException.invalidPublicKey: + return BuilderException(message: "Invalid PublicKey."); } } @@ -121,7 +123,21 @@ NodeException mapNodeException(bridge.NodeException e) { "There are insufficient funds to complete the given operation."); case bridge.NodeException.feerateEstimationUpdateFailed: return NodeException(message: "Failed to update fee rate estimation. "); + case bridge.NodeException.liquidityRequestFailed: + return NodeException(message: "Liquidity request operation failed. "); + case bridge.NodeException.liquiditySourceUnavailable: + return NodeException( + message: + "Liquidity operation failed due to the required liquidity source being unavailable. "); + case bridge.NodeException.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"); + return NodeException(message: "The given transaction id is Invalid. "); + case bridge.NodeException.invalidPaymentId: + return NodeException(message: "The given paymentId is invalid. "); + case bridge.NodeException.decodeError: + return NodeException(message: "Failed to decode the data. "); } } diff --git a/pubspec.yaml b/pubspec.yaml index 0195250..928f300 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: ldk_node description: A ready-to-go Lightning node library built using LDK and BDK. -version: 0.2.2-dev +version: 0.2.3-dev homepage: https://github.com/LtbLightning/ldk-node-flutter environment: @@ -8,23 +8,22 @@ environment: flutter: ">=2.5.0" dependencies: - collection: ^1.17.1 + collection: ^1.18.0 ffi: ^2.1.0 flutter: sdk: flutter - flutter_rust_bridge: ">2.0.0-dev.30 <= 2.0.0-dev.31" + flutter_rust_bridge: "2.0.0" freezed_annotation: ^2.2.0 - meta: ^1.10.0 + meta: ^1.12.0 uuid: ^4.3.3 path_provider: ^2.1.2 dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^3.0.1 - ffigen: ^9.0.1 - freezed: ^2.4.7 + ffigen: ^12.0.0 + freezed: ^2.5.2 build_runner: ^2.4.8 - lints: ^3.0.0 + lints: ^4.0.0 flutter: plugin: diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 3d2870b..ceb4262 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ "getrandom", "once_cell", @@ -30,9 +30,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.7" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "once_cell", @@ -42,18 +42,18 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "allo-isolate" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f5a5fd28223e6f3cafb7d9cd685f51eafdd71d33ca1229f8316925d5957240" +checksum = "97b6d794345b06592d0ebeed8e477e41b71e5a0a49df4fc0e4184d5938b99509" dependencies = [ "anyhow", "atomic", @@ -62,9 +62,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "android-tzdata" @@ -101,19 +101,19 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.79" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "async-trait" -version = "0.1.77" +version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -124,15 +124,15 @@ checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba" [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ "addr2line", "cc", @@ -161,7 +161,7 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fc1fc1a92e0943bfbcd6eb7d32c1b2a79f2f1357eb1e2eee9d7f36d6d7ca44a" dependencies = [ - "ahash 0.7.7", + "ahash 0.7.8", "async-trait", "bdk-macros", "bip39", @@ -258,9 +258,18 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] [[package]] name = "build-target" @@ -270,15 +279,15 @@ checksum = "832133bbabbbaa9fbdba793456a2827627a7d2b8fb96032fa1e7666d7895832b" [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytemuck" -version = "1.14.1" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed2490600f404f2b94c167e31d3ed1d5f3c225a0f3b80230053b3e0b7b962bd9" +checksum = "78834c15cb5d5efe3452d58b1e8ba890dd62d21907f867f383358198e56ebca5" [[package]] name = "byteorder" @@ -288,18 +297,15 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "cc" -version = "1.0.83" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] +checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" [[package]] name = "cfg-if" @@ -309,14 +315,15 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.33" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", - "windows-targets 0.52.0", + "serde", + "windows-targets 0.52.5", ] [[package]] @@ -345,6 +352,16 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + [[package]] name = "dart-sys-fork" version = "4.1.1" @@ -372,29 +389,30 @@ checksum = "51aac4c99b2e6775164b412ea33ae8441b2fde2dbf05a20bc0052a63d08c475b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] -name = "deranged" -version = "0.3.11" +name = "digest" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "powerfmt", + "block-buffer", + "crypto-common", ] [[package]] name = "either" -version = "1.9.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] @@ -417,9 +435,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -452,9 +470,9 @@ checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" [[package]] name = "fastrand" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "fixedbitset" @@ -464,9 +482,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flutter_rust_bridge" -version = "2.0.0-dev.31" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d9ceb6f8db0bf711a55e20151c6699132bb5975f846ecac2c3bc7d23cc0845d" +checksum = "033e831e28f1077ceae3490fb6d093dfdefefd09c5c6e8544c6579effe7e814f" dependencies = [ "allo-isolate", "android_logger", @@ -491,13 +509,15 @@ dependencies = [ [[package]] name = "flutter_rust_bridge_macros" -version = "2.0.0-dev.31" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e02edfe56f04af804d3145b17dfe7820d46a6753b214160f227dbdfa1073f7cb" +checksum = "0217fc4b7131b52578be60bbe38c76b3edfc2f9fecab46d9f930510f40ef9023" dependencies = [ "hex", + "md-5", + "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -506,21 +526,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -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" @@ -586,7 +591,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -619,11 +624,21 @@ dependencies = [ "slab", ] +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -638,9 +653,9 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "h2" -version = "0.3.24" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", @@ -657,11 +672,11 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ - "ahash 0.8.7", + "ahash 0.8.11", "allocator-api2", ] @@ -682,9 +697,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.4" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hex" @@ -694,9 +709,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-conservative" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ed443af458ccb6d81c1e7e661545f94d3176752fb1df2f543b902a1e0f51e2" +checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" [[package]] name = "hex_lit" @@ -715,9 +730,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", @@ -785,24 +800,11 @@ 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.59" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -833,9 +835,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.1" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "433de089bd45971eecf4668ee0ee8f4cec17db4f8bd8f7bc3197a6ce37aa7d9b" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", "hashbrown", @@ -858,9 +860,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" @@ -879,20 +881,20 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "ldk-node" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "923588872d472775345535cdb87a123730c077b4acbb49f081bb4a91442b4a20" +checksum = "c4a5400043598f1da534abf81bb937739a680663d57a451bf8363d6113211424" dependencies = [ "bdk", "bip39", "bitcoin", "chrono", "esplora-client", - "futures", "libc", "lightning", "lightning-background-processor", "lightning-invoice", + "lightning-liquidity", "lightning-net-tokio", "lightning-persister", "lightning-rapid-gossip-sync", @@ -908,20 +910,18 @@ dependencies = [ [[package]] name = "ldk_node" -version = "0.2.2-dev" +version = "0.2.3-dev" dependencies = [ "anyhow", "flutter_rust_bridge", "ldk-node", - "log", - "simplelog", ] [[package]] name = "libc" -version = "0.2.152" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libsqlite3-sys" @@ -936,9 +936,9 @@ dependencies = [ [[package]] name = "lightning" -version = "0.0.121" +version = "0.0.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0c1f811ae288f86c6767055c55b5f7a721ca1e61bf1897a9ae2ec663e8aba1" +checksum = "5fd92d4aa159374be430c7590e169b4a6c0fb79018f5bc4ea1bffde536384db3" dependencies = [ "bitcoin", "hex-conservative", @@ -946,9 +946,9 @@ dependencies = [ [[package]] name = "lightning-background-processor" -version = "0.0.121" +version = "0.0.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d4711ad9cc33f30c2e8e876fcfd6255523fc250440abb8c374cd98e6c40e79" +checksum = "fb1c2c64050e37cee7c3b6b022106523784055ac3ee572d360780a1d6fe8062c" dependencies = [ "bitcoin", "lightning", @@ -957,22 +957,36 @@ dependencies = [ [[package]] name = "lightning-invoice" -version = "0.29.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b186aca4a605d4db3b85979922be287b9ebd5dedd8132963bb9dbeb8f7d2a04" +checksum = "26d07d01cf197bf2184b929b7dc94aa70d935aac6df896c256a3a9475b7e9d40" dependencies = [ "bech32", "bitcoin", "lightning", - "num-traits", "secp256k1", + "serde", +] + +[[package]] +name = "lightning-liquidity" +version = "0.1.0-alpha.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fa6284740f64672f42145de7b0a242beea3821dae1f0eac7949a8f48799c828" +dependencies = [ + "bitcoin", + "chrono", + "lightning", + "lightning-invoice", + "serde", + "serde_json", ] [[package]] name = "lightning-net-tokio" -version = "0.0.121" +version = "0.0.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4813cca14ed984924a6975895e80cde8673a0a105a1c7ddf3b0fb3d1ce59e6bf" +checksum = "f9e6a4d49c50a1344916d080dc8c012ce3a778cdd45de8def75350b2b40fe018" dependencies = [ "bitcoin", "lightning", @@ -981,9 +995,9 @@ dependencies = [ [[package]] name = "lightning-persister" -version = "0.0.121" +version = "0.0.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82a633e4d08b75e16dc131af2961254b7005c30ab29577e215080d2943c0511" +checksum = "8a8dd33971815fa074b05678e09a6d4b15c78225ea34d66ed4f17c35a53467a9" dependencies = [ "bitcoin", "lightning", @@ -992,9 +1006,9 @@ dependencies = [ [[package]] name = "lightning-rapid-gossip-sync" -version = "0.0.121" +version = "0.0.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "128d6c450cb698b46ecacc6645ebeb2b57d6f9458482635ab523863fa8378314" +checksum = "9d861b0f0cd5f8fe8c63760023c4fd4fd32c384881b41780b62ced2a8a619f91" dependencies = [ "bitcoin", "lightning", @@ -1002,9 +1016,9 @@ dependencies = [ [[package]] name = "lightning-transaction-sync" -version = "0.0.121" +version = "0.0.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0721b05c0230f11e1c96af68304103ad07e146b13b47f7fd9a12e69cacb610d" +checksum = "04c1e88eece28f19b5834fb5aefceabc5d143cfda2dfa9a32f73e66f4d0c84ed" dependencies = [ "bdk-macros", "bitcoin", @@ -1015,21 +1029,31 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "md-5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest", +] [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "mime" @@ -1050,18 +1074,18 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "wasi", @@ -1074,29 +1098,11 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" -[[package]] -name = "native-tls" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" -dependencies = [ - "lazy_static", - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] @@ -1111,15 +1117,6 @@ dependencies = [ "libc", ] -[[package]] -name = "num_threads" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" -dependencies = [ - "libc", -] - [[package]] name = "object" version = "0.32.2" @@ -1135,50 +1132,6 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "openssl" -version = "0.10.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" -dependencies = [ - "bitflags 2.4.2", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.99" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "oslog" version = "0.1.0" @@ -1198,9 +1151,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "petgraph" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", "indexmap", @@ -1208,9 +1161,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -1220,15 +1173,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" - -[[package]] -name = "powerfmt" -version = "0.2.0" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "ppv-lite86" @@ -1248,9 +1195,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6" dependencies = [ "unicode-ident", ] @@ -1311,9 +1258,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -1348,20 +1295,11 @@ dependencies = [ "getrandom", ] -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "regex" -version = "1.10.3" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", @@ -1371,9 +1309,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", @@ -1382,15 +1320,15 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "reqwest" -version = "0.11.23" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ "base64 0.21.7", "bytes", @@ -1402,12 +1340,10 @@ dependencies = [ "http-body", "hyper", "hyper-rustls", - "hyper-tls", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", @@ -1416,9 +1352,9 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", "system-configuration", "tokio", - "tokio-native-tls", "tokio-rustls", "tokio-socks", "tower-service", @@ -1432,16 +1368,17 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.7" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", + "cfg-if", "getrandom", "libc", "spin", "untrusted", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1460,17 +1397,17 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustix" -version = "0.38.30" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "errno", "libc", "linux-raw-sys", @@ -1479,9 +1416,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.10" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", "ring", @@ -1510,18 +1447,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" - -[[package]] -name = "schannel" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" -dependencies = [ - "windows-sys 0.52.0", -] +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "sct" @@ -1554,54 +1482,31 @@ dependencies = [ "cc", ] -[[package]] -name = "security-framework" -version = "2.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" -dependencies = [ - "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.196" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.196" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "serde_json" -version = "1.0.113" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", "ryu", @@ -1620,17 +1525,6 @@ dependencies = [ "serde", ] -[[package]] -name = "simplelog" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acee08041c5de3d5048c8b3f6f13fafb3026b24ba43c6a695a0c76179b844369" -dependencies = [ - "log", - "termcolor", - "time", -] - [[package]] name = "slab" version = "0.4.9" @@ -1642,18 +1536,18 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1675,15 +1569,21 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" 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" @@ -1707,44 +1607,34 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.9.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", "fastrand", - "redox_syscall", "rustix", "windows-sys 0.52.0", ] -[[package]] -name = "termcolor" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" -dependencies = [ - "winapi-util", -] - [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -1756,37 +1646,6 @@ dependencies = [ "num_cpus", ] -[[package]] -name = "time" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" -dependencies = [ - "deranged", - "itoa", - "libc", - "num_threads", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" -dependencies = [ - "time-core", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -1804,9 +1663,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.35.1" +version = "1.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" dependencies = [ "backtrace", "bytes", @@ -1827,17 +1686,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "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", + "syn 2.0.66", ] [[package]] @@ -1864,16 +1713,15 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] @@ -1907,6 +1755,12 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + [[package]] name = "unicode-bidi" version = "0.3.15" @@ -1959,9 +1813,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "vss-client" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3d56cb3a4c815901ee46fcaac027ab1674232eb4f136a17e3b0576a4c77ded7" +checksum = "a62cbd331368125aeb93b67dd4a80826a4ee29a810d4c76d2c9d265c1522a3f2" dependencies = [ "prost", "prost-build", @@ -2006,7 +1860,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", "wasm-bindgen-shared", ] @@ -2040,7 +1894,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2053,9 +1907,9 @@ checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "web-sys" -version = "0.3.67" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -2063,9 +1917,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.3" +version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "which" @@ -2095,15 +1949,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" -dependencies = [ - "winapi", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -2116,7 +1961,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -2134,7 +1979,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -2154,17 +1999,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "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", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -2175,9 +2021,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -2187,9 +2033,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -2199,9 +2045,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -2211,9 +2063,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -2223,9 +2075,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -2235,9 +2087,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -2247,9 +2099,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winreg" @@ -2263,20 +2115,20 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 8c5bd1a..1e2fb84 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ldk_node" -version = "0.2.2-dev" +version = "0.2.3-dev" edition = "2021" [lib] @@ -10,12 +10,10 @@ crate-type = ["staticlib", "cdylib"] [build-dependencies] anyhow = "1.0.68" [dependencies] -flutter_rust_bridge = "=2.0.0-dev.31" - -log = "0.4.19" -simplelog = "0.12.1" +flutter_rust_bridge = "=2.0.0" anyhow = { version = "1.0.71"} -ldk-node = { version = "= 0.2.2" } +ldk-node = { version = "= 0.3.0" } +# ldk-node = {git = 'https://github.com/lightningdevkit/ldk-node.git', rev = "246775d04dbb2e99528a6a1aa0bc04ad7378e900"} [profile.release] diff --git a/rust/cargokit.yaml b/rust/cargokit.yaml index de2761f..fc12e2c 100644 --- a/rust/cargokit.yaml +++ b/rust/cargokit.yaml @@ -1,7 +1,10 @@ cargo: release: - toolchain: stable + toolchain: nightly + extra_flags: + - -Z + - build-std=panic_abort,std precompiled_binaries: url_prefix: https://github.com/LtbLightning/ldk-node-flutter/releases/download/precompiled_ - public_key: 9ac2de724ed22cc1e1400b7630331f82b99cfc11e76f8d4b04c0cd1f0c9dcfd1 + public_key: 0e43d5e8452d00db7f3000c18fb1ba796babfcb5dc6306bb0629eff24f8be85b diff --git a/rust/src/api/error.rs b/rust/src/api/error.rs index 95359e4..0cceb27 100644 --- a/rust/src/api/error.rs +++ b/rust/src/api/error.rs @@ -1,4 +1,5 @@ -use ldk_node::{BuildError, NodeError}; +use ldk_node::{ BuildError, NodeError }; + #[derive(Debug, PartialEq)] pub enum NodeException { @@ -61,8 +62,18 @@ pub enum NodeException { DuplicatePayment, /// There are insufficient funds to complete the given operation. InsufficientFunds, - + ///A fee rate estimation update failed. FeerateEstimationUpdateFailed, + ///A liquidity request operation failed. + LiquidityRequestFailed, + ///The given operation failed due to the required liquidity source being unavailable. + LiquiditySourceUnavailable, + ///The given operation failed due to the LSP's required opening fee being too high. + LiquidityFeeTooHigh, + ///The given payment id is invalid. + InvalidPaymentId, + ///An error in decoding a message or struct. + DecodeError, } #[allow(dead_code)] #[derive(Debug)] @@ -90,7 +101,8 @@ pub enum BuilderException { WalletSetupFailed, /// We failed to setup the logger. LoggerSetupFailed, - InvalidTrustedPeer, + + InvalidPublicKey, } impl From for NodeException { @@ -125,9 +137,11 @@ impl From for NodeException { NodeError::InvalidNetwork => NodeException::InvalidNetwork, NodeError::DuplicatePayment => NodeException::DuplicatePayment, NodeError::InsufficientFunds => NodeException::InsufficientFunds, - NodeError::FeerateEstimationUpdateFailed => { - NodeException::FeerateEstimationUpdateFailed - } + NodeError::FeerateEstimationUpdateFailed => NodeException::FeerateEstimationUpdateFailed, + NodeError::LiquidityRequestFailed => NodeException::LiquidityRequestFailed, + NodeError::LiquiditySourceUnavailable => NodeException::LiquiditySourceUnavailable, + NodeError::LiquidityFeeTooHigh => NodeException::LiquidityFeeTooHigh, + NodeError::InvalidPaymentId => NodeException::InvalidPaymentId } } } @@ -160,3 +174,9 @@ impl From for BuilderException { } } } + +impl From for NodeException { + fn from(_: ldk_node::lightning::ln::msgs::DecodeError) -> Self { + NodeException::DecodeError + } +} diff --git a/rust/src/api/mod.rs b/rust/src/api/mod.rs index 6f054f8..05b9af3 100644 --- a/rust/src/api/mod.rs +++ b/rust/src/api/mod.rs @@ -1,3 +1,3 @@ pub mod error; -pub mod types; pub mod node; +pub mod types; diff --git a/rust/src/api/node.rs b/rust/src/api/node.rs index fa291de..1d29441 100644 --- a/rust/src/api/node.rs +++ b/rust/src/api/node.rs @@ -1,11 +1,12 @@ -use crate::api::error::{BuilderException, NodeException}; +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; pub use ldk_node::Node; use std::str::FromStr; -pub use std::sync::{Arc, Mutex}; +pub use std::sync::{ Arc, Mutex }; +use flutter_rust_bridge::frb; #[derive(Debug, Clone)] pub struct LdkMnemonic { @@ -32,59 +33,98 @@ impl LdkMnemonic { } } -pub fn build_with_sqlite_store( - config: Config, - chain_data_source_config: Option, - entropy_source_config: Option, - gossip_source_config: Option, -) -> anyhow::Result { - let builder = create_builder( - config, - chain_data_source_config, - entropy_source_config, - gossip_source_config, - ); - match builder?.build() { - Ok(e) => Ok(LdkNode { - ptr: RustOpaque::new(e), - }), - Err(e) => Err(e.into()), - } + #[frb(opaque)] +pub struct NodeBuilder { + pub builder: RustOpaque } -fn create_builder( - config: Config, - chain_data_source_config: Option, - entropy_source_config: Option, - gossip_source_config: Option, -) -> 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), - EntropySourceConfig::SeedBytes(e) => builder.set_entropy_seed_bytes(e.encode())?, - EntropySourceConfig::Bip39Mnemonic { - mnemonic, - passphrase, - } => builder.set_entropy_bip39_mnemonic(mnemonic.try_into()?, passphrase), - }; - } - if let Some(source) = chain_data_source_config { - match source { - ChainDataSourceConfig::Esplora(e) => builder.set_esplora_server(e), - }; - } - if let Some(source) = gossip_source_config { - match source { - GossipSourceConfig::P2PNetwork => builder.set_gossip_source_p2p(), - GossipSourceConfig::RapidGossipSync(e) => builder.set_gossip_source_rgs(e), - }; - } - Ok(builder) +impl NodeBuilder { + pub fn create_builder( + config: Config, + 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.try_into()?); + if let Some(source) = entropy_source_config { + match source { + EntropySourceConfig::SeedFile(e) => builder.set_entropy_seed_path(e), + EntropySourceConfig::SeedBytes(e) => builder.set_entropy_seed_bytes(e.encode())?, + EntropySourceConfig::Bip39Mnemonic { + mnemonic, + passphrase, + } => builder.set_entropy_bip39_mnemonic(>::try_into(mnemonic)?, passphrase), + }; + } + if let Some(source) = chain_data_source_config { + match source { + ChainDataSourceConfig::Esplora(e) => builder.set_esplora_server(e), + }; + } + if let Some(source) = gossip_source_config { + match source { + GossipSourceConfig::P2PNetwork => builder.set_gossip_source_p2p(), + 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.try_into()?, + liquidity.lsps2_service.1.try_into().map_err(|_| BuilderException::InvalidPublicKey)?, + liquidity.lsps2_service.2, + ); + } + Ok(NodeBuilder { builder: RustOpaque::new(builder) }) + } + pub fn build( + self + ) -> anyhow::Result { + + match self.builder.build() { + Ok(e) => Ok(LdkNode { + ptr: RustOpaque::new(e), + }), + Err(e) => Err(e.into()), + } + } + pub fn build_with_fs_store( + self + ) -> anyhow::Result { + + match self.builder.build_with_fs_store() { + Ok(e) => Ok(LdkNode { + ptr: RustOpaque::new(e), + }), + Err(e) => Err(e.into()), + } + } +// fn build_with_store( +// self +// ) -> anyhow::Result { +// match self.builder.build_with_store(Arc::new(())) { +// Ok(e) => Ok(LdkNode { +// ptr: RustOpaque::new(e), +// }), +// Err(e) => Err(e.into()), +// } +// } } + // pub fn build_with_vss_store( + // self, url: String, store_id: String + // ) -> anyhow::Result { + // match self.builder.build_with_vss_store(url, store_id) { + // Ok(e) => Ok(LdkNode { + // ptr: RustOpaque::new(e), + // }), + // Err(e) => Err(e.into()), + // } + // } + + pub struct LdkNode { - pub ptr: RustOpaque>, + pub ptr: RustOpaque, } impl LdkNode { pub fn start(&self) -> anyhow::Result<(), NodeException> { @@ -94,10 +134,12 @@ impl LdkNode { pub fn stop(&self) -> anyhow::Result<(), NodeException> { self.ptr.stop().map_err(|e| e.into()) } - pub fn is_running(&self) -> bool { - self.ptr.is_running() + pub fn status(&self) -> NodeStatus { + self.ptr.status().into() + } + pub fn config(&self) -> Config { + self.ptr.config().into() } - pub fn event_handled(&self) { self.ptr.event_handled() } @@ -112,7 +154,9 @@ impl LdkNode { pub fn wait_next_event(&self) -> Event { self.ptr.wait_next_event().into() } - + pub async fn next_event_async(&self) -> Event { + self.ptr.next_event_async().await.into() + } pub fn node_id(&self) -> PublicKey { self.ptr.node_id().into() } @@ -126,48 +170,17 @@ impl LdkNode { }) } - 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 { - self.ptr - .send_to_onchain_address(&(address.try_into()?), amount_sats) - .map_err(|e| e.into()) - .map(|e| Txid { - hash: e.to_string(), - }) - } - - pub fn send_all_to_onchain_address( - &self, - address: Address, - ) -> anyhow::Result { - self.ptr - .send_all_to_onchain_address(&(address.try_into()?)) - .map_err(|e| e.into()) - .map(|e| e.into()) - } pub fn list_channels(&self) -> Vec { - self.ptr.list_channels().iter().map(|x| x.into()).collect() + self.ptr + .list_channels() + .iter() + .map(|x| x.into()) + .collect() } pub fn connect( @@ -201,7 +214,7 @@ impl LdkNode { push_to_counterparty_msat: Option, announce_channel: bool, channel_config: Option, - ) -> anyhow::Result<(), NodeException> { + ) -> Result { self.ptr .connect_open_channel( node_id.try_into()?, @@ -214,6 +227,7 @@ impl LdkNode { announce_channel, ) .map_err(|e| e.into()) + .map(|e| e.into()) } pub fn sync_wallets(&self) -> anyhow::Result<(), NodeException> { @@ -222,165 +236,227 @@ impl LdkNode { pub fn close_channel( &self, - channel_id: ChannelId, + user_channel_id: UserChannelId, counterparty_node_id: PublicKey, ) -> anyhow::Result<(), NodeException> { self.ptr - .close_channel(&(channel_id.into()), counterparty_node_id.try_into()?) + .close_channel(&(user_channel_id.try_into()?), counterparty_node_id.try_into()?) .map_err(|e| e.into()) } pub fn update_channel_config( &self, - channel_id: ChannelId, + user_channel_id: UserChannelId, counterparty_node_id: PublicKey, - channel_config: ChannelConfig, + channel_config: ChannelConfig ) -> anyhow::Result<(), NodeException> { self.ptr .update_channel_config( - &channel_id.into(), + &(user_channel_id.try_into()?), counterparty_node_id.try_into()?, - Arc::new(channel_config.into()), + Arc::new(channel_config.into()) ) .map_err(|e| e.into()) } - pub fn send_payment( - &self, - invoice: Bolt11Invoice, - ) -> anyhow::Result { - self.ptr - .send_payment(&(invoice.try_into()?)) - .map_err(|e| e.into()) - .map(|e| e.into()) + pub fn payment(&self, payment_id: PaymentId) -> Option { + match self.ptr.payment(&(payment_id.into())) { + None => None, + Some(e) => Some(e.into()), + } } - pub fn send_payment_using_amount( - &self, - invoice: Bolt11Invoice, - amount_msat: u64, - ) -> anyhow::Result { - self.ptr - .send_payment_using_amount(&(invoice.try_into()?), amount_msat) - .map_err(|e| e.into()) - .map(|e| e.into()) + pub fn remove_payment(&self, payment_id: PaymentId) -> Result<(), NodeException> { + self.ptr.remove_payment(&(payment_id.into())).map_err(|e| e.into()) } - pub fn send_spontaneous_payment( + pub fn list_payments_with_filter( &self, - amount_msat: u64, - node_id: PublicKey, - ) -> anyhow::Result { + payment_direction: PaymentDirection + ) -> Vec { self.ptr - .send_spontaneous_payment(amount_msat, node_id.try_into()?) - .map_err(|e| e.into()) - .map(|e| e.into()) + .list_payments_with_filter(|p| p.direction == payment_direction.into()) + .iter() + .map(|x| x.to_owned().into()) + .collect() } - pub fn send_payment_probes(&self, invoice: Bolt11Invoice) -> anyhow::Result<(), NodeException> { + pub fn list_payments(&self) -> Vec { self.ptr - .send_payment_probes(&(invoice.try_into()?)) - .map_err(|e| e.into()) + .list_payments() + .iter() + .map(|x| x.to_owned().into()) + .collect() } - ///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<(), NodeException> { + pub fn list_peers(&self) -> Vec { self.ptr - .send_spontaneous_payment_probes(amount_msat, node_id.try_into()?) - .map_err(|e| e.into()) + .list_peers() + .iter() + .map(|x| x.to_owned().into()) + .collect() } - pub fn send_payment_probes_using_amount( + pub fn sign_message(&self, msg: Vec) -> anyhow::Result { + self.ptr.sign_message(msg.as_slice()).map_err(|e| e.into()) + } + pub fn bolt11_payment(ptr: Self) -> LdkBolt11Payment { + ptr.ptr.bolt11_payment().into() + } + pub fn on_chain_payment(ptr: Self) -> LdkOnChainPayment { + ptr.ptr.onchain_payment().into() + } + pub fn spontaneous_payment(ptr: Self) -> LdkSpontaneousPayment { + ptr.ptr.spontaneous_payment().into() + } + + pub fn verify_signature( &self, - invoice: Bolt11Invoice, - amount_msat: u64, - ) -> Result<(), NodeException> { - self.ptr - .send_payment_probes_using_amount(&(invoice.try_into()?), amount_msat) - .map_err(|e| e.into()) + msg: Vec, + sig: String, + public_key: PublicKey + ) -> anyhow::Result { + Ok(self.ptr.verify_signature(msg.as_slice(), sig.as_str(), &public_key.try_into()?)) + } +} +pub struct LdkSpontaneousPayment { + pub ptr:RustOpaque +} +impl From for LdkSpontaneousPayment { + fn from(value: ldk_node::payment::SpontaneousPayment) -> Self { + Self{ptr:RustOpaque::new(value)} + } +} +impl LdkSpontaneousPayment { + pub fn send(&self, amount_msat: u64, node_id: PublicKey) -> Result { + self.ptr.send(amount_msat, node_id.try_into()?).map_err(|e| e.into()).map(|e| e.into()) + } + pub fn send_probes(&self, amount_msat: u64, node_id: PublicKey) -> Result<(), NodeException> { + self.ptr.send_probes(amount_msat, node_id.try_into()?).map_err(|e| e.into()).map(|e| e.into()) + } +} +pub struct LdkBolt11Payment { + pub ptr:RustOpaque +} +impl From for LdkBolt11Payment { + fn from(value: ldk_node::payment::Bolt11Payment) -> Self { + LdkBolt11Payment {ptr:RustOpaque::new(value)} } +} + - pub fn receive_payment( +impl LdkBolt11Payment { + pub fn receive( &self, amount_msat: u64, description: String, expiry_secs: u32, ) -> anyhow::Result { self.ptr - .receive_payment(amount_msat, description.as_str(), expiry_secs) + .receive(amount_msat, description.as_str(), expiry_secs) .map_err(|e| e.into()) .map(|e| e.into()) } - - pub fn receive_variable_amount_payment( + pub fn receive_variable_amount( &self, description: String, expiry_secs: u32, ) -> anyhow::Result { self.ptr - .receive_variable_amount_payment(description.as_str(), expiry_secs) + .receive_variable_amount + (description.as_str(), expiry_secs) .map_err(|e| e.into()) - .map(|e| Bolt11Invoice { - signed_raw_invoice: e.to_string(), - }) + .map(|e| e.into()) + } + pub fn receive_variable_amount_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_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 payment(&self, payment_hash: PaymentHash) -> Option { - match self.ptr.payment(&(payment_hash.into())) { - None => None, - Some(e) => Some(e.into()), + pub fn receive_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_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 remove_payment(&self, payment_hash: PaymentHash) -> Result<(), NodeException> { + + pub fn send_probes(&self, invoice: Bolt11Invoice) -> anyhow::Result<(), NodeException> { self.ptr - .remove_payment(&(payment_hash.into())) + .send_probes(&(invoice.try_into()?)) .map_err(|e| e.into()) } - pub fn list_payments_with_filter( + + pub fn send_probes_using_amount( &self, - payment_direction: PaymentDirection, - ) -> Vec { + invoice: Bolt11Invoice, + amount_msat: u64, + ) -> Result<(), NodeException> { self.ptr - .list_payments_with_filter(|p| p.direction == payment_direction.into()) - .iter() - .map(|x| x.to_owned().into()) - .collect() + .send_probes_using_amount(&(invoice.try_into()?), amount_msat) + .map_err(|e| e.into()) } - pub fn list_payments(&self) -> Vec { - self.ptr - .list_payments() - .iter() - .map(|x| x.to_owned().into()) - .collect() + pub fn send(&self, invoice: Bolt11Invoice) -> Result { + self.ptr.send(&(invoice.try_into()?)).map_err(|e| e.into()).map(|e| e.into()) } - - pub fn list_peers(&self) -> Vec { + pub fn send_using_amount( + &self, + invoice: Bolt11Invoice, + amount_msat: u64, + ) -> anyhow::Result { self.ptr - .list_peers() - .iter() - .map(|x| x.to_owned().into()) - .collect() + .send_using_amount(&(invoice.try_into()?), amount_msat) + .map_err(|e| e.into()) + .map(|e| e.into()) } - - pub fn sign_message(&self, msg: Vec) -> anyhow::Result { - self.ptr.sign_message(msg.as_slice()).map_err(|e| e.into()) +} +pub struct LdkOnChainPayment { + pub ptr:RustOpaque +} +impl From for LdkOnChainPayment { + fn from(value: ldk_node::payment::OnchainPayment) -> Self { + LdkOnChainPayment {ptr:RustOpaque::new(value)} } +} - pub fn verify_signature( - &self, - msg: Vec, - sig: String, - pkey: PublicKey, - ) -> anyhow::Result { - Ok(self - .ptr - .verify_signature(msg.as_slice(), sig.as_str(), &pkey.try_into()?)) +impl LdkOnChainPayment { + pub fn new_address(&self) -> Result { + self.ptr.new_address().map_err(|e| e.into()).map(|e| e.into()) } -} + pub fn send_to_address( + &self, address: Address, amount_sats: u64, + ) -> Result { + self.ptr.send_to_address(&(address.try_into()?), amount_sats).map_err(|e| e.into()).map(|e| e.into()) + } + pub fn send_all_to_address( + &self, address: Address, + ) -> Result { + self.ptr.send_all_to_address(&(address.try_into()?)).map_err(|e| e.into()).map(|e| e.into()) + } + + +} \ No newline at end of file diff --git a/rust/src/api/types.rs b/rust/src/api/types.rs index 35504d3..02e8ea5 100644 --- a/rust/src/api/types.rs +++ b/rust/src/api/types.rs @@ -1,10 +1,11 @@ -use crate::api::error::{BuilderException, NodeException}; use crate::api::node::LdkMnemonic; -use flutter_rust_bridge::frb; +use flutter_rust_bridge::*; +use ldk_node::lightning::util::ser::{Readable, Writeable}; use std::str::FromStr; use std::string::ToString; +use crate::api::error::{BuilderException, NodeException}; -///An address which can be used to connect to a remote peer. +///The addresses on which the node will listen for incoming connections. #[derive(Debug, Clone, PartialEq, Eq)] pub enum SocketAddress { TcpIpV4 { @@ -27,17 +28,6 @@ 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 { @@ -68,7 +58,6 @@ impl From for SocketAddress { } } } - impl TryFrom for ldk_node::lightning::ln::msgs::SocketAddress { type Error = BuilderException; @@ -104,6 +93,7 @@ impl TryFrom for ldk_node::lightning::ln::msgs::SocketAddress { } } } +#[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. @@ -123,7 +113,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: MaxDustHTLCExposure, + pub max_dust_htlc_exposure: Option, ///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. @@ -135,10 +125,26 @@ 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. + // 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. 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. // @@ -155,29 +161,27 @@ 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::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, - }); + 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) + } + } + }; config } } @@ -208,87 +212,307 @@ impl From for ldk_node::lightning::ln::ChannelId { /// #[derive(Debug, Clone, PartialEq, Eq)] pub struct UserChannelId { - pub data: u64, + pub data: Vec, } /// 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.0 as u64, + data: value.encode(), } } } -#[derive(Debug, Clone, PartialEq, Eq)] -/// An event emitted by [Node], which should be handled by the user. +impl TryFrom for ldk_node::UserChannelId { + type Error = NodeException; + + fn try_from(value: UserChannelId) -> Result { + let mut encoded = value.data.as_slice(); + ldk_node::UserChannelId::read(&mut encoded).map_err(|e| e.into()) + } +} +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::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 + } + ldk_node::lightning::events::ClosureReason::LegacyCooperativeClosure => ClosureReason::LegacyCooperativeClosure, + ldk_node::lightning::events::ClosureReason::CounterpartyInitiatedCooperativeClosure => ClosureReason::CounterpartyInitiatedCooperativeClosure, + ldk_node::lightning::events:: ClosureReason::LocallyInitiatedCooperativeClosure => ClosureReason::LocallyInitiatedCooperativeClosure, + ldk_node::lightning::events::ClosureReason::HTLCsTimedOut => ClosureReason::HTLCsTimedOut + } + } +} +/// 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 + } + } + } +} +#[derive(Clone, Debug, PartialEq, Eq)] +/// The reason the channel was closed. See individual variants for more details. +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. + /// + /// [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel. + 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. + /// + /// This was only set in versions of LDK prior to 0.0.122. + // Can be removed once we disallow downgrading to 0.0.121 + LegacyCooperativeClosure, + /// The channel was closed after negotiating a cooperative close and we've now broadcasted + /// the cooperative close transaction. This indicates that the shutdown was initiated by our + /// counterparty. + /// + /// In rare cases where we initiated closure immediately prior to shutting down without + /// persisting, this value may be provided for channels we initiated closure for. + CounterpartyInitiatedCooperativeClosure, + /// The channel was closed after negotiating a cooperative close and we've now broadcasted + /// the cooperative close transaction. This indicates that the shutdown was initiated by us. + LocallyInitiatedCooperativeClosure, + /// 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. + /// + /// [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor + DisconnectedPeer, + /// Closure generated from `ChannelManager::read` if the [`ChannelMonitor`] is newer than + /// the [`ChannelManager`] deserialized. + /// + /// [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor + /// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager + 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, + /// One of our HTLCs timed out in a channel, causing us to force close the channel. + HTLCsTimedOut, +} +///A user-provided identifier in channelManager.sendPayment used to uniquely identify a payment and ensure idempotency in LDK. +#[derive(Eq, PartialEq, Debug, Clone)] + +pub struct PaymentId(pub [u8; 32]); + +impl From for PaymentId { + fn from(value: ldk_node::lightning::ln::channelmanager::PaymentId) -> Self { + PaymentId(value.0) + } +} +impl From for ldk_node::lightning::ln::channelmanager::PaymentId { + fn from(value:PaymentId) -> Self { + ldk_node::lightning::ln::channelmanager::PaymentId(value.0) + } +} +/// 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 { + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + payment_id: Option, /// 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 { + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + payment_id: Option, /// 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 { + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + payment_id: Option, /// The hash of the payment. payment_hash: PaymentHash, /// 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 `channelId` of the channel. + channel_id: ChannelId, + /// The `userChannelId` of the channel. + user_channel_id: UserChannelId, + /// The `temporaryChannelId` this channel used to be known by during channel establishment. + former_temporary_channel_id: ChannelId, + /// The `nodeId` 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 `channelId` of the channel. channel_id: ChannelId, - /// The user_channel_id of the channel. + /// The `userChannelId` of the channel. user_channel_id: UserChannelId, - + /// The `nodeId` 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 `channelId` of the channel. channel_id: ChannelId, - /// The user_channel_id of the channel. + /// The `userChannelId` of the channel. user_channel_id: UserChannelId, + /// The `nodeId` 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 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, + /// This will be `None` for events serialized by LDK Node v0.2.1 and prior. + reason: Option, }, } impl From for Event { fn from(value: ldk_node::Event) -> Self { match value { - ldk_node::Event::PaymentSuccessful { payment_hash } => Event::PaymentSuccessful { + ldk_node::Event::PaymentSuccessful { + payment_id, payment_hash, + fee_paid_msat, + } => Event::PaymentSuccessful { + payment_id: payment_id.map(|e| e.into()), payment_hash: PaymentHash { data: payment_hash.0, }, + fee_paid_msat, }, - ldk_node::Event::PaymentFailed { payment_hash } => Event::PaymentFailed { + ldk_node::Event::PaymentFailed { + payment_id, payment_hash, + reason, + } => Event::PaymentFailed { + payment_id: payment_id.map(|e| e.into()), payment_hash: PaymentHash { data: payment_hash.0, }, + reason: reason.map(|e| e.into()), }, ldk_node::Event::PaymentReceived { - payment_hash, + payment_id, payment_hash, amount_msat, } => Event::PaymentReceived { + payment_id: payment_id.map(|e| e.into()), payment_hash: PaymentHash { data: payment_hash.0, }, @@ -307,10 +531,12 @@ 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, @@ -385,12 +611,12 @@ pub enum PaymentStatus { Failed, } -impl From for PaymentStatus { - fn from(value: ldk_node::PaymentStatus) -> Self { +impl From for PaymentStatus { + fn from(value: ldk_node::payment::PaymentStatus) -> Self { match value { - ldk_node::PaymentStatus::Pending => PaymentStatus::Pending, - ldk_node::PaymentStatus::Succeeded => PaymentStatus::Succeeded, - ldk_node::PaymentStatus::Failed => PaymentStatus::Failed, + ldk_node::payment::PaymentStatus::Pending => PaymentStatus::Pending, + ldk_node::payment::PaymentStatus::Succeeded => PaymentStatus::Succeeded, + ldk_node::payment::PaymentStatus::Failed => PaymentStatus::Failed, } } } @@ -405,20 +631,20 @@ pub enum PaymentDirection { Outbound, } -impl From for PaymentDirection { - fn from(value: ldk_node::PaymentDirection) -> Self { +impl From for PaymentDirection { + fn from(value: ldk_node::payment::PaymentDirection) -> Self { match value { - ldk_node::PaymentDirection::Inbound => PaymentDirection::Inbound, - ldk_node::PaymentDirection::Outbound => PaymentDirection::Outbound, + ldk_node::payment::PaymentDirection::Inbound => PaymentDirection::Inbound, + ldk_node::payment::PaymentDirection::Outbound => PaymentDirection::Outbound, } } } -impl From for ldk_node::PaymentDirection { +impl From for ldk_node::payment::PaymentDirection { fn from(value: PaymentDirection) -> Self { match value { - PaymentDirection::Inbound => ldk_node::PaymentDirection::Inbound, - PaymentDirection::Outbound => ldk_node::PaymentDirection::Outbound, + PaymentDirection::Inbound => ldk_node::payment::PaymentDirection::Inbound, + PaymentDirection::Outbound => ldk_node::payment::PaymentDirection::Outbound, } } } @@ -449,6 +675,11 @@ 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)] @@ -456,19 +687,18 @@ pub struct PaymentSecret { pub data: [u8; 32], } -// Structs wrapping the particular information which should easily be -// understandable, parseable, and transformable, i.e., we'll try to avoid -// exposing too many technical detail here. +impl From for PaymentSecret { + fn from(value: ldk_node::lightning_invoice::PaymentSecret) -> Self { + PaymentSecret{ data: value.0 } + } +} /// Represents a payment. -/// #[derive(Clone, Debug, PartialEq, Eq)] pub struct PaymentDetails { - /// The payment hash, i.e., the hash of the `preimage`. - pub hash: PaymentHash, - /// The pre-image used by the payment. - pub preimage: Option, - /// The secret used by the payment. - pub secret: Option, + /// The identifier of this payment. + pub id: PaymentId, + /// The kind of the payment. + pub kind: PaymentKind, /// The amount transferred. pub amount_msat: Option, /// The direction of the payment. @@ -477,19 +707,99 @@ pub struct PaymentDetails { pub status: PaymentStatus, } -impl From for PaymentDetails { - fn from(value: ldk_node::PaymentDetails) -> Self { +impl From for PaymentDetails { + fn from(value: ldk_node::payment::PaymentDetails) -> Self { PaymentDetails { - hash: PaymentHash { data: value.hash.0 }, - preimage: value.preimage.map(|x| PaymentPreimage { data: x.0 }), - secret: value.secret.map(|x| PaymentSecret { data: x.0 }), + id: value.id.into(), status: value.status.into(), amount_msat: value.amount_msat, direction: value.direction.into(), + kind: value.kind.into(), + } + } +} +/// Limits applying to how much fee we allow an LSP to deduct from the payment amount. +#[derive(Copy, Clone, Debug, PartialEq, Eq)] +pub struct LSPFeeLimits { + /// The maximal total amount we allow any configured LSP withhold from us when forwarding the + /// payment. + pub max_total_opening_fee_msat: Option, + /// The maximal proportional fee, in parts-per-million millisatoshi, we allow any configured + /// LSP withhold from us when forwarding the payment. + pub max_proportional_opening_fee_ppm_msat: Option, +} +impl From for LSPFeeLimits{ + fn from(value: ldk_node::payment::LSPFeeLimits) -> Self { + LSPFeeLimits{ max_total_opening_fee_msat: value.max_total_opening_fee_msat, + max_proportional_opening_fee_ppm_msat: value. max_proportional_opening_fee_ppm_msat } + } +} +/// Represents the kind of a payment. +#[derive(Clone, Debug, PartialEq, Eq)] +pub enum PaymentKind { + /// An on-chain payment. + Onchain, + /// A [BOLT 11] payment. + /// + /// [BOLT 11]: https://github.com/lightning/bolts/blob/master/11-payment-encoding.md + // TODO: Bolt11 { invoice: Option }, + Bolt11 { + /// The payment hash, i.e., the hash of the `preimage`. + hash: PaymentHash, + /// The pre-image used by the payment. + preimage: Option, + /// The secret used by the payment. + secret: Option, + }, + /// A [BOLT 11] payment intended to open an [LSPS 2] just-in-time channel. + /// + /// [BOLT 11]: https://github.com/lightning/bolts/blob/master/11-payment-encoding.md + /// [LSPS 2]: https://github.com/BitcoinAndLightningLayerSpecs/lsp/blob/main/LSPS2/README.md + Bolt11Jit { + /// The payment hash, i.e., the hash of the `preimage`. + hash: PaymentHash, + /// The pre-image used by the payment. + preimage: Option, + /// The secret used by the payment. + secret: Option, + /// Limits applying to how much fee we allow an LSP to deduct from the payment amount. + /// + /// Allowing them to deduct this fee from the first inbound payment will pay for the LSP's + /// channel opening fees. + /// + lsp_fee_limits: LSPFeeLimits, + }, + /// A spontaneous ("keysend") payment. + Spontaneous { + /// The payment hash, i.e., the hash of the `preimage`. + hash: PaymentHash, + /// The pre-image used by the payment. + preimage: Option, + }, +} +impl From for PaymentKind{ + fn from(value: ldk_node::payment::PaymentKind) -> Self { + match value { + ldk_node::payment::PaymentKind::Onchain => PaymentKind::Onchain, + ldk_node::payment::PaymentKind::Bolt11 + { hash, preimage, secret } => PaymentKind::Bolt11{ + hash: hash.into(), + preimage: preimage.map(|e| e.into()), + secret: secret.map(|e| e.into()), + }, + ldk_node::payment::PaymentKind::Bolt11Jit { hash, preimage, secret, lsp_fee_limits } => + PaymentKind::Bolt11Jit { + hash: hash.into(), + preimage: preimage.map(|e| e.into()), + secret: secret.map(|e| e.into()), + lsp_fee_limits: lsp_fee_limits.into(), + }, + ldk_node::payment::PaymentKind::Spontaneous { hash, preimage } => + PaymentKind::Spontaneous{ hash: hash.into(), + preimage: preimage.map(|e| e.into()) } } } } - #[derive(Debug, Clone, PartialEq, Eq)] ///Represents a syntactically and semantically correct lightning BOLT11 invoice. /// @@ -557,116 +867,130 @@ impl From for Address { } } -/// Details of a channel, as returned by node.listChannels() -/// -#[derive(Clone, Debug, PartialEq, Eq)] +#[derive(Debug, Clone)] pub struct ChannelDetails { - /// 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). + /// 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). + /// /// 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 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 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. /// - /// This value is not included in `outbound_capacity_msat` as it can never be spent. + /// This value is not included in `outboundCapacityMsat` as it can never be spent. /// - /// This value will be null for outbound channels until the counterparty accepts the channel. + /// This value will be `None` for outbound channels until the counterparty accepts the channel. /// pub unspendable_punishment_reserve: Option, - /// 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. - /// + /// The local `user_channel_id` of this channel. 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, - /// 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 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 + /// The amount does not include any pending HTLCs which are not yet 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 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 available outbound capacity for sending HTLCs to the remote peer. /// + /// 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 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 number of required confirmations on the funding transactions before the funding is + /// considered "locked". The amount is selected by the channel fundee. /// + /// 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, - - /// True if the channel was initiated (and thus funded) by us. - /// + /// Returns `true` if the channel was initiated (and therefore funded) by us. 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 - /// + /// 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, - /// 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 is a strict superset of `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. /// + /// This is a strict superset of `is_channel_ready`. pub is_usable: bool, - /// True if this channel is (or will be) publicly-announced. - /// + /// 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. + /// + /// This value is not included in [`inbound_capacity_msat`] as it can never be spent. + /// + /// [`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 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. + /// + /// 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, } 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.txid.to_string()), + funding_txo: value.clone().funding_txo.map(|x| x.into()), 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, @@ -675,6 +999,29 @@ 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(), } } } @@ -697,13 +1044,24 @@ pub enum Network { Regtest, } -impl From for ldk_node::Network { +impl From for ldk_node::bitcoin::Network { fn from(value: Network) -> Self { match value { - Network::Bitcoin => ldk_node::Network::Bitcoin, - Network::Testnet => ldk_node::Network::Testnet, - Network::Signet => ldk_node::Network::Signet, - Network::Regtest => ldk_node::Network::Regtest, + 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, } } } @@ -770,9 +1128,90 @@ 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 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::InvalidPublicKey) + }) + .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 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] +#[frb(serialize)] #[derive(Debug, Clone)] pub struct Config { #[frb(non_final)] @@ -820,49 +1259,7 @@ 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 { @@ -902,6 +1299,385 @@ 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::lightning::chain::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 22a3cb7..451e5c9 100644 --- a/rust/src/frb_generated.io.rs +++ b/rust/src/frb_generated.io.rs @@ -15,9 +15,46 @@ flutter_rust_bridge::frb_generated_boilerplate_io!(); // Section: dart2rust -impl CstDecode>> for usize { +impl CstDecode for usize { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> RustOpaqueNom> { + fn cst_decode(self) -> NodeBuilder { + CstDecode::< + RustOpaqueNom>, + >::cst_decode(self) + .rust_auto_opaque_decode_owned() + } +} +impl CstDecode> for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> RustOpaqueNom { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode>> + for usize +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode( + self, + ) -> RustOpaqueNom> { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode> for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> RustOpaqueNom { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode> for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> RustOpaqueNom { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode> for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> RustOpaqueNom { unsafe { decode_rust_opaque_nom(self as _) } } } @@ -36,6 +73,29 @@ 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 { @@ -81,6 +141,13 @@ 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 { @@ -109,6 +176,13 @@ impl CstDecode for *mut wire_cst_gossip_s CstDecode::::cst_decode(*wrap).into() } } +impl CstDecode for *mut wire_cst_ldk_bolt_11_payment { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::node::LdkBolt11Payment { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} 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::LdkMnemonic { @@ -123,6 +197,41 @@ impl CstDecode for *mut wire_cst_ldk_node { CstDecode::::cst_decode(*wrap).into() } } +impl CstDecode for *mut wire_cst_ldk_on_chain_payment { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::node::LdkOnChainPayment { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} +impl CstDecode for *mut wire_cst_ldk_spontaneous_payment { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::node::LdkSpontaneousPayment { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + 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_lsp_fee_limits { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::LSPFeeLimits { + 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_out_point { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::OutPoint { @@ -137,6 +246,13 @@ 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 { @@ -144,6 +260,13 @@ impl CstDecode for *mut wire_cst_payment_hash { CstDecode::::cst_decode(*wrap).into() } } +impl CstDecode for *mut wire_cst_payment_id { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::PaymentId { + 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_preimage { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::PaymentPreimage { @@ -172,6 +295,19 @@ 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 { @@ -231,7 +367,6 @@ 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(), @@ -240,6 +375,31 @@ 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(), } } } @@ -251,6 +411,37 @@ 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::LegacyCooperativeClosure, + 3 => crate::api::types::ClosureReason::CounterpartyInitiatedCooperativeClosure, + 4 => crate::api::types::ClosureReason::LocallyInitiatedCooperativeClosure, + 5 => crate::api::types::ClosureReason::CommitmentTxConfirmed, + 6 => crate::api::types::ClosureReason::FundingTimedOut, + 7 => { + let ans = unsafe { self.kind.ProcessingError }; + crate::api::types::ClosureReason::ProcessingError { + err: ans.err.cst_decode(), + } + } + 8 => crate::api::types::ClosureReason::DisconnectedPeer, + 9 => crate::api::types::ClosureReason::OutdatedChannelManager, + 10 => crate::api::types::ClosureReason::CounterpartyCoopClosedUnfundedChannel, + 11 => crate::api::types::ClosureReason::FundingBatchClosure, + 12 => crate::api::types::ClosureReason::HTLCsTimedOut, + _ => 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 { @@ -303,46 +494,52 @@ impl CstDecode for wire_cst_event { 0 => { let ans = unsafe { self.kind.PaymentSuccessful }; crate::api::types::Event::PaymentSuccessful { + payment_id: ans.payment_id.cst_decode(), 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_id: ans.payment_id.cst_decode(), payment_hash: ans.payment_hash.cst_decode(), + reason: ans.reason.cst_decode(), } } 2 => { let ans = unsafe { self.kind.PaymentReceived }; crate::api::types::Event::PaymentReceived { + payment_id: ans.payment_id.cst_decode(), payment_hash: ans.payment_hash.cst_decode(), amount_msat: ans.amount_msat.cst_decode(), } } 3 => { - let ans = unsafe { self.kind.ChannelReady }; - crate::api::types::Event::ChannelReady { + 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(), + funding_txo: ans.funding_txo.cst_decode(), } } 4 => { - let ans = unsafe { self.kind.ChannelClosed }; - crate::api::types::Event::ChannelClosed { + 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(), counterparty_node_id: ans.counterparty_node_id.cst_decode(), } } 5 => { - let ans = unsafe { self.kind.ChannelPending }; - crate::api::types::Event::ChannelPending { + 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(), - 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(), + reason: ans.reason.cst_decode(), } } _ => unreachable!(), @@ -362,6 +559,14 @@ impl CstDecode for wire_cst_gossip_source } } } +impl CstDecode for wire_cst_ldk_bolt_11_payment { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::node::LdkBolt11Payment { + crate::api::node::LdkBolt11Payment { + ptr: self.ptr.cst_decode(), + } + } +} impl CstDecode for wire_cst_ldk_mnemonic { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::node::LdkMnemonic { @@ -378,6 +583,94 @@ impl CstDecode for wire_cst_ldk_node { } } } +impl CstDecode for wire_cst_ldk_on_chain_payment { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::node::LdkOnChainPayment { + crate::api::node::LdkOnChainPayment { + ptr: self.ptr.cst_decode(), + } + } +} +impl CstDecode for wire_cst_ldk_spontaneous_payment { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::node::LdkSpontaneousPayment { + crate::api::node::LdkSpontaneousPayment { + ptr: self.ptr.cst_decode(), + } + } +} +impl CstDecode for wire_cst_lightning_balance { + // 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!(), + } + } +} +impl CstDecode for wire_cst_liquidity_source_config { + // 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(), + } + } +} impl CstDecode> for *mut wire_cst_list_channel_details { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> Vec { @@ -388,6 +681,16 @@ 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 { @@ -408,6 +711,18 @@ 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 { @@ -446,6 +761,17 @@ impl CstDecode> for *mut wire_cst_list_soc vec.into_iter().map(CstDecode::cst_decode).collect() } } +impl CstDecode for wire_cst_lsp_fee_limits { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::LSPFeeLimits { + crate::api::types::LSPFeeLimits { + max_total_opening_fee_msat: self.max_total_opening_fee_msat.cst_decode(), + max_proportional_opening_fee_ppm_msat: self + .max_proportional_opening_fee_ppm_msat + .cst_decode(), + } + } +} impl CstDecode for 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 { @@ -462,6 +788,27 @@ impl CstDecode for wire_cst_max_dust_htl } } } +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 { @@ -475,9 +822,8 @@ impl CstDecode for wire_cst_payment_details { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::PaymentDetails { crate::api::types::PaymentDetails { - hash: self.hash.cst_decode(), - preimage: self.preimage.cst_decode(), - secret: self.secret.cst_decode(), + id: self.id.cst_decode(), + kind: self.kind.cst_decode(), amount_msat: self.amount_msat.cst_decode(), direction: self.direction.cst_decode(), status: self.status.cst_decode(), @@ -492,6 +838,45 @@ impl CstDecode for wire_cst_payment_hash { } } } +impl CstDecode for wire_cst_payment_id { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::PaymentId { + crate::api::types::PaymentId(self.field0.cst_decode()) + } +} +impl CstDecode for wire_cst_payment_kind { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::PaymentKind { + match self.tag { + 0 => crate::api::types::PaymentKind::Onchain, + 1 => { + let ans = unsafe { self.kind.Bolt11 }; + crate::api::types::PaymentKind::Bolt11 { + hash: ans.hash.cst_decode(), + preimage: ans.preimage.cst_decode(), + secret: ans.secret.cst_decode(), + } + } + 2 => { + let ans = unsafe { self.kind.Bolt11Jit }; + crate::api::types::PaymentKind::Bolt11Jit { + hash: ans.hash.cst_decode(), + preimage: ans.preimage.cst_decode(), + secret: ans.secret.cst_decode(), + lsp_fee_limits: ans.lsp_fee_limits.cst_decode(), + } + } + 3 => { + let ans = unsafe { self.kind.Spontaneous }; + crate::api::types::PaymentKind::Spontaneous { + hash: ans.hash.cst_decode(), + preimage: ans.preimage.cst_decode(), + } + } + _ => unreachable!(), + } + } +} impl CstDecode for wire_cst_payment_preimage { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::PaymentPreimage { @@ -518,6 +903,40 @@ 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 { @@ -526,6 +945,28 @@ impl CstDecode for wire_cst_public_key { } } } +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 { @@ -631,6 +1072,35 @@ 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 { @@ -662,7 +1132,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: Default::default(), + max_dust_htlc_exposure: core::ptr::null_mut(), force_close_avoidance_max_fee_satoshis: Default::default(), accept_underpaying_htlcs: Default::default(), } @@ -683,7 +1153,6 @@ 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(), @@ -692,6 +1161,19 @@ 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(), } } } @@ -712,7 +1194,20 @@ impl Default for wire_cst_channel_id { Self::new_with_null_ptr() } } -impl NewWithNullPtr for wire_cst_config { +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 { storage_dir_path: core::ptr::null_mut(), @@ -773,6 +1268,18 @@ impl Default for wire_cst_gossip_source_config { Self::new_with_null_ptr() } } +impl NewWithNullPtr for wire_cst_ldk_bolt_11_payment { + fn new_with_null_ptr() -> Self { + Self { + ptr: Default::default(), + } + } +} +impl Default for wire_cst_ldk_bolt_11_payment { + fn default() -> Self { + Self::new_with_null_ptr() + } +} impl NewWithNullPtr for wire_cst_ldk_mnemonic { fn new_with_null_ptr() -> Self { Self { @@ -797,6 +1304,68 @@ impl Default for wire_cst_ldk_node { Self::new_with_null_ptr() } } +impl NewWithNullPtr for wire_cst_ldk_on_chain_payment { + fn new_with_null_ptr() -> Self { + Self { + ptr: Default::default(), + } + } +} +impl Default for wire_cst_ldk_on_chain_payment { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_ldk_spontaneous_payment { + fn new_with_null_ptr() -> Self { + Self { + ptr: Default::default(), + } + } +} +impl Default for wire_cst_ldk_spontaneous_payment { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_lightning_balance { + fn new_with_null_ptr() -> Self { + Self { + tag: -1, + kind: LightningBalanceKind { nil__: () }, + } + } +} +impl Default for wire_cst_lightning_balance { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_liquidity_source_config { + fn new_with_null_ptr() -> Self { + Self { + lsps2_service: Default::default(), + } + } +} +impl Default for wire_cst_liquidity_source_config { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_lsp_fee_limits { + fn new_with_null_ptr() -> Self { + Self { + max_total_opening_fee_msat: core::ptr::null_mut(), + max_proportional_opening_fee_ppm_msat: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_lsp_fee_limits { + fn default() -> Self { + Self::new_with_null_ptr() + } +} impl NewWithNullPtr for wire_cst_max_dust_htlc_exposure { fn new_with_null_ptr() -> Self { Self { @@ -810,6 +1379,25 @@ impl Default for wire_cst_max_dust_htlc_exposure { 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 { @@ -826,9 +1414,8 @@ impl Default for wire_cst_out_point { impl NewWithNullPtr for wire_cst_payment_details { fn new_with_null_ptr() -> Self { Self { - hash: Default::default(), - preimage: core::ptr::null_mut(), - secret: core::ptr::null_mut(), + id: Default::default(), + kind: Default::default(), amount_msat: core::ptr::null_mut(), direction: Default::default(), status: Default::default(), @@ -852,6 +1439,31 @@ impl Default for wire_cst_payment_hash { Self::new_with_null_ptr() } } +impl NewWithNullPtr for wire_cst_payment_id { + fn new_with_null_ptr() -> Self { + Self { + field0: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_payment_id { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_payment_kind { + fn new_with_null_ptr() -> Self { + Self { + tag: -1, + kind: PaymentKindKind { nil__: () }, + } + } +} +impl Default for wire_cst_payment_kind { + fn default() -> Self { + Self::new_with_null_ptr() + } +} impl NewWithNullPtr for wire_cst_payment_preimage { fn new_with_null_ptr() -> Self { Self { @@ -890,6 +1502,19 @@ 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 { @@ -902,6 +1527,20 @@ 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 { @@ -930,7 +1569,7 @@ impl Default for wire_cst_txid { impl NewWithNullPtr for wire_cst_user_channel_id { fn new_with_null_ptr() -> Self { Self { - data: Default::default(), + data: core::ptr::null_mut(), } } } @@ -941,35 +1580,155 @@ impl Default for wire_cst_user_channel_id { } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_build_with_sqlite_store( +pub extern "C" fn frbgen_ldk_node_wire_NodeBuilder_build(port_: i64, that: usize) { + wire_NodeBuilder_build_impl(port_, that) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire_NodeBuilder_build_with_fs_store(port_: i64, that: usize) { + wire_NodeBuilder_build_with_fs_store_impl(port_, that) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire_NodeBuilder_create_builder( 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, ) { - wire_build_with_sqlite_store_impl( + wire_NodeBuilder_create_builder_impl( port_, config, chain_data_source_config, entropy_source_config, gossip_source_config, + liquidity_source_config, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire_ldk_bolt_11_payment_receive( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + amount_msat: u64, + description: *mut wire_cst_list_prim_u_8_strict, + expiry_secs: u32, +) { + wire_ldk_bolt_11_payment_receive_impl(port_, that, amount_msat, description, expiry_secs) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire_ldk_bolt_11_payment_receive_variable_amount( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + description: *mut wire_cst_list_prim_u_8_strict, + expiry_secs: u32, +) { + wire_ldk_bolt_11_payment_receive_variable_amount_impl(port_, that, description, expiry_secs) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire_ldk_bolt_11_payment_receive_variable_amount_via_jit_channel( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + description: *mut wire_cst_list_prim_u_8_strict, + expiry_secs: u32, + max_proportional_lsp_fee_limit_ppm_msat: *mut u64, +) { + wire_ldk_bolt_11_payment_receive_variable_amount_via_jit_channel_impl( + port_, + that, + description, + expiry_secs, + max_proportional_lsp_fee_limit_ppm_msat, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire_ldk_bolt_11_payment_receive_via_jit_channel( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + amount_msat: u64, + description: *mut wire_cst_list_prim_u_8_strict, + expiry_secs: u32, + max_total_lsp_fee_limit_msat: *mut u64, +) { + wire_ldk_bolt_11_payment_receive_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_ldk_bolt_11_payment_send( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + invoice: *mut wire_cst_bolt_11_invoice, +) { + wire_ldk_bolt_11_payment_send_impl(port_, that, invoice) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire_ldk_bolt_11_payment_send_probes( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + invoice: *mut wire_cst_bolt_11_invoice, +) { + wire_ldk_bolt_11_payment_send_probes_impl(port_, that, invoice) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire_ldk_bolt_11_payment_send_probes_using_amount( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + invoice: *mut wire_cst_bolt_11_invoice, + amount_msat: u64, +) { + wire_ldk_bolt_11_payment_send_probes_using_amount_impl(port_, that, invoice, amount_msat) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire_ldk_bolt_11_payment_send_using_amount( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + invoice: *mut wire_cst_bolt_11_invoice, + amount_msat: u64, +) { + wire_ldk_bolt_11_payment_send_using_amount_impl(port_, that, invoice, amount_msat) +} + #[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_ldk_node_bolt11_payment( + port_: i64, + ptr: *mut wire_cst_ldk_node, +) { + wire_ldk_node_bolt11_payment_impl(port_, ptr) +} + #[no_mangle] pub extern "C" fn frbgen_ldk_node_wire_ldk_node_close_channel( port_: i64, that: *mut wire_cst_ldk_node, - channel_id: *mut wire_cst_channel_id, + user_channel_id: *mut wire_cst_user_channel_id, counterparty_node_id: *mut wire_cst_public_key, ) { - wire_ldk_node_close_channel_impl(port_, that, channel_id, counterparty_node_id) + wire_ldk_node_close_channel_impl(port_, that, user_channel_id, counterparty_node_id) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_config(port_: i64, that: *mut wire_cst_ldk_node) { + wire_ldk_node_config_impl(port_, that) } #[no_mangle] @@ -1024,11 +1783,11 @@ pub extern "C" fn frbgen_ldk_node_wire_ldk_node_event_handled( } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_is_running( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_list_balances( port_: i64, that: *mut wire_cst_ldk_node, ) { - wire_ldk_node_is_running_impl(port_, that) + wire_ldk_node_list_balances_impl(port_, that) } #[no_mangle] @@ -1073,19 +1832,19 @@ pub extern "C" fn frbgen_ldk_node_wire_ldk_node_listening_addresses( } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_new_onchain_address( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_next_event( port_: i64, that: *mut wire_cst_ldk_node, ) { - wire_ldk_node_new_onchain_address_impl(port_, that) + wire_ldk_node_next_event_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_next_event( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_next_event_async( port_: i64, that: *mut wire_cst_ldk_node, ) { - wire_ldk_node_next_event_impl(port_, that) + wire_ldk_node_next_event_async_impl(port_, that) } #[no_mangle] @@ -1094,231 +1853,241 @@ pub extern "C" fn frbgen_ldk_node_wire_ldk_node_node_id(port_: i64, that: *mut w } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_payment( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_on_chain_payment( port_: i64, - that: *mut wire_cst_ldk_node, - payment_hash: *mut wire_cst_payment_hash, + ptr: *mut wire_cst_ldk_node, ) { - wire_ldk_node_payment_impl(port_, that, payment_hash) + wire_ldk_node_on_chain_payment_impl(port_, ptr) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_receive_payment( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_payment( port_: i64, that: *mut wire_cst_ldk_node, - amount_msat: u64, - description: *mut wire_cst_list_prim_u_8_strict, - expiry_secs: u32, + payment_id: *mut wire_cst_payment_id, ) { - wire_ldk_node_receive_payment_impl(port_, that, amount_msat, description, expiry_secs) + wire_ldk_node_payment_impl(port_, that, payment_id) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_receive_variable_amount_payment( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_remove_payment( port_: i64, that: *mut wire_cst_ldk_node, - description: *mut wire_cst_list_prim_u_8_strict, - expiry_secs: u32, + payment_id: *mut wire_cst_payment_id, ) { - wire_ldk_node_receive_variable_amount_payment_impl(port_, that, description, expiry_secs) + wire_ldk_node_remove_payment_impl(port_, that, payment_id) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_remove_payment( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_sign_message( port_: i64, that: *mut wire_cst_ldk_node, - payment_hash: *mut wire_cst_payment_hash, + msg: *mut wire_cst_list_prim_u_8_loose, ) { - wire_ldk_node_remove_payment_impl(port_, that, payment_hash) + wire_ldk_node_sign_message_impl(port_, that, msg) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_send_all_to_onchain_address( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_spontaneous_payment( port_: i64, - that: *mut wire_cst_ldk_node, - address: *mut wire_cst_address, + ptr: *mut wire_cst_ldk_node, ) { - wire_ldk_node_send_all_to_onchain_address_impl(port_, that, address) + wire_ldk_node_spontaneous_payment_impl(port_, ptr) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_send_payment( - port_: i64, - that: *mut wire_cst_ldk_node, - invoice: *mut wire_cst_bolt_11_invoice, -) { - wire_ldk_node_send_payment_impl(port_, that, invoice) +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_ldk_node_send_payment_probes( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_status(port_: i64, that: *mut wire_cst_ldk_node) { + wire_ldk_node_status_impl(port_, that) +} + +#[no_mangle] +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_ldk_node_sync_wallets( port_: i64, that: *mut wire_cst_ldk_node, - invoice: *mut wire_cst_bolt_11_invoice, ) { - wire_ldk_node_send_payment_probes_impl(port_, that, invoice) + wire_ldk_node_sync_wallets_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_send_payment_probes_using_amount( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_update_channel_config( port_: i64, that: *mut wire_cst_ldk_node, - invoice: *mut wire_cst_bolt_11_invoice, - amount_msat: u64, + user_channel_id: *mut wire_cst_user_channel_id, + counterparty_node_id: *mut wire_cst_public_key, + channel_config: *mut wire_cst_channel_config, ) { - wire_ldk_node_send_payment_probes_using_amount_impl(port_, that, invoice, amount_msat) + wire_ldk_node_update_channel_config_impl( + port_, + that, + user_channel_id, + counterparty_node_id, + channel_config, + ) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_send_payment_using_amount( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_verify_signature( port_: i64, that: *mut wire_cst_ldk_node, - invoice: *mut wire_cst_bolt_11_invoice, - amount_msat: u64, + msg: *mut wire_cst_list_prim_u_8_loose, + sig: *mut wire_cst_list_prim_u_8_strict, + public_key: *mut wire_cst_public_key, ) { - wire_ldk_node_send_payment_using_amount_impl(port_, that, invoice, amount_msat) + wire_ldk_node_verify_signature_impl(port_, that, msg, sig, public_key) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_send_spontaneous_payment( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_wait_next_event( port_: i64, that: *mut wire_cst_ldk_node, - amount_msat: u64, - node_id: *mut wire_cst_public_key, ) { - wire_ldk_node_send_spontaneous_payment_impl(port_, that, amount_msat, node_id) + wire_ldk_node_wait_next_event_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_send_spontaneous_payment_probes( +pub extern "C" fn frbgen_ldk_node_wire_ldk_on_chain_payment_new_address( port_: i64, - that: *mut wire_cst_ldk_node, - amount_msat: u64, - node_id: *mut wire_cst_public_key, + that: *mut wire_cst_ldk_on_chain_payment, ) { - wire_ldk_node_send_spontaneous_payment_probes_impl(port_, that, amount_msat, node_id) + wire_ldk_on_chain_payment_new_address_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_send_to_onchain_address( +pub extern "C" fn frbgen_ldk_node_wire_ldk_on_chain_payment_send_all_to_address( port_: i64, - that: *mut wire_cst_ldk_node, + that: *mut wire_cst_ldk_on_chain_payment, address: *mut wire_cst_address, - amount_sats: u64, ) { - wire_ldk_node_send_to_onchain_address_impl(port_, that, address, amount_sats) + wire_ldk_on_chain_payment_send_all_to_address_impl(port_, that, address) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_sign_message( +pub extern "C" fn frbgen_ldk_node_wire_ldk_on_chain_payment_send_to_address( port_: i64, - that: *mut wire_cst_ldk_node, - msg: *mut wire_cst_list_prim_u_8_loose, + that: *mut wire_cst_ldk_on_chain_payment, + address: *mut wire_cst_address, + amount_sats: u64, ) { - wire_ldk_node_sign_message_impl(port_, that, msg) + wire_ldk_on_chain_payment_send_to_address_impl(port_, that, address, amount_sats) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_spendable_onchain_balance_sats( +pub extern "C" fn frbgen_ldk_node_wire_ldk_spontaneous_payment_send( port_: i64, - that: *mut wire_cst_ldk_node, + that: *mut wire_cst_ldk_spontaneous_payment, + amount_msat: u64, + node_id: *mut wire_cst_public_key, ) { - wire_ldk_node_spendable_onchain_balance_sats_impl(port_, that) + wire_ldk_spontaneous_payment_send_impl(port_, that, amount_msat, node_id) } #[no_mangle] -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) +pub extern "C" fn frbgen_ldk_node_wire_ldk_spontaneous_payment_send_probes( + port_: i64, + that: *mut wire_cst_ldk_spontaneous_payment, + amount_msat: u64, + node_id: *mut wire_cst_public_key, +) { + wire_ldk_spontaneous_payment_send_probes_impl(port_, that, amount_msat, node_id) } #[no_mangle] -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) +pub extern "C" fn frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_Node( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::::increment_strong_count(ptr as _); + } } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_sync_wallets( - port_: i64, - that: *mut wire_cst_ldk_node, +pub extern "C" fn frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_Node( + ptr: *const std::ffi::c_void, ) { - wire_ldk_node_sync_wallets_impl(port_, that) + unsafe { + StdArc::::decrement_strong_count(ptr as _); + } } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_total_onchain_balance_sats( - port_: i64, - that: *mut wire_cst_ldk_node, +pub extern "C" fn frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + ptr: *const std::ffi::c_void, ) { - wire_ldk_node_total_onchain_balance_sats_impl(port_, that) + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } } #[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, +pub extern "C" fn frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + ptr: *const std::ffi::c_void, ) { - wire_ldk_node_update_channel_config_impl( - port_, - that, - channel_id, - counterparty_node_id, - channel_config, - ) + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_verify_signature( - port_: i64, - 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, +pub extern "C" fn frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( + ptr: *const std::ffi::c_void, ) { - wire_ldk_node_verify_signature_impl(port_, that, msg, sig, pkey) + unsafe { + StdArc::::increment_strong_count(ptr as _); + } } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_wait_next_event( - port_: i64, - that: *mut wire_cst_ldk_node, +pub extern "C" fn frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( + ptr: *const std::ffi::c_void, ) { - wire_ldk_node_wait_next_event_impl(port_, that) + unsafe { + StdArc::::decrement_strong_count(ptr as _); + } } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_socket_address_as_string( - port_: i64, - that: *mut wire_cst_socket_address, +pub extern "C" fn frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( + ptr: *const std::ffi::c_void, ) { - wire_socket_address_as_string_impl(port_, that) + unsafe { + StdArc::::increment_strong_count(ptr as _); + } } #[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, +pub extern "C" fn frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( + ptr: *const std::ffi::c_void, ) { - wire_socket_address_from_str_impl(port_, address) + unsafe { + StdArc::::decrement_strong_count(ptr as _); + } } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore( +pub extern "C" fn frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( ptr: *const std::ffi::c_void, ) { unsafe { - StdArc::>::increment_strong_count(ptr as _); + StdArc::::increment_strong_count(ptr as _); } } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore( +pub extern "C" fn frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( ptr: *const std::ffi::c_void, ) { unsafe { - StdArc::>::decrement_strong_count(ptr as _); + StdArc::::decrement_strong_count(ptr as _); } } @@ -1356,6 +2125,14 @@ 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()) @@ -1382,6 +2159,14 @@ 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_ldk_bolt_11_payment( +) -> *mut wire_cst_ldk_bolt_11_payment { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_ldk_bolt_11_payment::new_with_null_ptr(), + ) +} + #[no_mangle] 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()) @@ -1392,6 +2177,46 @@ pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_ldk_node() -> *mut wire_cs flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_ldk_node::new_with_null_ptr()) } +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_ldk_on_chain_payment( +) -> *mut wire_cst_ldk_on_chain_payment { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_ldk_on_chain_payment::new_with_null_ptr(), + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_ldk_spontaneous_payment( +) -> *mut wire_cst_ldk_spontaneous_payment { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_ldk_spontaneous_payment::new_with_null_ptr(), + ) +} + +#[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(), + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_lsp_fee_limits( +) -> *mut wire_cst_lsp_fee_limits { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_lsp_fee_limits::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_out_point() -> *mut wire_cst_out_point { flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_out_point::new_with_null_ptr()) @@ -1405,11 +2230,23 @@ 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()) } +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_payment_id() -> *mut wire_cst_payment_id { + flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_payment_id::new_with_null_ptr()) +} + #[no_mangle] pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_payment_preimage( ) -> *mut wire_cst_payment_preimage { @@ -1439,6 +2276,16 @@ 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) @@ -1471,6 +2318,20 @@ 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, @@ -1499,6 +2360,20 @@ 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, @@ -1556,6 +2431,21 @@ 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, } @@ -1582,7 +2472,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: wire_cst_max_dust_htlc_exposure, + max_dust_htlc_exposure: *mut wire_cst_max_dust_htlc_exposure, force_close_avoidance_max_fee_satoshis: u64, accept_underpaying_htlcs: bool, } @@ -1591,12 +2481,11 @@ 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_list_prim_u_8_strict, + funding_txo: *mut wire_cst_out_point, 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, @@ -1605,6 +2494,19 @@ 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)] @@ -1613,6 +2515,29 @@ 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, @@ -1668,49 +2593,55 @@ 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_id: *mut wire_cst_payment_id, payment_hash: *mut wire_cst_payment_hash, + fee_paid_msat: *mut u64, } #[repr(C)] #[derive(Clone, Copy)] pub struct wire_cst_Event_PaymentFailed { + payment_id: *mut wire_cst_payment_id, payment_hash: *mut wire_cst_payment_hash, + reason: *mut i32, } #[repr(C)] #[derive(Clone, Copy)] pub struct wire_cst_Event_PaymentReceived { + payment_id: *mut wire_cst_payment_id, payment_hash: *mut wire_cst_payment_hash, amount_msat: u64, } #[repr(C)] #[derive(Clone, Copy)] -pub struct wire_cst_Event_ChannelReady { +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, + funding_txo: *mut wire_cst_out_point, } #[repr(C)] #[derive(Clone, Copy)] -pub struct wire_cst_Event_ChannelClosed { +pub struct wire_cst_Event_ChannelReady { 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_ChannelPending { +pub struct wire_cst_Event_ChannelClosed { 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, + reason: *mut wire_cst_closure_reason, } #[repr(C)] #[derive(Clone, Copy)] @@ -1731,6 +2662,11 @@ pub struct wire_cst_GossipSourceConfig_RapidGossipSync { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_ldk_bolt_11_payment { + ptr: usize, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_ldk_mnemonic { seed_phrase: *mut wire_cst_list_prim_u_8_strict, } @@ -1741,12 +2677,101 @@ pub struct wire_cst_ldk_node { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_ldk_on_chain_payment { + ptr: usize, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_ldk_spontaneous_payment { + ptr: usize, +} +#[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, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_liquidity_source_config { + lsps2_service: wire_cst_record_socket_address_public_key_opt_string, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_list_channel_details { ptr: *mut wire_cst_channel_details, len: i32, } #[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, @@ -1759,6 +2784,12 @@ 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, @@ -1783,6 +2814,12 @@ pub struct wire_cst_list_socket_address { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_lsp_fee_limits { + max_total_opening_fee_msat: *mut u64, + max_proportional_opening_fee_ppm_msat: *mut u64, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_max_dust_htlc_exposure { tag: i32, kind: MaxDustHTLCExposureKind, @@ -1806,6 +2843,18 @@ pub struct wire_cst_MaxDustHTLCExposure_FeeRateMultiplier { } #[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, @@ -1813,9 +2862,8 @@ pub struct wire_cst_out_point { #[repr(C)] #[derive(Clone, Copy)] pub struct wire_cst_payment_details { - hash: wire_cst_payment_hash, - preimage: *mut wire_cst_payment_preimage, - secret: *mut wire_cst_payment_secret, + id: wire_cst_payment_id, + kind: wire_cst_payment_kind, amount_msat: *mut u64, direction: i32, status: i32, @@ -1827,6 +2875,46 @@ pub struct wire_cst_payment_hash { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_payment_id { + field0: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_payment_kind { + tag: i32, + kind: PaymentKindKind, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub union PaymentKindKind { + Bolt11: wire_cst_PaymentKind_Bolt11, + Bolt11Jit: wire_cst_PaymentKind_Bolt11Jit, + Spontaneous: wire_cst_PaymentKind_Spontaneous, + nil__: (), +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_PaymentKind_Bolt11 { + hash: *mut wire_cst_payment_hash, + preimage: *mut wire_cst_payment_preimage, + secret: *mut wire_cst_payment_secret, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_PaymentKind_Bolt11Jit { + hash: *mut wire_cst_payment_hash, + preimage: *mut wire_cst_payment_preimage, + secret: *mut wire_cst_payment_secret, + lsp_fee_limits: *mut wire_cst_lsp_fee_limits, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_PaymentKind_Spontaneous { + hash: *mut wire_cst_payment_hash, + preimage: *mut wire_cst_payment_preimage, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_payment_preimage { data: *mut wire_cst_list_prim_u_8_strict, } @@ -1844,11 +2932,55 @@ 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: *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, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_socket_address { tag: i32, kind: SocketAddressKind, @@ -1902,5 +3034,5 @@ pub struct wire_cst_txid { #[repr(C)] #[derive(Clone, Copy)] pub struct wire_cst_user_channel_id { - data: u64, + data: *mut wire_cst_list_prim_u_8_strict, } diff --git a/rust/src/frb_generated.rs b/rust/src/frb_generated.rs index 1478aaa..a55ae33 100644 --- a/rust/src/frb_generated.rs +++ b/rust/src/frb_generated.rs @@ -39,16 +39,55 @@ flutter_rust_bridge::frb_generated_default_handler!(); // Section: wire_funcs -fn wire_build_with_sqlite_store_impl( +fn wire_NodeBuilder_build_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: "NodeBuilder_build", + 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::NodeBuilder::build(api_that))()) + } + }, + ) +} +fn wire_NodeBuilder_build_with_fs_store_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: "NodeBuilder_build_with_fs_store", + 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::NodeBuilder::build_with_fs_store(api_that) + })()) + } + }, + ) +} +fn wire_NodeBuilder_create_builder_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>, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "build_with_sqlite_store", + debug_name: "NodeBuilder_create_builder", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -57,268 +96,317 @@ fn wire_build_with_sqlite_store_impl( 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(); move |context| { transform_result_dco((move || { - crate::api::node::build_with_sqlite_store( + crate::api::node::NodeBuilder::create_builder( api_config, api_chain_data_source_config, api_entropy_source_config, api_gossip_source_config, + api_liquidity_source_config, ) })()) } }, ) } -fn wire_ldk_mnemonic_generate_impl(port_: flutter_rust_bridge::for_generated::MessagePort) { +fn wire_ldk_bolt_11_payment_receive_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: "ldk_mnemonic_generate", + debug_name: "ldk_bolt_11_payment_receive", 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 || { - Result::<_, ()>::Ok(crate::api::node::LdkMnemonic::generate()) + crate::api::node::LdkBolt11Payment::receive( + &api_that, + api_amount_msat, + api_description, + api_expiry_secs, + ) })()) } }, ) } -fn wire_ldk_node_close_channel_impl( +fn wire_ldk_bolt_11_payment_receive_variable_amount_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - channel_id: impl CstDecode, - counterparty_node_id: impl CstDecode, + that: impl CstDecode, + description: impl CstDecode, + expiry_secs: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_close_channel", + debug_name: "ldk_bolt_11_payment_receive_variable_amount", 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(); + let api_description = description.cst_decode(); + let api_expiry_secs = expiry_secs.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::LdkNode::close_channel( + crate::api::node::LdkBolt11Payment::receive_variable_amount( &api_that, - api_channel_id, - api_counterparty_node_id, + api_description, + api_expiry_secs, ) })()) } }, ) } -fn wire_ldk_node_connect_impl( +fn wire_ldk_bolt_11_payment_receive_variable_amount_via_jit_channel_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - node_id: impl CstDecode, - address: impl CstDecode, - persist: 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: "ldk_node_connect", + debug_name: "ldk_bolt_11_payment_receive_variable_amount_via_jit_channel", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_node_id = node_id.cst_decode(); - let api_address = address.cst_decode(); - let api_persist = persist.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::LdkNode::connect( + crate::api::node::LdkBolt11Payment::receive_variable_amount_via_jit_channel( &api_that, - api_node_id, - api_address, - api_persist, + api_description, + api_expiry_secs, + api_max_proportional_lsp_fee_limit_ppm_msat, ) })()) } }, ) } -fn wire_ldk_node_connect_open_channel_impl( +fn wire_ldk_bolt_11_payment_receive_via_jit_channel_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - socket_address: impl CstDecode, - node_id: impl CstDecode, - channel_amount_sats: impl CstDecode, - push_to_counterparty_msat: impl CstDecode>, - announce_channel: impl CstDecode, - channel_config: 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: "ldk_node_connect_open_channel", + debug_name: "ldk_bolt_11_payment_receive_via_jit_channel", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.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(); - let api_announce_channel = announce_channel.cst_decode(); - let api_channel_config = channel_config.cst_decode(); + 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::LdkNode::connect_open_channel( + crate::api::node::LdkBolt11Payment::receive_via_jit_channel( &api_that, - api_socket_address, - api_node_id, - api_channel_amount_sats, - api_push_to_counterparty_msat, - api_announce_channel, - api_channel_config, + api_amount_msat, + api_description, + api_expiry_secs, + api_max_total_lsp_fee_limit_msat, ) })()) } }, ) } -fn wire_ldk_node_disconnect_impl( +fn wire_ldk_bolt_11_payment_send_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - counterparty_node_id: impl CstDecode, + that: impl CstDecode, + invoice: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_disconnect", + debug_name: "ldk_bolt_11_payment_send", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_counterparty_node_id = counterparty_node_id.cst_decode(); + let api_invoice = invoice.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::LdkNode::disconnect(&api_that, api_counterparty_node_id) + crate::api::node::LdkBolt11Payment::send(&api_that, api_invoice) })()) } }, ) } -fn wire_ldk_node_event_handled_impl( +fn wire_ldk_bolt_11_payment_send_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: "ldk_node_event_handled", + debug_name: "ldk_bolt_11_payment_send_probes", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); + let api_invoice = invoice.cst_decode(); move |context| { transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::event_handled(&api_that)) + crate::api::node::LdkBolt11Payment::send_probes(&api_that, api_invoice) })()) } }, ) } -fn wire_ldk_node_is_running_impl( +fn wire_ldk_bolt_11_payment_send_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: "ldk_node_is_running", + debug_name: "ldk_bolt_11_payment_send_probes_using_amount", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); + let api_invoice = invoice.cst_decode(); + let api_amount_msat = amount_msat.cst_decode(); move |context| { transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::is_running(&api_that)) + crate::api::node::LdkBolt11Payment::send_probes_using_amount( + &api_that, + api_invoice, + api_amount_msat, + ) })()) } }, ) } -fn wire_ldk_node_list_channels_impl( +fn wire_ldk_bolt_11_payment_send_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: "ldk_node_list_channels", + debug_name: "ldk_bolt_11_payment_send_using_amount", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); + let api_invoice = invoice.cst_decode(); + let api_amount_msat = amount_msat.cst_decode(); move |context| { transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::list_channels(&api_that)) + crate::api::node::LdkBolt11Payment::send_using_amount( + &api_that, + api_invoice, + api_amount_msat, + ) })()) } }, ) } -fn wire_ldk_node_list_payments_impl( +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: "ldk_mnemonic_generate", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + move |context| { + transform_result_dco((move || { + Result::<_, ()>::Ok(crate::api::node::LdkMnemonic::generate()) + })()) + } + }, + ) +} +fn wire_ldk_node_bolt11_payment_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + ptr: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_list_payments", + debug_name: "ldk_node_bolt11_payment", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { - let api_that = that.cst_decode(); + let api_ptr = ptr.cst_decode(); move |context| { transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::list_payments(&api_that)) + Result::<_, ()>::Ok(crate::api::node::LdkNode::bolt11_payment(api_ptr)) })()) } }, ) } -fn wire_ldk_node_list_payments_with_filter_impl( +fn wire_ldk_node_close_channel_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, - payment_direction: impl CstDecode, + user_channel_id: impl CstDecode, + counterparty_node_id: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_list_payments_with_filter", + 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_payment_direction = payment_direction.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 || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::list_payments_with_filter( + crate::api::node::LdkNode::close_channel( &api_that, - api_payment_direction, - )) + api_user_channel_id, + api_counterparty_node_id, + ) })()) } }, ) } -fn wire_ldk_node_list_peers_impl( +fn wire_ldk_node_config_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_list_peers", + debug_name: "ldk_node_config", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -326,79 +414,112 @@ fn wire_ldk_node_list_peers_impl( let api_that = that.cst_decode(); move |context| { transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::list_peers(&api_that)) + Result::<_, ()>::Ok(crate::api::node::LdkNode::config(&api_that)) })()) } }, ) } -fn wire_ldk_node_listening_addresses_impl( +fn wire_ldk_node_connect_impl( port_: flutter_rust_bridge::for_generated::MessagePort, 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: "ldk_node_listening_addresses", + debug_name: "ldk_node_connect", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); + let api_node_id = node_id.cst_decode(); + let api_address = address.cst_decode(); + let api_persist = persist.cst_decode(); move |context| { transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::listening_addresses(&api_that)) + crate::api::node::LdkNode::connect( + &api_that, + api_node_id, + api_address, + api_persist, + ) })()) } }, ) } -fn wire_ldk_node_new_onchain_address_impl( +fn wire_ldk_node_connect_open_channel_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, + socket_address: impl CstDecode, + node_id: impl CstDecode, + channel_amount_sats: impl CstDecode, + push_to_counterparty_msat: impl CstDecode>, + announce_channel: impl CstDecode, + channel_config: impl CstDecode>, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_new_onchain_address", + 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_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(); + let api_announce_channel = announce_channel.cst_decode(); + let api_channel_config = channel_config.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::LdkNode::new_onchain_address(&api_that) + crate::api::node::LdkNode::connect_open_channel( + &api_that, + api_socket_address, + api_node_id, + api_channel_amount_sats, + api_push_to_counterparty_msat, + api_announce_channel, + api_channel_config, + ) })()) } }, ) } -fn wire_ldk_node_next_event_impl( +fn wire_ldk_node_disconnect_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, + counterparty_node_id: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_next_event", + debug_name: "ldk_node_disconnect", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); + let api_counterparty_node_id = counterparty_node_id.cst_decode(); move |context| { transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::next_event(&api_that)) + crate::api::node::LdkNode::disconnect(&api_that, api_counterparty_node_id) })()) } }, ) } -fn wire_ldk_node_node_id_impl( +fn wire_ldk_node_event_handled_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_node_id", + debug_name: "ldk_node_event_handled", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -406,319 +527,264 @@ fn wire_ldk_node_node_id_impl( let api_that = that.cst_decode(); move |context| { transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::node_id(&api_that)) + Result::<_, ()>::Ok(crate::api::node::LdkNode::event_handled(&api_that)) })()) } }, ) } -fn wire_ldk_node_payment_impl( +fn wire_ldk_node_list_balances_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, - payment_hash: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_payment", + debug_name: "ldk_node_list_balances", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_payment_hash = payment_hash.cst_decode(); move |context| { transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::payment( - &api_that, - api_payment_hash, - )) + crate::api::node::LdkNode::list_balances(&api_that) })()) } }, ) } -fn wire_ldk_node_receive_payment_impl( +fn wire_ldk_node_list_channels_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: "ldk_node_receive_payment", + debug_name: "ldk_node_list_channels", 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::LdkNode::receive_payment( - &api_that, - api_amount_msat, - api_description, - api_expiry_secs, - ) + Result::<_, ()>::Ok(crate::api::node::LdkNode::list_channels(&api_that)) })()) } }, ) } -fn wire_ldk_node_receive_variable_amount_payment_impl( +fn wire_ldk_node_list_payments_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: "ldk_node_receive_variable_amount_payment", + debug_name: "ldk_node_list_payments", 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::LdkNode::receive_variable_amount_payment( - &api_that, - api_description, - api_expiry_secs, - ) + Result::<_, ()>::Ok(crate::api::node::LdkNode::list_payments(&api_that)) })()) } }, ) } -fn wire_ldk_node_remove_payment_impl( +fn wire_ldk_node_list_payments_with_filter_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, - payment_hash: impl CstDecode, + payment_direction: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_remove_payment", + debug_name: "ldk_node_list_payments_with_filter", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_payment_hash = payment_hash.cst_decode(); + let api_payment_direction = payment_direction.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::LdkNode::remove_payment(&api_that, api_payment_hash) + Result::<_, ()>::Ok(crate::api::node::LdkNode::list_payments_with_filter( + &api_that, + api_payment_direction, + )) })()) } }, ) } -fn wire_ldk_node_send_all_to_onchain_address_impl( +fn wire_ldk_node_list_peers_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, - address: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_send_all_to_onchain_address", + debug_name: "ldk_node_list_peers", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_address = address.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::LdkNode::send_all_to_onchain_address(&api_that, api_address) + Result::<_, ()>::Ok(crate::api::node::LdkNode::list_peers(&api_that)) })()) } }, ) } -fn wire_ldk_node_send_payment_impl( +fn wire_ldk_node_listening_addresses_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, - invoice: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_send_payment", + debug_name: "ldk_node_listening_addresses", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_invoice = invoice.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::LdkNode::send_payment(&api_that, api_invoice) + Result::<_, ()>::Ok(crate::api::node::LdkNode::listening_addresses(&api_that)) })()) } }, ) } -fn wire_ldk_node_send_payment_probes_impl( +fn wire_ldk_node_next_event_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, - invoice: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_send_payment_probes", + debug_name: "ldk_node_next_event", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_invoice = invoice.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::LdkNode::send_payment_probes(&api_that, api_invoice) + Result::<_, ()>::Ok(crate::api::node::LdkNode::next_event(&api_that)) })()) } }, ) } -fn wire_ldk_node_send_payment_probes_using_amount_impl( +fn wire_ldk_node_next_event_async_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, - invoice: impl CstDecode, - amount_msat: impl CstDecode, ) { - FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_send_payment_probes_using_amount", + debug_name: "ldk_node_next_event_async", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_invoice = invoice.cst_decode(); - let api_amount_msat = amount_msat.cst_decode(); - move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::send_payment_probes_using_amount( - &api_that, - api_invoice, - api_amount_msat, - ) - })()) + move |context| async move { + transform_result_dco( + (move || async move { + Result::<_, ()>::Ok( + crate::api::node::LdkNode::next_event_async(&api_that).await, + ) + })() + .await, + ) } }, ) } -fn wire_ldk_node_send_payment_using_amount_impl( +fn wire_ldk_node_node_id_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, - invoice: impl CstDecode, - amount_msat: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_send_payment_using_amount", + debug_name: "ldk_node_node_id", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_invoice = invoice.cst_decode(); - let api_amount_msat = amount_msat.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::LdkNode::send_payment_using_amount( - &api_that, - api_invoice, - api_amount_msat, - ) + Result::<_, ()>::Ok(crate::api::node::LdkNode::node_id(&api_that)) })()) } }, ) } -fn wire_ldk_node_send_spontaneous_payment_impl( +fn wire_ldk_node_on_chain_payment_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - amount_msat: impl CstDecode, - node_id: impl CstDecode, + ptr: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_send_spontaneous_payment", + debug_name: "ldk_node_on_chain_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_node_id = node_id.cst_decode(); + let api_ptr = ptr.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::LdkNode::send_spontaneous_payment( - &api_that, - api_amount_msat, - api_node_id, - ) + Result::<_, ()>::Ok(crate::api::node::LdkNode::on_chain_payment(api_ptr)) })()) } }, ) } -fn wire_ldk_node_send_spontaneous_payment_probes_impl( +fn wire_ldk_node_payment_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, - amount_msat: impl CstDecode, - node_id: impl CstDecode, + payment_id: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_send_spontaneous_payment_probes", + debug_name: "ldk_node_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_node_id = node_id.cst_decode(); + let api_payment_id = payment_id.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::LdkNode::send_spontaneous_payment_probes( + Result::<_, ()>::Ok(crate::api::node::LdkNode::payment( &api_that, - api_amount_msat, - api_node_id, - ) + api_payment_id, + )) })()) } }, ) } -fn wire_ldk_node_send_to_onchain_address_impl( +fn wire_ldk_node_remove_payment_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, - address: impl CstDecode, - amount_sats: impl CstDecode, + payment_id: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_send_to_onchain_address", + debug_name: "ldk_node_remove_payment", 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_amount_sats = amount_sats.cst_decode(); + let api_payment_id = payment_id.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::LdkNode::send_to_onchain_address( - &api_that, - api_address, - api_amount_sats, - ) + crate::api::node::LdkNode::remove_payment(&api_that, api_payment_id) })()) } }, @@ -746,21 +812,21 @@ fn wire_ldk_node_sign_message_impl( }, ) } -fn wire_ldk_node_spendable_onchain_balance_sats_impl( +fn wire_ldk_node_spontaneous_payment_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + ptr: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_spendable_onchain_balance_sats", + debug_name: "ldk_node_spontaneous_payment", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { - let api_that = that.cst_decode(); + let api_ptr = ptr.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::LdkNode::spendable_onchain_balance_sats(&api_that) + Result::<_, ()>::Ok(crate::api::node::LdkNode::spontaneous_payment(api_ptr)) })()) } }, @@ -784,58 +850,58 @@ fn wire_ldk_node_start_impl( }, ) } -fn wire_ldk_node_stop_impl( +fn wire_ldk_node_status_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_stop", + debug_name: "ldk_node_status", 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::stop(&api_that))()) + transform_result_dco((move || { + Result::<_, ()>::Ok(crate::api::node::LdkNode::status(&api_that)) + })()) } }, ) } -fn wire_ldk_node_sync_wallets_impl( +fn wire_ldk_node_stop_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_sync_wallets", + 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 || crate::api::node::LdkNode::sync_wallets(&api_that))()) + transform_result_dco((move || crate::api::node::LdkNode::stop(&api_that))()) } }, ) } -fn wire_ldk_node_total_onchain_balance_sats_impl( +fn wire_ldk_node_sync_wallets_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_total_onchain_balance_sats", + 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::LdkNode::total_onchain_balance_sats(&api_that) - })()) + transform_result_dco((move || crate::api::node::LdkNode::sync_wallets(&api_that))()) } }, ) @@ -843,7 +909,7 @@ fn wire_ldk_node_total_onchain_balance_sats_impl( fn wire_ldk_node_update_channel_config_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, - channel_id: impl CstDecode, + user_channel_id: impl CstDecode, counterparty_node_id: impl CstDecode, channel_config: impl CstDecode, ) { @@ -855,14 +921,14 @@ fn wire_ldk_node_update_channel_config_impl( }, move || { let api_that = that.cst_decode(); - let api_channel_id = channel_id.cst_decode(); + let api_user_channel_id = user_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::LdkNode::update_channel_config( &api_that, - api_channel_id, + api_user_channel_id, api_counterparty_node_id, api_channel_config, ) @@ -871,89 +937,178 @@ fn wire_ldk_node_update_channel_config_impl( }, ) } -fn wire_ldk_node_verify_signature_impl( +fn wire_ldk_node_verify_signature_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode, + msg: impl CstDecode>, + sig: impl CstDecode, + public_key: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ldk_node_verify_signature", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_msg = msg.cst_decode(); + let api_sig = sig.cst_decode(); + let api_public_key = public_key.cst_decode(); + move |context| { + transform_result_dco((move || { + crate::api::node::LdkNode::verify_signature( + &api_that, + api_msg, + api_sig, + api_public_key, + ) + })()) + } + }, + ) +} +fn wire_ldk_node_wait_next_event_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_wait_next_event", + 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::LdkNode::wait_next_event(&api_that)) + })()) + } + }, + ) +} +fn wire_ldk_on_chain_payment_new_address_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_on_chain_payment_new_address", + 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::LdkOnChainPayment::new_address(&api_that) + })()) + } + }, + ) +} +fn wire_ldk_on_chain_payment_send_all_to_address_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - msg: impl CstDecode>, - sig: impl CstDecode, - pkey: impl CstDecode, + that: impl CstDecode, + address: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_verify_signature", + debug_name: "ldk_on_chain_payment_send_all_to_address", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_msg = msg.cst_decode(); - let api_sig = sig.cst_decode(); - let api_pkey = pkey.cst_decode(); + let api_address = address.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::LdkNode::verify_signature( - &api_that, api_msg, api_sig, api_pkey, - ) + crate::api::node::LdkOnChainPayment::send_all_to_address(&api_that, api_address) })()) } }, ) } -fn wire_ldk_node_wait_next_event_impl( +fn wire_ldk_on_chain_payment_send_to_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: "ldk_node_wait_next_event", + debug_name: "ldk_on_chain_payment_send_to_address", 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_amount_sats = amount_sats.cst_decode(); move |context| { transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::wait_next_event(&api_that)) + crate::api::node::LdkOnChainPayment::send_to_address( + &api_that, + api_address, + api_amount_sats, + ) })()) } }, ) } -fn wire_socket_address_as_string_impl( +fn wire_ldk_spontaneous_payment_send_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: "socket_address_as_string", + debug_name: "ldk_spontaneous_payment_send", 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_node_id = node_id.cst_decode(); move |context| { transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::types::SocketAddress::as_string(&api_that)) + crate::api::node::LdkSpontaneousPayment::send( + &api_that, + api_amount_msat, + api_node_id, + ) })()) } }, ) } -fn wire_socket_address_from_str_impl( +fn wire_ldk_spontaneous_payment_send_probes_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - address: 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: "socket_address_from_str", + debug_name: "ldk_spontaneous_payment_send_probes", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { - let api_address = address.cst_decode(); + let api_that = that.cst_decode(); + let api_amount_msat = amount_msat.cst_decode(); + let api_node_id = node_id.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::types::SocketAddress::from_str(api_address) + crate::api::node::LdkSpontaneousPayment::send_probes( + &api_that, + api_amount_msat, + api_node_id, + ) })()) } }, @@ -984,7 +1139,7 @@ impl CstDecode for i32 { 9 => crate::api::error::BuilderException::KVStoreSetupFailed, 10 => crate::api::error::BuilderException::WalletSetupFailed, 11 => crate::api::error::BuilderException::LoggerSetupFailed, - 12 => crate::api::error::BuilderException::InvalidTrustedPeer, + 12 => crate::api::error::BuilderException::InvalidPublicKey, _ => unreachable!("Invalid variant for BuilderException: {}", self), } } @@ -1056,6 +1211,11 @@ impl CstDecode for i32 { 28 => crate::api::error::NodeException::DuplicatePayment, 29 => crate::api::error::NodeException::InsufficientFunds, 30 => crate::api::error::NodeException::FeerateEstimationUpdateFailed, + 31 => crate::api::error::NodeException::LiquidityRequestFailed, + 32 => crate::api::error::NodeException::LiquiditySourceUnavailable, + 33 => crate::api::error::NodeException::LiquidityFeeTooHigh, + 34 => crate::api::error::NodeException::InvalidPaymentId, + 35 => crate::api::error::NodeException::DecodeError, _ => unreachable!("Invalid variant for NodeException: {}", self), } } @@ -1070,6 +1230,20 @@ 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 { @@ -1111,7 +1285,51 @@ impl CstDecode for usize { self } } -impl SseDecode for RustOpaqueNom> { +impl SseDecode for NodeBuilder { + // 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 inner.rust_auto_opaque_decode_owned(); + } +} + +impl SseDecode for RustOpaqueNom { + // 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 unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode + for RustOpaqueNom> +{ + // 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 unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode for RustOpaqueNom { + // 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 unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode for RustOpaqueNom { + // 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 unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode for RustOpaqueNom { // 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); @@ -1135,6 +1353,38 @@ 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 { @@ -1169,7 +1419,7 @@ impl SseDecode for crate::api::error::BuilderException { 9 => crate::api::error::BuilderException::KVStoreSetupFailed, 10 => crate::api::error::BuilderException::WalletSetupFailed, 11 => crate::api::error::BuilderException::LoggerSetupFailed, - 12 => crate::api::error::BuilderException::InvalidTrustedPeer, + 12 => crate::api::error::BuilderException::InvalidPublicKey, _ => unreachable!("Invalid variant for BuilderException: {}", inner), }; } @@ -1198,7 +1448,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 { @@ -1217,12 +1467,11 @@ 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); @@ -1231,6 +1480,21 @@ 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, @@ -1239,7 +1503,6 @@ 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, @@ -1248,6 +1511,22 @@ 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, }; } } @@ -1260,6 +1539,61 @@ 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::LegacyCooperativeClosure; + } + 3 => { + return crate::api::types::ClosureReason::CounterpartyInitiatedCooperativeClosure; + } + 4 => { + return crate::api::types::ClosureReason::LocallyInitiatedCooperativeClosure; + } + 5 => { + return crate::api::types::ClosureReason::CommitmentTxConfirmed; + } + 6 => { + return crate::api::types::ClosureReason::FundingTimedOut; + } + 7 => { + let mut var_err = ::sse_decode(deserializer); + return crate::api::types::ClosureReason::ProcessingError { err: var_err }; + } + 8 => { + return crate::api::types::ClosureReason::DisconnectedPeer; + } + 9 => { + return crate::api::types::ClosureReason::OutdatedChannelManager; + } + 10 => { + return crate::api::types::ClosureReason::CounterpartyCoopClosedUnfundedChannel; + } + 11 => { + return crate::api::types::ClosureReason::FundingBatchClosure; + } + 12 => { + return crate::api::types::ClosureReason::HTLCsTimedOut; + } + _ => { + 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 { @@ -1320,73 +1654,259 @@ impl SseDecode for crate::api::types::EntropySourceConfig { } } -impl SseDecode for crate::api::types::Event { +impl SseDecode for crate::api::types::Event { + // 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_paymentId = + >::sse_decode(deserializer); + let mut var_paymentHash = + ::sse_decode(deserializer); + let mut var_feePaidMsat = >::sse_decode(deserializer); + return crate::api::types::Event::PaymentSuccessful { + payment_id: var_paymentId, + payment_hash: var_paymentHash, + fee_paid_msat: var_feePaidMsat, + }; + } + 1 => { + let mut var_paymentId = + >::sse_decode(deserializer); + let mut var_paymentHash = + ::sse_decode(deserializer); + let mut var_reason = + >::sse_decode(deserializer); + return crate::api::types::Event::PaymentFailed { + payment_id: var_paymentId, + payment_hash: var_paymentHash, + reason: var_reason, + }; + } + 2 => { + let mut var_paymentId = + >::sse_decode(deserializer); + let mut var_paymentHash = + ::sse_decode(deserializer); + let mut var_amountMsat = ::sse_decode(deserializer); + return crate::api::types::Event::PaymentReceived { + payment_id: var_paymentId, + payment_hash: var_paymentHash, + amount_msat: var_amountMsat, + }; + } + 3 => { + 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 { + 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 => { + let mut var_channelId = ::sse_decode(deserializer); + let mut var_userChannelId = + ::sse_decode(deserializer); + let mut var_counterpartyNodeId = + >::sse_decode(deserializer); + return crate::api::types::Event::ChannelReady { + channel_id: var_channelId, + user_channel_id: var_userChannelId, + counterparty_node_id: var_counterpartyNodeId, + }; + } + 5 => { + let mut var_channelId = ::sse_decode(deserializer); + let mut var_userChannelId = + ::sse_decode(deserializer); + let mut var_counterpartyNodeId = + >::sse_decode(deserializer); + let mut var_reason = + >::sse_decode(deserializer); + return crate::api::types::Event::ChannelClosed { + channel_id: var_channelId, + user_channel_id: var_userChannelId, + counterparty_node_id: var_counterpartyNodeId, + reason: var_reason, + }; + } + _ => { + unimplemented!(""); + } + } + } +} + +impl SseDecode for crate::api::types::GossipSourceConfig { + // 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 => { + return crate::api::types::GossipSourceConfig::P2PNetwork; + } + 1 => { + let mut var_field0 = ::sse_decode(deserializer); + return crate::api::types::GossipSourceConfig::RapidGossipSync(var_field0); + } + _ => { + unimplemented!(""); + } + } + } +} + +impl SseDecode for i32 { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + deserializer.cursor.read_i32::().unwrap() + } +} + +impl SseDecode for crate::api::node::LdkBolt11Payment { + // 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::LdkBolt11Payment { ptr: var_ptr }; + } +} + +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 var_seedPhrase = ::sse_decode(deserializer); + return crate::api::node::LdkMnemonic { + seed_phrase: var_seedPhrase, + }; + } +} + +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_ptr = >::sse_decode(deserializer); + return crate::api::node::LdkNode { ptr: var_ptr }; + } +} + +impl SseDecode for crate::api::node::LdkOnChainPayment { + // 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::LdkOnChainPayment { ptr: var_ptr }; + } +} + +impl SseDecode for crate::api::node::LdkSpontaneousPayment { + // 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::LdkSpontaneousPayment { ptr: var_ptr }; + } +} + +impl SseDecode for crate::api::types::LightningBalance { // 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_paymentHash = - ::sse_decode(deserializer); - return crate::api::types::Event::PaymentSuccessful { - payment_hash: var_paymentHash, + 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_paymentHash = - ::sse_decode(deserializer); - return crate::api::types::Event::PaymentFailed { - payment_hash: var_paymentHash, + 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_amountMsat = ::sse_decode(deserializer); - return crate::api::types::Event::PaymentReceived { + 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, - amount_msat: var_amountMsat, + payment_preimage: var_paymentPreimage, }; } 3 => { let mut var_channelId = ::sse_decode(deserializer); - let mut var_userChannelId = - ::sse_decode(deserializer); let mut var_counterpartyNodeId = - >::sse_decode(deserializer); - return crate::api::types::Event::ChannelReady { + ::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, - user_channel_id: var_userChannelId, 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_userChannelId = - ::sse_decode(deserializer); let mut var_counterpartyNodeId = - >::sse_decode(deserializer); - return crate::api::types::Event::ChannelClosed { + ::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, - user_channel_id: var_userChannelId, 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_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 { + let mut var_amountSatoshis = ::sse_decode(deserializer); + return crate::api::types::LightningBalance::CounterpartyRevokedOutputClaimable { channel_id: var_channelId, - user_channel_id: var_userChannelId, - former_temporary_channel_id: var_formerTemporaryChannelId, counterparty_node_id: var_counterpartyNodeId, - funding_txo: var_fundingTxo, + amount_satoshis: var_amountSatoshis, }; } _ => { @@ -1396,57 +1916,41 @@ impl SseDecode for crate::api::types::Event { } } -impl SseDecode for crate::api::types::GossipSourceConfig { - // 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 => { - return crate::api::types::GossipSourceConfig::P2PNetwork; - } - 1 => { - let mut var_field0 = ::sse_decode(deserializer); - return crate::api::types::GossipSourceConfig::RapidGossipSync(var_field0); - } - _ => { - unimplemented!(""); - } - } - } -} - -impl SseDecode for i32 { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - deserializer.cursor.read_i32::().unwrap() - } -} - -impl SseDecode for crate::api::node::LdkMnemonic { +impl SseDecode for crate::api::types::LiquiditySourceConfig { // 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::LdkMnemonic { - seed_phrase: var_seedPhrase, + 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, }; } } -impl SseDecode for crate::api::node::LdkNode { +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 var_ptr = >>::sse_decode(deserializer); - return crate::api::node::LdkNode { ptr: var_ptr }; + 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 { +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( + ans_.push(::sse_decode( deserializer, )); } @@ -1480,6 +1984,20 @@ 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 { @@ -1532,6 +2050,18 @@ impl SseDecode for crate::api::types::LogLevel { } } +impl SseDecode for crate::api::types::LSPFeeLimits { + // 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_maxTotalOpeningFeeMsat = >::sse_decode(deserializer); + let mut var_maxProportionalOpeningFeePpmMsat = >::sse_decode(deserializer); + return crate::api::types::LSPFeeLimits { + max_total_opening_fee_msat: var_maxTotalOpeningFeeMsat, + max_proportional_opening_fee_ppm_msat: var_maxProportionalOpeningFeePpmMsat, + }; + } +} + impl SseDecode for crate::api::types::MaxDustHTLCExposure { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -1602,11 +2132,42 @@ impl SseDecode for crate::api::error::NodeException { 28 => crate::api::error::NodeException::DuplicatePayment, 29 => crate::api::error::NodeException::InsufficientFunds, 30 => crate::api::error::NodeException::FeerateEstimationUpdateFailed, + 31 => crate::api::error::NodeException::LiquidityRequestFailed, + 32 => crate::api::error::NodeException::LiquiditySourceUnavailable, + 33 => crate::api::error::NodeException::LiquidityFeeTooHigh, + 34 => crate::api::error::NodeException::InvalidPaymentId, + 35 => crate::api::error::NodeException::DecodeError, _ => unreachable!("Invalid variant for NodeException: {}", 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, + }; + } +} + 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 { @@ -1642,6 +2203,28 @@ 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 { @@ -1679,6 +2262,43 @@ 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 { @@ -1692,6 +2312,30 @@ 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 { @@ -1727,6 +2371,17 @@ 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 { @@ -1777,17 +2432,14 @@ impl SseDecode for crate::api::types::OutPoint { impl SseDecode for crate::api::types::PaymentDetails { // 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_hash = ::sse_decode(deserializer); - let mut var_preimage = - >::sse_decode(deserializer); - let mut var_secret = >::sse_decode(deserializer); + let mut var_id = ::sse_decode(deserializer); + let mut var_kind = ::sse_decode(deserializer); let mut var_amountMsat = >::sse_decode(deserializer); let mut var_direction = ::sse_decode(deserializer); let mut var_status = ::sse_decode(deserializer); return crate::api::types::PaymentDetails { - hash: var_hash, - preimage: var_preimage, - secret: var_secret, + id: var_id, + kind: var_kind, amount_msat: var_amountMsat, direction: var_direction, status: var_status, @@ -1807,6 +2459,22 @@ 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 { @@ -1815,6 +2483,65 @@ impl SseDecode for crate::api::types::PaymentHash { } } +impl SseDecode for crate::api::types::PaymentId { + // 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 = <[u8; 32]>::sse_decode(deserializer); + return crate::api::types::PaymentId(var_field0); + } +} + +impl SseDecode for crate::api::types::PaymentKind { + // 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 => { + return crate::api::types::PaymentKind::Onchain; + } + 1 => { + let mut var_hash = ::sse_decode(deserializer); + let mut var_preimage = + >::sse_decode(deserializer); + let mut var_secret = + >::sse_decode(deserializer); + return crate::api::types::PaymentKind::Bolt11 { + hash: var_hash, + preimage: var_preimage, + secret: var_secret, + }; + } + 2 => { + let mut var_hash = ::sse_decode(deserializer); + let mut var_preimage = + >::sse_decode(deserializer); + let mut var_secret = + >::sse_decode(deserializer); + let mut var_lspFeeLimits = + ::sse_decode(deserializer); + return crate::api::types::PaymentKind::Bolt11Jit { + hash: var_hash, + preimage: var_preimage, + secret: var_secret, + lsp_fee_limits: var_lspFeeLimits, + }; + } + 3 => { + let mut var_hash = ::sse_decode(deserializer); + let mut var_preimage = + >::sse_decode(deserializer); + return crate::api::types::PaymentKind::Spontaneous { + hash: var_hash, + preimage: var_preimage, + }; + } + _ => { + unimplemented!(""); + } + } + } +} + impl SseDecode for crate::api::types::PaymentPreimage { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -1858,6 +2585,57 @@ 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 { @@ -1866,6 +2644,22 @@ impl SseDecode for crate::api::types::PublicKey { } } +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); + } +} + impl SseDecode for crate::api::types::SocketAddress { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -2002,7 +2796,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 }; } } @@ -2041,6 +2835,21 @@ fn pde_ffi_dispatcher_sync_impl( // Section: rust2dart +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for FrbWrapper { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self.0) + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for FrbWrapper {} + +impl flutter_rust_bridge::IntoIntoDart> for NodeBuilder { + fn into_into_dart(self) -> FrbWrapper { + self.into() + } +} + // Codec=Dco (DartCObject based), see doc to use other codecs impl flutter_rust_bridge::IntoDart for crate::api::types::Address { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { @@ -2054,6 +2863,54 @@ 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() @@ -2086,7 +2943,7 @@ impl flutter_rust_bridge::IntoDart for crate::api::error::BuilderException { Self::KVStoreSetupFailed => 9.into_dart(), Self::WalletSetupFailed => 10.into_dart(), Self::LoggerSetupFailed => 11.into_dart(), - Self::InvalidTrustedPeer => 12.into_dart(), + Self::InvalidPublicKey => 12.into_dart(), } } } @@ -2166,7 +3023,6 @@ 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(), @@ -2175,6 +3031,35 @@ 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() } @@ -2205,6 +3090,49 @@ 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::LegacyCooperativeClosure => { + [2.into_dart()].into_dart() + } + crate::api::types::ClosureReason::CounterpartyInitiatedCooperativeClosure => { + [3.into_dart()].into_dart() + } + crate::api::types::ClosureReason::LocallyInitiatedCooperativeClosure => { + [4.into_dart()].into_dart() + } + crate::api::types::ClosureReason::CommitmentTxConfirmed => [5.into_dart()].into_dart(), + crate::api::types::ClosureReason::FundingTimedOut => [6.into_dart()].into_dart(), + crate::api::types::ClosureReason::ProcessingError { err } => { + [7.into_dart(), err.into_into_dart().into_dart()].into_dart() + } + crate::api::types::ClosureReason::DisconnectedPeer => [8.into_dart()].into_dart(), + crate::api::types::ClosureReason::OutdatedChannelManager => [9.into_dart()].into_dart(), + crate::api::types::ClosureReason::CounterpartyCoopClosedUnfundedChannel => { + [10.into_dart()].into_dart() + } + crate::api::types::ClosureReason::FundingBatchClosure => [11.into_dart()].into_dart(), + crate::api::types::ClosureReason::HTLCsTimedOut => [12.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 { [ @@ -2272,112 +3200,300 @@ 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 } => { - [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::PaymentSuccessful { + payment_id, + payment_hash, + fee_paid_msat, + } => [ + 0.into_dart(), + payment_id.into_into_dart().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_id, + payment_hash, + reason, + } => [ + 1.into_dart(), + payment_id.into_into_dart().into_dart(), + payment_hash.into_into_dart().into_dart(), + reason.into_into_dart().into_dart(), + ] + .into_dart(), crate::api::types::Event::PaymentReceived { + payment_id, + payment_hash, + amount_msat, + } => [ + 2.into_dart(), + payment_id.into_into_dart().into_dart(), + payment_hash.into_into_dart().into_dart(), + amount_msat.into_into_dart().into_dart(), + ] + .into_dart(), + crate::api::types::Event::ChannelPending { + 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 { + channel_id, + user_channel_id, + counterparty_node_id, + } => [ + 4.into_dart(), + channel_id.into_into_dart().into_dart(), + user_channel_id.into_into_dart().into_dart(), + counterparty_node_id.into_into_dart().into_dart(), + ] + .into_dart(), + crate::api::types::Event::ChannelClosed { + channel_id, + user_channel_id, + counterparty_node_id, + reason, + } => [ + 5.into_dart(), + channel_id.into_into_dart().into_dart(), + user_channel_id.into_into_dart().into_dart(), + counterparty_node_id.into_into_dart().into_dart(), + reason.into_into_dart().into_dart(), + ] + .into_dart(), + } + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::Event {} +impl flutter_rust_bridge::IntoIntoDart for crate::api::types::Event { + fn into_into_dart(self) -> crate::api::types::Event { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::GossipSourceConfig { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + match self { + crate::api::types::GossipSourceConfig::P2PNetwork => [0.into_dart()].into_dart(), + crate::api::types::GossipSourceConfig::RapidGossipSync(field0) => { + [1.into_dart(), field0.into_into_dart().into_dart()].into_dart() + } + } + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::GossipSourceConfig +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::GossipSourceConfig +{ + fn into_into_dart(self) -> crate::api::types::GossipSourceConfig { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::node::LdkBolt11Payment { + 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::LdkBolt11Payment +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::node::LdkBolt11Payment +{ + fn into_into_dart(self) -> crate::api::node::LdkBolt11Payment { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::node::LdkMnemonic { + 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::LdkMnemonic {} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::node::LdkMnemonic +{ + 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::node::LdkNode { + 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::LdkNode {} +impl flutter_rust_bridge::IntoIntoDart for crate::api::node::LdkNode { + fn into_into_dart(self) -> crate::api::node::LdkNode { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::node::LdkOnChainPayment { + 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::LdkOnChainPayment +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::node::LdkOnChainPayment +{ + fn into_into_dart(self) -> crate::api::node::LdkOnChainPayment { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::node::LdkSpontaneousPayment { + 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::LdkSpontaneousPayment +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::node::LdkSpontaneousPayment +{ + fn into_into_dart(self) -> crate::api::node::LdkSpontaneousPayment { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::LightningBalance { + 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, - amount_msat, + 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(), - amount_msat.into_into_dart().into_dart(), + payment_preimage.into_into_dart().into_dart(), ] .into_dart(), - crate::api::types::Event::ChannelReady { + crate::api::types::LightningBalance::MaybeTimeoutClaimableHTLC { channel_id, - user_channel_id, counterparty_node_id, + amount_satoshis, + claimable_height, + payment_hash, } => [ 3.into_dart(), channel_id.into_into_dart().into_dart(), - user_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::Event::ChannelClosed { + crate::api::types::LightningBalance::MaybePreimageClaimableHTLC { channel_id, - user_channel_id, counterparty_node_id, + amount_satoshis, + expiry_height, + payment_hash, } => [ 4.into_dart(), channel_id.into_into_dart().into_dart(), - user_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::Event::ChannelPending { + crate::api::types::LightningBalance::CounterpartyRevokedOutputClaimable { channel_id, - user_channel_id, - former_temporary_channel_id, counterparty_node_id, - funding_txo, + amount_satoshis, } => [ 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(), - funding_txo.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::Event {} -impl flutter_rust_bridge::IntoIntoDart for crate::api::types::Event { - fn into_into_dart(self) -> crate::api::types::Event { - self - } -} -// Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::GossipSourceConfig { - fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - match self { - crate::api::types::GossipSourceConfig::P2PNetwork => [0.into_dart()].into_dart(), - crate::api::types::GossipSourceConfig::RapidGossipSync(field0) => { - [1.into_dart(), field0.into_into_dart().into_dart()].into_dart() - } - } - } -} impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::GossipSourceConfig + for crate::api::types::LightningBalance { } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::GossipSourceConfig +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::LightningBalance { - fn into_into_dart(self) -> crate::api::types::GossipSourceConfig { + fn into_into_dart(self) -> crate::api::types::LightningBalance { self } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::node::LdkMnemonic { +impl flutter_rust_bridge::IntoDart for crate::api::types::LiquiditySourceConfig { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [self.seed_phrase.into_into_dart().into_dart()].into_dart() + [self.lsps2_service.into_into_dart().into_dart()].into_dart() } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::node::LdkMnemonic {} -impl flutter_rust_bridge::IntoIntoDart - for crate::api::node::LdkMnemonic +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::LiquiditySourceConfig { - 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::node::LdkNode { - 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::LdkNode {} -impl flutter_rust_bridge::IntoIntoDart for crate::api::node::LdkNode { - fn into_into_dart(self) -> crate::api::node::LdkNode { +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::LiquiditySourceConfig +{ + fn into_into_dart(self) -> crate::api::types::LiquiditySourceConfig { self } } @@ -2403,6 +3519,29 @@ impl flutter_rust_bridge::IntoIntoDart } } // Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::LSPFeeLimits { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [ + self.max_total_opening_fee_msat.into_into_dart().into_dart(), + self.max_proportional_opening_fee_ppm_msat + .into_into_dart() + .into_dart(), + ] + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::LSPFeeLimits +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::LSPFeeLimits +{ + fn into_into_dart(self) -> crate::api::types::LSPFeeLimits { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs impl flutter_rust_bridge::IntoDart for crate::api::types::MaxDustHTLCExposure { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { match self { @@ -2478,6 +3617,11 @@ impl flutter_rust_bridge::IntoDart for crate::api::error::NodeException { Self::DuplicatePayment => 28.into_dart(), Self::InsufficientFunds => 29.into_dart(), Self::FeerateEstimationUpdateFailed => 30.into_dart(), + Self::LiquidityRequestFailed => 31.into_dart(), + Self::LiquiditySourceUnavailable => 32.into_dart(), + Self::LiquidityFeeTooHigh => 33.into_dart(), + Self::InvalidPaymentId => 34.into_dart(), + Self::DecodeError => 35.into_dart(), } } } @@ -2493,6 +3637,40 @@ impl flutter_rust_bridge::IntoIntoDart } } // 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 +{ + fn into_into_dart(self) -> crate::api::types::NodeStatus { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs impl flutter_rust_bridge::IntoDart for crate::api::types::OutPoint { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { [ @@ -2514,9 +3692,8 @@ impl flutter_rust_bridge::IntoIntoDart impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentDetails { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { [ - self.hash.into_into_dart().into_dart(), - self.preimage.into_into_dart().into_dart(), - self.secret.into_into_dart().into_dart(), + self.id.into_into_dart().into_dart(), + self.kind.into_into_dart().into_dart(), self.amount_msat.into_into_dart().into_dart(), self.direction.into_into_dart().into_dart(), self.status.into_into_dart().into_dart(), @@ -2556,6 +3733,30 @@ 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() @@ -2573,6 +3774,69 @@ impl flutter_rust_bridge::IntoIntoDart } } // Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentId { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.0.into_into_dart().into_dart()].into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::PaymentId {} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::PaymentId +{ + fn into_into_dart(self) -> crate::api::types::PaymentId { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentKind { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + match self { + crate::api::types::PaymentKind::Onchain => [0.into_dart()].into_dart(), + crate::api::types::PaymentKind::Bolt11 { + hash, + preimage, + secret, + } => [ + 1.into_dart(), + hash.into_into_dart().into_dart(), + preimage.into_into_dart().into_dart(), + secret.into_into_dart().into_dart(), + ] + .into_dart(), + crate::api::types::PaymentKind::Bolt11Jit { + hash, + preimage, + secret, + lsp_fee_limits, + } => [ + 2.into_dart(), + hash.into_into_dart().into_dart(), + preimage.into_into_dart().into_dart(), + secret.into_into_dart().into_dart(), + lsp_fee_limits.into_into_dart().into_dart(), + ] + .into_dart(), + crate::api::types::PaymentKind::Spontaneous { hash, preimage } => [ + 3.into_dart(), + hash.into_into_dart().into_dart(), + preimage.into_into_dart().into_dart(), + ] + .into_dart(), + } + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::PaymentKind +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::PaymentKind +{ + fn into_into_dart(self) -> crate::api::types::PaymentKind { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentPreimage { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { [self.data.into_into_dart().into_dart()].into_dart() @@ -2650,6 +3914,61 @@ 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.into_into_dart().into_dart()].into_dart() @@ -2745,7 +4064,52 @@ impl flutter_rust_bridge::IntoIntoDart } } -impl SseEncode for RustOpaqueNom> { +impl SseEncode for NodeBuilder { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + >>::sse_encode(flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self), serializer); + } +} + +impl SseEncode for RustOpaqueNom { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode + for RustOpaqueNom> +{ + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode for RustOpaqueNom { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode for RustOpaqueNom { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode for RustOpaqueNom { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { let (ptr, size) = self.sse_encode_raw(); @@ -2768,6 +4132,28 @@ 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) { @@ -2799,7 +4185,7 @@ impl SseEncode for crate::api::error::BuilderException { crate::api::error::BuilderException::KVStoreSetupFailed => 9, crate::api::error::BuilderException::WalletSetupFailed => 10, crate::api::error::BuilderException::LoggerSetupFailed => 11, - crate::api::error::BuilderException::InvalidTrustedPeer => 12, + crate::api::error::BuilderException::InvalidPublicKey => 12, _ => { unimplemented!(""); } @@ -2827,7 +4213,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, ); @@ -2841,12 +4227,11 @@ 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); @@ -2855,6 +4240,25 @@ 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); } } @@ -2865,6 +4269,55 @@ 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::LegacyCooperativeClosure => { + ::sse_encode(2, serializer); + } + crate::api::types::ClosureReason::CounterpartyInitiatedCooperativeClosure => { + ::sse_encode(3, serializer); + } + crate::api::types::ClosureReason::LocallyInitiatedCooperativeClosure => { + ::sse_encode(4, serializer); + } + crate::api::types::ClosureReason::CommitmentTxConfirmed => { + ::sse_encode(5, serializer); + } + crate::api::types::ClosureReason::FundingTimedOut => { + ::sse_encode(6, serializer); + } + crate::api::types::ClosureReason::ProcessingError { err } => { + ::sse_encode(7, serializer); + ::sse_encode(err, serializer); + } + crate::api::types::ClosureReason::DisconnectedPeer => { + ::sse_encode(8, serializer); + } + crate::api::types::ClosureReason::OutdatedChannelManager => { + ::sse_encode(9, serializer); + } + crate::api::types::ClosureReason::CounterpartyCoopClosedUnfundedChannel => { + ::sse_encode(10, serializer); + } + crate::api::types::ClosureReason::FundingBatchClosure => { + ::sse_encode(11, serializer); + } + crate::api::types::ClosureReason::HTLCsTimedOut => { + ::sse_encode(12, 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) { @@ -2913,36 +4366,51 @@ 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 } => { + crate::api::types::Event::PaymentSuccessful { + payment_id, + payment_hash, + fee_paid_msat, + } => { ::sse_encode(0, serializer); + >::sse_encode(payment_id, serializer); ::sse_encode(payment_hash, serializer); + >::sse_encode(fee_paid_msat, serializer); } - crate::api::types::Event::PaymentFailed { payment_hash } => { + crate::api::types::Event::PaymentFailed { + payment_id, + payment_hash, + reason, + } => { ::sse_encode(1, serializer); + >::sse_encode(payment_id, serializer); ::sse_encode(payment_hash, serializer); + >::sse_encode(reason, serializer); } crate::api::types::Event::PaymentReceived { + payment_id, payment_hash, amount_msat, } => { ::sse_encode(2, serializer); + >::sse_encode(payment_id, serializer); ::sse_encode(payment_hash, serializer); ::sse_encode(amount_msat, serializer); } - crate::api::types::Event::ChannelReady { + crate::api::types::Event::ChannelPending { 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( - counterparty_node_id, - serializer, - ); + ::sse_encode(former_temporary_channel_id, serializer); + ::sse_encode(counterparty_node_id, serializer); + ::sse_encode(funding_txo, serializer); } - crate::api::types::Event::ChannelClosed { + crate::api::types::Event::ChannelReady { channel_id, user_channel_id, counterparty_node_id, @@ -2955,19 +4423,20 @@ impl SseEncode for crate::api::types::Event { serializer, ); } - crate::api::types::Event::ChannelPending { + crate::api::types::Event::ChannelClosed { channel_id, user_channel_id, - former_temporary_channel_id, counterparty_node_id, - funding_txo, + reason, } => { ::sse_encode(5, 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, + ); + >::sse_encode(reason, serializer); } } } @@ -2995,6 +4464,13 @@ impl SseEncode for i32 { } } +impl SseEncode for crate::api::node::LdkBolt11Payment { + // 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::node::LdkMnemonic { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -3005,7 +4481,116 @@ impl SseEncode for crate::api::node::LdkMnemonic { 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) { - >>::sse_encode(self.ptr, serializer); + >::sse_encode(self.ptr, serializer); + } +} + +impl SseEncode for crate::api::node::LdkOnChainPayment { + // 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::node::LdkSpontaneousPayment { + // 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::types::LightningBalance { + // 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); + } + } + } +} + +impl SseEncode for crate::api::types::LiquiditySourceConfig { + // 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); } } @@ -3019,6 +4604,16 @@ 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) { @@ -3039,6 +4634,16 @@ 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) { @@ -3089,6 +4694,14 @@ impl SseEncode for crate::api::types::LogLevel { } } +impl SseEncode for crate::api::types::LSPFeeLimits { + // 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.max_total_opening_fee_msat, serializer); + >::sse_encode(self.max_proportional_opening_fee_ppm_msat, serializer); + } +} + impl SseEncode for crate::api::types::MaxDustHTLCExposure { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -3159,6 +4772,11 @@ impl SseEncode for crate::api::error::NodeException { crate::api::error::NodeException::DuplicatePayment => 28, crate::api::error::NodeException::InsufficientFunds => 29, crate::api::error::NodeException::FeerateEstimationUpdateFailed => 30, + crate::api::error::NodeException::LiquidityRequestFailed => 31, + crate::api::error::NodeException::LiquiditySourceUnavailable => 32, + crate::api::error::NodeException::LiquidityFeeTooHigh => 33, + crate::api::error::NodeException::InvalidPaymentId => 34, + crate::api::error::NodeException::DecodeError => 35, _ => { unimplemented!(""); } @@ -3168,6 +4786,23 @@ impl SseEncode for crate::api::error::NodeException { } } +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) { @@ -3198,6 +4833,26 @@ 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) { @@ -3228,6 +4883,36 @@ 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) { @@ -3238,6 +4923,26 @@ 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) { @@ -3268,6 +4973,16 @@ 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) { @@ -3309,9 +5024,8 @@ impl SseEncode for crate::api::types::OutPoint { impl SseEncode for crate::api::types::PaymentDetails { // 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.hash, serializer); - >::sse_encode(self.preimage, serializer); - >::sse_encode(self.secret, serializer); + ::sse_encode(self.id, serializer); + ::sse_encode(self.kind, serializer); >::sse_encode(self.amount_msat, serializer); ::sse_encode(self.direction, serializer); ::sse_encode(self.status, serializer); @@ -3334,6 +5048,26 @@ 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) { @@ -3341,6 +5075,51 @@ impl SseEncode for crate::api::types::PaymentHash { } } +impl SseEncode for crate::api::types::PaymentId { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + <[u8; 32]>::sse_encode(self.0, serializer); + } +} + +impl SseEncode for crate::api::types::PaymentKind { + // 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::PaymentKind::Onchain => { + ::sse_encode(0, serializer); + } + crate::api::types::PaymentKind::Bolt11 { + hash, + preimage, + secret, + } => { + ::sse_encode(1, serializer); + ::sse_encode(hash, serializer); + >::sse_encode(preimage, serializer); + >::sse_encode(secret, serializer); + } + crate::api::types::PaymentKind::Bolt11Jit { + hash, + preimage, + secret, + lsp_fee_limits, + } => { + ::sse_encode(2, serializer); + ::sse_encode(hash, serializer); + >::sse_encode(preimage, serializer); + >::sse_encode(secret, serializer); + ::sse_encode(lsp_fee_limits, serializer); + } + crate::api::types::PaymentKind::Spontaneous { hash, preimage } => { + ::sse_encode(3, serializer); + ::sse_encode(hash, serializer); + >::sse_encode(preimage, serializer); + } + } + } +} + impl SseEncode for crate::api::types::PaymentPreimage { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -3381,6 +5160,48 @@ 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) { @@ -3388,6 +5209,21 @@ impl SseEncode for crate::api::types::PublicKey { } } +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); + } +} + impl SseEncode for crate::api::types::SocketAddress { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -3535,7 +5371,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 1785bd2..9a02f7d 100644 --- a/rust/src/frb_generated.web.rs +++ b/rust/src/frb_generated.web.rs @@ -42,6 +42,49 @@ 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 { @@ -107,8 +150,8 @@ impl CstDecode .unwrap(); assert_eq!( self_.length(), - 16, - "Expected 16 elements, got {}", + 28, + "Expected 28 elements, got {}", self_.length() ); crate::api::types::ChannelDetails { @@ -119,15 +162,27 @@ 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(), - 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(), + 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(), } } } @@ -150,6 +205,34 @@ 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::LegacyCooperativeClosure, + 3 => crate::api::types::ClosureReason::CounterpartyInitiatedCooperativeClosure, + 4 => crate::api::types::ClosureReason::LocallyInitiatedCooperativeClosure, + 5 => crate::api::types::ClosureReason::CommitmentTxConfirmed, + 6 => crate::api::types::ClosureReason::FundingTimedOut, + 7 => crate::api::types::ClosureReason::ProcessingError { + err: self_.get(1).cst_decode(), + }, + 8 => crate::api::types::ClosureReason::DisconnectedPeer, + 9 => crate::api::types::ClosureReason::OutdatedChannelManager, + 10 => crate::api::types::ClosureReason::CounterpartyCoopClosedUnfundedChannel, + 11 => crate::api::types::ClosureReason::FundingBatchClosure, + 12 => crate::api::types::ClosureReason::HTLCsTimedOut, + _ => unreachable!(), + } + } +} impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { @@ -204,31 +287,37 @@ impl CstDecode let self_ = self.unchecked_into::(); match self_.get(0).unchecked_into_f64() as _ { 0 => crate::api::types::Event::PaymentSuccessful { - payment_hash: self_.get(1).cst_decode(), + payment_id: self_.get(1).cst_decode(), + payment_hash: self_.get(2).cst_decode(), + fee_paid_msat: self_.get(3).cst_decode(), }, 1 => crate::api::types::Event::PaymentFailed { - payment_hash: self_.get(1).cst_decode(), + payment_id: self_.get(1).cst_decode(), + payment_hash: self_.get(2).cst_decode(), + reason: self_.get(3).cst_decode(), }, 2 => crate::api::types::Event::PaymentReceived { - payment_hash: self_.get(1).cst_decode(), - amount_msat: self_.get(2).cst_decode(), + payment_id: self_.get(1).cst_decode(), + payment_hash: self_.get(2).cst_decode(), + amount_msat: self_.get(3).cst_decode(), }, - 3 => crate::api::types::Event::ChannelReady { + 3 => 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(), + former_temporary_channel_id: self_.get(3).cst_decode(), + counterparty_node_id: self_.get(4).cst_decode(), + funding_txo: self_.get(5).cst_decode(), }, - 4 => crate::api::types::Event::ChannelClosed { + 4 => crate::api::types::Event::ChannelReady { 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::ChannelPending { + 5 => crate::api::types::Event::ChannelClosed { 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(), + reason: self_.get(4).cst_decode(), }, _ => unreachable!(), } @@ -247,6 +336,25 @@ 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::LdkBolt11Payment { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 1, + "Expected 1 elements, got {}", + self_.length() + ); + crate::api::node::LdkBolt11Payment { + ptr: self_.get(0).cst_decode(), + } + } +} impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { @@ -285,6 +393,112 @@ 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::LdkOnChainPayment { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 1, + "Expected 1 elements, got {}", + self_.length() + ); + crate::api::node::LdkOnChainPayment { + 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::node::LdkSpontaneousPayment { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 1, + "Expected 1 elements, got {}", + self_.length() + ); + crate::api::node::LdkSpontaneousPayment { + 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::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!(), + } + } +} +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 { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 1, + "Expected 1 elements, got {}", + self_.length() + ); + crate::api::types::LiquiditySourceConfig { + lsps2_service: self_.get(0).cst_decode(), + } + } +} impl CstDecode> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { @@ -297,6 +511,18 @@ 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 { @@ -321,6 +547,18 @@ 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 { @@ -351,6 +589,26 @@ 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) -> crate::api::types::LSPFeeLimits { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 2, + "Expected 2 elements, got {}", + self_.length() + ); + crate::api::types::LSPFeeLimits { + max_total_opening_fee_msat: self_.get(0).cst_decode(), + max_proportional_opening_fee_ppm_msat: self_.get(1).cst_decode(), + } + } +} impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { @@ -366,6 +624,32 @@ 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::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 { @@ -402,17 +686,16 @@ impl CstDecode .unwrap(); assert_eq!( self_.length(), - 6, - "Expected 6 elements, got {}", + 5, + "Expected 5 elements, got {}", self_.length() ); crate::api::types::PaymentDetails { - hash: self_.get(0).cst_decode(), - preimage: self_.get(1).cst_decode(), - secret: self_.get(2).cst_decode(), - amount_msat: self_.get(3).cst_decode(), - direction: self_.get(4).cst_decode(), - status: self_.get(5).cst_decode(), + id: self_.get(0).cst_decode(), + kind: self_.get(1).cst_decode(), + amount_msat: self_.get(2).cst_decode(), + direction: self_.get(3).cst_decode(), + status: self_.get(4).cst_decode(), } } } @@ -435,6 +718,50 @@ 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::PaymentId { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 1, + "Expected 1 elements, got {}", + self_.length() + ); + crate::api::types::PaymentId(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::PaymentKind { + let self_ = self.unchecked_into::(); + match self_.get(0).unchecked_into_f64() as _ { + 0 => crate::api::types::PaymentKind::Onchain, + 1 => crate::api::types::PaymentKind::Bolt11 { + hash: self_.get(1).cst_decode(), + preimage: self_.get(2).cst_decode(), + secret: self_.get(3).cst_decode(), + }, + 2 => crate::api::types::PaymentKind::Bolt11Jit { + hash: self_.get(1).cst_decode(), + preimage: self_.get(2).cst_decode(), + secret: self_.get(3).cst_decode(), + lsp_fee_limits: self_.get(4).cst_decode(), + }, + 3 => crate::api::types::PaymentKind::Spontaneous { + hash: self_.get(1).cst_decode(), + preimage: self_.get(2).cst_decode(), + }, + _ => unreachable!(), + } + } +} impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { @@ -494,6 +821,34 @@ 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 { @@ -513,6 +868,37 @@ impl CstDecode } } } +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 { @@ -616,11 +1002,68 @@ 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) -> NodeBuilder { + CstDecode::< + RustOpaqueNom>, + >::cst_decode(self) + .rust_auto_opaque_decode_owned() + } +} +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) -> RustOpaqueNom { + #[cfg(target_pointer_width = "64")] + { + compile_error!("64-bit pointers are not supported."); + } + unsafe { decode_rust_opaque_nom((self.as_f64().unwrap() as usize) as _) } + } +} +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, + ) -> RustOpaqueNom> { + #[cfg(target_pointer_width = "64")] + { + compile_error!("64-bit pointers are not supported."); + } + unsafe { decode_rust_opaque_nom((self.as_f64().unwrap() as usize) as _) } + } +} +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) -> RustOpaqueNom { + #[cfg(target_pointer_width = "64")] + { + compile_error!("64-bit pointers are not supported."); + } + unsafe { decode_rust_opaque_nom((self.as_f64().unwrap() as usize) as _) } + } +} +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) -> RustOpaqueNom { + #[cfg(target_pointer_width = "64")] + { + compile_error!("64-bit pointers are not supported."); + } + unsafe { decode_rust_opaque_nom((self.as_f64().unwrap() as usize) as _) } + } +} +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) -> RustOpaqueNom> { + fn cst_decode(self) -> RustOpaqueNom { #[cfg(target_pointer_width = "64")] { compile_error!("64-bit pointers are not supported."); @@ -694,6 +1137,14 @@ 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 { @@ -773,35 +1224,164 @@ impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsVa } #[wasm_bindgen] -pub fn wire_build_with_sqlite_store( +pub fn wire_NodeBuilder_build( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire_NodeBuilder_build_impl(port_, that) +} + +#[wasm_bindgen] +pub fn wire_NodeBuilder_build_with_fs_store( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire_NodeBuilder_build_with_fs_store_impl(port_, that) +} + +#[wasm_bindgen] +pub fn wire_NodeBuilder_create_builder( 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, ) { - wire_build_with_sqlite_store_impl( + wire_NodeBuilder_create_builder_impl( port_, config, chain_data_source_config, entropy_source_config, gossip_source_config, + liquidity_source_config, ) } +#[wasm_bindgen] +pub fn wire_ldk_bolt_11_payment_receive( + 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_ldk_bolt_11_payment_receive_impl(port_, that, amount_msat, description, expiry_secs) +} + +#[wasm_bindgen] +pub fn wire_ldk_bolt_11_payment_receive_variable_amount( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + description: String, + expiry_secs: u32, +) { + wire_ldk_bolt_11_payment_receive_variable_amount_impl(port_, that, description, expiry_secs) +} + +#[wasm_bindgen] +pub fn wire_ldk_bolt_11_payment_receive_variable_amount_via_jit_channel( + 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_ldk_bolt_11_payment_receive_variable_amount_via_jit_channel_impl( + port_, + that, + description, + expiry_secs, + max_proportional_lsp_fee_limit_ppm_msat, + ) +} + +#[wasm_bindgen] +pub fn wire_ldk_bolt_11_payment_receive_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_ldk_bolt_11_payment_receive_via_jit_channel_impl( + port_, + that, + amount_msat, + description, + expiry_secs, + max_total_lsp_fee_limit_msat, + ) +} + +#[wasm_bindgen] +pub fn wire_ldk_bolt_11_payment_send( + 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_ldk_bolt_11_payment_send_impl(port_, that, invoice) +} + +#[wasm_bindgen] +pub fn wire_ldk_bolt_11_payment_send_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_ldk_bolt_11_payment_send_probes_impl(port_, that, invoice) +} + +#[wasm_bindgen] +pub fn wire_ldk_bolt_11_payment_send_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_ldk_bolt_11_payment_send_probes_using_amount_impl(port_, that, invoice, amount_msat) +} + +#[wasm_bindgen] +pub fn wire_ldk_bolt_11_payment_send_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_ldk_bolt_11_payment_send_using_amount_impl(port_, that, invoice, amount_msat) +} + #[wasm_bindgen] pub fn wire_ldk_mnemonic_generate(port_: flutter_rust_bridge::for_generated::MessagePort) { wire_ldk_mnemonic_generate_impl(port_) } +#[wasm_bindgen] +pub fn wire_ldk_node_bolt11_payment( + port_: flutter_rust_bridge::for_generated::MessagePort, + ptr: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire_ldk_node_bolt11_payment_impl(port_, ptr) +} + #[wasm_bindgen] 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, + user_channel_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, counterparty_node_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_close_channel_impl(port_, that, channel_id, counterparty_node_id) + wire_ldk_node_close_channel_impl(port_, that, user_channel_id, counterparty_node_id) +} + +#[wasm_bindgen] +pub fn wire_ldk_node_config( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire_ldk_node_config_impl(port_, that) } #[wasm_bindgen] @@ -856,11 +1436,11 @@ pub fn wire_ldk_node_event_handled( } #[wasm_bindgen] -pub fn wire_ldk_node_is_running( +pub fn wire_ldk_node_list_balances( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_is_running_impl(port_, that) + wire_ldk_node_list_balances_impl(port_, that) } #[wasm_bindgen] @@ -905,19 +1485,19 @@ pub fn wire_ldk_node_listening_addresses( } #[wasm_bindgen] -pub fn wire_ldk_node_new_onchain_address( +pub fn wire_ldk_node_next_event( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_new_onchain_address_impl(port_, that) + wire_ldk_node_next_event_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_next_event( +pub fn wire_ldk_node_next_event_async( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_next_event_impl(port_, that) + wire_ldk_node_next_event_async_impl(port_, that) } #[wasm_bindgen] @@ -929,232 +1509,245 @@ pub fn wire_ldk_node_node_id( } #[wasm_bindgen] -pub fn wire_ldk_node_payment( +pub fn wire_ldk_node_on_chain_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, + ptr: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_payment_impl(port_, that, payment_hash) + wire_ldk_node_on_chain_payment_impl(port_, ptr) } #[wasm_bindgen] -pub fn wire_ldk_node_receive_payment( +pub fn wire_ldk_node_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, + payment_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_receive_payment_impl(port_, that, amount_msat, description, expiry_secs) + wire_ldk_node_payment_impl(port_, that, payment_id) } #[wasm_bindgen] -pub fn wire_ldk_node_receive_variable_amount_payment( +pub fn wire_ldk_node_remove_payment( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - description: String, - expiry_secs: u32, + payment_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_receive_variable_amount_payment_impl(port_, that, description, expiry_secs) + wire_ldk_node_remove_payment_impl(port_, that, payment_id) } #[wasm_bindgen] -pub fn wire_ldk_node_remove_payment( +pub fn wire_ldk_node_sign_message( 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, + msg: Box<[u8]>, ) { - wire_ldk_node_remove_payment_impl(port_, that, payment_hash) + wire_ldk_node_sign_message_impl(port_, that, msg) } #[wasm_bindgen] -pub fn wire_ldk_node_send_all_to_onchain_address( +pub fn wire_ldk_node_spontaneous_payment( 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, + ptr: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_send_all_to_onchain_address_impl(port_, that, address) + wire_ldk_node_spontaneous_payment_impl(port_, ptr) } #[wasm_bindgen] -pub fn wire_ldk_node_send_payment( +pub fn wire_ldk_node_start( 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_ldk_node_send_payment_impl(port_, that, invoice) + wire_ldk_node_start_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_send_payment_probes( +pub fn wire_ldk_node_status( 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_ldk_node_send_payment_probes_impl(port_, that, invoice) + wire_ldk_node_status_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_send_payment_probes_using_amount( +pub fn wire_ldk_node_stop( 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_ldk_node_send_payment_probes_using_amount_impl(port_, that, invoice, amount_msat) + wire_ldk_node_stop_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_send_payment_using_amount( +pub fn wire_ldk_node_sync_wallets( 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_ldk_node_send_payment_using_amount_impl(port_, that, invoice, amount_msat) + wire_ldk_node_sync_wallets_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_send_spontaneous_payment( +pub fn wire_ldk_node_update_channel_config( 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, + user_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_ldk_node_send_spontaneous_payment_impl(port_, that, amount_msat, node_id) + wire_ldk_node_update_channel_config_impl( + port_, + that, + user_channel_id, + counterparty_node_id, + channel_config, + ) } #[wasm_bindgen] -pub fn wire_ldk_node_send_spontaneous_payment_probes( +pub fn wire_ldk_node_verify_signature( 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, + msg: Box<[u8]>, + sig: String, + public_key: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_send_spontaneous_payment_probes_impl(port_, that, amount_msat, node_id) + wire_ldk_node_verify_signature_impl(port_, that, msg, sig, public_key) } #[wasm_bindgen] -pub fn wire_ldk_node_send_to_onchain_address( +pub fn wire_ldk_node_wait_next_event( 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_ldk_node_send_to_onchain_address_impl(port_, that, address, amount_sats) + wire_ldk_node_wait_next_event_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_sign_message( +pub fn wire_ldk_on_chain_payment_new_address( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - msg: Box<[u8]>, ) { - wire_ldk_node_sign_message_impl(port_, that, msg) + wire_ldk_on_chain_payment_new_address_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_spendable_onchain_balance_sats( +pub fn wire_ldk_on_chain_payment_send_all_to_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_ldk_node_spendable_onchain_balance_sats_impl(port_, that) + wire_ldk_on_chain_payment_send_all_to_address_impl(port_, that, address) } #[wasm_bindgen] -pub fn wire_ldk_node_start( +pub fn wire_ldk_on_chain_payment_send_to_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_ldk_node_start_impl(port_, that) + wire_ldk_on_chain_payment_send_to_address_impl(port_, that, address, amount_sats) } #[wasm_bindgen] -pub fn wire_ldk_node_stop( +pub fn wire_ldk_spontaneous_payment_send( 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_ldk_node_stop_impl(port_, that) + wire_ldk_spontaneous_payment_send_impl(port_, that, amount_msat, node_id) } #[wasm_bindgen] -pub fn wire_ldk_node_sync_wallets( +pub fn wire_ldk_spontaneous_payment_send_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_ldk_node_sync_wallets_impl(port_, that) + wire_ldk_spontaneous_payment_send_probes_impl(port_, that, amount_msat, node_id) } #[wasm_bindgen] -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, +pub fn rust_arc_increment_strong_count_RustOpaque_Node(ptr: *const std::ffi::c_void) { + unsafe { + StdArc::::increment_strong_count(ptr as _); + } +} + +#[wasm_bindgen] +pub fn rust_arc_decrement_strong_count_RustOpaque_Node(ptr: *const std::ffi::c_void) { + unsafe { + StdArc::::decrement_strong_count(ptr as _); + } +} + +#[wasm_bindgen] +pub fn rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + ptr: *const std::ffi::c_void, ) { - wire_ldk_node_total_onchain_balance_sats_impl(port_, that) + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } } #[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, +pub fn rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + ptr: *const std::ffi::c_void, ) { - wire_ldk_node_update_channel_config_impl( - port_, - that, - channel_id, - counterparty_node_id, - channel_config, - ) + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } } #[wasm_bindgen] -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, +pub fn rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( + ptr: *const std::ffi::c_void, ) { - wire_ldk_node_verify_signature_impl(port_, that, msg, sig, pkey) + unsafe { + StdArc::::increment_strong_count(ptr as _); + } } #[wasm_bindgen] -pub fn wire_ldk_node_wait_next_event( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +pub fn rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( + ptr: *const std::ffi::c_void, ) { - wire_ldk_node_wait_next_event_impl(port_, that) + unsafe { + StdArc::::decrement_strong_count(ptr as _); + } } #[wasm_bindgen] -pub fn wire_socket_address_as_string( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +pub fn rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( + ptr: *const std::ffi::c_void, ) { - wire_socket_address_as_string_impl(port_, that) + unsafe { + StdArc::::increment_strong_count(ptr as _); + } } #[wasm_bindgen] -pub fn wire_socket_address_from_str( - port_: flutter_rust_bridge::for_generated::MessagePort, - address: String, +pub fn rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( + ptr: *const std::ffi::c_void, ) { - wire_socket_address_from_str_impl(port_, address) + unsafe { + StdArc::::decrement_strong_count(ptr as _); + } } #[wasm_bindgen] -pub fn rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore(ptr: *const std::ffi::c_void) { +pub fn rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( + ptr: *const std::ffi::c_void, +) { unsafe { - StdArc::>::increment_strong_count(ptr as _); + StdArc::::increment_strong_count(ptr as _); } } #[wasm_bindgen] -pub fn rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore(ptr: *const std::ffi::c_void) { +pub fn rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( + ptr: *const std::ffi::c_void, +) { unsafe { - StdArc::>::decrement_strong_count(ptr as _); + StdArc::::decrement_strong_count(ptr as _); } } From 28d30225da129f5890e0b008b1dfc014035a994f Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Mon, 24 Jun 2024 15:56:00 -0400 Subject: [PATCH 02/48] version upgraded to 0.3.0 --- CHANGELOG.md | 2 +- README.md | 2 +- ios/ldk_node.podspec | 2 +- pubspec.yaml | 2 +- rust/Cargo.lock | 2 +- rust/Cargo.toml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0a4cfa..f0423dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## [0.2.3-dev] +## [0.3.0] ## [0.2.2-dev] Updated Rust and Flutter dependencies. diff --git a/README.md b/README.md index ba5a465..c7cda5e 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ To use the `ldk_node` package in your project, add it as a dependency in your pr ```dart dependencies: - ldk_node: ^0.2.3-dev + ldk_node: ^0.3.0 ``` or add from pub.dev using `pub add` command diff --git a/ios/ldk_node.podspec b/ios/ldk_node.podspec index 1513dc0..efbef9a 100644 --- a/ios/ldk_node.podspec +++ b/ios/ldk_node.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'ldk_node' - s.version = '0.2.3-dev' + s.version = '0.3.0' s.summary = 'A ready-to-go Lightning node library built using LDK and BDK.' s.homepage = 'http://example.com' s.license = { :file => '../LICENSE' } diff --git a/pubspec.yaml b/pubspec.yaml index 928f300..fa3e563 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: ldk_node description: A ready-to-go Lightning node library built using LDK and BDK. -version: 0.2.3-dev +version: 0.3.0 homepage: https://github.com/LtbLightning/ldk-node-flutter environment: diff --git a/rust/Cargo.lock b/rust/Cargo.lock index ceb4262..a74fed9 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -910,7 +910,7 @@ dependencies = [ [[package]] name = "ldk_node" -version = "0.2.3-dev" +version = "0.3.0" dependencies = [ "anyhow", "flutter_rust_bridge", diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 1e2fb84..36d8254 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ldk_node" -version = "0.2.3-dev" +version = "0.3.0" edition = "2021" [lib] From 77f441fb85e34c779079243292bc45ef98ca306f Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Mon, 24 Jun 2024 18:34:00 -0400 Subject: [PATCH 03/48] feat(Config): anchorChannelsConfig added --- lib/src/generated/api/types.dart | 252 +++- lib/src/generated/api/types.freezed.dart | 1654 ++++++++++++++++++---- rust/src/api/types.rs | 584 +++++--- 3 files changed, 1928 insertions(+), 562 deletions(-) diff --git a/lib/src/generated/api/types.dart b/lib/src/generated/api/types.dart index 437c45f..48f43b2 100644 --- a/lib/src/generated/api/types.dart +++ b/lib/src/generated/api/types.dart @@ -1,14 +1,17 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. +// Generated by `flutter_rust_bridge`@ 2.0.0. // ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import import '../frb_generated.dart'; -import 'node.dart'; +import '../lib.dart'; +import 'builder.dart'; import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; import 'package:freezed_annotation/freezed_annotation.dart' hide protected; part 'types.freezed.dart'; +// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `default`, `default`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `hash`, `hash`, `hash`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from` + /// A Bitcoin address. /// class Address { @@ -27,20 +30,98 @@ class Address { other is Address && runtimeType == other.runtimeType && s == other.s; } -/// Details of the known available balances returned by [`Node::list_balances`]. +/// Configuration options pertaining to 'Anchor' channels, i.e., channels for which the +/// `optionAnchorsZeroFeeHtlcTx` channel type is negotiated. +/// +/// Prior to the introduction of Anchor channels, the on-chain fees paying for the transactions +/// issued on channel closure were pre-determined and locked-in at the time of the channel +/// opening. This required to estimate what fee rate would be sufficient to still have the +/// closing transactions be spendable on-chain (i.e., not be considered dust). This legacy +/// design of pre-anchor channels proved inadequate in the unpredictable, often turbulent, fee +/// markets we experience today. +/// +/// In contrast, Anchor channels allow to determine an adequate fee rate *at the time of channel +/// closure*, making them much more robust in the face of fee spikes. In turn, they require to +/// maintain a reserve of on-chain funds to have the channel closure transactions confirmed +/// on-chain, at least if the channel counterparty can't be trusted to do this for us. +/// +/// See [BOLT 3] for more technical details on Anchor channels. +/// +/// +/// ### Defaults +/// +/// | Parameter | Value | +/// |----------------------------|--------| +/// | `trustedPeersNoReserve` | [] | +/// | `perChannelReserveSats` | 25000 | +/// +/// +/// [BOLT 3]: https://github.com/lightning/bolts/blob/master/03-transactions.md#htlc-timeout-and-htlc-success-transactions +class AnchorChannelsConfig { + /// A list of peers that we trust to get the required channel closing transactions confirmed + /// on-chain. + /// + /// Channels with these peers won't count towards the retained on-chain reserve and we won't + /// take any action to get the required transactions confirmed ourselves. + /// + /// **Note:** Trusting the channel counterparty to take the necessary actions to get the + /// required Anchor spending and HTLC transactions confirmed on-chain is potentially insecure + /// as the channel may not be closed if they refuse to do so, potentially leaving the user + /// funds stuck *or* even allow the counterparty to steal any in-flight funds after the + /// corresponding HTLCs time out. + final List trustedPeersNoReserve; + + /// The amount of satoshis per anchors-negotiated channel with an untrusted peer that we keep + /// as an emergency reserve in our on-chain wallet. + /// + /// This allows for having the required Anchor output spending and HTLC transactions confirmed + /// when the channel is closed. + /// + /// If the channel peer is not marked as trusted via trustedPeersNoReserve, + /// we will always try to spend the Anchor + /// outputs with *any* on-chain funds available, i.e., the total reserve value as well as any + /// spendable funds available in the on-chain wallet. Therefore, this per-channel multiplier is + /// really an emergency reserve that we maintain at all time to reduce reduce the risk of + /// insufficient funds at time of a channel closure. To this end, we will refuse to open + /// outbound or accept inbound channels if we don't have sufficient on-chain funds available to + /// cover the additional reserve requirement. + /// + /// **Note:** Depending on the fee market at the time of closure, this reserve amount might or + /// might not suffice to successfully spend the Anchor output and have the HTLC transactions + /// confirmed on-chain, i.e., you may want to adjust this value accordingly. + final BigInt perChannelReserveSats; + + const AnchorChannelsConfig({ + required this.trustedPeersNoReserve, + required this.perChannelReserveSats, + }); + + @override + int get hashCode => + trustedPeersNoReserve.hashCode ^ perChannelReserveSats.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AnchorChannelsConfig && + runtimeType == other.runtimeType && + trustedPeersNoReserve == other.trustedPeersNoReserve && + perChannelReserveSats == other.perChannelReserveSats; +} + +/// Details of the known available balances returned by `node.listBalances`. /// -/// [`Node::list_balances`]: crate::Node::list_balances class BalanceDetails { /// The total balance of our on-chain wallet. - final int totalOnchainBalanceSats; + final BigInt totalOnchainBalanceSats; /// The currently spendable balance of our on-chain wallet. - final int spendableOnchainBalanceSats; + final BigInt 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; + final BigInt totalLightningBalanceSats; /// A detailed list of all known Lightning balances that would be claimable on channel closure. /// @@ -174,7 +255,7 @@ class ChannelConfig { /// When we are not the funder, we require the closing transaction fee pay at least our Background fee estimate, but allow our counterparty to pay as much fee as they like. Thus, this value is ignored when we are not the funder. /// /// Default value: 1000 satoshis. - final int forceCloseAvoidanceMaxFeeSatoshis; + final BigInt 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. final bool acceptUnderpayingHtlcs; @@ -229,7 +310,7 @@ class ChannelDetails { final OutPoint? fundingTxo; /// The value, in satoshis, of this channel as it appears in the funding output. - final int channelValueSats; + final BigInt 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 @@ -239,7 +320,7 @@ class ChannelDetails { /// /// This value will be `None` for outbound channels until the counterparty accepts the channel. /// - final int? unspendablePunishmentReserve; + final BigInt? unspendablePunishmentReserve; /// The local `user_channel_id` of this channel. final UserChannelId userChannelId; @@ -253,7 +334,7 @@ class ChannelDetails { /// The amount does not include any pending HTLCs which are not yet 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. - final int outboundCapacityMsat; + final BigInt outboundCapacityMsat; /// The available outbound capacity for sending HTLCs to the remote peer. /// @@ -261,7 +342,7 @@ class ChannelDetails { /// (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; + final BigInt inboundCapacityMsat; /// The number of required confirmations on the funding transactions before the funding is /// considered "locked". The amount is selected by the channel fundee. @@ -301,16 +382,16 @@ class ChannelDetails { /// This value is not included in [`inbound_capacity_msat`] as it can never be spent. /// /// [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat - final int counterpartyUnspendablePunishmentReserve; + final BigInt counterpartyUnspendablePunishmentReserve; /// The smallest value HTLC (in msat) the remote peer will accept, for this channel. /// /// This field is only `None` before we have received either the `OpenChannel` or /// `AcceptChannel` message from the remote peer. - final int? counterpartyOutboundHtlcMinimumMsat; + final BigInt? counterpartyOutboundHtlcMinimumMsat; /// The largest value HTLC (in msat) the remote peer currently will accept, for this channel. - final int? counterpartyOutboundHtlcMaximumMsat; + final BigInt? counterpartyOutboundHtlcMaximumMsat; /// Base routing fee in millisatoshis. final int? counterpartyForwardingInfoFeeBaseMsat; @@ -326,13 +407,13 @@ class ChannelDetails { /// 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; + final BigInt 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; + final BigInt 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 @@ -344,10 +425,10 @@ class ChannelDetails { final int? forceCloseSpendDelay; /// The smallest value HTLC (in msat) we will accept, for this channel. - final int inboundHtlcMinimumMsat; + final BigInt inboundHtlcMinimumMsat; /// The largest value HTLC (in msat) we currently will accept, for this channel. - final int? inboundHtlcMaximumMsat; + final BigInt? inboundHtlcMaximumMsat; /// Set of configurable parameters that affect channel operation. final ChannelConfig config; @@ -595,28 +676,29 @@ class Config { ///The time in-between background sync attempts of the onchain wallet, in seconds. /// Note: A minimum of 10 seconds is always enforced. - int onchainWalletSyncIntervalSecs; + BigInt onchainWalletSyncIntervalSecs; /// The time in-between background sync attempts of the LDK wallet, in seconds. /// Note: A minimum of 10 seconds is always enforced. /// - int walletSyncIntervalSecs; + BigInt walletSyncIntervalSecs; ///The time in-between background update attempts to our fee rate cache, in seconds. /// Note: A minimum of 10 seconds is always enforced. /// - int feeRateCacheUpdateIntervalSecs; + BigInt feeRateCacheUpdateIntervalSecs; ///A list of peers that we allow to establish zero confirmation channels to us. /// ///Note: Allowing payments via zero-confirmation channels is potentially insecure if the funding transaction ends up never being confirmed on-chain. Zero-confirmation channels should therefore only be accepted from trusted peers. final List trustedPeers0Conf; - final int probingLiquidityLimitMultiplier; + final BigInt probingLiquidityLimitMultiplier; ///The level at which we log messages. /// Any messages below this level will be excluded from the logs. /// LogLevel logLevel; + AnchorChannelsConfig? anchorChannelsConfig; Config({ required this.storageDirPath, @@ -630,6 +712,7 @@ class Config { required this.trustedPeers0Conf, required this.probingLiquidityLimitMultiplier, required this.logLevel, + this.anchorChannelsConfig, }); @override @@ -644,7 +727,8 @@ class Config { feeRateCacheUpdateIntervalSecs.hashCode ^ trustedPeers0Conf.hashCode ^ probingLiquidityLimitMultiplier.hashCode ^ - logLevel.hashCode; + logLevel.hashCode ^ + anchorChannelsConfig.hashCode; @override bool operator ==(Object other) => @@ -664,7 +748,8 @@ class Config { trustedPeers0Conf == other.trustedPeers0Conf && probingLiquidityLimitMultiplier == other.probingLiquidityLimitMultiplier && - logLevel == other.logLevel; + logLevel == other.logLevel && + anchorChannelsConfig == other.anchorChannelsConfig; } @freezed @@ -687,6 +772,27 @@ sealed class EntropySourceConfig with _$EntropySourceConfig { sealed class Event with _$Event { const Event._(); + /// A payment for a previously-registered payment hash has been received. + /// + /// This needs to be manually claimed by supplying the correct preimage to `claimForHash`. + /// + /// If the the provided parameters don't match the expectations or the preimage can't be + /// retrieved in time, should be failed-back via [`failForHash`]. + const factory Event.paymentClaimable({ + /// A local identifier used to track the payment. + required PaymentId paymentId, + + /// The hash of the payment. + required PaymentHash paymentHash, + + /// The value, in thousandths of a satoshi, that is claimable. + required BigInt claimableAmountMsat, + + /// The block height at which this payment will be failed back and will no longer be + /// eligible for claiming. + int? claimDeadline, + }) = Event_PaymentClaimable; + /// A sent payment was successful. const factory Event.paymentSuccessful({ /// A local identifier used to track the payment. @@ -698,7 +804,7 @@ sealed class Event with _$Event { required PaymentHash paymentHash, /// The total fee which was spent at intermediate hops in this payment. - int? feePaidMsat, + BigInt? feePaidMsat, }) = Event_PaymentSuccessful; /// A sent payment has failed. @@ -728,7 +834,7 @@ sealed class Event with _$Event { required PaymentHash paymentHash, /// The value, in thousandths of a satoshi, that has been received. - required int amountMsat, + required BigInt amountMsat, }) = Event_PaymentReceived; /// A channel has been created and is pending confirmation on-chain. @@ -807,7 +913,7 @@ sealed class LightningBalance with _$LightningBalance { /// The amount available to claim, in satoshis, excluding the on-chain fees which will be /// required to do so. - required int amountSatoshis, + required BigInt amountSatoshis, }) = LightningBalance_ClaimableOnChannelClose; /// The channel has been closed, and the given balance is ours but awaiting confirmations until @@ -821,7 +927,7 @@ sealed class LightningBalance with _$LightningBalance { /// The amount available to claim, in satoshis, possibly excluding the on-chain fees which /// were spent in broadcasting the transaction. - required int amountSatoshis, + required BigInt amountSatoshis, /// The height at which an [`Event::SpendableOutputs`] event will be generated for this /// amount. @@ -846,7 +952,7 @@ sealed class LightningBalance with _$LightningBalance { /// The amount available to claim, in satoshis, excluding the on-chain fees which will be /// required to do so. - required int amountSatoshis, + required BigInt amountSatoshis, /// The height at which the counterparty may be able to claim the balance if we have not /// done so. @@ -871,7 +977,7 @@ sealed class LightningBalance with _$LightningBalance { /// The amount potentially available to claim, in satoshis, excluding the on-chain fees /// which will be required to do so. - required int amountSatoshis, + required BigInt amountSatoshis, /// The height at which we will be able to claim the balance if our counterparty has not /// done so. @@ -893,7 +999,7 @@ sealed class LightningBalance with _$LightningBalance { /// The amount potentially available to claim, in satoshis, excluding the on-chain fees /// which will be required to do so. - required int amountSatoshis, + required BigInt 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. @@ -916,7 +1022,7 @@ sealed class LightningBalance with _$LightningBalance { required PublicKey counterpartyNodeId, /// The amount, in satoshis, of the output which we can claim. - required int amountSatoshis, + required BigInt amountSatoshis, }) = LightningBalance_CounterpartyRevokedOutputClaimable; } @@ -964,17 +1070,18 @@ enum LogLevel { /// Designates very serious errors /// error, + ; } /// Limits applying to how much fee we allow an LSP to deduct from the payment amount. class LSPFeeLimits { /// The maximal total amount we allow any configured LSP withhold from us when forwarding the /// payment. - final int? maxTotalOpeningFeeMsat; + final BigInt? maxTotalOpeningFeeMsat; /// The maximal proportional fee, in parts-per-million millisatoshi, we allow any configured /// LSP withhold from us when forwarding the payment. - final int? maxProportionalOpeningFeePpmMsat; + final BigInt? maxProportionalOpeningFeePpmMsat; const LSPFeeLimits({ this.maxTotalOpeningFeeMsat, @@ -1002,12 +1109,12 @@ sealed class MaxDustHTLCExposure with _$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, + BigInt field0, ) = MaxDustHTLCExposure_FixedLimitMsat; ///This sets a multiplier on the estimated high priority feerate (sats/KW, as obtained from FeeEstimator) to determine the maximum allowed dust exposure. If this variant is used then the maximum dust exposure in millisatoshis is calculated as: high_priority_feerate_per_kw * value. For example, with our default value FeeRateMultiplier(5000): const factory MaxDustHTLCExposure.feeRateMultiplier( - int field0, + BigInt field0, ) = MaxDustHTLCExposure_FeeRateMultiplier; } @@ -1029,6 +1136,7 @@ enum Network { ///Bitcoin’s regtest /// regtest, + ; } /// Represents the status of the [Node]. @@ -1047,31 +1155,31 @@ class NodeStatus { /// 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; + final BigInt? 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; + final BigInt? 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; + final BigInt? 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; + final BigInt? 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; + final BigInt? latestNodeAnnouncementBroadcastTimestamp; const NodeStatus({ required this.isRunning, @@ -1113,6 +1221,24 @@ class NodeStatus { other.latestNodeAnnouncementBroadcastTimestamp; } +class OfferId { + final U8Array32 field0; + + const OfferId({ + required this.field0, + }); + + @override + int get hashCode => field0.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is OfferId && + runtimeType == other.runtimeType && + field0 == other.field0; +} + ///A reference to a transaction output. /// class OutPoint { @@ -1145,7 +1271,7 @@ class PaymentDetails { final PaymentKind kind; /// The amount transferred. - final int? amountMsat; + final BigInt? amountMsat; /// The direction of the payment. final PaymentDirection direction; @@ -1189,6 +1315,7 @@ enum PaymentDirection { /// The payment is outbound. outbound, + ; } /// The reason the payment failed. Used in `Event.PaymentFailed`. @@ -1216,6 +1343,7 @@ enum PaymentFailureReason { /// 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 @@ -1308,6 +1436,37 @@ sealed class PaymentKind with _$PaymentKind { /// The pre-image used by the payment. PaymentPreimage? preimage, }) = PaymentKind_Spontaneous; + + /// A [BOLT 12] offer payment, i.e., a payment for an `Offer`. + /// + /// [BOLT 12]: https://github.com/lightning/bolts/blob/master/12-offer-encoding.md + const factory PaymentKind.bolt12Offer({ + /// The payment hash, i.e., the hash of the `preimage`. + PaymentHash? hash, + + /// The pre-image used by the payment. + PaymentPreimage? preimage, + + /// The secret used by the payment. + PaymentSecret? secret, + + /// The ID of the offer this payment is for. + required OfferId offerId, + }) = PaymentKind_Bolt12Offer; + + /// A [BOLT 12] 'refund' payment, i.e., a payment for a `Refund`. + /// + /// [BOLT 12]: https://github.com/lightning/bolts/blob/master/12-offer-encoding.md + const factory PaymentKind.bolt12Refund({ + /// The payment hash, i.e., the hash of the `preimage`. + PaymentHash? hash, + + /// The pre-image used by the payment. + PaymentPreimage? preimage, + + /// The secret used by the payment. + PaymentSecret? secret, + }) = PaymentKind_Bolt12Refund; } /// paymentPreimage type, use to route payment between hop @@ -1361,6 +1520,7 @@ enum PaymentStatus { /// The payment failed. failed, + ; } /// Details of a known Lightning peer as returned by `node.listPeers`. @@ -1408,7 +1568,7 @@ sealed class PendingSweepBalance with _$PendingSweepBalance { ChannelId? channelId, /// The amount, in satoshis, of the output being swept. - required int amountSatoshis, + required BigInt amountSatoshis, }) = PendingSweepBalance_PendingBroadcast; /// A spending transaction has been generated and broadcast and is awaiting confirmation @@ -1424,7 +1584,7 @@ sealed class PendingSweepBalance with _$PendingSweepBalance { required Txid latestSpendingTxid, /// The amount, in satoshis, of the output being swept. - required int amountSatoshis, + required BigInt amountSatoshis, }) = PendingSweepBalance_BroadcastAwaitingConfirmation; /// A spending transaction has been confirmed on-chain and is awaiting threshold confirmations. @@ -1446,7 +1606,7 @@ sealed class PendingSweepBalance with _$PendingSweepBalance { required int confirmationHeight, /// The amount, in satoshis, of the output being swept. - required int amountSatoshis, + required BigInt amountSatoshis, }) = PendingSweepBalance_AwaitingThresholdConfirmations; } diff --git a/lib/src/generated/api/types.freezed.dart b/lib/src/generated/api/types.freezed.dart index c936acd..ac2bfd5 100644 --- a/lib/src/generated/api/types.freezed.dart +++ b/lib/src/generated/api/types.freezed.dart @@ -3750,14 +3750,17 @@ abstract class EntropySourceConfig_Bip39Mnemonic extends EntropySourceConfig { mixin _$Event { @optionalTypeArgs TResult when({ + required TResult Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline) + paymentClaimable, required TResult Function( - PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat) + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat) paymentSuccessful, required TResult Function(PaymentId? paymentId, PaymentHash paymentHash, PaymentFailureReason? reason) paymentFailed, required TResult Function( - PaymentId? paymentId, PaymentHash paymentHash, int amountMsat) + PaymentId? paymentId, PaymentHash paymentHash, BigInt amountMsat) paymentReceived, required TResult Function( ChannelId channelId, @@ -3776,14 +3779,17 @@ mixin _$Event { throw _privateConstructorUsedError; @optionalTypeArgs TResult? whenOrNull({ + TResult? Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, TResult? Function( - PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat)? + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? paymentSuccessful, TResult? Function(PaymentId? paymentId, PaymentHash paymentHash, PaymentFailureReason? reason)? paymentFailed, TResult? Function( - PaymentId? paymentId, PaymentHash paymentHash, int amountMsat)? + PaymentId? paymentId, PaymentHash paymentHash, BigInt amountMsat)? paymentReceived, TResult? Function( ChannelId channelId, @@ -3802,14 +3808,17 @@ mixin _$Event { throw _privateConstructorUsedError; @optionalTypeArgs TResult maybeWhen({ + TResult Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, TResult Function( - PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat)? + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? paymentSuccessful, TResult Function(PaymentId? paymentId, PaymentHash paymentHash, PaymentFailureReason? reason)? paymentFailed, TResult Function( - PaymentId? paymentId, PaymentHash paymentHash, int amountMsat)? + PaymentId? paymentId, PaymentHash paymentHash, BigInt amountMsat)? paymentReceived, TResult Function( ChannelId channelId, @@ -3829,6 +3838,7 @@ mixin _$Event { throw _privateConstructorUsedError; @optionalTypeArgs TResult map({ + required TResult Function(Event_PaymentClaimable value) paymentClaimable, required TResult Function(Event_PaymentSuccessful value) paymentSuccessful, required TResult Function(Event_PaymentFailed value) paymentFailed, required TResult Function(Event_PaymentReceived value) paymentReceived, @@ -3839,6 +3849,7 @@ mixin _$Event { throw _privateConstructorUsedError; @optionalTypeArgs TResult? mapOrNull({ + TResult? Function(Event_PaymentClaimable value)? paymentClaimable, TResult? Function(Event_PaymentSuccessful value)? paymentSuccessful, TResult? Function(Event_PaymentFailed value)? paymentFailed, TResult? Function(Event_PaymentReceived value)? paymentReceived, @@ -3849,6 +3860,7 @@ mixin _$Event { throw _privateConstructorUsedError; @optionalTypeArgs TResult maybeMap({ + TResult Function(Event_PaymentClaimable value)? paymentClaimable, TResult Function(Event_PaymentSuccessful value)? paymentSuccessful, TResult Function(Event_PaymentFailed value)? paymentFailed, TResult Function(Event_PaymentReceived value)? paymentReceived, @@ -3877,6 +3889,291 @@ class _$EventCopyWithImpl<$Res, $Val extends Event> final $Res Function($Val) _then; } +/// @nodoc +abstract class _$$Event_PaymentClaimableImplCopyWith<$Res> { + factory _$$Event_PaymentClaimableImplCopyWith( + _$Event_PaymentClaimableImpl value, + $Res Function(_$Event_PaymentClaimableImpl) then) = + __$$Event_PaymentClaimableImplCopyWithImpl<$Res>; + @useResult + $Res call( + {PaymentId paymentId, + PaymentHash paymentHash, + BigInt claimableAmountMsat, + int? claimDeadline}); +} + +/// @nodoc +class __$$Event_PaymentClaimableImplCopyWithImpl<$Res> + extends _$EventCopyWithImpl<$Res, _$Event_PaymentClaimableImpl> + implements _$$Event_PaymentClaimableImplCopyWith<$Res> { + __$$Event_PaymentClaimableImplCopyWithImpl( + _$Event_PaymentClaimableImpl _value, + $Res Function(_$Event_PaymentClaimableImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? paymentId = null, + Object? paymentHash = null, + Object? claimableAmountMsat = null, + Object? claimDeadline = freezed, + }) { + return _then(_$Event_PaymentClaimableImpl( + paymentId: null == paymentId + ? _value.paymentId + : paymentId // ignore: cast_nullable_to_non_nullable + as PaymentId, + paymentHash: null == paymentHash + ? _value.paymentHash + : paymentHash // ignore: cast_nullable_to_non_nullable + as PaymentHash, + claimableAmountMsat: null == claimableAmountMsat + ? _value.claimableAmountMsat + : claimableAmountMsat // ignore: cast_nullable_to_non_nullable + as BigInt, + claimDeadline: freezed == claimDeadline + ? _value.claimDeadline + : claimDeadline // ignore: cast_nullable_to_non_nullable + as int?, + )); + } +} + +/// @nodoc + +class _$Event_PaymentClaimableImpl extends Event_PaymentClaimable { + const _$Event_PaymentClaimableImpl( + {required this.paymentId, + required this.paymentHash, + required this.claimableAmountMsat, + this.claimDeadline}) + : super._(); + + /// A local identifier used to track the payment. + @override + final PaymentId paymentId; + + /// The hash of the payment. + @override + final PaymentHash paymentHash; + + /// The value, in thousandths of a satoshi, that is claimable. + @override + final BigInt claimableAmountMsat; + + /// The block height at which this payment will be failed back and will no longer be + /// eligible for claiming. + @override + final int? claimDeadline; + + @override + String toString() { + return 'Event.paymentClaimable(paymentId: $paymentId, paymentHash: $paymentHash, claimableAmountMsat: $claimableAmountMsat, claimDeadline: $claimDeadline)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Event_PaymentClaimableImpl && + (identical(other.paymentId, paymentId) || + other.paymentId == paymentId) && + (identical(other.paymentHash, paymentHash) || + other.paymentHash == paymentHash) && + (identical(other.claimableAmountMsat, claimableAmountMsat) || + other.claimableAmountMsat == claimableAmountMsat) && + (identical(other.claimDeadline, claimDeadline) || + other.claimDeadline == claimDeadline)); + } + + @override + int get hashCode => Object.hash( + runtimeType, paymentId, paymentHash, claimableAmountMsat, claimDeadline); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$Event_PaymentClaimableImplCopyWith<_$Event_PaymentClaimableImpl> + get copyWith => __$$Event_PaymentClaimableImplCopyWithImpl< + _$Event_PaymentClaimableImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline) + paymentClaimable, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat) + paymentSuccessful, + required TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason) + paymentFailed, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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 paymentClaimable( + paymentId, paymentHash, claimableAmountMsat, claimDeadline); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult? Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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 paymentClaimable?.call( + paymentId, paymentHash, claimableAmountMsat, claimDeadline); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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 (paymentClaimable != null) { + return paymentClaimable( + paymentId, paymentHash, claimableAmountMsat, claimDeadline); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Event_PaymentClaimable value) paymentClaimable, + 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 paymentClaimable(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Event_PaymentClaimable value)? paymentClaimable, + 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 paymentClaimable?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Event_PaymentClaimable value)? paymentClaimable, + 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 (paymentClaimable != null) { + return paymentClaimable(this); + } + return orElse(); + } +} + +abstract class Event_PaymentClaimable extends Event { + const factory Event_PaymentClaimable( + {required final PaymentId paymentId, + required final PaymentHash paymentHash, + required final BigInt claimableAmountMsat, + final int? claimDeadline}) = _$Event_PaymentClaimableImpl; + const Event_PaymentClaimable._() : super._(); + + /// A local identifier used to track the payment. + PaymentId get paymentId; + + /// The hash of the payment. + PaymentHash get paymentHash; + + /// The value, in thousandths of a satoshi, that is claimable. + BigInt get claimableAmountMsat; + + /// The block height at which this payment will be failed back and will no longer be + /// eligible for claiming. + int? get claimDeadline; + @JsonKey(ignore: true) + _$$Event_PaymentClaimableImplCopyWith<_$Event_PaymentClaimableImpl> + get copyWith => throw _privateConstructorUsedError; +} + /// @nodoc abstract class _$$Event_PaymentSuccessfulImplCopyWith<$Res> { factory _$$Event_PaymentSuccessfulImplCopyWith( @@ -3884,7 +4181,8 @@ abstract class _$$Event_PaymentSuccessfulImplCopyWith<$Res> { $Res Function(_$Event_PaymentSuccessfulImpl) then) = __$$Event_PaymentSuccessfulImplCopyWithImpl<$Res>; @useResult - $Res call({PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat}); + $Res call( + {PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat}); } /// @nodoc @@ -3915,7 +4213,7 @@ class __$$Event_PaymentSuccessfulImplCopyWithImpl<$Res> feePaidMsat: freezed == feePaidMsat ? _value.feePaidMsat : feePaidMsat // ignore: cast_nullable_to_non_nullable - as int?, + as BigInt?, )); } } @@ -3939,7 +4237,7 @@ class _$Event_PaymentSuccessfulImpl extends Event_PaymentSuccessful { /// The total fee which was spent at intermediate hops in this payment. @override - final int? feePaidMsat; + final BigInt? feePaidMsat; @override String toString() { @@ -3973,14 +4271,17 @@ class _$Event_PaymentSuccessfulImpl extends Event_PaymentSuccessful { @override @optionalTypeArgs TResult when({ + required TResult Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline) + paymentClaimable, required TResult Function( - PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat) + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat) paymentSuccessful, required TResult Function(PaymentId? paymentId, PaymentHash paymentHash, PaymentFailureReason? reason) paymentFailed, required TResult Function( - PaymentId? paymentId, PaymentHash paymentHash, int amountMsat) + PaymentId? paymentId, PaymentHash paymentHash, BigInt amountMsat) paymentReceived, required TResult Function( ChannelId channelId, @@ -4002,14 +4303,17 @@ class _$Event_PaymentSuccessfulImpl extends Event_PaymentSuccessful { @override @optionalTypeArgs TResult? whenOrNull({ + TResult? Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, TResult? Function( - PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat)? + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? paymentSuccessful, TResult? Function(PaymentId? paymentId, PaymentHash paymentHash, PaymentFailureReason? reason)? paymentFailed, TResult? Function( - PaymentId? paymentId, PaymentHash paymentHash, int amountMsat)? + PaymentId? paymentId, PaymentHash paymentHash, BigInt amountMsat)? paymentReceived, TResult? Function( ChannelId channelId, @@ -4031,14 +4335,17 @@ class _$Event_PaymentSuccessfulImpl extends Event_PaymentSuccessful { @override @optionalTypeArgs TResult maybeWhen({ + TResult Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, TResult Function( - PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat)? + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? paymentSuccessful, TResult Function(PaymentId? paymentId, PaymentHash paymentHash, PaymentFailureReason? reason)? paymentFailed, TResult Function( - PaymentId? paymentId, PaymentHash paymentHash, int amountMsat)? + PaymentId? paymentId, PaymentHash paymentHash, BigInt amountMsat)? paymentReceived, TResult Function( ChannelId channelId, @@ -4064,6 +4371,7 @@ class _$Event_PaymentSuccessfulImpl extends Event_PaymentSuccessful { @override @optionalTypeArgs TResult map({ + required TResult Function(Event_PaymentClaimable value) paymentClaimable, required TResult Function(Event_PaymentSuccessful value) paymentSuccessful, required TResult Function(Event_PaymentFailed value) paymentFailed, required TResult Function(Event_PaymentReceived value) paymentReceived, @@ -4077,6 +4385,7 @@ class _$Event_PaymentSuccessfulImpl extends Event_PaymentSuccessful { @override @optionalTypeArgs TResult? mapOrNull({ + TResult? Function(Event_PaymentClaimable value)? paymentClaimable, TResult? Function(Event_PaymentSuccessful value)? paymentSuccessful, TResult? Function(Event_PaymentFailed value)? paymentFailed, TResult? Function(Event_PaymentReceived value)? paymentReceived, @@ -4090,6 +4399,7 @@ class _$Event_PaymentSuccessfulImpl extends Event_PaymentSuccessful { @override @optionalTypeArgs TResult maybeMap({ + TResult Function(Event_PaymentClaimable value)? paymentClaimable, TResult Function(Event_PaymentSuccessful value)? paymentSuccessful, TResult Function(Event_PaymentFailed value)? paymentFailed, TResult Function(Event_PaymentReceived value)? paymentReceived, @@ -4109,7 +4419,7 @@ abstract class Event_PaymentSuccessful extends Event { const factory Event_PaymentSuccessful( {final PaymentId? paymentId, required final PaymentHash paymentHash, - final int? feePaidMsat}) = _$Event_PaymentSuccessfulImpl; + final BigInt? feePaidMsat}) = _$Event_PaymentSuccessfulImpl; const Event_PaymentSuccessful._() : super._(); /// A local identifier used to track the payment. @@ -4121,7 +4431,7 @@ abstract class Event_PaymentSuccessful extends Event { PaymentHash get paymentHash; /// The total fee which was spent at intermediate hops in this payment. - int? get feePaidMsat; + BigInt? get feePaidMsat; @JsonKey(ignore: true) _$$Event_PaymentSuccessfulImplCopyWith<_$Event_PaymentSuccessfulImpl> get copyWith => throw _privateConstructorUsedError; @@ -4224,14 +4534,17 @@ class _$Event_PaymentFailedImpl extends Event_PaymentFailed { @override @optionalTypeArgs TResult when({ + required TResult Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline) + paymentClaimable, required TResult Function( - PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat) + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat) paymentSuccessful, required TResult Function(PaymentId? paymentId, PaymentHash paymentHash, PaymentFailureReason? reason) paymentFailed, required TResult Function( - PaymentId? paymentId, PaymentHash paymentHash, int amountMsat) + PaymentId? paymentId, PaymentHash paymentHash, BigInt amountMsat) paymentReceived, required TResult Function( ChannelId channelId, @@ -4253,14 +4566,17 @@ class _$Event_PaymentFailedImpl extends Event_PaymentFailed { @override @optionalTypeArgs TResult? whenOrNull({ + TResult? Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, TResult? Function( - PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat)? + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? paymentSuccessful, TResult? Function(PaymentId? paymentId, PaymentHash paymentHash, PaymentFailureReason? reason)? paymentFailed, TResult? Function( - PaymentId? paymentId, PaymentHash paymentHash, int amountMsat)? + PaymentId? paymentId, PaymentHash paymentHash, BigInt amountMsat)? paymentReceived, TResult? Function( ChannelId channelId, @@ -4282,14 +4598,17 @@ class _$Event_PaymentFailedImpl extends Event_PaymentFailed { @override @optionalTypeArgs TResult maybeWhen({ + TResult Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, TResult Function( - PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat)? + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? paymentSuccessful, TResult Function(PaymentId? paymentId, PaymentHash paymentHash, PaymentFailureReason? reason)? paymentFailed, TResult Function( - PaymentId? paymentId, PaymentHash paymentHash, int amountMsat)? + PaymentId? paymentId, PaymentHash paymentHash, BigInt amountMsat)? paymentReceived, TResult Function( ChannelId channelId, @@ -4315,6 +4634,7 @@ class _$Event_PaymentFailedImpl extends Event_PaymentFailed { @override @optionalTypeArgs TResult map({ + required TResult Function(Event_PaymentClaimable value) paymentClaimable, required TResult Function(Event_PaymentSuccessful value) paymentSuccessful, required TResult Function(Event_PaymentFailed value) paymentFailed, required TResult Function(Event_PaymentReceived value) paymentReceived, @@ -4328,6 +4648,7 @@ class _$Event_PaymentFailedImpl extends Event_PaymentFailed { @override @optionalTypeArgs TResult? mapOrNull({ + TResult? Function(Event_PaymentClaimable value)? paymentClaimable, TResult? Function(Event_PaymentSuccessful value)? paymentSuccessful, TResult? Function(Event_PaymentFailed value)? paymentFailed, TResult? Function(Event_PaymentReceived value)? paymentReceived, @@ -4341,6 +4662,7 @@ class _$Event_PaymentFailedImpl extends Event_PaymentFailed { @override @optionalTypeArgs TResult maybeMap({ + TResult Function(Event_PaymentClaimable value)? paymentClaimable, TResult Function(Event_PaymentSuccessful value)? paymentSuccessful, TResult Function(Event_PaymentFailed value)? paymentFailed, TResult Function(Event_PaymentReceived value)? paymentReceived, @@ -4387,7 +4709,7 @@ abstract class _$$Event_PaymentReceivedImplCopyWith<$Res> { $Res Function(_$Event_PaymentReceivedImpl) then) = __$$Event_PaymentReceivedImplCopyWithImpl<$Res>; @useResult - $Res call({PaymentId? paymentId, PaymentHash paymentHash, int amountMsat}); + $Res call({PaymentId? paymentId, PaymentHash paymentHash, BigInt amountMsat}); } /// @nodoc @@ -4417,7 +4739,7 @@ class __$$Event_PaymentReceivedImplCopyWithImpl<$Res> amountMsat: null == amountMsat ? _value.amountMsat : amountMsat // ignore: cast_nullable_to_non_nullable - as int, + as BigInt, )); } } @@ -4441,7 +4763,7 @@ class _$Event_PaymentReceivedImpl extends Event_PaymentReceived { /// The value, in thousandths of a satoshi, that has been received. @override - final int amountMsat; + final BigInt amountMsat; @override String toString() { @@ -4475,14 +4797,17 @@ class _$Event_PaymentReceivedImpl extends Event_PaymentReceived { @override @optionalTypeArgs TResult when({ + required TResult Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline) + paymentClaimable, required TResult Function( - PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat) + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat) paymentSuccessful, required TResult Function(PaymentId? paymentId, PaymentHash paymentHash, PaymentFailureReason? reason) paymentFailed, required TResult Function( - PaymentId? paymentId, PaymentHash paymentHash, int amountMsat) + PaymentId? paymentId, PaymentHash paymentHash, BigInt amountMsat) paymentReceived, required TResult Function( ChannelId channelId, @@ -4504,14 +4829,17 @@ class _$Event_PaymentReceivedImpl extends Event_PaymentReceived { @override @optionalTypeArgs TResult? whenOrNull({ + TResult? Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, TResult? Function( - PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat)? + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? paymentSuccessful, TResult? Function(PaymentId? paymentId, PaymentHash paymentHash, PaymentFailureReason? reason)? paymentFailed, TResult? Function( - PaymentId? paymentId, PaymentHash paymentHash, int amountMsat)? + PaymentId? paymentId, PaymentHash paymentHash, BigInt amountMsat)? paymentReceived, TResult? Function( ChannelId channelId, @@ -4533,14 +4861,17 @@ class _$Event_PaymentReceivedImpl extends Event_PaymentReceived { @override @optionalTypeArgs TResult maybeWhen({ + TResult Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, TResult Function( - PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat)? + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? paymentSuccessful, TResult Function(PaymentId? paymentId, PaymentHash paymentHash, PaymentFailureReason? reason)? paymentFailed, TResult Function( - PaymentId? paymentId, PaymentHash paymentHash, int amountMsat)? + PaymentId? paymentId, PaymentHash paymentHash, BigInt amountMsat)? paymentReceived, TResult Function( ChannelId channelId, @@ -4566,6 +4897,7 @@ class _$Event_PaymentReceivedImpl extends Event_PaymentReceived { @override @optionalTypeArgs TResult map({ + required TResult Function(Event_PaymentClaimable value) paymentClaimable, required TResult Function(Event_PaymentSuccessful value) paymentSuccessful, required TResult Function(Event_PaymentFailed value) paymentFailed, required TResult Function(Event_PaymentReceived value) paymentReceived, @@ -4579,6 +4911,7 @@ class _$Event_PaymentReceivedImpl extends Event_PaymentReceived { @override @optionalTypeArgs TResult? mapOrNull({ + TResult? Function(Event_PaymentClaimable value)? paymentClaimable, TResult? Function(Event_PaymentSuccessful value)? paymentSuccessful, TResult? Function(Event_PaymentFailed value)? paymentFailed, TResult? Function(Event_PaymentReceived value)? paymentReceived, @@ -4592,6 +4925,7 @@ class _$Event_PaymentReceivedImpl extends Event_PaymentReceived { @override @optionalTypeArgs TResult maybeMap({ + TResult Function(Event_PaymentClaimable value)? paymentClaimable, TResult Function(Event_PaymentSuccessful value)? paymentSuccessful, TResult Function(Event_PaymentFailed value)? paymentFailed, TResult Function(Event_PaymentReceived value)? paymentReceived, @@ -4611,7 +4945,7 @@ abstract class Event_PaymentReceived extends Event { const factory Event_PaymentReceived( {final PaymentId? paymentId, required final PaymentHash paymentHash, - required final int amountMsat}) = _$Event_PaymentReceivedImpl; + required final BigInt amountMsat}) = _$Event_PaymentReceivedImpl; const Event_PaymentReceived._() : super._(); /// A local identifier used to track the payment. @@ -4623,7 +4957,7 @@ abstract class Event_PaymentReceived extends Event { PaymentHash get paymentHash; /// The value, in thousandths of a satoshi, that has been received. - int get amountMsat; + BigInt get amountMsat; @JsonKey(ignore: true) _$$Event_PaymentReceivedImplCopyWith<_$Event_PaymentReceivedImpl> get copyWith => throw _privateConstructorUsedError; @@ -4754,14 +5088,17 @@ class _$Event_ChannelPendingImpl extends Event_ChannelPending { @override @optionalTypeArgs TResult when({ + required TResult Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline) + paymentClaimable, required TResult Function( - PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat) + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat) paymentSuccessful, required TResult Function(PaymentId? paymentId, PaymentHash paymentHash, PaymentFailureReason? reason) paymentFailed, required TResult Function( - PaymentId? paymentId, PaymentHash paymentHash, int amountMsat) + PaymentId? paymentId, PaymentHash paymentHash, BigInt amountMsat) paymentReceived, required TResult Function( ChannelId channelId, @@ -4784,14 +5121,17 @@ class _$Event_ChannelPendingImpl extends Event_ChannelPending { @override @optionalTypeArgs TResult? whenOrNull({ + TResult? Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, TResult? Function( - PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat)? + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? paymentSuccessful, TResult? Function(PaymentId? paymentId, PaymentHash paymentHash, PaymentFailureReason? reason)? paymentFailed, TResult? Function( - PaymentId? paymentId, PaymentHash paymentHash, int amountMsat)? + PaymentId? paymentId, PaymentHash paymentHash, BigInt amountMsat)? paymentReceived, TResult? Function( ChannelId channelId, @@ -4814,14 +5154,17 @@ class _$Event_ChannelPendingImpl extends Event_ChannelPending { @override @optionalTypeArgs TResult maybeWhen({ + TResult Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, TResult Function( - PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat)? + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? paymentSuccessful, TResult Function(PaymentId? paymentId, PaymentHash paymentHash, PaymentFailureReason? reason)? paymentFailed, TResult Function( - PaymentId? paymentId, PaymentHash paymentHash, int amountMsat)? + PaymentId? paymentId, PaymentHash paymentHash, BigInt amountMsat)? paymentReceived, TResult Function( ChannelId channelId, @@ -4848,6 +5191,7 @@ class _$Event_ChannelPendingImpl extends Event_ChannelPending { @override @optionalTypeArgs TResult map({ + required TResult Function(Event_PaymentClaimable value) paymentClaimable, required TResult Function(Event_PaymentSuccessful value) paymentSuccessful, required TResult Function(Event_PaymentFailed value) paymentFailed, required TResult Function(Event_PaymentReceived value) paymentReceived, @@ -4861,6 +5205,7 @@ class _$Event_ChannelPendingImpl extends Event_ChannelPending { @override @optionalTypeArgs TResult? mapOrNull({ + TResult? Function(Event_PaymentClaimable value)? paymentClaimable, TResult? Function(Event_PaymentSuccessful value)? paymentSuccessful, TResult? Function(Event_PaymentFailed value)? paymentFailed, TResult? Function(Event_PaymentReceived value)? paymentReceived, @@ -4874,6 +5219,7 @@ class _$Event_ChannelPendingImpl extends Event_ChannelPending { @override @optionalTypeArgs TResult maybeMap({ + TResult Function(Event_PaymentClaimable value)? paymentClaimable, TResult Function(Event_PaymentSuccessful value)? paymentSuccessful, TResult Function(Event_PaymentFailed value)? paymentFailed, TResult Function(Event_PaymentReceived value)? paymentReceived, @@ -5016,14 +5362,17 @@ class _$Event_ChannelReadyImpl extends Event_ChannelReady { @override @optionalTypeArgs TResult when({ + required TResult Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline) + paymentClaimable, required TResult Function( - PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat) + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat) paymentSuccessful, required TResult Function(PaymentId? paymentId, PaymentHash paymentHash, PaymentFailureReason? reason) paymentFailed, required TResult Function( - PaymentId? paymentId, PaymentHash paymentHash, int amountMsat) + PaymentId? paymentId, PaymentHash paymentHash, BigInt amountMsat) paymentReceived, required TResult Function( ChannelId channelId, @@ -5045,14 +5394,17 @@ class _$Event_ChannelReadyImpl extends Event_ChannelReady { @override @optionalTypeArgs TResult? whenOrNull({ + TResult? Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, TResult? Function( - PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat)? + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? paymentSuccessful, TResult? Function(PaymentId? paymentId, PaymentHash paymentHash, PaymentFailureReason? reason)? paymentFailed, TResult? Function( - PaymentId? paymentId, PaymentHash paymentHash, int amountMsat)? + PaymentId? paymentId, PaymentHash paymentHash, BigInt amountMsat)? paymentReceived, TResult? Function( ChannelId channelId, @@ -5074,14 +5426,17 @@ class _$Event_ChannelReadyImpl extends Event_ChannelReady { @override @optionalTypeArgs TResult maybeWhen({ + TResult Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, TResult Function( - PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat)? + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? paymentSuccessful, TResult Function(PaymentId? paymentId, PaymentHash paymentHash, PaymentFailureReason? reason)? paymentFailed, TResult Function( - PaymentId? paymentId, PaymentHash paymentHash, int amountMsat)? + PaymentId? paymentId, PaymentHash paymentHash, BigInt amountMsat)? paymentReceived, TResult Function( ChannelId channelId, @@ -5107,6 +5462,7 @@ class _$Event_ChannelReadyImpl extends Event_ChannelReady { @override @optionalTypeArgs TResult map({ + required TResult Function(Event_PaymentClaimable value) paymentClaimable, required TResult Function(Event_PaymentSuccessful value) paymentSuccessful, required TResult Function(Event_PaymentFailed value) paymentFailed, required TResult Function(Event_PaymentReceived value) paymentReceived, @@ -5120,6 +5476,7 @@ class _$Event_ChannelReadyImpl extends Event_ChannelReady { @override @optionalTypeArgs TResult? mapOrNull({ + TResult? Function(Event_PaymentClaimable value)? paymentClaimable, TResult? Function(Event_PaymentSuccessful value)? paymentSuccessful, TResult? Function(Event_PaymentFailed value)? paymentFailed, TResult? Function(Event_PaymentReceived value)? paymentReceived, @@ -5133,6 +5490,7 @@ class _$Event_ChannelReadyImpl extends Event_ChannelReady { @override @optionalTypeArgs TResult maybeMap({ + TResult Function(Event_PaymentClaimable value)? paymentClaimable, TResult Function(Event_PaymentSuccessful value)? paymentSuccessful, TResult Function(Event_PaymentFailed value)? paymentFailed, TResult Function(Event_PaymentReceived value)? paymentReceived, @@ -5295,14 +5653,17 @@ class _$Event_ChannelClosedImpl extends Event_ChannelClosed { @override @optionalTypeArgs TResult when({ + required TResult Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline) + paymentClaimable, required TResult Function( - PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat) + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat) paymentSuccessful, required TResult Function(PaymentId? paymentId, PaymentHash paymentHash, PaymentFailureReason? reason) paymentFailed, required TResult Function( - PaymentId? paymentId, PaymentHash paymentHash, int amountMsat) + PaymentId? paymentId, PaymentHash paymentHash, BigInt amountMsat) paymentReceived, required TResult Function( ChannelId channelId, @@ -5324,14 +5685,17 @@ class _$Event_ChannelClosedImpl extends Event_ChannelClosed { @override @optionalTypeArgs TResult? whenOrNull({ + TResult? Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, TResult? Function( - PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat)? + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? paymentSuccessful, TResult? Function(PaymentId? paymentId, PaymentHash paymentHash, PaymentFailureReason? reason)? paymentFailed, TResult? Function( - PaymentId? paymentId, PaymentHash paymentHash, int amountMsat)? + PaymentId? paymentId, PaymentHash paymentHash, BigInt amountMsat)? paymentReceived, TResult? Function( ChannelId channelId, @@ -5354,14 +5718,17 @@ class _$Event_ChannelClosedImpl extends Event_ChannelClosed { @override @optionalTypeArgs TResult maybeWhen({ + TResult Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, TResult Function( - PaymentId? paymentId, PaymentHash paymentHash, int? feePaidMsat)? + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? paymentSuccessful, TResult Function(PaymentId? paymentId, PaymentHash paymentHash, PaymentFailureReason? reason)? paymentFailed, TResult Function( - PaymentId? paymentId, PaymentHash paymentHash, int amountMsat)? + PaymentId? paymentId, PaymentHash paymentHash, BigInt amountMsat)? paymentReceived, TResult Function( ChannelId channelId, @@ -5388,6 +5755,7 @@ class _$Event_ChannelClosedImpl extends Event_ChannelClosed { @override @optionalTypeArgs TResult map({ + required TResult Function(Event_PaymentClaimable value) paymentClaimable, required TResult Function(Event_PaymentSuccessful value) paymentSuccessful, required TResult Function(Event_PaymentFailed value) paymentFailed, required TResult Function(Event_PaymentReceived value) paymentReceived, @@ -5401,6 +5769,7 @@ class _$Event_ChannelClosedImpl extends Event_ChannelClosed { @override @optionalTypeArgs TResult? mapOrNull({ + TResult? Function(Event_PaymentClaimable value)? paymentClaimable, TResult? Function(Event_PaymentSuccessful value)? paymentSuccessful, TResult? Function(Event_PaymentFailed value)? paymentFailed, TResult? Function(Event_PaymentReceived value)? paymentReceived, @@ -5414,6 +5783,7 @@ class _$Event_ChannelClosedImpl extends Event_ChannelClosed { @override @optionalTypeArgs TResult maybeMap({ + TResult Function(Event_PaymentClaimable value)? paymentClaimable, TResult Function(Event_PaymentSuccessful value)? paymentSuccessful, TResult Function(Event_PaymentFailed value)? paymentFailed, TResult Function(Event_PaymentReceived value)? paymentReceived, @@ -5782,85 +6152,93 @@ mixin _$LightningBalance { /// The amount available to claim, in satoshis, excluding the on-chain fees which will be /// required to do so. - int get amountSatoshis => throw _privateConstructorUsedError; + BigInt get amountSatoshis => throw _privateConstructorUsedError; @optionalTypeArgs TResult when({ required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis) + BigInt amountSatoshis) claimableOnChannelClose, required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight) + BigInt amountSatoshis, int confirmationHeight) claimableAwaitingConfirmations, required TResult Function( ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, + BigInt amountSatoshis, int timeoutHeight, PaymentHash paymentHash, PaymentPreimage paymentPreimage) contentiousClaimable, required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash) + BigInt amountSatoshis, int claimableHeight, PaymentHash paymentHash) maybeTimeoutClaimableHtlc, required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash) + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash) maybePreimageClaimableHtlc, required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis) + BigInt amountSatoshis) counterpartyRevokedOutputClaimable, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult? whenOrNull({ TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? + BigInt amountSatoshis)? claimableOnChannelClose, TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight)? + BigInt amountSatoshis, int confirmationHeight)? claimableAwaitingConfirmations, TResult? Function( ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, + BigInt amountSatoshis, int timeoutHeight, PaymentHash paymentHash, PaymentPreimage paymentPreimage)? contentiousClaimable, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash)? + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? maybeTimeoutClaimableHtlc, TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? maybePreimageClaimableHtlc, TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? + BigInt amountSatoshis)? counterpartyRevokedOutputClaimable, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult maybeWhen({ TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? + BigInt amountSatoshis)? claimableOnChannelClose, TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight)? + BigInt amountSatoshis, int confirmationHeight)? claimableAwaitingConfirmations, TResult Function( ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, + BigInt amountSatoshis, int timeoutHeight, PaymentHash paymentHash, PaymentPreimage paymentPreimage)? contentiousClaimable, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash)? + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? maybeTimeoutClaimableHtlc, TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? maybePreimageClaimableHtlc, TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? + BigInt amountSatoshis)? counterpartyRevokedOutputClaimable, required TResult orElse(), }) => @@ -5930,7 +6308,9 @@ abstract class $LightningBalanceCopyWith<$Res> { _$LightningBalanceCopyWithImpl<$Res, LightningBalance>; @useResult $Res call( - {ChannelId channelId, PublicKey counterpartyNodeId, int amountSatoshis}); + {ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis}); } /// @nodoc @@ -5962,7 +6342,7 @@ class _$LightningBalanceCopyWithImpl<$Res, $Val extends LightningBalance> amountSatoshis: null == amountSatoshis ? _value.amountSatoshis : amountSatoshis // ignore: cast_nullable_to_non_nullable - as int, + as BigInt, ) as $Val); } } @@ -5977,7 +6357,9 @@ abstract class _$$LightningBalance_ClaimableOnChannelCloseImplCopyWith<$Res> @override @useResult $Res call( - {ChannelId channelId, PublicKey counterpartyNodeId, int amountSatoshis}); + {ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis}); } /// @nodoc @@ -6009,7 +6391,7 @@ class __$$LightningBalance_ClaimableOnChannelCloseImplCopyWithImpl<$Res> amountSatoshis: null == amountSatoshis ? _value.amountSatoshis : amountSatoshis // ignore: cast_nullable_to_non_nullable - as int, + as BigInt, )); } } @@ -6035,7 +6417,7 @@ class _$LightningBalance_ClaimableOnChannelCloseImpl /// The amount available to claim, in satoshis, excluding the on-chain fees which will be /// required to do so. @override - final int amountSatoshis; + final BigInt amountSatoshis; @override String toString() { @@ -6072,27 +6454,27 @@ class _$LightningBalance_ClaimableOnChannelCloseImpl @optionalTypeArgs TResult when({ required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis) + BigInt amountSatoshis) claimableOnChannelClose, required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight) + BigInt amountSatoshis, int confirmationHeight) claimableAwaitingConfirmations, required TResult Function( ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, + BigInt amountSatoshis, int timeoutHeight, PaymentHash paymentHash, PaymentPreimage paymentPreimage) contentiousClaimable, required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash) + BigInt amountSatoshis, int claimableHeight, PaymentHash paymentHash) maybeTimeoutClaimableHtlc, required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash) + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash) maybePreimageClaimableHtlc, required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis) + BigInt amountSatoshis) counterpartyRevokedOutputClaimable, }) { return claimableOnChannelClose( @@ -6103,27 +6485,31 @@ class _$LightningBalance_ClaimableOnChannelCloseImpl @optionalTypeArgs TResult? whenOrNull({ TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? + BigInt amountSatoshis)? claimableOnChannelClose, TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight)? + BigInt amountSatoshis, int confirmationHeight)? claimableAwaitingConfirmations, TResult? Function( ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, + BigInt amountSatoshis, int timeoutHeight, PaymentHash paymentHash, PaymentPreimage paymentPreimage)? contentiousClaimable, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash)? + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? maybeTimeoutClaimableHtlc, TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? maybePreimageClaimableHtlc, TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? + BigInt amountSatoshis)? counterpartyRevokedOutputClaimable, }) { return claimableOnChannelClose?.call( @@ -6134,27 +6520,31 @@ class _$LightningBalance_ClaimableOnChannelCloseImpl @optionalTypeArgs TResult maybeWhen({ TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? + BigInt amountSatoshis)? claimableOnChannelClose, TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight)? + BigInt amountSatoshis, int confirmationHeight)? claimableAwaitingConfirmations, TResult Function( ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, + BigInt amountSatoshis, int timeoutHeight, PaymentHash paymentHash, PaymentPreimage paymentPreimage)? contentiousClaimable, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash)? + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? maybeTimeoutClaimableHtlc, TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? maybePreimageClaimableHtlc, TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? + BigInt amountSatoshis)? counterpartyRevokedOutputClaimable, required TResult orElse(), }) { @@ -6235,7 +6625,7 @@ abstract class LightningBalance_ClaimableOnChannelClose const factory LightningBalance_ClaimableOnChannelClose( {required final ChannelId channelId, required final PublicKey counterpartyNodeId, - required final int amountSatoshis}) = + required final BigInt amountSatoshis}) = _$LightningBalance_ClaimableOnChannelCloseImpl; const LightningBalance_ClaimableOnChannelClose._() : super._(); @@ -6251,7 +6641,7 @@ abstract class LightningBalance_ClaimableOnChannelClose /// The amount available to claim, in satoshis, excluding the on-chain fees which will be /// required to do so. - int get amountSatoshis; + BigInt get amountSatoshis; @override @JsonKey(ignore: true) _$$LightningBalance_ClaimableOnChannelCloseImplCopyWith< @@ -6272,7 +6662,7 @@ abstract class _$$LightningBalance_ClaimableAwaitingConfirmationsImplCopyWith< $Res call( {ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, + BigInt amountSatoshis, int confirmationHeight}); } @@ -6308,7 +6698,7 @@ class __$$LightningBalance_ClaimableAwaitingConfirmationsImplCopyWithImpl<$Res> amountSatoshis: null == amountSatoshis ? _value.amountSatoshis : amountSatoshis // ignore: cast_nullable_to_non_nullable - as int, + as BigInt, confirmationHeight: null == confirmationHeight ? _value.confirmationHeight : confirmationHeight // ignore: cast_nullable_to_non_nullable @@ -6339,7 +6729,7 @@ class _$LightningBalance_ClaimableAwaitingConfirmationsImpl /// The amount available to claim, in satoshis, possibly excluding the on-chain fees which /// were spent in broadcasting the transaction. @override - final int amountSatoshis; + final BigInt amountSatoshis; /// The height at which an [`Event::SpendableOutputs`] event will be generated for this /// amount. @@ -6386,27 +6776,27 @@ class _$LightningBalance_ClaimableAwaitingConfirmationsImpl @optionalTypeArgs TResult when({ required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis) + BigInt amountSatoshis) claimableOnChannelClose, required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight) + BigInt amountSatoshis, int confirmationHeight) claimableAwaitingConfirmations, required TResult Function( ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, + BigInt amountSatoshis, int timeoutHeight, PaymentHash paymentHash, PaymentPreimage paymentPreimage) contentiousClaimable, required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash) + BigInt amountSatoshis, int claimableHeight, PaymentHash paymentHash) maybeTimeoutClaimableHtlc, required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash) + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash) maybePreimageClaimableHtlc, required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis) + BigInt amountSatoshis) counterpartyRevokedOutputClaimable, }) { return claimableAwaitingConfirmations( @@ -6417,27 +6807,31 @@ class _$LightningBalance_ClaimableAwaitingConfirmationsImpl @optionalTypeArgs TResult? whenOrNull({ TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? + BigInt amountSatoshis)? claimableOnChannelClose, TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight)? + BigInt amountSatoshis, int confirmationHeight)? claimableAwaitingConfirmations, TResult? Function( ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, + BigInt amountSatoshis, int timeoutHeight, PaymentHash paymentHash, PaymentPreimage paymentPreimage)? contentiousClaimable, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash)? + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? maybeTimeoutClaimableHtlc, TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? maybePreimageClaimableHtlc, TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? + BigInt amountSatoshis)? counterpartyRevokedOutputClaimable, }) { return claimableAwaitingConfirmations?.call( @@ -6448,27 +6842,31 @@ class _$LightningBalance_ClaimableAwaitingConfirmationsImpl @optionalTypeArgs TResult maybeWhen({ TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? + BigInt amountSatoshis)? claimableOnChannelClose, TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight)? + BigInt amountSatoshis, int confirmationHeight)? claimableAwaitingConfirmations, TResult Function( ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, + BigInt amountSatoshis, int timeoutHeight, PaymentHash paymentHash, PaymentPreimage paymentPreimage)? contentiousClaimable, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash)? + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? maybeTimeoutClaimableHtlc, TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? maybePreimageClaimableHtlc, TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? + BigInt amountSatoshis)? counterpartyRevokedOutputClaimable, required TResult orElse(), }) { @@ -6549,7 +6947,7 @@ abstract class LightningBalance_ClaimableAwaitingConfirmations const factory LightningBalance_ClaimableAwaitingConfirmations( {required final ChannelId channelId, required final PublicKey counterpartyNodeId, - required final int amountSatoshis, + required final BigInt amountSatoshis, required final int confirmationHeight}) = _$LightningBalance_ClaimableAwaitingConfirmationsImpl; const LightningBalance_ClaimableAwaitingConfirmations._() : super._(); @@ -6566,7 +6964,7 @@ abstract class LightningBalance_ClaimableAwaitingConfirmations /// The amount available to claim, in satoshis, possibly excluding the on-chain fees which /// were spent in broadcasting the transaction. - int get amountSatoshis; + BigInt get amountSatoshis; /// The height at which an [`Event::SpendableOutputs`] event will be generated for this /// amount. @@ -6592,7 +6990,7 @@ abstract class _$$LightningBalance_ContentiousClaimableImplCopyWith<$Res> $Res call( {ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, + BigInt amountSatoshis, int timeoutHeight, PaymentHash paymentHash, PaymentPreimage paymentPreimage}); @@ -6630,7 +7028,7 @@ class __$$LightningBalance_ContentiousClaimableImplCopyWithImpl<$Res> amountSatoshis: null == amountSatoshis ? _value.amountSatoshis : amountSatoshis // ignore: cast_nullable_to_non_nullable - as int, + as BigInt, timeoutHeight: null == timeoutHeight ? _value.timeoutHeight : timeoutHeight // ignore: cast_nullable_to_non_nullable @@ -6671,7 +7069,7 @@ class _$LightningBalance_ContentiousClaimableImpl /// The amount available to claim, in satoshis, excluding the on-chain fees which will be /// required to do so. @override - final int amountSatoshis; + final BigInt amountSatoshis; /// The height at which the counterparty may be able to claim the balance if we have not /// done so. @@ -6726,27 +7124,27 @@ class _$LightningBalance_ContentiousClaimableImpl @optionalTypeArgs TResult when({ required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis) + BigInt amountSatoshis) claimableOnChannelClose, required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight) + BigInt amountSatoshis, int confirmationHeight) claimableAwaitingConfirmations, required TResult Function( ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, + BigInt amountSatoshis, int timeoutHeight, PaymentHash paymentHash, PaymentPreimage paymentPreimage) contentiousClaimable, required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash) + BigInt amountSatoshis, int claimableHeight, PaymentHash paymentHash) maybeTimeoutClaimableHtlc, required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash) + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash) maybePreimageClaimableHtlc, required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis) + BigInt amountSatoshis) counterpartyRevokedOutputClaimable, }) { return contentiousClaimable(channelId, counterpartyNodeId, amountSatoshis, @@ -6757,27 +7155,31 @@ class _$LightningBalance_ContentiousClaimableImpl @optionalTypeArgs TResult? whenOrNull({ TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? + BigInt amountSatoshis)? claimableOnChannelClose, TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight)? + BigInt amountSatoshis, int confirmationHeight)? claimableAwaitingConfirmations, TResult? Function( ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, + BigInt amountSatoshis, int timeoutHeight, PaymentHash paymentHash, PaymentPreimage paymentPreimage)? contentiousClaimable, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash)? + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? maybeTimeoutClaimableHtlc, TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? maybePreimageClaimableHtlc, TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? + BigInt amountSatoshis)? counterpartyRevokedOutputClaimable, }) { return contentiousClaimable?.call(channelId, counterpartyNodeId, @@ -6788,27 +7190,31 @@ class _$LightningBalance_ContentiousClaimableImpl @optionalTypeArgs TResult maybeWhen({ TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? + BigInt amountSatoshis)? claimableOnChannelClose, TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight)? + BigInt amountSatoshis, int confirmationHeight)? claimableAwaitingConfirmations, TResult Function( ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, + BigInt amountSatoshis, int timeoutHeight, PaymentHash paymentHash, PaymentPreimage paymentPreimage)? contentiousClaimable, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash)? + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? maybeTimeoutClaimableHtlc, TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? maybePreimageClaimableHtlc, TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? + BigInt amountSatoshis)? counterpartyRevokedOutputClaimable, required TResult orElse(), }) { @@ -6888,7 +7294,7 @@ abstract class LightningBalance_ContentiousClaimable extends LightningBalance { const factory LightningBalance_ContentiousClaimable( {required final ChannelId channelId, required final PublicKey counterpartyNodeId, - required final int amountSatoshis, + required final BigInt amountSatoshis, required final int timeoutHeight, required final PaymentHash paymentHash, required final PaymentPreimage paymentPreimage}) = @@ -6907,7 +7313,7 @@ abstract class LightningBalance_ContentiousClaimable extends LightningBalance { /// The amount available to claim, in satoshis, excluding the on-chain fees which will be /// required to do so. - int get amountSatoshis; + BigInt get amountSatoshis; /// The height at which the counterparty may be able to claim the balance if we have not /// done so. @@ -6938,7 +7344,7 @@ abstract class _$$LightningBalance_MaybeTimeoutClaimableHTLCImplCopyWith<$Res> $Res call( {ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, + BigInt amountSatoshis, int claimableHeight, PaymentHash paymentHash}); } @@ -6974,7 +7380,7 @@ class __$$LightningBalance_MaybeTimeoutClaimableHTLCImplCopyWithImpl<$Res> amountSatoshis: null == amountSatoshis ? _value.amountSatoshis : amountSatoshis // ignore: cast_nullable_to_non_nullable - as int, + as BigInt, claimableHeight: null == claimableHeight ? _value.claimableHeight : claimableHeight // ignore: cast_nullable_to_non_nullable @@ -7010,7 +7416,7 @@ class _$LightningBalance_MaybeTimeoutClaimableHTLCImpl /// The amount potentially available to claim, in satoshis, excluding the on-chain fees /// which will be required to do so. @override - final int amountSatoshis; + final BigInt amountSatoshis; /// The height at which we will be able to claim the balance if our counterparty has not /// done so. @@ -7061,27 +7467,27 @@ class _$LightningBalance_MaybeTimeoutClaimableHTLCImpl @optionalTypeArgs TResult when({ required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis) + BigInt amountSatoshis) claimableOnChannelClose, required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight) + BigInt amountSatoshis, int confirmationHeight) claimableAwaitingConfirmations, required TResult Function( ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, + BigInt amountSatoshis, int timeoutHeight, PaymentHash paymentHash, PaymentPreimage paymentPreimage) contentiousClaimable, required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash) + BigInt amountSatoshis, int claimableHeight, PaymentHash paymentHash) maybeTimeoutClaimableHtlc, required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash) + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash) maybePreimageClaimableHtlc, required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis) + BigInt amountSatoshis) counterpartyRevokedOutputClaimable, }) { return maybeTimeoutClaimableHtlc(channelId, counterpartyNodeId, @@ -7092,27 +7498,31 @@ class _$LightningBalance_MaybeTimeoutClaimableHTLCImpl @optionalTypeArgs TResult? whenOrNull({ TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? + BigInt amountSatoshis)? claimableOnChannelClose, TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight)? + BigInt amountSatoshis, int confirmationHeight)? claimableAwaitingConfirmations, TResult? Function( ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, + BigInt amountSatoshis, int timeoutHeight, PaymentHash paymentHash, PaymentPreimage paymentPreimage)? contentiousClaimable, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash)? + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? maybeTimeoutClaimableHtlc, TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? maybePreimageClaimableHtlc, TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? + BigInt amountSatoshis)? counterpartyRevokedOutputClaimable, }) { return maybeTimeoutClaimableHtlc?.call(channelId, counterpartyNodeId, @@ -7123,27 +7533,31 @@ class _$LightningBalance_MaybeTimeoutClaimableHTLCImpl @optionalTypeArgs TResult maybeWhen({ TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? + BigInt amountSatoshis)? claimableOnChannelClose, TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight)? + BigInt amountSatoshis, int confirmationHeight)? claimableAwaitingConfirmations, TResult Function( ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, + BigInt amountSatoshis, int timeoutHeight, PaymentHash paymentHash, PaymentPreimage paymentPreimage)? contentiousClaimable, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash)? + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? maybeTimeoutClaimableHtlc, TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? maybePreimageClaimableHtlc, TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? + BigInt amountSatoshis)? counterpartyRevokedOutputClaimable, required TResult orElse(), }) { @@ -7224,7 +7638,7 @@ abstract class LightningBalance_MaybeTimeoutClaimableHTLC const factory LightningBalance_MaybeTimeoutClaimableHTLC( {required final ChannelId channelId, required final PublicKey counterpartyNodeId, - required final int amountSatoshis, + required final BigInt amountSatoshis, required final int claimableHeight, required final PaymentHash paymentHash}) = _$LightningBalance_MaybeTimeoutClaimableHTLCImpl; @@ -7242,7 +7656,7 @@ abstract class LightningBalance_MaybeTimeoutClaimableHTLC /// The amount potentially available to claim, in satoshis, excluding the on-chain fees /// which will be required to do so. - int get amountSatoshis; + BigInt get amountSatoshis; /// The height at which we will be able to claim the balance if our counterparty has not /// done so. @@ -7270,7 +7684,7 @@ abstract class _$$LightningBalance_MaybePreimageClaimableHTLCImplCopyWith<$Res> $Res call( {ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash}); } @@ -7307,7 +7721,7 @@ class __$$LightningBalance_MaybePreimageClaimableHTLCImplCopyWithImpl<$Res> amountSatoshis: null == amountSatoshis ? _value.amountSatoshis : amountSatoshis // ignore: cast_nullable_to_non_nullable - as int, + as BigInt, expiryHeight: null == expiryHeight ? _value.expiryHeight : expiryHeight // ignore: cast_nullable_to_non_nullable @@ -7343,7 +7757,7 @@ class _$LightningBalance_MaybePreimageClaimableHTLCImpl /// The amount potentially available to claim, in satoshis, excluding the on-chain fees /// which will be required to do so. @override - final int amountSatoshis; + final BigInt 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. @@ -7394,27 +7808,27 @@ class _$LightningBalance_MaybePreimageClaimableHTLCImpl @optionalTypeArgs TResult when({ required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis) + BigInt amountSatoshis) claimableOnChannelClose, required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight) + BigInt amountSatoshis, int confirmationHeight) claimableAwaitingConfirmations, required TResult Function( ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, + BigInt amountSatoshis, int timeoutHeight, PaymentHash paymentHash, PaymentPreimage paymentPreimage) contentiousClaimable, required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash) + BigInt amountSatoshis, int claimableHeight, PaymentHash paymentHash) maybeTimeoutClaimableHtlc, required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash) + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash) maybePreimageClaimableHtlc, required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis) + BigInt amountSatoshis) counterpartyRevokedOutputClaimable, }) { return maybePreimageClaimableHtlc(channelId, counterpartyNodeId, @@ -7425,27 +7839,31 @@ class _$LightningBalance_MaybePreimageClaimableHTLCImpl @optionalTypeArgs TResult? whenOrNull({ TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? + BigInt amountSatoshis)? claimableOnChannelClose, TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight)? + BigInt amountSatoshis, int confirmationHeight)? claimableAwaitingConfirmations, TResult? Function( ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, + BigInt amountSatoshis, int timeoutHeight, PaymentHash paymentHash, PaymentPreimage paymentPreimage)? contentiousClaimable, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash)? + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? maybeTimeoutClaimableHtlc, TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? maybePreimageClaimableHtlc, TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? + BigInt amountSatoshis)? counterpartyRevokedOutputClaimable, }) { return maybePreimageClaimableHtlc?.call(channelId, counterpartyNodeId, @@ -7456,27 +7874,31 @@ class _$LightningBalance_MaybePreimageClaimableHTLCImpl @optionalTypeArgs TResult maybeWhen({ TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? + BigInt amountSatoshis)? claimableOnChannelClose, TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight)? + BigInt amountSatoshis, int confirmationHeight)? claimableAwaitingConfirmations, TResult Function( ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, + BigInt amountSatoshis, int timeoutHeight, PaymentHash paymentHash, PaymentPreimage paymentPreimage)? contentiousClaimable, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash)? + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? maybeTimeoutClaimableHtlc, TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? maybePreimageClaimableHtlc, TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? + BigInt amountSatoshis)? counterpartyRevokedOutputClaimable, required TResult orElse(), }) { @@ -7557,7 +7979,7 @@ abstract class LightningBalance_MaybePreimageClaimableHTLC const factory LightningBalance_MaybePreimageClaimableHTLC( {required final ChannelId channelId, required final PublicKey counterpartyNodeId, - required final int amountSatoshis, + required final BigInt amountSatoshis, required final int expiryHeight, required final PaymentHash paymentHash}) = _$LightningBalance_MaybePreimageClaimableHTLCImpl; @@ -7575,7 +7997,7 @@ abstract class LightningBalance_MaybePreimageClaimableHTLC /// The amount potentially available to claim, in satoshis, excluding the on-chain fees /// which will be required to do so. - int get amountSatoshis; + BigInt 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. @@ -7603,7 +8025,9 @@ abstract class _$$LightningBalance_CounterpartyRevokedOutputClaimableImplCopyWit @override @useResult $Res call( - {ChannelId channelId, PublicKey counterpartyNodeId, int amountSatoshis}); + {ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis}); } /// @nodoc @@ -7639,7 +8063,7 @@ class __$$LightningBalance_CounterpartyRevokedOutputClaimableImplCopyWithImpl< amountSatoshis: null == amountSatoshis ? _value.amountSatoshis : amountSatoshis // ignore: cast_nullable_to_non_nullable - as int, + as BigInt, )); } } @@ -7664,7 +8088,7 @@ class _$LightningBalance_CounterpartyRevokedOutputClaimableImpl /// The amount, in satoshis, of the output which we can claim. @override - final int amountSatoshis; + final BigInt amountSatoshis; @override String toString() { @@ -7703,27 +8127,27 @@ class _$LightningBalance_CounterpartyRevokedOutputClaimableImpl @optionalTypeArgs TResult when({ required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis) + BigInt amountSatoshis) claimableOnChannelClose, required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight) + BigInt amountSatoshis, int confirmationHeight) claimableAwaitingConfirmations, required TResult Function( ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, + BigInt amountSatoshis, int timeoutHeight, PaymentHash paymentHash, PaymentPreimage paymentPreimage) contentiousClaimable, required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash) + BigInt amountSatoshis, int claimableHeight, PaymentHash paymentHash) maybeTimeoutClaimableHtlc, required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash) + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash) maybePreimageClaimableHtlc, required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis) + BigInt amountSatoshis) counterpartyRevokedOutputClaimable, }) { return counterpartyRevokedOutputClaimable( @@ -7734,27 +8158,31 @@ class _$LightningBalance_CounterpartyRevokedOutputClaimableImpl @optionalTypeArgs TResult? whenOrNull({ TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? + BigInt amountSatoshis)? claimableOnChannelClose, TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight)? + BigInt amountSatoshis, int confirmationHeight)? claimableAwaitingConfirmations, TResult? Function( ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, + BigInt amountSatoshis, int timeoutHeight, PaymentHash paymentHash, PaymentPreimage paymentPreimage)? contentiousClaimable, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash)? + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? maybeTimeoutClaimableHtlc, TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? maybePreimageClaimableHtlc, TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? + BigInt amountSatoshis)? counterpartyRevokedOutputClaimable, }) { return counterpartyRevokedOutputClaimable?.call( @@ -7765,27 +8193,31 @@ class _$LightningBalance_CounterpartyRevokedOutputClaimableImpl @optionalTypeArgs TResult maybeWhen({ TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? + BigInt amountSatoshis)? claimableOnChannelClose, TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight)? + BigInt amountSatoshis, int confirmationHeight)? claimableAwaitingConfirmations, TResult Function( ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, + BigInt amountSatoshis, int timeoutHeight, PaymentHash paymentHash, PaymentPreimage paymentPreimage)? contentiousClaimable, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash)? + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? maybeTimeoutClaimableHtlc, TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? maybePreimageClaimableHtlc, TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? + BigInt amountSatoshis)? counterpartyRevokedOutputClaimable, required TResult orElse(), }) { @@ -7866,7 +8298,7 @@ abstract class LightningBalance_CounterpartyRevokedOutputClaimable const factory LightningBalance_CounterpartyRevokedOutputClaimable( {required final ChannelId channelId, required final PublicKey counterpartyNodeId, - required final int amountSatoshis}) = + required final BigInt amountSatoshis}) = _$LightningBalance_CounterpartyRevokedOutputClaimableImpl; const LightningBalance_CounterpartyRevokedOutputClaimable._() : super._(); @@ -7881,7 +8313,7 @@ abstract class LightningBalance_CounterpartyRevokedOutputClaimable @override /// The amount, in satoshis, of the output which we can claim. - int get amountSatoshis; + BigInt get amountSatoshis; @override @JsonKey(ignore: true) _$$LightningBalance_CounterpartyRevokedOutputClaimableImplCopyWith< @@ -7891,23 +8323,23 @@ abstract class LightningBalance_CounterpartyRevokedOutputClaimable /// @nodoc mixin _$MaxDustHTLCExposure { - int get field0 => throw _privateConstructorUsedError; + BigInt get field0 => throw _privateConstructorUsedError; @optionalTypeArgs TResult when({ - required TResult Function(int field0) fixedLimitMsat, - required TResult Function(int field0) feeRateMultiplier, + required TResult Function(BigInt field0) fixedLimitMsat, + required TResult Function(BigInt field0) feeRateMultiplier, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(int field0)? fixedLimitMsat, - TResult? Function(int field0)? feeRateMultiplier, + TResult? Function(BigInt field0)? fixedLimitMsat, + TResult? Function(BigInt field0)? feeRateMultiplier, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult maybeWhen({ - TResult Function(int field0)? fixedLimitMsat, - TResult Function(int field0)? feeRateMultiplier, + TResult Function(BigInt field0)? fixedLimitMsat, + TResult Function(BigInt field0)? feeRateMultiplier, required TResult orElse(), }) => throw _privateConstructorUsedError; @@ -7946,7 +8378,7 @@ abstract class $MaxDustHTLCExposureCopyWith<$Res> { MaxDustHTLCExposure value, $Res Function(MaxDustHTLCExposure) then) = _$MaxDustHTLCExposureCopyWithImpl<$Res, MaxDustHTLCExposure>; @useResult - $Res call({int field0}); + $Res call({BigInt field0}); } /// @nodoc @@ -7968,7 +8400,7 @@ class _$MaxDustHTLCExposureCopyWithImpl<$Res, $Val extends MaxDustHTLCExposure> field0: null == field0 ? _value.field0 : field0 // ignore: cast_nullable_to_non_nullable - as int, + as BigInt, ) as $Val); } } @@ -7982,7 +8414,7 @@ abstract class _$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWith<$Res> __$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWithImpl<$Res>; @override @useResult - $Res call({int field0}); + $Res call({BigInt field0}); } /// @nodoc @@ -8004,7 +8436,7 @@ class __$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWithImpl<$Res> null == field0 ? _value.field0 : field0 // ignore: cast_nullable_to_non_nullable - as int, + as BigInt, )); } } @@ -8016,7 +8448,7 @@ class _$MaxDustHTLCExposure_FixedLimitMsatImpl const _$MaxDustHTLCExposure_FixedLimitMsatImpl(this.field0) : super._(); @override - final int field0; + final BigInt field0; @override String toString() { @@ -8045,8 +8477,8 @@ class _$MaxDustHTLCExposure_FixedLimitMsatImpl @override @optionalTypeArgs TResult when({ - required TResult Function(int field0) fixedLimitMsat, - required TResult Function(int field0) feeRateMultiplier, + required TResult Function(BigInt field0) fixedLimitMsat, + required TResult Function(BigInt field0) feeRateMultiplier, }) { return fixedLimitMsat(field0); } @@ -8054,8 +8486,8 @@ class _$MaxDustHTLCExposure_FixedLimitMsatImpl @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(int field0)? fixedLimitMsat, - TResult? Function(int field0)? feeRateMultiplier, + TResult? Function(BigInt field0)? fixedLimitMsat, + TResult? Function(BigInt field0)? feeRateMultiplier, }) { return fixedLimitMsat?.call(field0); } @@ -8063,8 +8495,8 @@ class _$MaxDustHTLCExposure_FixedLimitMsatImpl @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(int field0)? fixedLimitMsat, - TResult Function(int field0)? feeRateMultiplier, + TResult Function(BigInt field0)? fixedLimitMsat, + TResult Function(BigInt field0)? feeRateMultiplier, required TResult orElse(), }) { if (fixedLimitMsat != null) { @@ -8110,12 +8542,12 @@ class _$MaxDustHTLCExposure_FixedLimitMsatImpl } abstract class MaxDustHTLCExposure_FixedLimitMsat extends MaxDustHTLCExposure { - const factory MaxDustHTLCExposure_FixedLimitMsat(final int field0) = + const factory MaxDustHTLCExposure_FixedLimitMsat(final BigInt field0) = _$MaxDustHTLCExposure_FixedLimitMsatImpl; const MaxDustHTLCExposure_FixedLimitMsat._() : super._(); @override - int get field0; + BigInt get field0; @override @JsonKey(ignore: true) _$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWith< @@ -8132,7 +8564,7 @@ abstract class _$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWith<$Res> __$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWithImpl<$Res>; @override @useResult - $Res call({int field0}); + $Res call({BigInt field0}); } /// @nodoc @@ -8154,7 +8586,7 @@ class __$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWithImpl<$Res> null == field0 ? _value.field0 : field0 // ignore: cast_nullable_to_non_nullable - as int, + as BigInt, )); } } @@ -8166,7 +8598,7 @@ class _$MaxDustHTLCExposure_FeeRateMultiplierImpl const _$MaxDustHTLCExposure_FeeRateMultiplierImpl(this.field0) : super._(); @override - final int field0; + final BigInt field0; @override String toString() { @@ -8195,8 +8627,8 @@ class _$MaxDustHTLCExposure_FeeRateMultiplierImpl @override @optionalTypeArgs TResult when({ - required TResult Function(int field0) fixedLimitMsat, - required TResult Function(int field0) feeRateMultiplier, + required TResult Function(BigInt field0) fixedLimitMsat, + required TResult Function(BigInt field0) feeRateMultiplier, }) { return feeRateMultiplier(field0); } @@ -8204,8 +8636,8 @@ class _$MaxDustHTLCExposure_FeeRateMultiplierImpl @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(int field0)? fixedLimitMsat, - TResult? Function(int field0)? feeRateMultiplier, + TResult? Function(BigInt field0)? fixedLimitMsat, + TResult? Function(BigInt field0)? feeRateMultiplier, }) { return feeRateMultiplier?.call(field0); } @@ -8213,8 +8645,8 @@ class _$MaxDustHTLCExposure_FeeRateMultiplierImpl @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(int field0)? fixedLimitMsat, - TResult Function(int field0)? feeRateMultiplier, + TResult Function(BigInt field0)? fixedLimitMsat, + TResult Function(BigInt field0)? feeRateMultiplier, required TResult orElse(), }) { if (feeRateMultiplier != null) { @@ -8261,12 +8693,12 @@ class _$MaxDustHTLCExposure_FeeRateMultiplierImpl abstract class MaxDustHTLCExposure_FeeRateMultiplier extends MaxDustHTLCExposure { - const factory MaxDustHTLCExposure_FeeRateMultiplier(final int field0) = + const factory MaxDustHTLCExposure_FeeRateMultiplier(final BigInt field0) = _$MaxDustHTLCExposure_FeeRateMultiplierImpl; const MaxDustHTLCExposure_FeeRateMultiplier._() : super._(); @override - int get field0; + BigInt get field0; @override @JsonKey(ignore: true) _$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWith< @@ -8287,6 +8719,12 @@ mixin _$PaymentKind { bolt11Jit, required TResult Function(PaymentHash hash, PaymentPreimage? preimage) spontaneous, + required TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId) + bolt12Offer, + required TResult Function( + PaymentHash? hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt12Refund, }) => throw _privateConstructorUsedError; @optionalTypeArgs @@ -8299,6 +8737,12 @@ mixin _$PaymentKind { PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? bolt11Jit, TResult? Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, }) => throw _privateConstructorUsedError; @optionalTypeArgs @@ -8311,6 +8755,12 @@ mixin _$PaymentKind { PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? bolt11Jit, TResult Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, required TResult orElse(), }) => throw _privateConstructorUsedError; @@ -8320,6 +8770,8 @@ mixin _$PaymentKind { required TResult Function(PaymentKind_Bolt11 value) bolt11, required TResult Function(PaymentKind_Bolt11Jit value) bolt11Jit, required TResult Function(PaymentKind_Spontaneous value) spontaneous, + required TResult Function(PaymentKind_Bolt12Offer value) bolt12Offer, + required TResult Function(PaymentKind_Bolt12Refund value) bolt12Refund, }) => throw _privateConstructorUsedError; @optionalTypeArgs @@ -8328,6 +8780,8 @@ mixin _$PaymentKind { TResult? Function(PaymentKind_Bolt11 value)? bolt11, TResult? Function(PaymentKind_Bolt11Jit value)? bolt11Jit, TResult? Function(PaymentKind_Spontaneous value)? spontaneous, + TResult? Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult? Function(PaymentKind_Bolt12Refund value)? bolt12Refund, }) => throw _privateConstructorUsedError; @optionalTypeArgs @@ -8336,6 +8790,8 @@ mixin _$PaymentKind { TResult Function(PaymentKind_Bolt11 value)? bolt11, TResult Function(PaymentKind_Bolt11Jit value)? bolt11Jit, TResult Function(PaymentKind_Spontaneous value)? spontaneous, + TResult Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult Function(PaymentKind_Bolt12Refund value)? bolt12Refund, required TResult orElse(), }) => throw _privateConstructorUsedError; @@ -8407,6 +8863,12 @@ class _$PaymentKind_OnchainImpl extends PaymentKind_Onchain { bolt11Jit, required TResult Function(PaymentHash hash, PaymentPreimage? preimage) spontaneous, + required TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId) + bolt12Offer, + required TResult Function( + PaymentHash? hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt12Refund, }) { return onchain(); } @@ -8422,6 +8884,12 @@ class _$PaymentKind_OnchainImpl extends PaymentKind_Onchain { PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? bolt11Jit, TResult? Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, }) { return onchain?.call(); } @@ -8437,6 +8905,12 @@ class _$PaymentKind_OnchainImpl extends PaymentKind_Onchain { PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? bolt11Jit, TResult Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, required TResult orElse(), }) { if (onchain != null) { @@ -8452,6 +8926,8 @@ class _$PaymentKind_OnchainImpl extends PaymentKind_Onchain { required TResult Function(PaymentKind_Bolt11 value) bolt11, required TResult Function(PaymentKind_Bolt11Jit value) bolt11Jit, required TResult Function(PaymentKind_Spontaneous value) spontaneous, + required TResult Function(PaymentKind_Bolt12Offer value) bolt12Offer, + required TResult Function(PaymentKind_Bolt12Refund value) bolt12Refund, }) { return onchain(this); } @@ -8463,6 +8939,8 @@ class _$PaymentKind_OnchainImpl extends PaymentKind_Onchain { TResult? Function(PaymentKind_Bolt11 value)? bolt11, TResult? Function(PaymentKind_Bolt11Jit value)? bolt11Jit, TResult? Function(PaymentKind_Spontaneous value)? spontaneous, + TResult? Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult? Function(PaymentKind_Bolt12Refund value)? bolt12Refund, }) { return onchain?.call(this); } @@ -8474,6 +8952,8 @@ class _$PaymentKind_OnchainImpl extends PaymentKind_Onchain { TResult Function(PaymentKind_Bolt11 value)? bolt11, TResult Function(PaymentKind_Bolt11Jit value)? bolt11Jit, TResult Function(PaymentKind_Spontaneous value)? spontaneous, + TResult Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult Function(PaymentKind_Bolt12Refund value)? bolt12Refund, required TResult orElse(), }) { if (onchain != null) { @@ -8587,6 +9067,12 @@ class _$PaymentKind_Bolt11Impl extends PaymentKind_Bolt11 { bolt11Jit, required TResult Function(PaymentHash hash, PaymentPreimage? preimage) spontaneous, + required TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId) + bolt12Offer, + required TResult Function( + PaymentHash? hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt12Refund, }) { return bolt11(hash, preimage, secret); } @@ -8602,6 +9088,12 @@ class _$PaymentKind_Bolt11Impl extends PaymentKind_Bolt11 { PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? bolt11Jit, TResult? Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, }) { return bolt11?.call(hash, preimage, secret); } @@ -8617,6 +9109,12 @@ class _$PaymentKind_Bolt11Impl extends PaymentKind_Bolt11 { PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? bolt11Jit, TResult Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, required TResult orElse(), }) { if (bolt11 != null) { @@ -8632,6 +9130,8 @@ class _$PaymentKind_Bolt11Impl extends PaymentKind_Bolt11 { required TResult Function(PaymentKind_Bolt11 value) bolt11, required TResult Function(PaymentKind_Bolt11Jit value) bolt11Jit, required TResult Function(PaymentKind_Spontaneous value) spontaneous, + required TResult Function(PaymentKind_Bolt12Offer value) bolt12Offer, + required TResult Function(PaymentKind_Bolt12Refund value) bolt12Refund, }) { return bolt11(this); } @@ -8643,6 +9143,8 @@ class _$PaymentKind_Bolt11Impl extends PaymentKind_Bolt11 { TResult? Function(PaymentKind_Bolt11 value)? bolt11, TResult? Function(PaymentKind_Bolt11Jit value)? bolt11Jit, TResult? Function(PaymentKind_Spontaneous value)? spontaneous, + TResult? Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult? Function(PaymentKind_Bolt12Refund value)? bolt12Refund, }) { return bolt11?.call(this); } @@ -8654,6 +9156,8 @@ class _$PaymentKind_Bolt11Impl extends PaymentKind_Bolt11 { TResult Function(PaymentKind_Bolt11 value)? bolt11, TResult Function(PaymentKind_Bolt11Jit value)? bolt11Jit, TResult Function(PaymentKind_Spontaneous value)? spontaneous, + TResult Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult Function(PaymentKind_Bolt12Refund value)? bolt12Refund, required TResult orElse(), }) { if (bolt11 != null) { @@ -8805,6 +9309,12 @@ class _$PaymentKind_Bolt11JitImpl extends PaymentKind_Bolt11Jit { bolt11Jit, required TResult Function(PaymentHash hash, PaymentPreimage? preimage) spontaneous, + required TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId) + bolt12Offer, + required TResult Function( + PaymentHash? hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt12Refund, }) { return bolt11Jit(hash, preimage, secret, lspFeeLimits); } @@ -8820,6 +9330,12 @@ class _$PaymentKind_Bolt11JitImpl extends PaymentKind_Bolt11Jit { PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? bolt11Jit, TResult? Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, }) { return bolt11Jit?.call(hash, preimage, secret, lspFeeLimits); } @@ -8835,6 +9351,12 @@ class _$PaymentKind_Bolt11JitImpl extends PaymentKind_Bolt11Jit { PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? bolt11Jit, TResult Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, required TResult orElse(), }) { if (bolt11Jit != null) { @@ -8850,6 +9372,8 @@ class _$PaymentKind_Bolt11JitImpl extends PaymentKind_Bolt11Jit { required TResult Function(PaymentKind_Bolt11 value) bolt11, required TResult Function(PaymentKind_Bolt11Jit value) bolt11Jit, required TResult Function(PaymentKind_Spontaneous value) spontaneous, + required TResult Function(PaymentKind_Bolt12Offer value) bolt12Offer, + required TResult Function(PaymentKind_Bolt12Refund value) bolt12Refund, }) { return bolt11Jit(this); } @@ -8861,6 +9385,8 @@ class _$PaymentKind_Bolt11JitImpl extends PaymentKind_Bolt11Jit { TResult? Function(PaymentKind_Bolt11 value)? bolt11, TResult? Function(PaymentKind_Bolt11Jit value)? bolt11Jit, TResult? Function(PaymentKind_Spontaneous value)? spontaneous, + TResult? Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult? Function(PaymentKind_Bolt12Refund value)? bolt12Refund, }) { return bolt11Jit?.call(this); } @@ -8872,6 +9398,8 @@ class _$PaymentKind_Bolt11JitImpl extends PaymentKind_Bolt11Jit { TResult Function(PaymentKind_Bolt11 value)? bolt11, TResult Function(PaymentKind_Bolt11Jit value)? bolt11Jit, TResult Function(PaymentKind_Spontaneous value)? spontaneous, + TResult Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult Function(PaymentKind_Bolt12Refund value)? bolt12Refund, required TResult orElse(), }) { if (bolt11Jit != null) { @@ -8998,6 +9526,12 @@ class _$PaymentKind_SpontaneousImpl extends PaymentKind_Spontaneous { bolt11Jit, required TResult Function(PaymentHash hash, PaymentPreimage? preimage) spontaneous, + required TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId) + bolt12Offer, + required TResult Function( + PaymentHash? hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt12Refund, }) { return spontaneous(hash, preimage); } @@ -9013,6 +9547,12 @@ class _$PaymentKind_SpontaneousImpl extends PaymentKind_Spontaneous { PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? bolt11Jit, TResult? Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, }) { return spontaneous?.call(hash, preimage); } @@ -9028,6 +9568,12 @@ class _$PaymentKind_SpontaneousImpl extends PaymentKind_Spontaneous { PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? bolt11Jit, TResult Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, required TResult orElse(), }) { if (spontaneous != null) { @@ -9043,6 +9589,8 @@ class _$PaymentKind_SpontaneousImpl extends PaymentKind_Spontaneous { required TResult Function(PaymentKind_Bolt11 value) bolt11, required TResult Function(PaymentKind_Bolt11Jit value) bolt11Jit, required TResult Function(PaymentKind_Spontaneous value) spontaneous, + required TResult Function(PaymentKind_Bolt12Offer value) bolt12Offer, + required TResult Function(PaymentKind_Bolt12Refund value) bolt12Refund, }) { return spontaneous(this); } @@ -9054,6 +9602,8 @@ class _$PaymentKind_SpontaneousImpl extends PaymentKind_Spontaneous { TResult? Function(PaymentKind_Bolt11 value)? bolt11, TResult? Function(PaymentKind_Bolt11Jit value)? bolt11Jit, TResult? Function(PaymentKind_Spontaneous value)? spontaneous, + TResult? Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult? Function(PaymentKind_Bolt12Refund value)? bolt12Refund, }) { return spontaneous?.call(this); } @@ -9065,6 +9615,8 @@ class _$PaymentKind_SpontaneousImpl extends PaymentKind_Spontaneous { TResult Function(PaymentKind_Bolt11 value)? bolt11, TResult Function(PaymentKind_Bolt11Jit value)? bolt11Jit, TResult Function(PaymentKind_Spontaneous value)? spontaneous, + TResult Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult Function(PaymentKind_Bolt12Refund value)? bolt12Refund, required TResult orElse(), }) { if (spontaneous != null) { @@ -9090,54 +9642,516 @@ abstract class PaymentKind_Spontaneous extends PaymentKind { get copyWith => throw _privateConstructorUsedError; } +/// @nodoc +abstract class _$$PaymentKind_Bolt12OfferImplCopyWith<$Res> { + factory _$$PaymentKind_Bolt12OfferImplCopyWith( + _$PaymentKind_Bolt12OfferImpl value, + $Res Function(_$PaymentKind_Bolt12OfferImpl) then) = + __$$PaymentKind_Bolt12OfferImplCopyWithImpl<$Res>; + @useResult + $Res call( + {PaymentHash? hash, + PaymentPreimage? preimage, + PaymentSecret? secret, + OfferId offerId}); +} + +/// @nodoc +class __$$PaymentKind_Bolt12OfferImplCopyWithImpl<$Res> + extends _$PaymentKindCopyWithImpl<$Res, _$PaymentKind_Bolt12OfferImpl> + implements _$$PaymentKind_Bolt12OfferImplCopyWith<$Res> { + __$$PaymentKind_Bolt12OfferImplCopyWithImpl( + _$PaymentKind_Bolt12OfferImpl _value, + $Res Function(_$PaymentKind_Bolt12OfferImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? hash = freezed, + Object? preimage = freezed, + Object? secret = freezed, + Object? offerId = null, + }) { + return _then(_$PaymentKind_Bolt12OfferImpl( + hash: freezed == hash + ? _value.hash + : hash // ignore: cast_nullable_to_non_nullable + as PaymentHash?, + preimage: freezed == preimage + ? _value.preimage + : preimage // ignore: cast_nullable_to_non_nullable + as PaymentPreimage?, + secret: freezed == secret + ? _value.secret + : secret // ignore: cast_nullable_to_non_nullable + as PaymentSecret?, + offerId: null == offerId + ? _value.offerId + : offerId // ignore: cast_nullable_to_non_nullable + as OfferId, + )); + } +} + +/// @nodoc + +class _$PaymentKind_Bolt12OfferImpl extends PaymentKind_Bolt12Offer { + const _$PaymentKind_Bolt12OfferImpl( + {this.hash, this.preimage, this.secret, required this.offerId}) + : super._(); + + /// The payment hash, i.e., the hash of the `preimage`. + @override + final PaymentHash? hash; + + /// The pre-image used by the payment. + @override + final PaymentPreimage? preimage; + + /// The secret used by the payment. + @override + final PaymentSecret? secret; + + /// The ID of the offer this payment is for. + @override + final OfferId offerId; + + @override + String toString() { + return 'PaymentKind.bolt12Offer(hash: $hash, preimage: $preimage, secret: $secret, offerId: $offerId)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$PaymentKind_Bolt12OfferImpl && + (identical(other.hash, hash) || other.hash == hash) && + (identical(other.preimage, preimage) || + other.preimage == preimage) && + (identical(other.secret, secret) || other.secret == secret) && + (identical(other.offerId, offerId) || other.offerId == offerId)); + } + + @override + int get hashCode => Object.hash(runtimeType, hash, preimage, secret, offerId); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$PaymentKind_Bolt12OfferImplCopyWith<_$PaymentKind_Bolt12OfferImpl> + get copyWith => __$$PaymentKind_Bolt12OfferImplCopyWithImpl< + _$PaymentKind_Bolt12OfferImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() onchain, + required TResult Function( + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt11, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits) + bolt11Jit, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage) + spontaneous, + required TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId) + bolt12Offer, + required TResult Function( + PaymentHash? hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt12Refund, + }) { + return bolt12Offer(hash, preimage, secret, offerId); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? onchain, + TResult? Function( + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, + }) { + return bolt12Offer?.call(hash, preimage, secret, offerId); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? onchain, + TResult Function( + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, + required TResult orElse(), + }) { + if (bolt12Offer != null) { + return bolt12Offer(hash, preimage, secret, offerId); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(PaymentKind_Onchain value) onchain, + required TResult Function(PaymentKind_Bolt11 value) bolt11, + required TResult Function(PaymentKind_Bolt11Jit value) bolt11Jit, + required TResult Function(PaymentKind_Spontaneous value) spontaneous, + required TResult Function(PaymentKind_Bolt12Offer value) bolt12Offer, + required TResult Function(PaymentKind_Bolt12Refund value) bolt12Refund, + }) { + return bolt12Offer(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(PaymentKind_Onchain value)? onchain, + TResult? Function(PaymentKind_Bolt11 value)? bolt11, + TResult? Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult? Function(PaymentKind_Spontaneous value)? spontaneous, + TResult? Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult? Function(PaymentKind_Bolt12Refund value)? bolt12Refund, + }) { + return bolt12Offer?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(PaymentKind_Onchain value)? onchain, + TResult Function(PaymentKind_Bolt11 value)? bolt11, + TResult Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult Function(PaymentKind_Spontaneous value)? spontaneous, + TResult Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult Function(PaymentKind_Bolt12Refund value)? bolt12Refund, + required TResult orElse(), + }) { + if (bolt12Offer != null) { + return bolt12Offer(this); + } + return orElse(); + } +} + +abstract class PaymentKind_Bolt12Offer extends PaymentKind { + const factory PaymentKind_Bolt12Offer( + {final PaymentHash? hash, + final PaymentPreimage? preimage, + final PaymentSecret? secret, + required final OfferId offerId}) = _$PaymentKind_Bolt12OfferImpl; + const PaymentKind_Bolt12Offer._() : super._(); + + /// The payment hash, i.e., the hash of the `preimage`. + PaymentHash? get hash; + + /// The pre-image used by the payment. + PaymentPreimage? get preimage; + + /// The secret used by the payment. + PaymentSecret? get secret; + + /// The ID of the offer this payment is for. + OfferId get offerId; + @JsonKey(ignore: true) + _$$PaymentKind_Bolt12OfferImplCopyWith<_$PaymentKind_Bolt12OfferImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$PaymentKind_Bolt12RefundImplCopyWith<$Res> { + factory _$$PaymentKind_Bolt12RefundImplCopyWith( + _$PaymentKind_Bolt12RefundImpl value, + $Res Function(_$PaymentKind_Bolt12RefundImpl) then) = + __$$PaymentKind_Bolt12RefundImplCopyWithImpl<$Res>; + @useResult + $Res call( + {PaymentHash? hash, PaymentPreimage? preimage, PaymentSecret? secret}); +} + +/// @nodoc +class __$$PaymentKind_Bolt12RefundImplCopyWithImpl<$Res> + extends _$PaymentKindCopyWithImpl<$Res, _$PaymentKind_Bolt12RefundImpl> + implements _$$PaymentKind_Bolt12RefundImplCopyWith<$Res> { + __$$PaymentKind_Bolt12RefundImplCopyWithImpl( + _$PaymentKind_Bolt12RefundImpl _value, + $Res Function(_$PaymentKind_Bolt12RefundImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? hash = freezed, + Object? preimage = freezed, + Object? secret = freezed, + }) { + return _then(_$PaymentKind_Bolt12RefundImpl( + hash: freezed == hash + ? _value.hash + : hash // ignore: cast_nullable_to_non_nullable + as PaymentHash?, + preimage: freezed == preimage + ? _value.preimage + : preimage // ignore: cast_nullable_to_non_nullable + as PaymentPreimage?, + secret: freezed == secret + ? _value.secret + : secret // ignore: cast_nullable_to_non_nullable + as PaymentSecret?, + )); + } +} + +/// @nodoc + +class _$PaymentKind_Bolt12RefundImpl extends PaymentKind_Bolt12Refund { + const _$PaymentKind_Bolt12RefundImpl({this.hash, this.preimage, this.secret}) + : super._(); + + /// The payment hash, i.e., the hash of the `preimage`. + @override + final PaymentHash? hash; + + /// The pre-image used by the payment. + @override + final PaymentPreimage? preimage; + + /// The secret used by the payment. + @override + final PaymentSecret? secret; + + @override + String toString() { + return 'PaymentKind.bolt12Refund(hash: $hash, preimage: $preimage, secret: $secret)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$PaymentKind_Bolt12RefundImpl && + (identical(other.hash, hash) || other.hash == hash) && + (identical(other.preimage, preimage) || + other.preimage == preimage) && + (identical(other.secret, secret) || other.secret == secret)); + } + + @override + int get hashCode => Object.hash(runtimeType, hash, preimage, secret); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$PaymentKind_Bolt12RefundImplCopyWith<_$PaymentKind_Bolt12RefundImpl> + get copyWith => __$$PaymentKind_Bolt12RefundImplCopyWithImpl< + _$PaymentKind_Bolt12RefundImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() onchain, + required TResult Function( + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt11, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits) + bolt11Jit, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage) + spontaneous, + required TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId) + bolt12Offer, + required TResult Function( + PaymentHash? hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt12Refund, + }) { + return bolt12Refund(hash, preimage, secret); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? onchain, + TResult? Function( + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, + }) { + return bolt12Refund?.call(hash, preimage, secret); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? onchain, + TResult Function( + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, + required TResult orElse(), + }) { + if (bolt12Refund != null) { + return bolt12Refund(hash, preimage, secret); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(PaymentKind_Onchain value) onchain, + required TResult Function(PaymentKind_Bolt11 value) bolt11, + required TResult Function(PaymentKind_Bolt11Jit value) bolt11Jit, + required TResult Function(PaymentKind_Spontaneous value) spontaneous, + required TResult Function(PaymentKind_Bolt12Offer value) bolt12Offer, + required TResult Function(PaymentKind_Bolt12Refund value) bolt12Refund, + }) { + return bolt12Refund(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(PaymentKind_Onchain value)? onchain, + TResult? Function(PaymentKind_Bolt11 value)? bolt11, + TResult? Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult? Function(PaymentKind_Spontaneous value)? spontaneous, + TResult? Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult? Function(PaymentKind_Bolt12Refund value)? bolt12Refund, + }) { + return bolt12Refund?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(PaymentKind_Onchain value)? onchain, + TResult Function(PaymentKind_Bolt11 value)? bolt11, + TResult Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult Function(PaymentKind_Spontaneous value)? spontaneous, + TResult Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult Function(PaymentKind_Bolt12Refund value)? bolt12Refund, + required TResult orElse(), + }) { + if (bolt12Refund != null) { + return bolt12Refund(this); + } + return orElse(); + } +} + +abstract class PaymentKind_Bolt12Refund extends PaymentKind { + const factory PaymentKind_Bolt12Refund( + {final PaymentHash? hash, + final PaymentPreimage? preimage, + final PaymentSecret? secret}) = _$PaymentKind_Bolt12RefundImpl; + const PaymentKind_Bolt12Refund._() : super._(); + + /// The payment hash, i.e., the hash of the `preimage`. + PaymentHash? get hash; + + /// The pre-image used by the payment. + PaymentPreimage? get preimage; + + /// The secret used by the payment. + PaymentSecret? get secret; + @JsonKey(ignore: true) + _$$PaymentKind_Bolt12RefundImplCopyWith<_$PaymentKind_Bolt12RefundImpl> + 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; + BigInt get amountSatoshis => throw _privateConstructorUsedError; @optionalTypeArgs TResult when({ - required TResult Function(ChannelId? channelId, int amountSatoshis) + required TResult Function(ChannelId? channelId, BigInt amountSatoshis) pendingBroadcast, required TResult Function(ChannelId? channelId, int latestBroadcastHeight, - Txid latestSpendingTxid, int amountSatoshis) + Txid latestSpendingTxid, BigInt amountSatoshis) broadcastAwaitingConfirmation, - required TResult Function(ChannelId? channelId, Txid latestSpendingTxid, - String confirmationHash, int confirmationHeight, int amountSatoshis) + required TResult Function( + ChannelId? channelId, + Txid latestSpendingTxid, + String confirmationHash, + int confirmationHeight, + BigInt amountSatoshis) awaitingThresholdConfirmations, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(ChannelId? channelId, int amountSatoshis)? + TResult? Function(ChannelId? channelId, BigInt amountSatoshis)? pendingBroadcast, TResult? Function(ChannelId? channelId, int latestBroadcastHeight, - Txid latestSpendingTxid, int amountSatoshis)? + Txid latestSpendingTxid, BigInt amountSatoshis)? broadcastAwaitingConfirmation, TResult? Function( ChannelId? channelId, Txid latestSpendingTxid, String confirmationHash, int confirmationHeight, - int amountSatoshis)? + BigInt amountSatoshis)? awaitingThresholdConfirmations, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult maybeWhen({ - TResult Function(ChannelId? channelId, int amountSatoshis)? + TResult Function(ChannelId? channelId, BigInt amountSatoshis)? pendingBroadcast, TResult Function(ChannelId? channelId, int latestBroadcastHeight, - Txid latestSpendingTxid, int amountSatoshis)? + Txid latestSpendingTxid, BigInt amountSatoshis)? broadcastAwaitingConfirmation, TResult Function( ChannelId? channelId, Txid latestSpendingTxid, String confirmationHash, int confirmationHeight, - int amountSatoshis)? + BigInt amountSatoshis)? awaitingThresholdConfirmations, required TResult orElse(), }) => @@ -9187,7 +10201,7 @@ abstract class $PendingSweepBalanceCopyWith<$Res> { PendingSweepBalance value, $Res Function(PendingSweepBalance) then) = _$PendingSweepBalanceCopyWithImpl<$Res, PendingSweepBalance>; @useResult - $Res call({ChannelId? channelId, int amountSatoshis}); + $Res call({ChannelId? channelId, BigInt amountSatoshis}); } /// @nodoc @@ -9214,7 +10228,7 @@ class _$PendingSweepBalanceCopyWithImpl<$Res, $Val extends PendingSweepBalance> amountSatoshis: null == amountSatoshis ? _value.amountSatoshis : amountSatoshis // ignore: cast_nullable_to_non_nullable - as int, + as BigInt, ) as $Val); } } @@ -9228,7 +10242,7 @@ abstract class _$$PendingSweepBalance_PendingBroadcastImplCopyWith<$Res> __$$PendingSweepBalance_PendingBroadcastImplCopyWithImpl<$Res>; @override @useResult - $Res call({ChannelId? channelId, int amountSatoshis}); + $Res call({ChannelId? channelId, BigInt amountSatoshis}); } /// @nodoc @@ -9255,7 +10269,7 @@ class __$$PendingSweepBalance_PendingBroadcastImplCopyWithImpl<$Res> amountSatoshis: null == amountSatoshis ? _value.amountSatoshis : amountSatoshis // ignore: cast_nullable_to_non_nullable - as int, + as BigInt, )); } } @@ -9274,7 +10288,7 @@ class _$PendingSweepBalance_PendingBroadcastImpl /// The amount, in satoshis, of the output being swept. @override - final int amountSatoshis; + final BigInt amountSatoshis; @override String toString() { @@ -9306,13 +10320,17 @@ class _$PendingSweepBalance_PendingBroadcastImpl @override @optionalTypeArgs TResult when({ - required TResult Function(ChannelId? channelId, int amountSatoshis) + required TResult Function(ChannelId? channelId, BigInt amountSatoshis) pendingBroadcast, required TResult Function(ChannelId? channelId, int latestBroadcastHeight, - Txid latestSpendingTxid, int amountSatoshis) + Txid latestSpendingTxid, BigInt amountSatoshis) broadcastAwaitingConfirmation, - required TResult Function(ChannelId? channelId, Txid latestSpendingTxid, - String confirmationHash, int confirmationHeight, int amountSatoshis) + required TResult Function( + ChannelId? channelId, + Txid latestSpendingTxid, + String confirmationHash, + int confirmationHeight, + BigInt amountSatoshis) awaitingThresholdConfirmations, }) { return pendingBroadcast(channelId, amountSatoshis); @@ -9321,17 +10339,17 @@ class _$PendingSweepBalance_PendingBroadcastImpl @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(ChannelId? channelId, int amountSatoshis)? + TResult? Function(ChannelId? channelId, BigInt amountSatoshis)? pendingBroadcast, TResult? Function(ChannelId? channelId, int latestBroadcastHeight, - Txid latestSpendingTxid, int amountSatoshis)? + Txid latestSpendingTxid, BigInt amountSatoshis)? broadcastAwaitingConfirmation, TResult? Function( ChannelId? channelId, Txid latestSpendingTxid, String confirmationHash, int confirmationHeight, - int amountSatoshis)? + BigInt amountSatoshis)? awaitingThresholdConfirmations, }) { return pendingBroadcast?.call(channelId, amountSatoshis); @@ -9340,17 +10358,17 @@ class _$PendingSweepBalance_PendingBroadcastImpl @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(ChannelId? channelId, int amountSatoshis)? + TResult Function(ChannelId? channelId, BigInt amountSatoshis)? pendingBroadcast, TResult Function(ChannelId? channelId, int latestBroadcastHeight, - Txid latestSpendingTxid, int amountSatoshis)? + Txid latestSpendingTxid, BigInt amountSatoshis)? broadcastAwaitingConfirmation, TResult Function( ChannelId? channelId, Txid latestSpendingTxid, String confirmationHash, int confirmationHeight, - int amountSatoshis)? + BigInt amountSatoshis)? awaitingThresholdConfirmations, required TResult orElse(), }) { @@ -9409,7 +10427,7 @@ class _$PendingSweepBalance_PendingBroadcastImpl abstract class PendingSweepBalance_PendingBroadcast extends PendingSweepBalance { const factory PendingSweepBalance_PendingBroadcast( - {final ChannelId? channelId, required final int amountSatoshis}) = + {final ChannelId? channelId, required final BigInt amountSatoshis}) = _$PendingSweepBalance_PendingBroadcastImpl; const PendingSweepBalance_PendingBroadcast._() : super._(); @@ -9420,7 +10438,7 @@ abstract class PendingSweepBalance_PendingBroadcast @override /// The amount, in satoshis, of the output being swept. - int get amountSatoshis; + BigInt get amountSatoshis; @override @JsonKey(ignore: true) _$$PendingSweepBalance_PendingBroadcastImplCopyWith< @@ -9443,7 +10461,7 @@ abstract class _$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWith< {ChannelId? channelId, int latestBroadcastHeight, Txid latestSpendingTxid, - int amountSatoshis}); + BigInt amountSatoshis}); } /// @nodoc @@ -9483,7 +10501,7 @@ class __$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWithImpl< amountSatoshis: null == amountSatoshis ? _value.amountSatoshis : amountSatoshis // ignore: cast_nullable_to_non_nullable - as int, + as BigInt, )); } } @@ -9513,7 +10531,7 @@ class _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl /// The amount, in satoshis, of the output being swept. @override - final int amountSatoshis; + final BigInt amountSatoshis; @override String toString() { @@ -9552,13 +10570,17 @@ class _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl @override @optionalTypeArgs TResult when({ - required TResult Function(ChannelId? channelId, int amountSatoshis) + required TResult Function(ChannelId? channelId, BigInt amountSatoshis) pendingBroadcast, required TResult Function(ChannelId? channelId, int latestBroadcastHeight, - Txid latestSpendingTxid, int amountSatoshis) + Txid latestSpendingTxid, BigInt amountSatoshis) broadcastAwaitingConfirmation, - required TResult Function(ChannelId? channelId, Txid latestSpendingTxid, - String confirmationHash, int confirmationHeight, int amountSatoshis) + required TResult Function( + ChannelId? channelId, + Txid latestSpendingTxid, + String confirmationHash, + int confirmationHeight, + BigInt amountSatoshis) awaitingThresholdConfirmations, }) { return broadcastAwaitingConfirmation( @@ -9568,17 +10590,17 @@ class _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(ChannelId? channelId, int amountSatoshis)? + TResult? Function(ChannelId? channelId, BigInt amountSatoshis)? pendingBroadcast, TResult? Function(ChannelId? channelId, int latestBroadcastHeight, - Txid latestSpendingTxid, int amountSatoshis)? + Txid latestSpendingTxid, BigInt amountSatoshis)? broadcastAwaitingConfirmation, TResult? Function( ChannelId? channelId, Txid latestSpendingTxid, String confirmationHash, int confirmationHeight, - int amountSatoshis)? + BigInt amountSatoshis)? awaitingThresholdConfirmations, }) { return broadcastAwaitingConfirmation?.call( @@ -9588,17 +10610,17 @@ class _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(ChannelId? channelId, int amountSatoshis)? + TResult Function(ChannelId? channelId, BigInt amountSatoshis)? pendingBroadcast, TResult Function(ChannelId? channelId, int latestBroadcastHeight, - Txid latestSpendingTxid, int amountSatoshis)? + Txid latestSpendingTxid, BigInt amountSatoshis)? broadcastAwaitingConfirmation, TResult Function( ChannelId? channelId, Txid latestSpendingTxid, String confirmationHash, int confirmationHeight, - int amountSatoshis)? + BigInt amountSatoshis)? awaitingThresholdConfirmations, required TResult orElse(), }) { @@ -9661,7 +10683,7 @@ abstract class PendingSweepBalance_BroadcastAwaitingConfirmation {final ChannelId? channelId, required final int latestBroadcastHeight, required final Txid latestSpendingTxid, - required final int amountSatoshis}) = + required final BigInt amountSatoshis}) = _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl; const PendingSweepBalance_BroadcastAwaitingConfirmation._() : super._(); @@ -9678,7 +10700,7 @@ abstract class PendingSweepBalance_BroadcastAwaitingConfirmation @override /// The amount, in satoshis, of the output being swept. - int get amountSatoshis; + BigInt get amountSatoshis; @override @JsonKey(ignore: true) _$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWith< @@ -9703,7 +10725,7 @@ abstract class _$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWith Txid latestSpendingTxid, String confirmationHash, int confirmationHeight, - int amountSatoshis}); + BigInt amountSatoshis}); } /// @nodoc @@ -9749,7 +10771,7 @@ class __$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWithImpl< amountSatoshis: null == amountSatoshis ? _value.amountSatoshis : amountSatoshis // ignore: cast_nullable_to_non_nullable - as int, + as BigInt, )); } } @@ -9784,7 +10806,7 @@ class _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl /// The amount, in satoshis, of the output being swept. @override - final int amountSatoshis; + final BigInt amountSatoshis; @override String toString() { @@ -9825,13 +10847,17 @@ class _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl @override @optionalTypeArgs TResult when({ - required TResult Function(ChannelId? channelId, int amountSatoshis) + required TResult Function(ChannelId? channelId, BigInt amountSatoshis) pendingBroadcast, required TResult Function(ChannelId? channelId, int latestBroadcastHeight, - Txid latestSpendingTxid, int amountSatoshis) + Txid latestSpendingTxid, BigInt amountSatoshis) broadcastAwaitingConfirmation, - required TResult Function(ChannelId? channelId, Txid latestSpendingTxid, - String confirmationHash, int confirmationHeight, int amountSatoshis) + required TResult Function( + ChannelId? channelId, + Txid latestSpendingTxid, + String confirmationHash, + int confirmationHeight, + BigInt amountSatoshis) awaitingThresholdConfirmations, }) { return awaitingThresholdConfirmations(channelId, latestSpendingTxid, @@ -9841,17 +10867,17 @@ class _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(ChannelId? channelId, int amountSatoshis)? + TResult? Function(ChannelId? channelId, BigInt amountSatoshis)? pendingBroadcast, TResult? Function(ChannelId? channelId, int latestBroadcastHeight, - Txid latestSpendingTxid, int amountSatoshis)? + Txid latestSpendingTxid, BigInt amountSatoshis)? broadcastAwaitingConfirmation, TResult? Function( ChannelId? channelId, Txid latestSpendingTxid, String confirmationHash, int confirmationHeight, - int amountSatoshis)? + BigInt amountSatoshis)? awaitingThresholdConfirmations, }) { return awaitingThresholdConfirmations?.call(channelId, latestSpendingTxid, @@ -9861,17 +10887,17 @@ class _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(ChannelId? channelId, int amountSatoshis)? + TResult Function(ChannelId? channelId, BigInt amountSatoshis)? pendingBroadcast, TResult Function(ChannelId? channelId, int latestBroadcastHeight, - Txid latestSpendingTxid, int amountSatoshis)? + Txid latestSpendingTxid, BigInt amountSatoshis)? broadcastAwaitingConfirmation, TResult Function( ChannelId? channelId, Txid latestSpendingTxid, String confirmationHash, int confirmationHeight, - int amountSatoshis)? + BigInt amountSatoshis)? awaitingThresholdConfirmations, required TResult orElse(), }) { @@ -9935,7 +10961,7 @@ abstract class PendingSweepBalance_AwaitingThresholdConfirmations required final Txid latestSpendingTxid, required final String confirmationHash, required final int confirmationHeight, - required final int amountSatoshis}) = + required final BigInt amountSatoshis}) = _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl; const PendingSweepBalance_AwaitingThresholdConfirmations._() : super._(); @@ -9955,7 +10981,7 @@ abstract class PendingSweepBalance_AwaitingThresholdConfirmations @override /// The amount, in satoshis, of the output being swept. - int get amountSatoshis; + BigInt get amountSatoshis; @override @JsonKey(ignore: true) _$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWith< diff --git a/rust/src/api/types.rs b/rust/src/api/types.rs index 02e8ea5..88e35f8 100644 --- a/rust/src/api/types.rs +++ b/rust/src/api/types.rs @@ -1,9 +1,10 @@ -use crate::api::node::LdkMnemonic; use flutter_rust_bridge::*; -use ldk_node::lightning::util::ser::{Readable, Writeable}; +use ldk_node::lightning::util::ser::{ Readable, Writeable }; use std::str::FromStr; use std::string::ToString; -use crate::api::error::{BuilderException, NodeException}; +use std::default::Default; +use crate::api::builder::LdkMnemonic; +use crate::utils::error::{LdkBuilderError, LdkNodeError}; ///The addresses on which the node will listen for incoming connections. #[derive(Debug, Clone, PartialEq, Eq)] @@ -43,12 +44,13 @@ impl From for SocketAddress { checksum, version, port, - } => SocketAddress::OnionV3 { - ed25519_pubkey, - checksum, - version, - port, - }, + } => + SocketAddress::OnionV3 { + ed25519_pubkey, + checksum, + version, + port, + }, ldk_node::lightning::ln::msgs::SocketAddress::Hostname { hostname, port } => { SocketAddress::Hostname { addr: hostname.to_string(), @@ -59,7 +61,7 @@ impl From for SocketAddress { } } impl TryFrom for ldk_node::lightning::ln::msgs::SocketAddress { - type Error = BuilderException; + type Error = LdkBuilderError; fn try_from(value: SocketAddress) -> Result { match value { @@ -72,21 +74,18 @@ impl TryFrom for ldk_node::lightning::ln::msgs::SocketAddress { SocketAddress::OnionV2(e) => { Ok(ldk_node::lightning::ln::msgs::SocketAddress::OnionV2(e)) } - SocketAddress::OnionV3 { - ed25519_pubkey, - checksum, - version, - port, - } => Ok(ldk_node::lightning::ln::msgs::SocketAddress::OnionV3 { - ed25519_pubkey, - checksum, - version, - port, - }), + SocketAddress::OnionV3 { ed25519_pubkey, checksum, version, port } => + Ok(ldk_node::lightning::ln::msgs::SocketAddress::OnionV3 { + ed25519_pubkey, + checksum, + version, + port, + }), SocketAddress::Hostname { addr, port } => { Ok(ldk_node::lightning::ln::msgs::SocketAddress::Hostname { - hostname: ldk_node::lightning::util::ser::Hostname::try_from(addr) - .map_err(|_| BuilderException::SocketAddressParseError)?, + hostname: ldk_node::lightning::util::ser::Hostname + ::try_from(addr) + .map_err(|_| LdkBuilderError::SocketAddressParseError)?, port, }) } @@ -144,7 +143,6 @@ impl From for ChannelConfig { } } #[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. // @@ -175,13 +173,13 @@ impl From for ldk_node::ChannelConfig { 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) + config.set_max_dust_htlc_exposure_from_fixed_limit(e); } MaxDustHTLCExposure::FeeRateMultiplier(e) => { - config.set_max_dust_htlc_exposure_from_fee_rate_multiplier(e) + config.set_max_dust_htlc_exposure_from_fee_rate_multiplier(e); } } - }; + } config } } @@ -224,7 +222,7 @@ impl From for UserChannelId { } } impl TryFrom for ldk_node::UserChannelId { - type Error = NodeException; + type Error = LdkNodeError; fn try_from(value: UserChannelId) -> Result { let mut encoded = value.data.as_slice(); @@ -264,10 +262,14 @@ impl From for ClosureReason { ldk_node::lightning::events::ClosureReason::FundingBatchClosure => { ClosureReason::FundingBatchClosure } - ldk_node::lightning::events::ClosureReason::LegacyCooperativeClosure => ClosureReason::LegacyCooperativeClosure, - ldk_node::lightning::events::ClosureReason::CounterpartyInitiatedCooperativeClosure => ClosureReason::CounterpartyInitiatedCooperativeClosure, - ldk_node::lightning::events:: ClosureReason::LocallyInitiatedCooperativeClosure => ClosureReason::LocallyInitiatedCooperativeClosure, - ldk_node::lightning::events::ClosureReason::HTLCsTimedOut => ClosureReason::HTLCsTimedOut + ldk_node::lightning::events::ClosureReason::LegacyCooperativeClosure => + ClosureReason::LegacyCooperativeClosure, + ldk_node::lightning::events::ClosureReason::CounterpartyInitiatedCooperativeClosure => + ClosureReason::CounterpartyInitiatedCooperativeClosure, + ldk_node::lightning::events::ClosureReason::LocallyInitiatedCooperativeClosure => + ClosureReason::LocallyInitiatedCooperativeClosure, + ldk_node::lightning::events::ClosureReason::HTLCsTimedOut => + ClosureReason::HTLCsTimedOut, } } } @@ -393,7 +395,6 @@ pub enum ClosureReason { } ///A user-provided identifier in channelManager.sendPayment used to uniquely identify a payment and ensure idempotency in LDK. #[derive(Eq, PartialEq, Debug, Clone)] - pub struct PaymentId(pub [u8; 32]); impl From for PaymentId { @@ -402,7 +403,7 @@ impl From for PaymentId { } } impl From for ldk_node::lightning::ln::channelmanager::PaymentId { - fn from(value:PaymentId) -> Self { + fn from(value: PaymentId) -> Self { ldk_node::lightning::ln::channelmanager::PaymentId(value.0) } } @@ -411,6 +412,23 @@ impl From for ldk_node::lightning::ln::channelmanager::PaymentId { #[derive(Debug, Clone, PartialEq, Eq)] pub enum Event { + /// A payment for a previously-registered payment hash has been received. + /// + /// This needs to be manually claimed by supplying the correct preimage to `claimForHash`. + /// + /// If the the provided parameters don't match the expectations or the preimage can't be + /// retrieved in time, should be failed-back via [`failForHash`]. + PaymentClaimable { + /// A local identifier used to track the payment. + payment_id: PaymentId, + /// The hash of the payment. + payment_hash: PaymentHash, + /// The value, in thousandths of a satoshi, that is claimable. + claimable_amount_msat: u64, + /// The block height at which this payment will be failed back and will no longer be + /// eligible for claiming. + claim_deadline: Option, + }, /// A sent payment was successful. PaymentSuccessful { /// A local identifier used to track the payment. @@ -488,75 +506,81 @@ pub enum Event { impl From for Event { fn from(value: ldk_node::Event) -> Self { match value { - ldk_node::Event::PaymentSuccessful { - payment_id, payment_hash, - fee_paid_msat, - } => Event::PaymentSuccessful { - payment_id: payment_id.map(|e| e.into()), - payment_hash: PaymentHash { - data: payment_hash.0, + ldk_node::Event::PaymentSuccessful { payment_id, payment_hash, fee_paid_msat } => + Event::PaymentSuccessful { + payment_id: payment_id.map(|e| e.into()), + payment_hash: PaymentHash { + data: payment_hash.0, + }, + fee_paid_msat, }, - fee_paid_msat, - }, - ldk_node::Event::PaymentFailed { - payment_id, payment_hash, - reason, - } => Event::PaymentFailed { - payment_id: payment_id.map(|e| e.into()), - payment_hash: PaymentHash { - data: payment_hash.0, + ldk_node::Event::PaymentFailed { payment_id, payment_hash, reason } => + Event::PaymentFailed { + payment_id: payment_id.map(|e| e.into()), + payment_hash: PaymentHash { + data: payment_hash.0, + }, + reason: reason.map(|e| e.into()), }, - reason: reason.map(|e| e.into()), - }, - ldk_node::Event::PaymentReceived { - payment_id, payment_hash, - amount_msat, - } => Event::PaymentReceived { - payment_id: payment_id.map(|e| e.into()), - payment_hash: PaymentHash { - data: payment_hash.0, + ldk_node::Event::PaymentReceived { payment_id, payment_hash, amount_msat } => + Event::PaymentReceived { + payment_id: payment_id.map(|e| e.into()), + payment_hash: PaymentHash { + data: payment_hash.0, + }, + amount_msat, + }, + ldk_node::Event::ChannelReady { channel_id, user_channel_id, counterparty_node_id } => + Event::ChannelReady { + channel_id: channel_id.into(), + user_channel_id: user_channel_id.into(), + counterparty_node_id: counterparty_node_id.map(|x| x.into()), }, - amount_msat, - }, - ldk_node::Event::ChannelReady { - channel_id, - user_channel_id, - counterparty_node_id, - } => Event::ChannelReady { - channel_id: channel_id.into(), - user_channel_id: user_channel_id.into(), - counterparty_node_id: counterparty_node_id.map(|x| x.into()), - }, ldk_node::Event::ChannelClosed { 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()), - }, + } => + 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, user_channel_id, former_temporary_channel_id, counterparty_node_id, funding_txo, - } => Event::ChannelPending { - channel_id: channel_id.into(), - user_channel_id: user_channel_id.into(), - former_temporary_channel_id: former_temporary_channel_id.into(), - counterparty_node_id: PublicKey { - hex: counterparty_node_id.to_string(), + } => + Event::ChannelPending { + channel_id: channel_id.into(), + user_channel_id: user_channel_id.into(), + former_temporary_channel_id: former_temporary_channel_id.into(), + counterparty_node_id: PublicKey { + hex: counterparty_node_id.to_string(), + }, + funding_txo: funding_txo.into(), + }, + ldk_node::Event::PaymentClaimable { + payment_id, + payment_hash, + claimable_amount_msat, + claim_deadline, + } => + Event::PaymentClaimable { + payment_id: payment_id.into(), + payment_hash: payment_hash.into(), + claimable_amount_msat: claimable_amount_msat, + claim_deadline: claim_deadline, }, - funding_txo: funding_txo.into(), - }, } } } + ///A bitcoin transaction hash/transaction ID. /// #[derive(Debug, Clone, PartialEq, Eq)] @@ -565,11 +589,12 @@ pub struct Txid { } impl TryFrom for ldk_node::bitcoin::Txid { - type Error = NodeException; + type Error = LdkNodeError; fn try_from(value: Txid) -> Result { - ldk_node::bitcoin::Txid::from_str(value.hash.as_str()) - .map_err(|_| NodeException::InvalidTxid) + ldk_node::bitcoin::Txid + ::from_str(value.hash.as_str()) + .map_err(|_| LdkNodeError::InvalidTxid) } } @@ -689,7 +714,7 @@ pub struct PaymentSecret { impl From for PaymentSecret { fn from(value: ldk_node::lightning_invoice::PaymentSecret) -> Self { - PaymentSecret{ data: value.0 } + PaymentSecret { data: value.0 } } } /// Represents a payment. @@ -728,10 +753,26 @@ pub struct LSPFeeLimits { /// LSP withhold from us when forwarding the payment. pub max_proportional_opening_fee_ppm_msat: Option, } -impl From for LSPFeeLimits{ +impl From for LSPFeeLimits { fn from(value: ldk_node::payment::LSPFeeLimits) -> Self { - LSPFeeLimits{ max_total_opening_fee_msat: value.max_total_opening_fee_msat, - max_proportional_opening_fee_ppm_msat: value. max_proportional_opening_fee_ppm_msat } + LSPFeeLimits { + max_total_opening_fee_msat: value.max_total_opening_fee_msat, + max_proportional_opening_fee_ppm_msat: value.max_proportional_opening_fee_ppm_msat, + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub struct OfferId(pub [u8; 32]); + +impl From for OfferId { + fn from(value: ldk_node::lightning::offers::offer::OfferId) -> Self { + Self(value.0) + } +} +impl From for ldk_node::lightning::offers::offer::OfferId { + fn from(value: OfferId) -> Self { + Self(value.0) } } /// Represents the kind of a payment. @@ -776,17 +817,42 @@ pub enum PaymentKind { /// The pre-image used by the payment. preimage: Option, }, + + /// A [BOLT 12] offer payment, i.e., a payment for an `Offer`. + /// + /// [BOLT 12]: https://github.com/lightning/bolts/blob/master/12-offer-encoding.md + Bolt12Offer { + /// The payment hash, i.e., the hash of the `preimage`. + hash: Option, + /// The pre-image used by the payment. + preimage: Option, + /// The secret used by the payment. + secret: Option, + /// The ID of the offer this payment is for. + offer_id: OfferId, + }, + /// A [BOLT 12] 'refund' payment, i.e., a payment for a `Refund`. + /// + /// [BOLT 12]: https://github.com/lightning/bolts/blob/master/12-offer-encoding.md + Bolt12Refund { + /// The payment hash, i.e., the hash of the `preimage`. + hash: Option, + /// The pre-image used by the payment. + preimage: Option, + /// The secret used by the payment. + secret: Option, + }, } -impl From for PaymentKind{ +impl From for PaymentKind { fn from(value: ldk_node::payment::PaymentKind) -> Self { match value { ldk_node::payment::PaymentKind::Onchain => PaymentKind::Onchain, - ldk_node::payment::PaymentKind::Bolt11 - { hash, preimage, secret } => PaymentKind::Bolt11{ - hash: hash.into(), - preimage: preimage.map(|e| e.into()), - secret: secret.map(|e| e.into()), - }, + ldk_node::payment::PaymentKind::Bolt11 { hash, preimage, secret } => + PaymentKind::Bolt11 { + hash: hash.into(), + preimage: preimage.map(|e| e.into()), + secret: secret.map(|e| e.into()), + }, ldk_node::payment::PaymentKind::Bolt11Jit { hash, preimage, secret, lsp_fee_limits } => PaymentKind::Bolt11Jit { hash: hash.into(), @@ -795,8 +861,23 @@ impl From for PaymentKind{ lsp_fee_limits: lsp_fee_limits.into(), }, ldk_node::payment::PaymentKind::Spontaneous { hash, preimage } => - PaymentKind::Spontaneous{ hash: hash.into(), - preimage: preimage.map(|e| e.into()) } + PaymentKind::Spontaneous { + hash: hash.into(), + preimage: preimage.map(|e| e.into()), + }, + ldk_node::payment::PaymentKind::Bolt12Offer { hash, preimage, secret, offer_id } => + PaymentKind::Bolt12Offer { + hash: hash.map(|e| e.into()), + preimage: preimage.map(|e| e.into()), + secret: secret.map(|e| e.into()), + offer_id: offer_id.into(), + }, + ldk_node::payment::PaymentKind::Bolt12Refund { hash, preimage, secret } => + PaymentKind::Bolt12Refund { + hash: hash.map(|e| e.into()), + preimage: preimage.map(|e| e.into()), + secret: secret.map(|e| e.into()), + }, } } } @@ -808,11 +889,12 @@ pub struct Bolt11Invoice { } impl TryFrom for ldk_node::lightning_invoice::Bolt11Invoice { - type Error = NodeException; + type Error = LdkNodeError; fn try_from(value: Bolt11Invoice) -> Result { - ldk_node::lightning_invoice::Bolt11Invoice::from_str(value.signed_raw_invoice.as_str()) - .map_err(|_| NodeException::InvalidInvoice) + ldk_node::lightning_invoice::Bolt11Invoice + ::from_str(value.signed_raw_invoice.as_str()) + .map_err(|_| LdkNodeError::InvalidInvoice) } } impl From for Bolt11Invoice { @@ -830,11 +912,12 @@ pub struct PublicKey { } impl TryFrom for ldk_node::bitcoin::secp256k1::PublicKey { - type Error = NodeException; + type Error = LdkNodeError; fn try_from(value: PublicKey) -> Result { - ldk_node::bitcoin::secp256k1::PublicKey::from_str(value.hex.as_str()) - .map_err(|_| NodeException::InvalidPublicKey) + ldk_node::bitcoin::secp256k1::PublicKey + ::from_str(value.hex.as_str()) + .map_err(|_| LdkNodeError::InvalidPublicKey) } } impl From for PublicKey { @@ -851,12 +934,13 @@ pub struct Address { } impl TryFrom
for ldk_node::bitcoin::Address { - type Error = NodeException; + type Error = LdkNodeError; fn try_from(value: Address) -> Result { - ldk_node::bitcoin::Address::from_str(value.s.as_str()) + ldk_node::bitcoin::Address + ::from_str(value.s.as_str()) .map(|e| e.assume_checked()) - .map_err(|_| NodeException::InvalidAddress) + .map_err(|_| LdkNodeError::InvalidAddress) } } impl From for Address { @@ -1000,22 +1084,12 @@ impl From<&ldk_node::ChannelDetails> for ChannelDetails { 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, + 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, @@ -1140,14 +1214,102 @@ impl From for LogLevel { } } } + +/// Configuration options pertaining to 'Anchor' channels, i.e., channels for which the +/// `optionAnchorsZeroFeeHtlcTx` channel type is negotiated. +/// +/// Prior to the introduction of Anchor channels, the on-chain fees paying for the transactions +/// issued on channel closure were pre-determined and locked-in at the time of the channel +/// opening. This required to estimate what fee rate would be sufficient to still have the +/// closing transactions be spendable on-chain (i.e., not be considered dust). This legacy +/// design of pre-anchor channels proved inadequate in the unpredictable, often turbulent, fee +/// markets we experience today. +/// +/// In contrast, Anchor channels allow to determine an adequate fee rate *at the time of channel +/// closure*, making them much more robust in the face of fee spikes. In turn, they require to +/// maintain a reserve of on-chain funds to have the channel closure transactions confirmed +/// on-chain, at least if the channel counterparty can't be trusted to do this for us. +/// +/// See [BOLT 3] for more technical details on Anchor channels. +/// +/// +/// ### Defaults +/// +/// | Parameter | Value | +/// |----------------------------|--------| +/// | `trustedPeersNoReserve` | [] | +/// | `perChannelReserveSats` | 25000 | +/// +/// +/// [BOLT 3]: https://github.com/lightning/bolts/blob/master/03-transactions.md#htlc-timeout-and-htlc-success-transactions +#[derive(Debug, Clone)] +pub struct AnchorChannelsConfig { + /// A list of peers that we trust to get the required channel closing transactions confirmed + /// on-chain. + /// + /// Channels with these peers won't count towards the retained on-chain reserve and we won't + /// take any action to get the required transactions confirmed ourselves. + /// + /// **Note:** Trusting the channel counterparty to take the necessary actions to get the + /// required Anchor spending and HTLC transactions confirmed on-chain is potentially insecure + /// as the channel may not be closed if they refuse to do so, potentially leaving the user + /// funds stuck *or* even allow the counterparty to steal any in-flight funds after the + /// corresponding HTLCs time out. + pub trusted_peers_no_reserve: Vec, + /// The amount of satoshis per anchors-negotiated channel with an untrusted peer that we keep + /// as an emergency reserve in our on-chain wallet. + /// + /// This allows for having the required Anchor output spending and HTLC transactions confirmed + /// when the channel is closed. + /// + /// If the channel peer is not marked as trusted via trustedPeersNoReserve, + /// we will always try to spend the Anchor + /// outputs with *any* on-chain funds available, i.e., the total reserve value as well as any + /// spendable funds available in the on-chain wallet. Therefore, this per-channel multiplier is + /// really an emergency reserve that we maintain at all time to reduce reduce the risk of + /// insufficient funds at time of a channel closure. To this end, we will refuse to open + /// outbound or accept inbound channels if we don't have sufficient on-chain funds available to + /// cover the additional reserve requirement. + /// + /// **Note:** Depending on the fee market at the time of closure, this reserve amount might or + /// might not suffice to successfully spend the Anchor output and have the HTLC transactions + /// confirmed on-chain, i.e., you may want to adjust this value accordingly. + pub per_channel_reserve_sats: u64, +} + +impl TryFrom for ldk_node::AnchorChannelsConfig{ + type Error = LdkBuilderError; + + fn try_from(value: AnchorChannelsConfig) -> Result { + let trusted_peers_no_reserve: Result< + Vec, + LdkBuilderError + > = value.trusted_peers_no_reserve + .into_iter() + .map(|x| { x.try_into().map_err(|_| LdkBuilderError::InvalidPublicKey) }) + .collect(); + Ok(Self { trusted_peers_no_reserve: trusted_peers_no_reserve?, per_channel_reserve_sats: value.per_channel_reserve_sats }) + } +} + +impl From for AnchorChannelsConfig { + fn from(value: ldk_node::AnchorChannelsConfig) -> Self { + Self{ trusted_peers_no_reserve: value.trusted_peers_no_reserve + .into_iter() + .map(|e| e.into()) + .collect() + , per_channel_reserve_sats: value.per_channel_reserve_sats } + } +} + impl TryFrom for ldk_node::Config { - type Error = BuilderException; + type Error = LdkBuilderError; fn try_from(value: Config) -> Result { let addresses = if let Some(addresses) = value.listening_addresses { let addr_vec: Result< Vec, - BuilderException, + LdkBuilderError > = addresses .into_iter() .map(|socket_addr| socket_addr.try_into()) @@ -1156,16 +1318,20 @@ impl TryFrom for ldk_node::Config { } else { None }; + let anchor_channels_config = if let Some(anchor_channels_config) = value.anchor_channels_config{ + let anchr_channels_config: Result< + ldk_node::AnchorChannelsConfig, + LdkBuilderError> = anchor_channels_config.try_into(); + Some(anchr_channels_config?) + }else { + None + }; let trusted_peers_0conf: Result< Vec, - BuilderException, - > = value - .trusted_peers_0conf + LdkBuilderError + > = value.trusted_peers_0conf .into_iter() - .map(|x| { - x.try_into() - .map_err(|_| BuilderException::InvalidPublicKey) - }) + .map(|x| { x.try_into().map_err(|_| LdkBuilderError::InvalidPublicKey) }) .collect(); Ok(ldk_node::Config { @@ -1180,6 +1346,7 @@ impl TryFrom for ldk_node::Config { trusted_peers_0conf: trusted_peers_0conf?, log_level: value.log_level.into(), probing_liquidity_limit_multiplier: value.probing_liquidity_limit_multiplier, + anchor_channels_config, }) } } @@ -1199,13 +1366,13 @@ impl From for Config { 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 + 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, + anchor_channels_config: value.anchor_channels_config.map(|e| e.into()), } } } @@ -1258,6 +1425,16 @@ pub struct Config { /// #[frb(non_final)] pub log_level: LogLevel, + #[frb(non_final)] + pub anchor_channels_config: Option, +} +impl Default for AnchorChannelsConfig { + fn default() -> Self { + AnchorChannelsConfig { + trusted_peers_no_reserve: vec![], + per_channel_reserve_sats: 25000, + } + } } impl Default for Config { @@ -1274,6 +1451,7 @@ impl Default for Config { trusted_peers_0conf: vec![], probing_liquidity_limit_multiplier: 3, log_level: DEFAULT_LOG_LEVEL, + anchor_channels_config:Some(Default::default()), } } } @@ -1310,22 +1488,19 @@ impl From for BalanceDetails { 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 + lightning_balances: value.lightning_balances .iter() .map(|e| e.clone().into()) .collect(), - pending_balances_from_channel_closures: value - .pending_balances_from_channel_closures + 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`]. +/// Details of the known available balances returned by `node.listBalances`. /// -/// [`Node::list_balances`]: crate::Node::list_balances #[derive(Debug, Clone)] pub struct BalanceDetails { /// The total balance of our on-chain wallet. @@ -1461,22 +1636,24 @@ impl From for LightningBalance { channel_id, counterparty_node_id, amount_satoshis, - } => LightningBalance::ClaimableOnChannelClose { - channel_id: channel_id.into(), - counterparty_node_id: counterparty_node_id.into(), - 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, - }, + } => + 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, @@ -1484,49 +1661,53 @@ impl From for LightningBalance { 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(), - }, + } => + 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(), - }, + } => + 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(), - }, + } => + 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, - }, + } => + LightningBalance::CounterpartyRevokedOutputClaimable { + channel_id: channel_id.into(), + counterparty_node_id: counterparty_node_id.into(), + amount_satoshis, + }, } } } @@ -1576,37 +1757,37 @@ pub enum PendingSweepBalance { 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::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, - }, + } => + 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, - }, + } => + 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, + }, } } } @@ -1673,8 +1854,7 @@ impl From for NodeStatus { 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, + latest_node_announcement_broadcast_timestamp: value.latest_node_announcement_broadcast_timestamp, } } } From bf4c5583b7fa1e3612cbc604ff9cbc68a9b4fef3 Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Mon, 24 Jun 2024 23:47:00 -0400 Subject: [PATCH 04/48] refactor: moved payment handlers --- lib/src/generated/api/bolt11.dart | 85 ++++++++++++++++++++ lib/src/generated/api/on_chain.dart | 44 +++++++++++ lib/src/generated/api/spontaneous.dart | 40 ++++++++++ rust/src/api/bolt11.rs | 103 +++++++++++++++++++++++++ rust/src/api/on_chain.rs | 31 ++++++++ rust/src/api/spontaneous.rs | 21 +++++ 6 files changed, 324 insertions(+) create mode 100644 lib/src/generated/api/bolt11.dart create mode 100644 lib/src/generated/api/on_chain.dart create mode 100644 lib/src/generated/api/spontaneous.dart create mode 100644 rust/src/api/bolt11.rs create mode 100644 rust/src/api/on_chain.rs create mode 100644 rust/src/api/spontaneous.rs diff --git a/lib/src/generated/api/bolt11.dart b/lib/src/generated/api/bolt11.dart new file mode 100644 index 0000000..86a85eb --- /dev/null +++ b/lib/src/generated/api/bolt11.dart @@ -0,0 +1,85 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0. + +// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import + +import '../frb_generated.dart'; +import '../lib.dart'; +import '../utils/error.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; +import 'types.dart'; + +// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `from` + +class LdkBolt11Payment { + final Bolt11Payment ptr; + + const LdkBolt11Payment({ + required this.ptr, + }); + + Future receive( + {required BigInt amountMsat, + required String description, + required int expirySecs}) => + core.instance.api.crateApiBolt11LdkBolt11PaymentReceive( + that: this, + amountMsat: amountMsat, + description: description, + expirySecs: expirySecs); + + Future receiveVariableAmount( + {required String description, required int expirySecs}) => + core.instance.api.crateApiBolt11LdkBolt11PaymentReceiveVariableAmount( + that: this, description: description, expirySecs: expirySecs); + + Future receiveVariableAmountViaJitChannel( + {required String description, + required int expirySecs, + BigInt? maxProportionalLspFeeLimitPpmMsat}) => + core.instance.api + .crateApiBolt11LdkBolt11PaymentReceiveVariableAmountViaJitChannel( + that: this, + description: description, + expirySecs: expirySecs, + maxProportionalLspFeeLimitPpmMsat: + maxProportionalLspFeeLimitPpmMsat); + + Future receiveViaJitChannel( + {required BigInt amountMsat, + required String description, + required int expirySecs, + BigInt? maxTotalLspFeeLimitMsat}) => + core.instance.api.crateApiBolt11LdkBolt11PaymentReceiveViaJitChannel( + that: this, + amountMsat: amountMsat, + description: description, + expirySecs: expirySecs, + maxTotalLspFeeLimitMsat: maxTotalLspFeeLimitMsat); + + Future send({required Bolt11Invoice invoice}) => core.instance.api + .crateApiBolt11LdkBolt11PaymentSend(that: this, invoice: invoice); + + Future sendProbes({required Bolt11Invoice invoice}) => core.instance.api + .crateApiBolt11LdkBolt11PaymentSendProbes(that: this, invoice: invoice); + + Future sendProbesUsingAmount( + {required Bolt11Invoice invoice, required BigInt amountMsat}) => + core.instance.api.crateApiBolt11LdkBolt11PaymentSendProbesUsingAmount( + that: this, invoice: invoice, amountMsat: amountMsat); + + Future sendUsingAmount( + {required Bolt11Invoice invoice, required BigInt amountMsat}) => + core.instance.api.crateApiBolt11LdkBolt11PaymentSendUsingAmount( + that: this, invoice: invoice, amountMsat: amountMsat); + + @override + int get hashCode => ptr.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LdkBolt11Payment && + runtimeType == other.runtimeType && + ptr == other.ptr; +} diff --git a/lib/src/generated/api/on_chain.dart b/lib/src/generated/api/on_chain.dart new file mode 100644 index 0000000..2679842 --- /dev/null +++ b/lib/src/generated/api/on_chain.dart @@ -0,0 +1,44 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0. + +// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import + +import '../frb_generated.dart'; +import '../lib.dart'; +import '../utils/error.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; +import 'types.dart'; + +// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `from` + +class LdkOnChainPayment { + final OnchainPayment ptr; + + const LdkOnChainPayment({ + required this.ptr, + }); + + Future
newAddress() => + core.instance.api.crateApiOnChainLdkOnChainPaymentNewAddress( + that: this, + ); + + Future sendAllToAddress({required Address address}) => + core.instance.api.crateApiOnChainLdkOnChainPaymentSendAllToAddress( + that: this, address: address); + + Future sendToAddress( + {required Address address, required BigInt amountSats}) => + core.instance.api.crateApiOnChainLdkOnChainPaymentSendToAddress( + that: this, address: address, amountSats: amountSats); + + @override + int get hashCode => ptr.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LdkOnChainPayment && + runtimeType == other.runtimeType && + ptr == other.ptr; +} diff --git a/lib/src/generated/api/spontaneous.dart b/lib/src/generated/api/spontaneous.dart new file mode 100644 index 0000000..adad377 --- /dev/null +++ b/lib/src/generated/api/spontaneous.dart @@ -0,0 +1,40 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0. + +// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import + +import '../frb_generated.dart'; +import '../lib.dart'; +import '../utils/error.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; +import 'types.dart'; + +// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `from` + +class LdkSpontaneousPayment { + final SpontaneousPayment ptr; + + const LdkSpontaneousPayment({ + required this.ptr, + }); + + Future send( + {required BigInt amountMsat, required PublicKey nodeId}) => + core.instance.api.crateApiSpontaneousLdkSpontaneousPaymentSend( + that: this, amountMsat: amountMsat, nodeId: nodeId); + + Future sendProbes( + {required BigInt amountMsat, required PublicKey nodeId}) => + core.instance.api.crateApiSpontaneousLdkSpontaneousPaymentSendProbes( + that: this, amountMsat: amountMsat, nodeId: nodeId); + + @override + int get hashCode => ptr.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LdkSpontaneousPayment && + runtimeType == other.runtimeType && + ptr == other.ptr; +} diff --git a/rust/src/api/bolt11.rs b/rust/src/api/bolt11.rs new file mode 100644 index 0000000..71d2342 --- /dev/null +++ b/rust/src/api/bolt11.rs @@ -0,0 +1,103 @@ +use crate::api::types::{Bolt11Invoice, PaymentId}; +use crate::frb_generated::RustOpaque; +use crate::utils::error::LdkNodeError; + +pub struct LdkBolt11Payment { + pub ptr:RustOpaque +} +impl From for LdkBolt11Payment { + fn from(value: ldk_node::payment::Bolt11Payment) -> Self { + LdkBolt11Payment {ptr:RustOpaque::new(value)} + } +} + + +impl LdkBolt11Payment { + pub fn receive( + &self, + amount_msat: u64, + description: String, + expiry_secs: u32, + ) -> anyhow::Result { + self.ptr + .receive(amount_msat, description.as_str(), expiry_secs) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + pub fn receive_variable_amount( + &self, + description: String, + expiry_secs: u32, + ) -> anyhow::Result { + self.ptr + .receive_variable_amount + (description.as_str(), expiry_secs) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + pub fn receive_variable_amount_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_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_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_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 send_probes(&self, invoice: Bolt11Invoice) -> anyhow::Result<(), LdkNodeError> { + self.ptr + .send_probes(&(invoice.try_into()?)) + .map_err(|e| e.into()) + } + + + pub fn send_probes_using_amount( + &self, + invoice: Bolt11Invoice, + amount_msat: u64, + ) -> Result<(), LdkNodeError> { + self.ptr + .send_probes_using_amount(&(invoice.try_into()?), amount_msat) + .map_err(|e| e.into()) + } + + pub fn send(&self, invoice: Bolt11Invoice) -> Result { + self.ptr.send(&(invoice.try_into()?)).map_err(|e| e.into()).map(|e| e.into()) + } + pub fn send_using_amount( + &self, + invoice: Bolt11Invoice, + amount_msat: u64, + ) -> anyhow::Result { + self.ptr + .send_using_amount(&(invoice.try_into()?), amount_msat) + .map_err(|e| e.into()) + .map(|e| e.into()) + } +} \ No newline at end of file diff --git a/rust/src/api/on_chain.rs b/rust/src/api/on_chain.rs new file mode 100644 index 0000000..2bece90 --- /dev/null +++ b/rust/src/api/on_chain.rs @@ -0,0 +1,31 @@ + +use crate::api::types::{Address, Txid}; +use crate::frb_generated::RustOpaque; +use crate::utils::error::LdkNodeError; + +pub struct LdkOnChainPayment { + pub ptr:RustOpaque +} +impl From for LdkOnChainPayment { + fn from(value: ldk_node::payment::OnchainPayment) -> Self { + LdkOnChainPayment {ptr:RustOpaque::new(value)} + } +} + +impl LdkOnChainPayment { + pub fn new_address(&self) -> Result { + self.ptr.new_address().map_err(|e| e.into()).map(|e| e.into()) + } + pub fn send_to_address( + &self, address: Address, amount_sats: u64, + ) -> Result { + self.ptr.send_to_address(&(address.try_into()?), amount_sats).map_err(|e| e.into()).map(|e| e.into()) + } + pub fn send_all_to_address( + &self, address: Address, + ) -> Result { + self.ptr.send_all_to_address(&(address.try_into()?)).map_err(|e| e.into()).map(|e| e.into()) + } + + +} \ No newline at end of file diff --git a/rust/src/api/spontaneous.rs b/rust/src/api/spontaneous.rs new file mode 100644 index 0000000..96e1147 --- /dev/null +++ b/rust/src/api/spontaneous.rs @@ -0,0 +1,21 @@ + +use crate::api::types::{PaymentId, PublicKey}; +use crate::frb_generated::RustOpaque; +use crate::utils::error::LdkNodeError; + +pub struct LdkSpontaneousPayment { + pub ptr:RustOpaque +} +impl From for LdkSpontaneousPayment { + fn from(value: ldk_node::payment::SpontaneousPayment) -> Self { + Self{ptr:RustOpaque::new(value)} + } +} +impl LdkSpontaneousPayment { + pub fn send(&self, amount_msat: u64, node_id: PublicKey) -> Result { + self.ptr.send(amount_msat, node_id.try_into()?).map_err(|e| e.into()).map(|e| e.into()) + } + pub fn send_probes(&self, amount_msat: u64, node_id: PublicKey) -> Result<(), LdkNodeError> { + self.ptr.send_probes(amount_msat, node_id.try_into()?).map_err(|e| e.into()).map(|e| e.into()) + } +} From 30d610fe3237265f5f9e8fa61226f1347b04577c Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Tue, 25 Jun 2024 09:56:00 -0400 Subject: [PATCH 05/48] refactor: builder moved --- lib/src/generated/api/builder.dart | 61 +++++++++++++++ rust/src/api/builder.rs | 121 +++++++++++++++++++++++++++++ 2 files changed, 182 insertions(+) create mode 100644 lib/src/generated/api/builder.dart create mode 100644 rust/src/api/builder.rs diff --git a/lib/src/generated/api/builder.dart b/lib/src/generated/api/builder.dart new file mode 100644 index 0000000..a6fd072 --- /dev/null +++ b/lib/src/generated/api/builder.dart @@ -0,0 +1,61 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0. + +// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import + +import '../frb_generated.dart'; +import '../lib.dart'; +import '../utils/error.dart'; +import 'node.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; +import 'types.dart'; + +// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `clone`, `fmt`, `from`, `try_from` + +// Rust type: RustOpaqueNom> +abstract class NodeBuilder implements RustOpaqueInterface { + Builder get builder; + + void set builder(Builder builder); + + Future build(); + + Future buildWithFsStore(); + + static Future createBuilder( + {required Config config, + ChainDataSourceConfig? chainDataSourceConfig, + EntropySourceConfig? entropySourceConfig, + GossipSourceConfig? gossipSourceConfig, + LiquiditySourceConfig? liquiditySourceConfig}) => + core.instance.api.crateApiBuilderNodeBuilderCreateBuilder( + config: config, + chainDataSourceConfig: chainDataSourceConfig, + entropySourceConfig: entropySourceConfig, + gossipSourceConfig: gossipSourceConfig, + liquiditySourceConfig: liquiditySourceConfig); +} + +// Rust type: RustOpaqueNom +abstract class Builder implements RustOpaqueInterface {} + +class LdkMnemonic { + final String seedPhrase; + + const LdkMnemonic({ + required this.seedPhrase, + }); + + static Future generate() => + core.instance.api.crateApiBuilderLdkMnemonicGenerate(); + + @override + int get hashCode => seedPhrase.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LdkMnemonic && + runtimeType == other.runtimeType && + seedPhrase == other.seedPhrase; +} diff --git a/rust/src/api/builder.rs b/rust/src/api/builder.rs new file mode 100644 index 0000000..5d1d1f3 --- /dev/null +++ b/rust/src/api/builder.rs @@ -0,0 +1,121 @@ +use std::str::FromStr; +use flutter_rust_bridge::frb; +use ldk_node::lightning::util::ser::Writeable; +use crate::api::node::LdkNode; +use crate::api::types::{ChainDataSourceConfig, Config, EntropySourceConfig, GossipSourceConfig, LiquiditySourceConfig}; +use crate::frb_generated::RustOpaque; +use crate::utils::error::LdkBuilderError; + +#[derive(Debug, Clone)] +pub struct LdkMnemonic { + pub seed_phrase: String, +} + +impl TryFrom for ldk_node::bip39::Mnemonic { + type Error = LdkBuilderError; + + fn try_from(value: LdkMnemonic) -> Result { + ldk_node::bip39::Mnemonic::from_str(&value.seed_phrase).map_err(|e| e.into()) + } +} +impl From for LdkMnemonic { + fn from(value: ldk_node::bip39::Mnemonic) -> Self { + LdkMnemonic { + seed_phrase: value.to_string(), + } + } +} +impl LdkMnemonic { + pub fn generate() -> LdkMnemonic { + ldk_node::generate_entropy_mnemonic().into() + } +} + +#[frb(opaque)] +pub struct NodeBuilder { + pub builder: RustOpaque +} + +impl NodeBuilder { + pub fn create_builder( + config: Config, + 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.try_into()?); + if let Some(source) = entropy_source_config { + match source { + EntropySourceConfig::SeedFile(e) => builder.set_entropy_seed_path(e), + EntropySourceConfig::SeedBytes(e) => builder.set_entropy_seed_bytes(e.encode())?, + EntropySourceConfig::Bip39Mnemonic { + mnemonic, + passphrase, + } => builder.set_entropy_bip39_mnemonic(>::try_into(mnemonic)?, passphrase), + }; + } + if let Some(source) = chain_data_source_config { + match source { + ChainDataSourceConfig::Esplora(e) => builder.set_esplora_server(e), + }; + } + if let Some(source) = gossip_source_config { + match source { + GossipSourceConfig::P2PNetwork => builder.set_gossip_source_p2p(), + 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.try_into()?, + liquidity.lsps2_service.1.try_into().map_err(|_| LdkBuilderError::InvalidPublicKey)?, + liquidity.lsps2_service.2, + ); + } + Ok(NodeBuilder { builder: RustOpaque::new(builder) }) + } + pub fn build( + self + ) -> anyhow::Result { + + match self.builder.build() { + Ok(e) => Ok(LdkNode { + ptr: RustOpaque::new(e), + }), + Err(e) => Err(e.into()), + } + } + pub fn build_with_fs_store( + self + ) -> anyhow::Result { + + match self.builder.build_with_fs_store() { + Ok(e) => Ok(LdkNode { + ptr: RustOpaque::new(e), + }), + Err(e) => Err(e.into()), + } + } +// fn build_with_store( +// self +// ) -> anyhow::Result { +// match self.builder.build_with_store(Arc::new(())) { +// Ok(e) => Ok(LdkNode { +// ptr: RustOpaque::new(e), +// }), +// Err(e) => Err(e.into()), +// } +// } +} + +// pub fn build_with_vss_store( +// self, url: String, store_id: String +// ) -> anyhow::Result { +// match self.builder.build_with_vss_store(url, store_id) { +// Ok(e) => Ok(LdkNode { +// ptr: RustOpaque::new(e), +// }), +// Err(e) => Err(e.into()), +// } +// } \ No newline at end of file From 6c2febd9a31963ce643895d2be4e56fdbd325b03 Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Tue, 25 Jun 2024 10:06:00 -0400 Subject: [PATCH 06/48] code cleanup --- flutter_rust_bridge.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/flutter_rust_bridge.yaml b/flutter_rust_bridge.yaml index 8524d59..53f8e62 100644 --- a/flutter_rust_bridge.yaml +++ b/flutter_rust_bridge.yaml @@ -1,5 +1,8 @@ -rust_input: rust/src/api/*.rs +rust_input: crate::api +rust_root: rust/ dart_output: lib/src/generated/ full_dep: true +web: false +dart3: true c_output: ios/Classes/frb_generated.h -dart_entrypoint_class_name: LdkCore \ No newline at end of file +dart_entrypoint_class_name: core \ No newline at end of file From 3010ecc99e70be48a9344c9793f3b379671eae55 Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Tue, 25 Jun 2024 10:08:00 -0400 Subject: [PATCH 07/48] refactor frb codegen version updated to 2.0.0 --- makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefile b/makefile index 5a42da9..a003e3c 100644 --- a/makefile +++ b/makefile @@ -11,7 +11,7 @@ help: makefile ## init: Install missing dependencies. init: - cargo install flutter_rust_bridge_codegen --version 2.0.0-dev.31 + cargo install flutter_rust_bridge_codegen --version 2.0.0 ## : all: init generate-bindings From f7699b9cc05c8bdfab1acaf3185369b2ff375aed Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Tue, 25 Jun 2024 10:12:00 -0400 Subject: [PATCH 08/48] code cleanup --- lib/src/utils/utils.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/utils/utils.dart b/lib/src/utils/utils.dart index 0f77fa2..2f58dbf 100644 --- a/lib/src/utils/utils.dart +++ b/lib/src/utils/utils.dart @@ -7,8 +7,8 @@ export 'exceptions.dart'; class Frb { static Future verifyInit() async { try { - if (!LdkCore.instance.initialized) { - await LdkCore.init(); + if (!core.instance.initialized) { + await core.init(); } } catch (e) { debugPrint(e.toString()); From 8aea7d068de9a018a149a5c29ab5cfd3a3d32b78 Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Tue, 25 Jun 2024 20:09:00 -0400 Subject: [PATCH 09/48] version updated to 0.3.0 --- example/pubspec.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index 448ccf8..d7b0271 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -169,7 +169,7 @@ packages: path: ".." relative: true source: path - version: "0.2.3-dev" + version: "0.3.0" leak_tracker: dependency: transitive description: From 56f2fa9bceda63cf883bf052a67880192bb16bd7 Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Wed, 26 Jun 2024 08:42:00 -0400 Subject: [PATCH 10/48] moved error to utils --- lib/src/generated/api/error.dart | 154 - lib/src/generated/utils/error.dart | 248 + lib/src/generated/utils/error.freezed.dart | 26142 +++++++++++++++++++ rust/src/api/error.rs | 182 - rust/src/utils/error.rs | 256 + rust/src/utils/mod.rs | 1 + 6 files changed, 26647 insertions(+), 336 deletions(-) delete mode 100644 lib/src/generated/api/error.dart create mode 100644 lib/src/generated/utils/error.dart create mode 100644 lib/src/generated/utils/error.freezed.dart delete mode 100644 rust/src/api/error.rs create mode 100644 rust/src/utils/error.rs create mode 100644 rust/src/utils/mod.rs diff --git a/lib/src/generated/api/error.dart b/lib/src/generated/api/error.dart deleted file mode 100644 index 8a720f1..0000000 --- a/lib/src/generated/api/error.dart +++ /dev/null @@ -1,154 +0,0 @@ -// This file is automatically generated, so please do not edit it. -// 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 BuilderException { - socketAddressParseError, - - /// The given seed bytes are invalid, e.g., have invalid length. - invalidSeedBytes, - - /// The given seed file is invalid, e.g., has invalid length, or could not be read. - invalidSeedFile, - - /// The current system time is invalid, clocks might have gone backwards. - invalidSystemTime, - - /// The a read channel monitor is invalid. - invalidChannelMonitor, - - /// The given listening addresses are invalid, e.g. too many were passed. - invalidListeningAddress, - - /// We failed to read data from the [`KVStore`]. - readFailed, - - /// We failed to write data to the [`KVStore`]. - writeFailed, - - /// We failed to access the given `storage_dir_path`. - storagePathAccessFailed, - - /// We failed to setup our [`KVStore`]. - kvStoreSetupFailed, - - /// We failed to setup the onchain wallet. - walletSetupFailed, - - /// We failed to setup the logger. - loggerSetupFailed, - invalidPublicKey, -} - -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. - notRunning, - - /// An on-chain transaction could not be created. - onchainTxCreationFailed, - - /// A network connection has been closed. - connectionFailed, - - /// Invoice creation failed. - invoiceCreationFailed, - - /// Sending a payment has failed. - paymentSendingFailed, - - /// Sending a payment probe has failed. - probeSendingFailed, - - /// A channel could not be opened. - channelCreationFailed, - - /// A channel could not be closed. - channelClosingFailed, - - /// A channel config could not be updated. - channelConfigUpdateFailed, - - /// Persistence failed. - persistenceFailed, - - /// A wallet operation failed. - walletOperationFailed, - - /// A signing operation for transaction failed. - onchainTxSigningFailed, - - /// A signing operation for message failed. - messageSigningFailed, - - /// A transaction sync operation failed. - txSyncFailed, - - /// A gossip updating operation failed. - gossipUpdateFailed, - - /// The given address is invalid. - invalidAddress, - - /// The given network address is invalid. - invalidSocketAddress, - - /// The given public key is invalid. - invalidPublicKey, - - /// The given secret key is invalid. - invalidSecretKey, - - /// The given payment hash is invalid. - invalidPaymentHash, - - /// The given payment preimage is invalid. - invalidPaymentPreimage, - - /// The given payment secret is invalid. - invalidPaymentSecret, - - /// The given amount is invalid. - invalidAmount, - - /// The given invoice is invalid. - invalidInvoice, - - /// The given channel ID is invalid. - invalidChannelId, - - /// The given network is invalid. - invalidNetwork, - - /// A payment with the given hash has already been initiated. - duplicatePayment, - - /// There are insufficient funds to complete the given operation. - insufficientFunds, - - ///A fee rate estimation update failed. - feerateEstimationUpdateFailed, - - ///A liquidity request operation failed. - liquidityRequestFailed, - - ///The given operation failed due to the required liquidity source being unavailable. - liquiditySourceUnavailable, - - ///The given operation failed due to the LSP's required opening fee being too high. - liquidityFeeTooHigh, - - ///The given payment id is invalid. - invalidPaymentId, - - ///An error in decoding a message or struct. - decodeError, -} diff --git a/lib/src/generated/utils/error.dart b/lib/src/generated/utils/error.dart new file mode 100644 index 0000000..a6e5d22 --- /dev/null +++ b/lib/src/generated/utils/error.dart @@ -0,0 +1,248 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0. + +// 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'; +import 'package:freezed_annotation/freezed_annotation.dart' hide protected; +part 'error.freezed.dart'; + +@freezed +sealed class Bolt12ParseError with _$Bolt12ParseError { + const Bolt12ParseError._(); + + const factory Bolt12ParseError.invalidContinuation() = + Bolt12ParseError_InvalidContinuation; + const factory Bolt12ParseError.invalidBech32Hrp() = + Bolt12ParseError_InvalidBech32Hrp; + const factory Bolt12ParseError.bech32( + String field0, + ) = Bolt12ParseError_Bech32; + const factory Bolt12ParseError.decode( + DecodeError field0, + ) = Bolt12ParseError_Decode; + const factory Bolt12ParseError.invalidSemantics( + String field0, + ) = Bolt12ParseError_InvalidSemantics; + const factory Bolt12ParseError.invalidSignature( + String field0, + ) = Bolt12ParseError_InvalidSignature; +} + +@freezed +sealed class DecodeError with _$DecodeError { + const DecodeError._(); + + const factory DecodeError.unknownVersion() = DecodeError_UnknownVersion; + const factory DecodeError.unknownRequiredFeature() = + DecodeError_UnknownRequiredFeature; + const factory DecodeError.invalidValue() = DecodeError_InvalidValue; + const factory DecodeError.shortRead() = DecodeError_ShortRead; + const factory DecodeError.badLengthDescriptor() = + DecodeError_BadLengthDescriptor; + const factory DecodeError.io( + String field0, + ) = DecodeError_Io; + const factory DecodeError.unsupportedCompression() = + DecodeError_UnsupportedCompression; + const factory DecodeError.dangerousValue() = DecodeError_DangerousValue; +} + +enum LdkBuilderError { + socketAddressParseError, + + /// The given seed bytes are invalid, e.g., have invalid length. + invalidSeedBytes, + + /// The given seed file is invalid, e.g., has invalid length, or could not be read. + invalidSeedFile, + + /// The current system time is invalid, clocks might have gone backwards. + invalidSystemTime, + + /// The a read channel monitor is invalid. + invalidChannelMonitor, + + /// The given listening addresses are invalid, e.g. too many were passed. + invalidListeningAddress, + + /// We failed to read data from the [`KVStore`]. + readFailed, + + /// We failed to write data to the [`KVStore`]. + writeFailed, + + /// We failed to access the given `storage_dir_path`. + storagePathAccessFailed, + + /// We failed to setup our [`KVStore`]. + kvStoreSetupFailed, + + /// We failed to setup the onchain wallet. + walletSetupFailed, + + /// We failed to setup the logger. + loggerSetupFailed, + invalidPublicKey, + ; +} + +@freezed +sealed class LdkNodeError with _$LdkNodeError implements FrbException { + const LdkNodeError._(); + + const factory LdkNodeError.invalidTxid() = LdkNodeError_InvalidTxid; + + /// Returned when trying to start [Node] while it is already running. + const factory LdkNodeError.alreadyRunning() = LdkNodeError_AlreadyRunning; + + /// Returned when trying to stop [Node] while it is not running. + const factory LdkNodeError.notRunning() = LdkNodeError_NotRunning; + + /// An on-chain transaction could not be created. + const factory LdkNodeError.onchainTxCreationFailed() = + LdkNodeError_OnchainTxCreationFailed; + + /// A network connection has been closed. + const factory LdkNodeError.connectionFailed() = LdkNodeError_ConnectionFailed; + + /// Invoice creation failed. + const factory LdkNodeError.invoiceCreationFailed() = + LdkNodeError_InvoiceCreationFailed; + + /// Sending a payment has failed. + const factory LdkNodeError.paymentSendingFailed() = + LdkNodeError_PaymentSendingFailed; + + /// Sending a payment probe has failed. + const factory LdkNodeError.probeSendingFailed() = + LdkNodeError_ProbeSendingFailed; + + /// A channel could not be opened. + const factory LdkNodeError.channelCreationFailed() = + LdkNodeError_ChannelCreationFailed; + + /// A channel could not be closed. + const factory LdkNodeError.channelClosingFailed() = + LdkNodeError_ChannelClosingFailed; + + /// A channel config could not be updated. + const factory LdkNodeError.channelConfigUpdateFailed() = + LdkNodeError_ChannelConfigUpdateFailed; + + /// Persistence failed. + const factory LdkNodeError.persistenceFailed() = + LdkNodeError_PersistenceFailed; + + /// A wallet operation failed. + const factory LdkNodeError.walletOperationFailed() = + LdkNodeError_WalletOperationFailed; + + /// A signing operation for transaction failed. + const factory LdkNodeError.onchainTxSigningFailed() = + LdkNodeError_OnchainTxSigningFailed; + + /// A signing operation for message failed. + const factory LdkNodeError.messageSigningFailed() = + LdkNodeError_MessageSigningFailed; + + /// A transaction sync operation failed. + const factory LdkNodeError.txSyncFailed() = LdkNodeError_TxSyncFailed; + + /// A gossip updating operation failed. + const factory LdkNodeError.gossipUpdateFailed() = + LdkNodeError_GossipUpdateFailed; + + /// The given address is invalid. + const factory LdkNodeError.invalidAddress() = LdkNodeError_InvalidAddress; + + /// The given network address is invalid. + const factory LdkNodeError.invalidSocketAddress() = + LdkNodeError_InvalidSocketAddress; + + /// The given public key is invalid. + const factory LdkNodeError.invalidPublicKey() = LdkNodeError_InvalidPublicKey; + + /// The given secret key is invalid. + const factory LdkNodeError.invalidSecretKey() = LdkNodeError_InvalidSecretKey; + + /// The given payment hash is invalid. + const factory LdkNodeError.invalidPaymentHash() = + LdkNodeError_InvalidPaymentHash; + + /// The given payment preimage is invalid. + const factory LdkNodeError.invalidPaymentPreimage() = + LdkNodeError_InvalidPaymentPreimage; + + /// The given payment secret is invalid. + const factory LdkNodeError.invalidPaymentSecret() = + LdkNodeError_InvalidPaymentSecret; + + /// The given amount is invalid. + const factory LdkNodeError.invalidAmount() = LdkNodeError_InvalidAmount; + + /// The given invoice is invalid. + const factory LdkNodeError.invalidInvoice() = LdkNodeError_InvalidInvoice; + + /// The given channel ID is invalid. + const factory LdkNodeError.invalidChannelId() = LdkNodeError_InvalidChannelId; + + /// The given network is invalid. + const factory LdkNodeError.invalidNetwork() = LdkNodeError_InvalidNetwork; + + /// A payment with the given hash has already been initiated. + const factory LdkNodeError.duplicatePayment() = LdkNodeError_DuplicatePayment; + + /// There are insufficient funds to complete the given operation. + const factory LdkNodeError.insufficientFunds() = + LdkNodeError_InsufficientFunds; + + ///A fee rate estimation update failed. + const factory LdkNodeError.feerateEstimationUpdateFailed() = + LdkNodeError_FeerateEstimationUpdateFailed; + + ///A liquidity request operation failed. + const factory LdkNodeError.liquidityRequestFailed() = + LdkNodeError_LiquidityRequestFailed; + + ///The given operation failed due to the required liquidity source being unavailable. + const factory LdkNodeError.liquiditySourceUnavailable() = + LdkNodeError_LiquiditySourceUnavailable; + + ///The given operation failed due to the LSP's required opening fee being too high. + const factory LdkNodeError.liquidityFeeTooHigh() = + LdkNodeError_LiquidityFeeTooHigh; + + ///The given payment id is invalid. + const factory LdkNodeError.invalidPaymentId() = LdkNodeError_InvalidPaymentId; + + ///An error in decoding a message or struct. + const factory LdkNodeError.decode( + DecodeError field0, + ) = LdkNodeError_Decode; + + ///An error in decoding the Bolt12 offer. + const factory LdkNodeError.bolt12Parse( + Bolt12ParseError field0, + ) = LdkNodeError_Bolt12Parse; + const factory LdkNodeError.invoiceRequestCreationFailed() = + LdkNodeError_InvoiceRequestCreationFailed; + const factory LdkNodeError.offerCreationFailed() = + LdkNodeError_OfferCreationFailed; + const factory LdkNodeError.refundCreationFailed() = + LdkNodeError_RefundCreationFailed; + const factory LdkNodeError.feerateEstimationUpdateTimeout() = + LdkNodeError_FeerateEstimationUpdateTimeout; + const factory LdkNodeError.walletOperationTimeout() = + LdkNodeError_WalletOperationTimeout; + const factory LdkNodeError.txSyncTimeout() = LdkNodeError_TxSyncTimeout; + const factory LdkNodeError.gossipUpdateTimeout() = + LdkNodeError_GossipUpdateTimeout; + const factory LdkNodeError.invalidOfferId() = LdkNodeError_InvalidOfferId; + const factory LdkNodeError.invalidNodeId() = LdkNodeError_InvalidNodeId; + const factory LdkNodeError.invalidOffer() = LdkNodeError_InvalidOffer; + const factory LdkNodeError.invalidRefund() = LdkNodeError_InvalidRefund; + const factory LdkNodeError.unsupportedCurrency() = + LdkNodeError_UnsupportedCurrency; +} diff --git a/lib/src/generated/utils/error.freezed.dart b/lib/src/generated/utils/error.freezed.dart new file mode 100644 index 0000000..2f4dd6b --- /dev/null +++ b/lib/src/generated/utils/error.freezed.dart @@ -0,0 +1,26142 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'error.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + +/// @nodoc +mixin _$Bolt12ParseError { + @optionalTypeArgs + TResult when({ + required TResult Function() invalidContinuation, + required TResult Function() invalidBech32Hrp, + required TResult Function(String field0) bech32, + required TResult Function(DecodeError field0) decode, + required TResult Function(String field0) invalidSemantics, + required TResult Function(String field0) invalidSignature, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidContinuation, + TResult? Function()? invalidBech32Hrp, + TResult? Function(String field0)? bech32, + TResult? Function(DecodeError field0)? decode, + TResult? Function(String field0)? invalidSemantics, + TResult? Function(String field0)? invalidSignature, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidContinuation, + TResult Function()? invalidBech32Hrp, + TResult Function(String field0)? bech32, + TResult Function(DecodeError field0)? decode, + TResult Function(String field0)? invalidSemantics, + TResult Function(String field0)? invalidSignature, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map({ + required TResult Function(Bolt12ParseError_InvalidContinuation value) + invalidContinuation, + required TResult Function(Bolt12ParseError_InvalidBech32Hrp value) + invalidBech32Hrp, + required TResult Function(Bolt12ParseError_Bech32 value) bech32, + required TResult Function(Bolt12ParseError_Decode value) decode, + required TResult Function(Bolt12ParseError_InvalidSemantics value) + invalidSemantics, + required TResult Function(Bolt12ParseError_InvalidSignature value) + invalidSignature, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult? Function(Bolt12ParseError_InvalidBech32Hrp value)? + invalidBech32Hrp, + TResult? Function(Bolt12ParseError_Bech32 value)? bech32, + TResult? Function(Bolt12ParseError_Decode value)? decode, + TResult? Function(Bolt12ParseError_InvalidSemantics value)? + invalidSemantics, + TResult? Function(Bolt12ParseError_InvalidSignature value)? + invalidSignature, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult Function(Bolt12ParseError_InvalidBech32Hrp value)? invalidBech32Hrp, + TResult Function(Bolt12ParseError_Bech32 value)? bech32, + TResult Function(Bolt12ParseError_Decode value)? decode, + TResult Function(Bolt12ParseError_InvalidSemantics value)? invalidSemantics, + TResult Function(Bolt12ParseError_InvalidSignature value)? invalidSignature, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $Bolt12ParseErrorCopyWith<$Res> { + factory $Bolt12ParseErrorCopyWith( + Bolt12ParseError value, $Res Function(Bolt12ParseError) then) = + _$Bolt12ParseErrorCopyWithImpl<$Res, Bolt12ParseError>; +} + +/// @nodoc +class _$Bolt12ParseErrorCopyWithImpl<$Res, $Val extends Bolt12ParseError> + implements $Bolt12ParseErrorCopyWith<$Res> { + _$Bolt12ParseErrorCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; +} + +/// @nodoc +abstract class _$$Bolt12ParseError_InvalidContinuationImplCopyWith<$Res> { + factory _$$Bolt12ParseError_InvalidContinuationImplCopyWith( + _$Bolt12ParseError_InvalidContinuationImpl value, + $Res Function(_$Bolt12ParseError_InvalidContinuationImpl) then) = + __$$Bolt12ParseError_InvalidContinuationImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$Bolt12ParseError_InvalidContinuationImplCopyWithImpl<$Res> + extends _$Bolt12ParseErrorCopyWithImpl<$Res, + _$Bolt12ParseError_InvalidContinuationImpl> + implements _$$Bolt12ParseError_InvalidContinuationImplCopyWith<$Res> { + __$$Bolt12ParseError_InvalidContinuationImplCopyWithImpl( + _$Bolt12ParseError_InvalidContinuationImpl _value, + $Res Function(_$Bolt12ParseError_InvalidContinuationImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$Bolt12ParseError_InvalidContinuationImpl + extends Bolt12ParseError_InvalidContinuation { + const _$Bolt12ParseError_InvalidContinuationImpl() : super._(); + + @override + String toString() { + return 'Bolt12ParseError.invalidContinuation()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Bolt12ParseError_InvalidContinuationImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidContinuation, + required TResult Function() invalidBech32Hrp, + required TResult Function(String field0) bech32, + required TResult Function(DecodeError field0) decode, + required TResult Function(String field0) invalidSemantics, + required TResult Function(String field0) invalidSignature, + }) { + return invalidContinuation(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidContinuation, + TResult? Function()? invalidBech32Hrp, + TResult? Function(String field0)? bech32, + TResult? Function(DecodeError field0)? decode, + TResult? Function(String field0)? invalidSemantics, + TResult? Function(String field0)? invalidSignature, + }) { + return invalidContinuation?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidContinuation, + TResult Function()? invalidBech32Hrp, + TResult Function(String field0)? bech32, + TResult Function(DecodeError field0)? decode, + TResult Function(String field0)? invalidSemantics, + TResult Function(String field0)? invalidSignature, + required TResult orElse(), + }) { + if (invalidContinuation != null) { + return invalidContinuation(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Bolt12ParseError_InvalidContinuation value) + invalidContinuation, + required TResult Function(Bolt12ParseError_InvalidBech32Hrp value) + invalidBech32Hrp, + required TResult Function(Bolt12ParseError_Bech32 value) bech32, + required TResult Function(Bolt12ParseError_Decode value) decode, + required TResult Function(Bolt12ParseError_InvalidSemantics value) + invalidSemantics, + required TResult Function(Bolt12ParseError_InvalidSignature value) + invalidSignature, + }) { + return invalidContinuation(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult? Function(Bolt12ParseError_InvalidBech32Hrp value)? + invalidBech32Hrp, + TResult? Function(Bolt12ParseError_Bech32 value)? bech32, + TResult? Function(Bolt12ParseError_Decode value)? decode, + TResult? Function(Bolt12ParseError_InvalidSemantics value)? + invalidSemantics, + TResult? Function(Bolt12ParseError_InvalidSignature value)? + invalidSignature, + }) { + return invalidContinuation?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult Function(Bolt12ParseError_InvalidBech32Hrp value)? invalidBech32Hrp, + TResult Function(Bolt12ParseError_Bech32 value)? bech32, + TResult Function(Bolt12ParseError_Decode value)? decode, + TResult Function(Bolt12ParseError_InvalidSemantics value)? invalidSemantics, + TResult Function(Bolt12ParseError_InvalidSignature value)? invalidSignature, + required TResult orElse(), + }) { + if (invalidContinuation != null) { + return invalidContinuation(this); + } + return orElse(); + } +} + +abstract class Bolt12ParseError_InvalidContinuation extends Bolt12ParseError { + const factory Bolt12ParseError_InvalidContinuation() = + _$Bolt12ParseError_InvalidContinuationImpl; + const Bolt12ParseError_InvalidContinuation._() : super._(); +} + +/// @nodoc +abstract class _$$Bolt12ParseError_InvalidBech32HrpImplCopyWith<$Res> { + factory _$$Bolt12ParseError_InvalidBech32HrpImplCopyWith( + _$Bolt12ParseError_InvalidBech32HrpImpl value, + $Res Function(_$Bolt12ParseError_InvalidBech32HrpImpl) then) = + __$$Bolt12ParseError_InvalidBech32HrpImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$Bolt12ParseError_InvalidBech32HrpImplCopyWithImpl<$Res> + extends _$Bolt12ParseErrorCopyWithImpl<$Res, + _$Bolt12ParseError_InvalidBech32HrpImpl> + implements _$$Bolt12ParseError_InvalidBech32HrpImplCopyWith<$Res> { + __$$Bolt12ParseError_InvalidBech32HrpImplCopyWithImpl( + _$Bolt12ParseError_InvalidBech32HrpImpl _value, + $Res Function(_$Bolt12ParseError_InvalidBech32HrpImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$Bolt12ParseError_InvalidBech32HrpImpl + extends Bolt12ParseError_InvalidBech32Hrp { + const _$Bolt12ParseError_InvalidBech32HrpImpl() : super._(); + + @override + String toString() { + return 'Bolt12ParseError.invalidBech32Hrp()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Bolt12ParseError_InvalidBech32HrpImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidContinuation, + required TResult Function() invalidBech32Hrp, + required TResult Function(String field0) bech32, + required TResult Function(DecodeError field0) decode, + required TResult Function(String field0) invalidSemantics, + required TResult Function(String field0) invalidSignature, + }) { + return invalidBech32Hrp(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidContinuation, + TResult? Function()? invalidBech32Hrp, + TResult? Function(String field0)? bech32, + TResult? Function(DecodeError field0)? decode, + TResult? Function(String field0)? invalidSemantics, + TResult? Function(String field0)? invalidSignature, + }) { + return invalidBech32Hrp?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidContinuation, + TResult Function()? invalidBech32Hrp, + TResult Function(String field0)? bech32, + TResult Function(DecodeError field0)? decode, + TResult Function(String field0)? invalidSemantics, + TResult Function(String field0)? invalidSignature, + required TResult orElse(), + }) { + if (invalidBech32Hrp != null) { + return invalidBech32Hrp(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Bolt12ParseError_InvalidContinuation value) + invalidContinuation, + required TResult Function(Bolt12ParseError_InvalidBech32Hrp value) + invalidBech32Hrp, + required TResult Function(Bolt12ParseError_Bech32 value) bech32, + required TResult Function(Bolt12ParseError_Decode value) decode, + required TResult Function(Bolt12ParseError_InvalidSemantics value) + invalidSemantics, + required TResult Function(Bolt12ParseError_InvalidSignature value) + invalidSignature, + }) { + return invalidBech32Hrp(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult? Function(Bolt12ParseError_InvalidBech32Hrp value)? + invalidBech32Hrp, + TResult? Function(Bolt12ParseError_Bech32 value)? bech32, + TResult? Function(Bolt12ParseError_Decode value)? decode, + TResult? Function(Bolt12ParseError_InvalidSemantics value)? + invalidSemantics, + TResult? Function(Bolt12ParseError_InvalidSignature value)? + invalidSignature, + }) { + return invalidBech32Hrp?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult Function(Bolt12ParseError_InvalidBech32Hrp value)? invalidBech32Hrp, + TResult Function(Bolt12ParseError_Bech32 value)? bech32, + TResult Function(Bolt12ParseError_Decode value)? decode, + TResult Function(Bolt12ParseError_InvalidSemantics value)? invalidSemantics, + TResult Function(Bolt12ParseError_InvalidSignature value)? invalidSignature, + required TResult orElse(), + }) { + if (invalidBech32Hrp != null) { + return invalidBech32Hrp(this); + } + return orElse(); + } +} + +abstract class Bolt12ParseError_InvalidBech32Hrp extends Bolt12ParseError { + const factory Bolt12ParseError_InvalidBech32Hrp() = + _$Bolt12ParseError_InvalidBech32HrpImpl; + const Bolt12ParseError_InvalidBech32Hrp._() : super._(); +} + +/// @nodoc +abstract class _$$Bolt12ParseError_Bech32ImplCopyWith<$Res> { + factory _$$Bolt12ParseError_Bech32ImplCopyWith( + _$Bolt12ParseError_Bech32Impl value, + $Res Function(_$Bolt12ParseError_Bech32Impl) then) = + __$$Bolt12ParseError_Bech32ImplCopyWithImpl<$Res>; + @useResult + $Res call({String field0}); +} + +/// @nodoc +class __$$Bolt12ParseError_Bech32ImplCopyWithImpl<$Res> + extends _$Bolt12ParseErrorCopyWithImpl<$Res, _$Bolt12ParseError_Bech32Impl> + implements _$$Bolt12ParseError_Bech32ImplCopyWith<$Res> { + __$$Bolt12ParseError_Bech32ImplCopyWithImpl( + _$Bolt12ParseError_Bech32Impl _value, + $Res Function(_$Bolt12ParseError_Bech32Impl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? field0 = null, + }) { + return _then(_$Bolt12ParseError_Bech32Impl( + null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc + +class _$Bolt12ParseError_Bech32Impl extends Bolt12ParseError_Bech32 { + const _$Bolt12ParseError_Bech32Impl(this.field0) : super._(); + + @override + final String field0; + + @override + String toString() { + return 'Bolt12ParseError.bech32(field0: $field0)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Bolt12ParseError_Bech32Impl && + (identical(other.field0, field0) || other.field0 == field0)); + } + + @override + int get hashCode => Object.hash(runtimeType, field0); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$Bolt12ParseError_Bech32ImplCopyWith<_$Bolt12ParseError_Bech32Impl> + get copyWith => __$$Bolt12ParseError_Bech32ImplCopyWithImpl< + _$Bolt12ParseError_Bech32Impl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidContinuation, + required TResult Function() invalidBech32Hrp, + required TResult Function(String field0) bech32, + required TResult Function(DecodeError field0) decode, + required TResult Function(String field0) invalidSemantics, + required TResult Function(String field0) invalidSignature, + }) { + return bech32(field0); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidContinuation, + TResult? Function()? invalidBech32Hrp, + TResult? Function(String field0)? bech32, + TResult? Function(DecodeError field0)? decode, + TResult? Function(String field0)? invalidSemantics, + TResult? Function(String field0)? invalidSignature, + }) { + return bech32?.call(field0); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidContinuation, + TResult Function()? invalidBech32Hrp, + TResult Function(String field0)? bech32, + TResult Function(DecodeError field0)? decode, + TResult Function(String field0)? invalidSemantics, + TResult Function(String field0)? invalidSignature, + required TResult orElse(), + }) { + if (bech32 != null) { + return bech32(field0); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Bolt12ParseError_InvalidContinuation value) + invalidContinuation, + required TResult Function(Bolt12ParseError_InvalidBech32Hrp value) + invalidBech32Hrp, + required TResult Function(Bolt12ParseError_Bech32 value) bech32, + required TResult Function(Bolt12ParseError_Decode value) decode, + required TResult Function(Bolt12ParseError_InvalidSemantics value) + invalidSemantics, + required TResult Function(Bolt12ParseError_InvalidSignature value) + invalidSignature, + }) { + return bech32(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult? Function(Bolt12ParseError_InvalidBech32Hrp value)? + invalidBech32Hrp, + TResult? Function(Bolt12ParseError_Bech32 value)? bech32, + TResult? Function(Bolt12ParseError_Decode value)? decode, + TResult? Function(Bolt12ParseError_InvalidSemantics value)? + invalidSemantics, + TResult? Function(Bolt12ParseError_InvalidSignature value)? + invalidSignature, + }) { + return bech32?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult Function(Bolt12ParseError_InvalidBech32Hrp value)? invalidBech32Hrp, + TResult Function(Bolt12ParseError_Bech32 value)? bech32, + TResult Function(Bolt12ParseError_Decode value)? decode, + TResult Function(Bolt12ParseError_InvalidSemantics value)? invalidSemantics, + TResult Function(Bolt12ParseError_InvalidSignature value)? invalidSignature, + required TResult orElse(), + }) { + if (bech32 != null) { + return bech32(this); + } + return orElse(); + } +} + +abstract class Bolt12ParseError_Bech32 extends Bolt12ParseError { + const factory Bolt12ParseError_Bech32(final String field0) = + _$Bolt12ParseError_Bech32Impl; + const Bolt12ParseError_Bech32._() : super._(); + + String get field0; + @JsonKey(ignore: true) + _$$Bolt12ParseError_Bech32ImplCopyWith<_$Bolt12ParseError_Bech32Impl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$Bolt12ParseError_DecodeImplCopyWith<$Res> { + factory _$$Bolt12ParseError_DecodeImplCopyWith( + _$Bolt12ParseError_DecodeImpl value, + $Res Function(_$Bolt12ParseError_DecodeImpl) then) = + __$$Bolt12ParseError_DecodeImplCopyWithImpl<$Res>; + @useResult + $Res call({DecodeError field0}); + + $DecodeErrorCopyWith<$Res> get field0; +} + +/// @nodoc +class __$$Bolt12ParseError_DecodeImplCopyWithImpl<$Res> + extends _$Bolt12ParseErrorCopyWithImpl<$Res, _$Bolt12ParseError_DecodeImpl> + implements _$$Bolt12ParseError_DecodeImplCopyWith<$Res> { + __$$Bolt12ParseError_DecodeImplCopyWithImpl( + _$Bolt12ParseError_DecodeImpl _value, + $Res Function(_$Bolt12ParseError_DecodeImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? field0 = null, + }) { + return _then(_$Bolt12ParseError_DecodeImpl( + null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as DecodeError, + )); + } + + @override + @pragma('vm:prefer-inline') + $DecodeErrorCopyWith<$Res> get field0 { + return $DecodeErrorCopyWith<$Res>(_value.field0, (value) { + return _then(_value.copyWith(field0: value)); + }); + } +} + +/// @nodoc + +class _$Bolt12ParseError_DecodeImpl extends Bolt12ParseError_Decode { + const _$Bolt12ParseError_DecodeImpl(this.field0) : super._(); + + @override + final DecodeError field0; + + @override + String toString() { + return 'Bolt12ParseError.decode(field0: $field0)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Bolt12ParseError_DecodeImpl && + (identical(other.field0, field0) || other.field0 == field0)); + } + + @override + int get hashCode => Object.hash(runtimeType, field0); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$Bolt12ParseError_DecodeImplCopyWith<_$Bolt12ParseError_DecodeImpl> + get copyWith => __$$Bolt12ParseError_DecodeImplCopyWithImpl< + _$Bolt12ParseError_DecodeImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidContinuation, + required TResult Function() invalidBech32Hrp, + required TResult Function(String field0) bech32, + required TResult Function(DecodeError field0) decode, + required TResult Function(String field0) invalidSemantics, + required TResult Function(String field0) invalidSignature, + }) { + return decode(field0); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidContinuation, + TResult? Function()? invalidBech32Hrp, + TResult? Function(String field0)? bech32, + TResult? Function(DecodeError field0)? decode, + TResult? Function(String field0)? invalidSemantics, + TResult? Function(String field0)? invalidSignature, + }) { + return decode?.call(field0); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidContinuation, + TResult Function()? invalidBech32Hrp, + TResult Function(String field0)? bech32, + TResult Function(DecodeError field0)? decode, + TResult Function(String field0)? invalidSemantics, + TResult Function(String field0)? invalidSignature, + required TResult orElse(), + }) { + if (decode != null) { + return decode(field0); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Bolt12ParseError_InvalidContinuation value) + invalidContinuation, + required TResult Function(Bolt12ParseError_InvalidBech32Hrp value) + invalidBech32Hrp, + required TResult Function(Bolt12ParseError_Bech32 value) bech32, + required TResult Function(Bolt12ParseError_Decode value) decode, + required TResult Function(Bolt12ParseError_InvalidSemantics value) + invalidSemantics, + required TResult Function(Bolt12ParseError_InvalidSignature value) + invalidSignature, + }) { + return decode(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult? Function(Bolt12ParseError_InvalidBech32Hrp value)? + invalidBech32Hrp, + TResult? Function(Bolt12ParseError_Bech32 value)? bech32, + TResult? Function(Bolt12ParseError_Decode value)? decode, + TResult? Function(Bolt12ParseError_InvalidSemantics value)? + invalidSemantics, + TResult? Function(Bolt12ParseError_InvalidSignature value)? + invalidSignature, + }) { + return decode?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult Function(Bolt12ParseError_InvalidBech32Hrp value)? invalidBech32Hrp, + TResult Function(Bolt12ParseError_Bech32 value)? bech32, + TResult Function(Bolt12ParseError_Decode value)? decode, + TResult Function(Bolt12ParseError_InvalidSemantics value)? invalidSemantics, + TResult Function(Bolt12ParseError_InvalidSignature value)? invalidSignature, + required TResult orElse(), + }) { + if (decode != null) { + return decode(this); + } + return orElse(); + } +} + +abstract class Bolt12ParseError_Decode extends Bolt12ParseError { + const factory Bolt12ParseError_Decode(final DecodeError field0) = + _$Bolt12ParseError_DecodeImpl; + const Bolt12ParseError_Decode._() : super._(); + + DecodeError get field0; + @JsonKey(ignore: true) + _$$Bolt12ParseError_DecodeImplCopyWith<_$Bolt12ParseError_DecodeImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$Bolt12ParseError_InvalidSemanticsImplCopyWith<$Res> { + factory _$$Bolt12ParseError_InvalidSemanticsImplCopyWith( + _$Bolt12ParseError_InvalidSemanticsImpl value, + $Res Function(_$Bolt12ParseError_InvalidSemanticsImpl) then) = + __$$Bolt12ParseError_InvalidSemanticsImplCopyWithImpl<$Res>; + @useResult + $Res call({String field0}); +} + +/// @nodoc +class __$$Bolt12ParseError_InvalidSemanticsImplCopyWithImpl<$Res> + extends _$Bolt12ParseErrorCopyWithImpl<$Res, + _$Bolt12ParseError_InvalidSemanticsImpl> + implements _$$Bolt12ParseError_InvalidSemanticsImplCopyWith<$Res> { + __$$Bolt12ParseError_InvalidSemanticsImplCopyWithImpl( + _$Bolt12ParseError_InvalidSemanticsImpl _value, + $Res Function(_$Bolt12ParseError_InvalidSemanticsImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? field0 = null, + }) { + return _then(_$Bolt12ParseError_InvalidSemanticsImpl( + null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc + +class _$Bolt12ParseError_InvalidSemanticsImpl + extends Bolt12ParseError_InvalidSemantics { + const _$Bolt12ParseError_InvalidSemanticsImpl(this.field0) : super._(); + + @override + final String field0; + + @override + String toString() { + return 'Bolt12ParseError.invalidSemantics(field0: $field0)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Bolt12ParseError_InvalidSemanticsImpl && + (identical(other.field0, field0) || other.field0 == field0)); + } + + @override + int get hashCode => Object.hash(runtimeType, field0); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$Bolt12ParseError_InvalidSemanticsImplCopyWith< + _$Bolt12ParseError_InvalidSemanticsImpl> + get copyWith => __$$Bolt12ParseError_InvalidSemanticsImplCopyWithImpl< + _$Bolt12ParseError_InvalidSemanticsImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidContinuation, + required TResult Function() invalidBech32Hrp, + required TResult Function(String field0) bech32, + required TResult Function(DecodeError field0) decode, + required TResult Function(String field0) invalidSemantics, + required TResult Function(String field0) invalidSignature, + }) { + return invalidSemantics(field0); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidContinuation, + TResult? Function()? invalidBech32Hrp, + TResult? Function(String field0)? bech32, + TResult? Function(DecodeError field0)? decode, + TResult? Function(String field0)? invalidSemantics, + TResult? Function(String field0)? invalidSignature, + }) { + return invalidSemantics?.call(field0); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidContinuation, + TResult Function()? invalidBech32Hrp, + TResult Function(String field0)? bech32, + TResult Function(DecodeError field0)? decode, + TResult Function(String field0)? invalidSemantics, + TResult Function(String field0)? invalidSignature, + required TResult orElse(), + }) { + if (invalidSemantics != null) { + return invalidSemantics(field0); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Bolt12ParseError_InvalidContinuation value) + invalidContinuation, + required TResult Function(Bolt12ParseError_InvalidBech32Hrp value) + invalidBech32Hrp, + required TResult Function(Bolt12ParseError_Bech32 value) bech32, + required TResult Function(Bolt12ParseError_Decode value) decode, + required TResult Function(Bolt12ParseError_InvalidSemantics value) + invalidSemantics, + required TResult Function(Bolt12ParseError_InvalidSignature value) + invalidSignature, + }) { + return invalidSemantics(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult? Function(Bolt12ParseError_InvalidBech32Hrp value)? + invalidBech32Hrp, + TResult? Function(Bolt12ParseError_Bech32 value)? bech32, + TResult? Function(Bolt12ParseError_Decode value)? decode, + TResult? Function(Bolt12ParseError_InvalidSemantics value)? + invalidSemantics, + TResult? Function(Bolt12ParseError_InvalidSignature value)? + invalidSignature, + }) { + return invalidSemantics?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult Function(Bolt12ParseError_InvalidBech32Hrp value)? invalidBech32Hrp, + TResult Function(Bolt12ParseError_Bech32 value)? bech32, + TResult Function(Bolt12ParseError_Decode value)? decode, + TResult Function(Bolt12ParseError_InvalidSemantics value)? invalidSemantics, + TResult Function(Bolt12ParseError_InvalidSignature value)? invalidSignature, + required TResult orElse(), + }) { + if (invalidSemantics != null) { + return invalidSemantics(this); + } + return orElse(); + } +} + +abstract class Bolt12ParseError_InvalidSemantics extends Bolt12ParseError { + const factory Bolt12ParseError_InvalidSemantics(final String field0) = + _$Bolt12ParseError_InvalidSemanticsImpl; + const Bolt12ParseError_InvalidSemantics._() : super._(); + + String get field0; + @JsonKey(ignore: true) + _$$Bolt12ParseError_InvalidSemanticsImplCopyWith< + _$Bolt12ParseError_InvalidSemanticsImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$Bolt12ParseError_InvalidSignatureImplCopyWith<$Res> { + factory _$$Bolt12ParseError_InvalidSignatureImplCopyWith( + _$Bolt12ParseError_InvalidSignatureImpl value, + $Res Function(_$Bolt12ParseError_InvalidSignatureImpl) then) = + __$$Bolt12ParseError_InvalidSignatureImplCopyWithImpl<$Res>; + @useResult + $Res call({String field0}); +} + +/// @nodoc +class __$$Bolt12ParseError_InvalidSignatureImplCopyWithImpl<$Res> + extends _$Bolt12ParseErrorCopyWithImpl<$Res, + _$Bolt12ParseError_InvalidSignatureImpl> + implements _$$Bolt12ParseError_InvalidSignatureImplCopyWith<$Res> { + __$$Bolt12ParseError_InvalidSignatureImplCopyWithImpl( + _$Bolt12ParseError_InvalidSignatureImpl _value, + $Res Function(_$Bolt12ParseError_InvalidSignatureImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? field0 = null, + }) { + return _then(_$Bolt12ParseError_InvalidSignatureImpl( + null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc + +class _$Bolt12ParseError_InvalidSignatureImpl + extends Bolt12ParseError_InvalidSignature { + const _$Bolt12ParseError_InvalidSignatureImpl(this.field0) : super._(); + + @override + final String field0; + + @override + String toString() { + return 'Bolt12ParseError.invalidSignature(field0: $field0)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Bolt12ParseError_InvalidSignatureImpl && + (identical(other.field0, field0) || other.field0 == field0)); + } + + @override + int get hashCode => Object.hash(runtimeType, field0); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$Bolt12ParseError_InvalidSignatureImplCopyWith< + _$Bolt12ParseError_InvalidSignatureImpl> + get copyWith => __$$Bolt12ParseError_InvalidSignatureImplCopyWithImpl< + _$Bolt12ParseError_InvalidSignatureImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidContinuation, + required TResult Function() invalidBech32Hrp, + required TResult Function(String field0) bech32, + required TResult Function(DecodeError field0) decode, + required TResult Function(String field0) invalidSemantics, + required TResult Function(String field0) invalidSignature, + }) { + return invalidSignature(field0); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidContinuation, + TResult? Function()? invalidBech32Hrp, + TResult? Function(String field0)? bech32, + TResult? Function(DecodeError field0)? decode, + TResult? Function(String field0)? invalidSemantics, + TResult? Function(String field0)? invalidSignature, + }) { + return invalidSignature?.call(field0); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidContinuation, + TResult Function()? invalidBech32Hrp, + TResult Function(String field0)? bech32, + TResult Function(DecodeError field0)? decode, + TResult Function(String field0)? invalidSemantics, + TResult Function(String field0)? invalidSignature, + required TResult orElse(), + }) { + if (invalidSignature != null) { + return invalidSignature(field0); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Bolt12ParseError_InvalidContinuation value) + invalidContinuation, + required TResult Function(Bolt12ParseError_InvalidBech32Hrp value) + invalidBech32Hrp, + required TResult Function(Bolt12ParseError_Bech32 value) bech32, + required TResult Function(Bolt12ParseError_Decode value) decode, + required TResult Function(Bolt12ParseError_InvalidSemantics value) + invalidSemantics, + required TResult Function(Bolt12ParseError_InvalidSignature value) + invalidSignature, + }) { + return invalidSignature(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult? Function(Bolt12ParseError_InvalidBech32Hrp value)? + invalidBech32Hrp, + TResult? Function(Bolt12ParseError_Bech32 value)? bech32, + TResult? Function(Bolt12ParseError_Decode value)? decode, + TResult? Function(Bolt12ParseError_InvalidSemantics value)? + invalidSemantics, + TResult? Function(Bolt12ParseError_InvalidSignature value)? + invalidSignature, + }) { + return invalidSignature?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult Function(Bolt12ParseError_InvalidBech32Hrp value)? invalidBech32Hrp, + TResult Function(Bolt12ParseError_Bech32 value)? bech32, + TResult Function(Bolt12ParseError_Decode value)? decode, + TResult Function(Bolt12ParseError_InvalidSemantics value)? invalidSemantics, + TResult Function(Bolt12ParseError_InvalidSignature value)? invalidSignature, + required TResult orElse(), + }) { + if (invalidSignature != null) { + return invalidSignature(this); + } + return orElse(); + } +} + +abstract class Bolt12ParseError_InvalidSignature extends Bolt12ParseError { + const factory Bolt12ParseError_InvalidSignature(final String field0) = + _$Bolt12ParseError_InvalidSignatureImpl; + const Bolt12ParseError_InvalidSignature._() : super._(); + + String get field0; + @JsonKey(ignore: true) + _$$Bolt12ParseError_InvalidSignatureImplCopyWith< + _$Bolt12ParseError_InvalidSignatureImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +mixin _$DecodeError { + @optionalTypeArgs + TResult when({ + required TResult Function() unknownVersion, + required TResult Function() unknownRequiredFeature, + required TResult Function() invalidValue, + required TResult Function() shortRead, + required TResult Function() badLengthDescriptor, + required TResult Function(String field0) io, + required TResult Function() unsupportedCompression, + required TResult Function() dangerousValue, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? unknownVersion, + TResult? Function()? unknownRequiredFeature, + TResult? Function()? invalidValue, + TResult? Function()? shortRead, + TResult? Function()? badLengthDescriptor, + TResult? Function(String field0)? io, + TResult? Function()? unsupportedCompression, + TResult? Function()? dangerousValue, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? unknownVersion, + TResult Function()? unknownRequiredFeature, + TResult Function()? invalidValue, + TResult Function()? shortRead, + TResult Function()? badLengthDescriptor, + TResult Function(String field0)? io, + TResult Function()? unsupportedCompression, + TResult Function()? dangerousValue, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map({ + required TResult Function(DecodeError_UnknownVersion value) unknownVersion, + required TResult Function(DecodeError_UnknownRequiredFeature value) + unknownRequiredFeature, + required TResult Function(DecodeError_InvalidValue value) invalidValue, + required TResult Function(DecodeError_ShortRead value) shortRead, + required TResult Function(DecodeError_BadLengthDescriptor value) + badLengthDescriptor, + required TResult Function(DecodeError_Io value) io, + required TResult Function(DecodeError_UnsupportedCompression value) + unsupportedCompression, + required TResult Function(DecodeError_DangerousValue value) dangerousValue, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult? Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult? Function(DecodeError_InvalidValue value)? invalidValue, + TResult? Function(DecodeError_ShortRead value)? shortRead, + TResult? Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult? Function(DecodeError_Io value)? io, + TResult? Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult? Function(DecodeError_DangerousValue value)? dangerousValue, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap({ + TResult Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult Function(DecodeError_InvalidValue value)? invalidValue, + TResult Function(DecodeError_ShortRead value)? shortRead, + TResult Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult Function(DecodeError_Io value)? io, + TResult Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult Function(DecodeError_DangerousValue value)? dangerousValue, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $DecodeErrorCopyWith<$Res> { + factory $DecodeErrorCopyWith( + DecodeError value, $Res Function(DecodeError) then) = + _$DecodeErrorCopyWithImpl<$Res, DecodeError>; +} + +/// @nodoc +class _$DecodeErrorCopyWithImpl<$Res, $Val extends DecodeError> + implements $DecodeErrorCopyWith<$Res> { + _$DecodeErrorCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; +} + +/// @nodoc +abstract class _$$DecodeError_UnknownVersionImplCopyWith<$Res> { + factory _$$DecodeError_UnknownVersionImplCopyWith( + _$DecodeError_UnknownVersionImpl value, + $Res Function(_$DecodeError_UnknownVersionImpl) then) = + __$$DecodeError_UnknownVersionImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$DecodeError_UnknownVersionImplCopyWithImpl<$Res> + extends _$DecodeErrorCopyWithImpl<$Res, _$DecodeError_UnknownVersionImpl> + implements _$$DecodeError_UnknownVersionImplCopyWith<$Res> { + __$$DecodeError_UnknownVersionImplCopyWithImpl( + _$DecodeError_UnknownVersionImpl _value, + $Res Function(_$DecodeError_UnknownVersionImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$DecodeError_UnknownVersionImpl extends DecodeError_UnknownVersion { + const _$DecodeError_UnknownVersionImpl() : super._(); + + @override + String toString() { + return 'DecodeError.unknownVersion()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$DecodeError_UnknownVersionImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() unknownVersion, + required TResult Function() unknownRequiredFeature, + required TResult Function() invalidValue, + required TResult Function() shortRead, + required TResult Function() badLengthDescriptor, + required TResult Function(String field0) io, + required TResult Function() unsupportedCompression, + required TResult Function() dangerousValue, + }) { + return unknownVersion(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? unknownVersion, + TResult? Function()? unknownRequiredFeature, + TResult? Function()? invalidValue, + TResult? Function()? shortRead, + TResult? Function()? badLengthDescriptor, + TResult? Function(String field0)? io, + TResult? Function()? unsupportedCompression, + TResult? Function()? dangerousValue, + }) { + return unknownVersion?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? unknownVersion, + TResult Function()? unknownRequiredFeature, + TResult Function()? invalidValue, + TResult Function()? shortRead, + TResult Function()? badLengthDescriptor, + TResult Function(String field0)? io, + TResult Function()? unsupportedCompression, + TResult Function()? dangerousValue, + required TResult orElse(), + }) { + if (unknownVersion != null) { + return unknownVersion(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(DecodeError_UnknownVersion value) unknownVersion, + required TResult Function(DecodeError_UnknownRequiredFeature value) + unknownRequiredFeature, + required TResult Function(DecodeError_InvalidValue value) invalidValue, + required TResult Function(DecodeError_ShortRead value) shortRead, + required TResult Function(DecodeError_BadLengthDescriptor value) + badLengthDescriptor, + required TResult Function(DecodeError_Io value) io, + required TResult Function(DecodeError_UnsupportedCompression value) + unsupportedCompression, + required TResult Function(DecodeError_DangerousValue value) dangerousValue, + }) { + return unknownVersion(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult? Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult? Function(DecodeError_InvalidValue value)? invalidValue, + TResult? Function(DecodeError_ShortRead value)? shortRead, + TResult? Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult? Function(DecodeError_Io value)? io, + TResult? Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult? Function(DecodeError_DangerousValue value)? dangerousValue, + }) { + return unknownVersion?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult Function(DecodeError_InvalidValue value)? invalidValue, + TResult Function(DecodeError_ShortRead value)? shortRead, + TResult Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult Function(DecodeError_Io value)? io, + TResult Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult Function(DecodeError_DangerousValue value)? dangerousValue, + required TResult orElse(), + }) { + if (unknownVersion != null) { + return unknownVersion(this); + } + return orElse(); + } +} + +abstract class DecodeError_UnknownVersion extends DecodeError { + const factory DecodeError_UnknownVersion() = _$DecodeError_UnknownVersionImpl; + const DecodeError_UnknownVersion._() : super._(); +} + +/// @nodoc +abstract class _$$DecodeError_UnknownRequiredFeatureImplCopyWith<$Res> { + factory _$$DecodeError_UnknownRequiredFeatureImplCopyWith( + _$DecodeError_UnknownRequiredFeatureImpl value, + $Res Function(_$DecodeError_UnknownRequiredFeatureImpl) then) = + __$$DecodeError_UnknownRequiredFeatureImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$DecodeError_UnknownRequiredFeatureImplCopyWithImpl<$Res> + extends _$DecodeErrorCopyWithImpl<$Res, + _$DecodeError_UnknownRequiredFeatureImpl> + implements _$$DecodeError_UnknownRequiredFeatureImplCopyWith<$Res> { + __$$DecodeError_UnknownRequiredFeatureImplCopyWithImpl( + _$DecodeError_UnknownRequiredFeatureImpl _value, + $Res Function(_$DecodeError_UnknownRequiredFeatureImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$DecodeError_UnknownRequiredFeatureImpl + extends DecodeError_UnknownRequiredFeature { + const _$DecodeError_UnknownRequiredFeatureImpl() : super._(); + + @override + String toString() { + return 'DecodeError.unknownRequiredFeature()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$DecodeError_UnknownRequiredFeatureImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() unknownVersion, + required TResult Function() unknownRequiredFeature, + required TResult Function() invalidValue, + required TResult Function() shortRead, + required TResult Function() badLengthDescriptor, + required TResult Function(String field0) io, + required TResult Function() unsupportedCompression, + required TResult Function() dangerousValue, + }) { + return unknownRequiredFeature(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? unknownVersion, + TResult? Function()? unknownRequiredFeature, + TResult? Function()? invalidValue, + TResult? Function()? shortRead, + TResult? Function()? badLengthDescriptor, + TResult? Function(String field0)? io, + TResult? Function()? unsupportedCompression, + TResult? Function()? dangerousValue, + }) { + return unknownRequiredFeature?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? unknownVersion, + TResult Function()? unknownRequiredFeature, + TResult Function()? invalidValue, + TResult Function()? shortRead, + TResult Function()? badLengthDescriptor, + TResult Function(String field0)? io, + TResult Function()? unsupportedCompression, + TResult Function()? dangerousValue, + required TResult orElse(), + }) { + if (unknownRequiredFeature != null) { + return unknownRequiredFeature(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(DecodeError_UnknownVersion value) unknownVersion, + required TResult Function(DecodeError_UnknownRequiredFeature value) + unknownRequiredFeature, + required TResult Function(DecodeError_InvalidValue value) invalidValue, + required TResult Function(DecodeError_ShortRead value) shortRead, + required TResult Function(DecodeError_BadLengthDescriptor value) + badLengthDescriptor, + required TResult Function(DecodeError_Io value) io, + required TResult Function(DecodeError_UnsupportedCompression value) + unsupportedCompression, + required TResult Function(DecodeError_DangerousValue value) dangerousValue, + }) { + return unknownRequiredFeature(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult? Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult? Function(DecodeError_InvalidValue value)? invalidValue, + TResult? Function(DecodeError_ShortRead value)? shortRead, + TResult? Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult? Function(DecodeError_Io value)? io, + TResult? Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult? Function(DecodeError_DangerousValue value)? dangerousValue, + }) { + return unknownRequiredFeature?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult Function(DecodeError_InvalidValue value)? invalidValue, + TResult Function(DecodeError_ShortRead value)? shortRead, + TResult Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult Function(DecodeError_Io value)? io, + TResult Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult Function(DecodeError_DangerousValue value)? dangerousValue, + required TResult orElse(), + }) { + if (unknownRequiredFeature != null) { + return unknownRequiredFeature(this); + } + return orElse(); + } +} + +abstract class DecodeError_UnknownRequiredFeature extends DecodeError { + const factory DecodeError_UnknownRequiredFeature() = + _$DecodeError_UnknownRequiredFeatureImpl; + const DecodeError_UnknownRequiredFeature._() : super._(); +} + +/// @nodoc +abstract class _$$DecodeError_InvalidValueImplCopyWith<$Res> { + factory _$$DecodeError_InvalidValueImplCopyWith( + _$DecodeError_InvalidValueImpl value, + $Res Function(_$DecodeError_InvalidValueImpl) then) = + __$$DecodeError_InvalidValueImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$DecodeError_InvalidValueImplCopyWithImpl<$Res> + extends _$DecodeErrorCopyWithImpl<$Res, _$DecodeError_InvalidValueImpl> + implements _$$DecodeError_InvalidValueImplCopyWith<$Res> { + __$$DecodeError_InvalidValueImplCopyWithImpl( + _$DecodeError_InvalidValueImpl _value, + $Res Function(_$DecodeError_InvalidValueImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$DecodeError_InvalidValueImpl extends DecodeError_InvalidValue { + const _$DecodeError_InvalidValueImpl() : super._(); + + @override + String toString() { + return 'DecodeError.invalidValue()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$DecodeError_InvalidValueImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() unknownVersion, + required TResult Function() unknownRequiredFeature, + required TResult Function() invalidValue, + required TResult Function() shortRead, + required TResult Function() badLengthDescriptor, + required TResult Function(String field0) io, + required TResult Function() unsupportedCompression, + required TResult Function() dangerousValue, + }) { + return invalidValue(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? unknownVersion, + TResult? Function()? unknownRequiredFeature, + TResult? Function()? invalidValue, + TResult? Function()? shortRead, + TResult? Function()? badLengthDescriptor, + TResult? Function(String field0)? io, + TResult? Function()? unsupportedCompression, + TResult? Function()? dangerousValue, + }) { + return invalidValue?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? unknownVersion, + TResult Function()? unknownRequiredFeature, + TResult Function()? invalidValue, + TResult Function()? shortRead, + TResult Function()? badLengthDescriptor, + TResult Function(String field0)? io, + TResult Function()? unsupportedCompression, + TResult Function()? dangerousValue, + required TResult orElse(), + }) { + if (invalidValue != null) { + return invalidValue(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(DecodeError_UnknownVersion value) unknownVersion, + required TResult Function(DecodeError_UnknownRequiredFeature value) + unknownRequiredFeature, + required TResult Function(DecodeError_InvalidValue value) invalidValue, + required TResult Function(DecodeError_ShortRead value) shortRead, + required TResult Function(DecodeError_BadLengthDescriptor value) + badLengthDescriptor, + required TResult Function(DecodeError_Io value) io, + required TResult Function(DecodeError_UnsupportedCompression value) + unsupportedCompression, + required TResult Function(DecodeError_DangerousValue value) dangerousValue, + }) { + return invalidValue(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult? Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult? Function(DecodeError_InvalidValue value)? invalidValue, + TResult? Function(DecodeError_ShortRead value)? shortRead, + TResult? Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult? Function(DecodeError_Io value)? io, + TResult? Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult? Function(DecodeError_DangerousValue value)? dangerousValue, + }) { + return invalidValue?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult Function(DecodeError_InvalidValue value)? invalidValue, + TResult Function(DecodeError_ShortRead value)? shortRead, + TResult Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult Function(DecodeError_Io value)? io, + TResult Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult Function(DecodeError_DangerousValue value)? dangerousValue, + required TResult orElse(), + }) { + if (invalidValue != null) { + return invalidValue(this); + } + return orElse(); + } +} + +abstract class DecodeError_InvalidValue extends DecodeError { + const factory DecodeError_InvalidValue() = _$DecodeError_InvalidValueImpl; + const DecodeError_InvalidValue._() : super._(); +} + +/// @nodoc +abstract class _$$DecodeError_ShortReadImplCopyWith<$Res> { + factory _$$DecodeError_ShortReadImplCopyWith( + _$DecodeError_ShortReadImpl value, + $Res Function(_$DecodeError_ShortReadImpl) then) = + __$$DecodeError_ShortReadImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$DecodeError_ShortReadImplCopyWithImpl<$Res> + extends _$DecodeErrorCopyWithImpl<$Res, _$DecodeError_ShortReadImpl> + implements _$$DecodeError_ShortReadImplCopyWith<$Res> { + __$$DecodeError_ShortReadImplCopyWithImpl(_$DecodeError_ShortReadImpl _value, + $Res Function(_$DecodeError_ShortReadImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$DecodeError_ShortReadImpl extends DecodeError_ShortRead { + const _$DecodeError_ShortReadImpl() : super._(); + + @override + String toString() { + return 'DecodeError.shortRead()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$DecodeError_ShortReadImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() unknownVersion, + required TResult Function() unknownRequiredFeature, + required TResult Function() invalidValue, + required TResult Function() shortRead, + required TResult Function() badLengthDescriptor, + required TResult Function(String field0) io, + required TResult Function() unsupportedCompression, + required TResult Function() dangerousValue, + }) { + return shortRead(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? unknownVersion, + TResult? Function()? unknownRequiredFeature, + TResult? Function()? invalidValue, + TResult? Function()? shortRead, + TResult? Function()? badLengthDescriptor, + TResult? Function(String field0)? io, + TResult? Function()? unsupportedCompression, + TResult? Function()? dangerousValue, + }) { + return shortRead?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? unknownVersion, + TResult Function()? unknownRequiredFeature, + TResult Function()? invalidValue, + TResult Function()? shortRead, + TResult Function()? badLengthDescriptor, + TResult Function(String field0)? io, + TResult Function()? unsupportedCompression, + TResult Function()? dangerousValue, + required TResult orElse(), + }) { + if (shortRead != null) { + return shortRead(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(DecodeError_UnknownVersion value) unknownVersion, + required TResult Function(DecodeError_UnknownRequiredFeature value) + unknownRequiredFeature, + required TResult Function(DecodeError_InvalidValue value) invalidValue, + required TResult Function(DecodeError_ShortRead value) shortRead, + required TResult Function(DecodeError_BadLengthDescriptor value) + badLengthDescriptor, + required TResult Function(DecodeError_Io value) io, + required TResult Function(DecodeError_UnsupportedCompression value) + unsupportedCompression, + required TResult Function(DecodeError_DangerousValue value) dangerousValue, + }) { + return shortRead(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult? Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult? Function(DecodeError_InvalidValue value)? invalidValue, + TResult? Function(DecodeError_ShortRead value)? shortRead, + TResult? Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult? Function(DecodeError_Io value)? io, + TResult? Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult? Function(DecodeError_DangerousValue value)? dangerousValue, + }) { + return shortRead?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult Function(DecodeError_InvalidValue value)? invalidValue, + TResult Function(DecodeError_ShortRead value)? shortRead, + TResult Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult Function(DecodeError_Io value)? io, + TResult Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult Function(DecodeError_DangerousValue value)? dangerousValue, + required TResult orElse(), + }) { + if (shortRead != null) { + return shortRead(this); + } + return orElse(); + } +} + +abstract class DecodeError_ShortRead extends DecodeError { + const factory DecodeError_ShortRead() = _$DecodeError_ShortReadImpl; + const DecodeError_ShortRead._() : super._(); +} + +/// @nodoc +abstract class _$$DecodeError_BadLengthDescriptorImplCopyWith<$Res> { + factory _$$DecodeError_BadLengthDescriptorImplCopyWith( + _$DecodeError_BadLengthDescriptorImpl value, + $Res Function(_$DecodeError_BadLengthDescriptorImpl) then) = + __$$DecodeError_BadLengthDescriptorImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$DecodeError_BadLengthDescriptorImplCopyWithImpl<$Res> + extends _$DecodeErrorCopyWithImpl<$Res, + _$DecodeError_BadLengthDescriptorImpl> + implements _$$DecodeError_BadLengthDescriptorImplCopyWith<$Res> { + __$$DecodeError_BadLengthDescriptorImplCopyWithImpl( + _$DecodeError_BadLengthDescriptorImpl _value, + $Res Function(_$DecodeError_BadLengthDescriptorImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$DecodeError_BadLengthDescriptorImpl + extends DecodeError_BadLengthDescriptor { + const _$DecodeError_BadLengthDescriptorImpl() : super._(); + + @override + String toString() { + return 'DecodeError.badLengthDescriptor()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$DecodeError_BadLengthDescriptorImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() unknownVersion, + required TResult Function() unknownRequiredFeature, + required TResult Function() invalidValue, + required TResult Function() shortRead, + required TResult Function() badLengthDescriptor, + required TResult Function(String field0) io, + required TResult Function() unsupportedCompression, + required TResult Function() dangerousValue, + }) { + return badLengthDescriptor(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? unknownVersion, + TResult? Function()? unknownRequiredFeature, + TResult? Function()? invalidValue, + TResult? Function()? shortRead, + TResult? Function()? badLengthDescriptor, + TResult? Function(String field0)? io, + TResult? Function()? unsupportedCompression, + TResult? Function()? dangerousValue, + }) { + return badLengthDescriptor?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? unknownVersion, + TResult Function()? unknownRequiredFeature, + TResult Function()? invalidValue, + TResult Function()? shortRead, + TResult Function()? badLengthDescriptor, + TResult Function(String field0)? io, + TResult Function()? unsupportedCompression, + TResult Function()? dangerousValue, + required TResult orElse(), + }) { + if (badLengthDescriptor != null) { + return badLengthDescriptor(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(DecodeError_UnknownVersion value) unknownVersion, + required TResult Function(DecodeError_UnknownRequiredFeature value) + unknownRequiredFeature, + required TResult Function(DecodeError_InvalidValue value) invalidValue, + required TResult Function(DecodeError_ShortRead value) shortRead, + required TResult Function(DecodeError_BadLengthDescriptor value) + badLengthDescriptor, + required TResult Function(DecodeError_Io value) io, + required TResult Function(DecodeError_UnsupportedCompression value) + unsupportedCompression, + required TResult Function(DecodeError_DangerousValue value) dangerousValue, + }) { + return badLengthDescriptor(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult? Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult? Function(DecodeError_InvalidValue value)? invalidValue, + TResult? Function(DecodeError_ShortRead value)? shortRead, + TResult? Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult? Function(DecodeError_Io value)? io, + TResult? Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult? Function(DecodeError_DangerousValue value)? dangerousValue, + }) { + return badLengthDescriptor?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult Function(DecodeError_InvalidValue value)? invalidValue, + TResult Function(DecodeError_ShortRead value)? shortRead, + TResult Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult Function(DecodeError_Io value)? io, + TResult Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult Function(DecodeError_DangerousValue value)? dangerousValue, + required TResult orElse(), + }) { + if (badLengthDescriptor != null) { + return badLengthDescriptor(this); + } + return orElse(); + } +} + +abstract class DecodeError_BadLengthDescriptor extends DecodeError { + const factory DecodeError_BadLengthDescriptor() = + _$DecodeError_BadLengthDescriptorImpl; + const DecodeError_BadLengthDescriptor._() : super._(); +} + +/// @nodoc +abstract class _$$DecodeError_IoImplCopyWith<$Res> { + factory _$$DecodeError_IoImplCopyWith(_$DecodeError_IoImpl value, + $Res Function(_$DecodeError_IoImpl) then) = + __$$DecodeError_IoImplCopyWithImpl<$Res>; + @useResult + $Res call({String field0}); +} + +/// @nodoc +class __$$DecodeError_IoImplCopyWithImpl<$Res> + extends _$DecodeErrorCopyWithImpl<$Res, _$DecodeError_IoImpl> + implements _$$DecodeError_IoImplCopyWith<$Res> { + __$$DecodeError_IoImplCopyWithImpl( + _$DecodeError_IoImpl _value, $Res Function(_$DecodeError_IoImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? field0 = null, + }) { + return _then(_$DecodeError_IoImpl( + null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc + +class _$DecodeError_IoImpl extends DecodeError_Io { + const _$DecodeError_IoImpl(this.field0) : super._(); + + @override + final String field0; + + @override + String toString() { + return 'DecodeError.io(field0: $field0)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$DecodeError_IoImpl && + (identical(other.field0, field0) || other.field0 == field0)); + } + + @override + int get hashCode => Object.hash(runtimeType, field0); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$DecodeError_IoImplCopyWith<_$DecodeError_IoImpl> get copyWith => + __$$DecodeError_IoImplCopyWithImpl<_$DecodeError_IoImpl>( + this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() unknownVersion, + required TResult Function() unknownRequiredFeature, + required TResult Function() invalidValue, + required TResult Function() shortRead, + required TResult Function() badLengthDescriptor, + required TResult Function(String field0) io, + required TResult Function() unsupportedCompression, + required TResult Function() dangerousValue, + }) { + return io(field0); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? unknownVersion, + TResult? Function()? unknownRequiredFeature, + TResult? Function()? invalidValue, + TResult? Function()? shortRead, + TResult? Function()? badLengthDescriptor, + TResult? Function(String field0)? io, + TResult? Function()? unsupportedCompression, + TResult? Function()? dangerousValue, + }) { + return io?.call(field0); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? unknownVersion, + TResult Function()? unknownRequiredFeature, + TResult Function()? invalidValue, + TResult Function()? shortRead, + TResult Function()? badLengthDescriptor, + TResult Function(String field0)? io, + TResult Function()? unsupportedCompression, + TResult Function()? dangerousValue, + required TResult orElse(), + }) { + if (io != null) { + return io(field0); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(DecodeError_UnknownVersion value) unknownVersion, + required TResult Function(DecodeError_UnknownRequiredFeature value) + unknownRequiredFeature, + required TResult Function(DecodeError_InvalidValue value) invalidValue, + required TResult Function(DecodeError_ShortRead value) shortRead, + required TResult Function(DecodeError_BadLengthDescriptor value) + badLengthDescriptor, + required TResult Function(DecodeError_Io value) io, + required TResult Function(DecodeError_UnsupportedCompression value) + unsupportedCompression, + required TResult Function(DecodeError_DangerousValue value) dangerousValue, + }) { + return io(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult? Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult? Function(DecodeError_InvalidValue value)? invalidValue, + TResult? Function(DecodeError_ShortRead value)? shortRead, + TResult? Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult? Function(DecodeError_Io value)? io, + TResult? Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult? Function(DecodeError_DangerousValue value)? dangerousValue, + }) { + return io?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult Function(DecodeError_InvalidValue value)? invalidValue, + TResult Function(DecodeError_ShortRead value)? shortRead, + TResult Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult Function(DecodeError_Io value)? io, + TResult Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult Function(DecodeError_DangerousValue value)? dangerousValue, + required TResult orElse(), + }) { + if (io != null) { + return io(this); + } + return orElse(); + } +} + +abstract class DecodeError_Io extends DecodeError { + const factory DecodeError_Io(final String field0) = _$DecodeError_IoImpl; + const DecodeError_Io._() : super._(); + + String get field0; + @JsonKey(ignore: true) + _$$DecodeError_IoImplCopyWith<_$DecodeError_IoImpl> get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$DecodeError_UnsupportedCompressionImplCopyWith<$Res> { + factory _$$DecodeError_UnsupportedCompressionImplCopyWith( + _$DecodeError_UnsupportedCompressionImpl value, + $Res Function(_$DecodeError_UnsupportedCompressionImpl) then) = + __$$DecodeError_UnsupportedCompressionImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$DecodeError_UnsupportedCompressionImplCopyWithImpl<$Res> + extends _$DecodeErrorCopyWithImpl<$Res, + _$DecodeError_UnsupportedCompressionImpl> + implements _$$DecodeError_UnsupportedCompressionImplCopyWith<$Res> { + __$$DecodeError_UnsupportedCompressionImplCopyWithImpl( + _$DecodeError_UnsupportedCompressionImpl _value, + $Res Function(_$DecodeError_UnsupportedCompressionImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$DecodeError_UnsupportedCompressionImpl + extends DecodeError_UnsupportedCompression { + const _$DecodeError_UnsupportedCompressionImpl() : super._(); + + @override + String toString() { + return 'DecodeError.unsupportedCompression()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$DecodeError_UnsupportedCompressionImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() unknownVersion, + required TResult Function() unknownRequiredFeature, + required TResult Function() invalidValue, + required TResult Function() shortRead, + required TResult Function() badLengthDescriptor, + required TResult Function(String field0) io, + required TResult Function() unsupportedCompression, + required TResult Function() dangerousValue, + }) { + return unsupportedCompression(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? unknownVersion, + TResult? Function()? unknownRequiredFeature, + TResult? Function()? invalidValue, + TResult? Function()? shortRead, + TResult? Function()? badLengthDescriptor, + TResult? Function(String field0)? io, + TResult? Function()? unsupportedCompression, + TResult? Function()? dangerousValue, + }) { + return unsupportedCompression?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? unknownVersion, + TResult Function()? unknownRequiredFeature, + TResult Function()? invalidValue, + TResult Function()? shortRead, + TResult Function()? badLengthDescriptor, + TResult Function(String field0)? io, + TResult Function()? unsupportedCompression, + TResult Function()? dangerousValue, + required TResult orElse(), + }) { + if (unsupportedCompression != null) { + return unsupportedCompression(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(DecodeError_UnknownVersion value) unknownVersion, + required TResult Function(DecodeError_UnknownRequiredFeature value) + unknownRequiredFeature, + required TResult Function(DecodeError_InvalidValue value) invalidValue, + required TResult Function(DecodeError_ShortRead value) shortRead, + required TResult Function(DecodeError_BadLengthDescriptor value) + badLengthDescriptor, + required TResult Function(DecodeError_Io value) io, + required TResult Function(DecodeError_UnsupportedCompression value) + unsupportedCompression, + required TResult Function(DecodeError_DangerousValue value) dangerousValue, + }) { + return unsupportedCompression(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult? Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult? Function(DecodeError_InvalidValue value)? invalidValue, + TResult? Function(DecodeError_ShortRead value)? shortRead, + TResult? Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult? Function(DecodeError_Io value)? io, + TResult? Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult? Function(DecodeError_DangerousValue value)? dangerousValue, + }) { + return unsupportedCompression?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult Function(DecodeError_InvalidValue value)? invalidValue, + TResult Function(DecodeError_ShortRead value)? shortRead, + TResult Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult Function(DecodeError_Io value)? io, + TResult Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult Function(DecodeError_DangerousValue value)? dangerousValue, + required TResult orElse(), + }) { + if (unsupportedCompression != null) { + return unsupportedCompression(this); + } + return orElse(); + } +} + +abstract class DecodeError_UnsupportedCompression extends DecodeError { + const factory DecodeError_UnsupportedCompression() = + _$DecodeError_UnsupportedCompressionImpl; + const DecodeError_UnsupportedCompression._() : super._(); +} + +/// @nodoc +abstract class _$$DecodeError_DangerousValueImplCopyWith<$Res> { + factory _$$DecodeError_DangerousValueImplCopyWith( + _$DecodeError_DangerousValueImpl value, + $Res Function(_$DecodeError_DangerousValueImpl) then) = + __$$DecodeError_DangerousValueImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$DecodeError_DangerousValueImplCopyWithImpl<$Res> + extends _$DecodeErrorCopyWithImpl<$Res, _$DecodeError_DangerousValueImpl> + implements _$$DecodeError_DangerousValueImplCopyWith<$Res> { + __$$DecodeError_DangerousValueImplCopyWithImpl( + _$DecodeError_DangerousValueImpl _value, + $Res Function(_$DecodeError_DangerousValueImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$DecodeError_DangerousValueImpl extends DecodeError_DangerousValue { + const _$DecodeError_DangerousValueImpl() : super._(); + + @override + String toString() { + return 'DecodeError.dangerousValue()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$DecodeError_DangerousValueImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() unknownVersion, + required TResult Function() unknownRequiredFeature, + required TResult Function() invalidValue, + required TResult Function() shortRead, + required TResult Function() badLengthDescriptor, + required TResult Function(String field0) io, + required TResult Function() unsupportedCompression, + required TResult Function() dangerousValue, + }) { + return dangerousValue(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? unknownVersion, + TResult? Function()? unknownRequiredFeature, + TResult? Function()? invalidValue, + TResult? Function()? shortRead, + TResult? Function()? badLengthDescriptor, + TResult? Function(String field0)? io, + TResult? Function()? unsupportedCompression, + TResult? Function()? dangerousValue, + }) { + return dangerousValue?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? unknownVersion, + TResult Function()? unknownRequiredFeature, + TResult Function()? invalidValue, + TResult Function()? shortRead, + TResult Function()? badLengthDescriptor, + TResult Function(String field0)? io, + TResult Function()? unsupportedCompression, + TResult Function()? dangerousValue, + required TResult orElse(), + }) { + if (dangerousValue != null) { + return dangerousValue(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(DecodeError_UnknownVersion value) unknownVersion, + required TResult Function(DecodeError_UnknownRequiredFeature value) + unknownRequiredFeature, + required TResult Function(DecodeError_InvalidValue value) invalidValue, + required TResult Function(DecodeError_ShortRead value) shortRead, + required TResult Function(DecodeError_BadLengthDescriptor value) + badLengthDescriptor, + required TResult Function(DecodeError_Io value) io, + required TResult Function(DecodeError_UnsupportedCompression value) + unsupportedCompression, + required TResult Function(DecodeError_DangerousValue value) dangerousValue, + }) { + return dangerousValue(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult? Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult? Function(DecodeError_InvalidValue value)? invalidValue, + TResult? Function(DecodeError_ShortRead value)? shortRead, + TResult? Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult? Function(DecodeError_Io value)? io, + TResult? Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult? Function(DecodeError_DangerousValue value)? dangerousValue, + }) { + return dangerousValue?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult Function(DecodeError_InvalidValue value)? invalidValue, + TResult Function(DecodeError_ShortRead value)? shortRead, + TResult Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult Function(DecodeError_Io value)? io, + TResult Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult Function(DecodeError_DangerousValue value)? dangerousValue, + required TResult orElse(), + }) { + if (dangerousValue != null) { + return dangerousValue(this); + } + return orElse(); + } +} + +abstract class DecodeError_DangerousValue extends DecodeError { + const factory DecodeError_DangerousValue() = _$DecodeError_DangerousValueImpl; + const DecodeError_DangerousValue._() : super._(); +} + +/// @nodoc +mixin _$LdkNodeError { + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $LdkNodeErrorCopyWith<$Res> { + factory $LdkNodeErrorCopyWith( + LdkNodeError value, $Res Function(LdkNodeError) then) = + _$LdkNodeErrorCopyWithImpl<$Res, LdkNodeError>; +} + +/// @nodoc +class _$LdkNodeErrorCopyWithImpl<$Res, $Val extends LdkNodeError> + implements $LdkNodeErrorCopyWith<$Res> { + _$LdkNodeErrorCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidTxidImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidTxidImplCopyWith( + _$LdkNodeError_InvalidTxidImpl value, + $Res Function(_$LdkNodeError_InvalidTxidImpl) then) = + __$$LdkNodeError_InvalidTxidImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidTxidImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_InvalidTxidImpl> + implements _$$LdkNodeError_InvalidTxidImplCopyWith<$Res> { + __$$LdkNodeError_InvalidTxidImplCopyWithImpl( + _$LdkNodeError_InvalidTxidImpl _value, + $Res Function(_$LdkNodeError_InvalidTxidImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidTxidImpl extends LdkNodeError_InvalidTxid { + const _$LdkNodeError_InvalidTxidImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidTxid()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidTxidImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidTxid(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidTxid?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidTxid != null) { + return invalidTxid(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidTxid(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidTxid?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidTxid != null) { + return invalidTxid(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidTxid extends LdkNodeError { + const factory LdkNodeError_InvalidTxid() = _$LdkNodeError_InvalidTxidImpl; + const LdkNodeError_InvalidTxid._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_AlreadyRunningImplCopyWith<$Res> { + factory _$$LdkNodeError_AlreadyRunningImplCopyWith( + _$LdkNodeError_AlreadyRunningImpl value, + $Res Function(_$LdkNodeError_AlreadyRunningImpl) then) = + __$$LdkNodeError_AlreadyRunningImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_AlreadyRunningImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_AlreadyRunningImpl> + implements _$$LdkNodeError_AlreadyRunningImplCopyWith<$Res> { + __$$LdkNodeError_AlreadyRunningImplCopyWithImpl( + _$LdkNodeError_AlreadyRunningImpl _value, + $Res Function(_$LdkNodeError_AlreadyRunningImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_AlreadyRunningImpl extends LdkNodeError_AlreadyRunning { + const _$LdkNodeError_AlreadyRunningImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.alreadyRunning()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_AlreadyRunningImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return alreadyRunning(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return alreadyRunning?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (alreadyRunning != null) { + return alreadyRunning(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return alreadyRunning(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return alreadyRunning?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (alreadyRunning != null) { + return alreadyRunning(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_AlreadyRunning extends LdkNodeError { + const factory LdkNodeError_AlreadyRunning() = + _$LdkNodeError_AlreadyRunningImpl; + const LdkNodeError_AlreadyRunning._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_NotRunningImplCopyWith<$Res> { + factory _$$LdkNodeError_NotRunningImplCopyWith( + _$LdkNodeError_NotRunningImpl value, + $Res Function(_$LdkNodeError_NotRunningImpl) then) = + __$$LdkNodeError_NotRunningImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_NotRunningImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_NotRunningImpl> + implements _$$LdkNodeError_NotRunningImplCopyWith<$Res> { + __$$LdkNodeError_NotRunningImplCopyWithImpl( + _$LdkNodeError_NotRunningImpl _value, + $Res Function(_$LdkNodeError_NotRunningImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_NotRunningImpl extends LdkNodeError_NotRunning { + const _$LdkNodeError_NotRunningImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.notRunning()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_NotRunningImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return notRunning(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return notRunning?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (notRunning != null) { + return notRunning(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return notRunning(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return notRunning?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (notRunning != null) { + return notRunning(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_NotRunning extends LdkNodeError { + const factory LdkNodeError_NotRunning() = _$LdkNodeError_NotRunningImpl; + const LdkNodeError_NotRunning._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_OnchainTxCreationFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_OnchainTxCreationFailedImplCopyWith( + _$LdkNodeError_OnchainTxCreationFailedImpl value, + $Res Function(_$LdkNodeError_OnchainTxCreationFailedImpl) then) = + __$$LdkNodeError_OnchainTxCreationFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_OnchainTxCreationFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_OnchainTxCreationFailedImpl> + implements _$$LdkNodeError_OnchainTxCreationFailedImplCopyWith<$Res> { + __$$LdkNodeError_OnchainTxCreationFailedImplCopyWithImpl( + _$LdkNodeError_OnchainTxCreationFailedImpl _value, + $Res Function(_$LdkNodeError_OnchainTxCreationFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_OnchainTxCreationFailedImpl + extends LdkNodeError_OnchainTxCreationFailed { + const _$LdkNodeError_OnchainTxCreationFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.onchainTxCreationFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_OnchainTxCreationFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return onchainTxCreationFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return onchainTxCreationFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (onchainTxCreationFailed != null) { + return onchainTxCreationFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return onchainTxCreationFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return onchainTxCreationFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (onchainTxCreationFailed != null) { + return onchainTxCreationFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_OnchainTxCreationFailed extends LdkNodeError { + const factory LdkNodeError_OnchainTxCreationFailed() = + _$LdkNodeError_OnchainTxCreationFailedImpl; + const LdkNodeError_OnchainTxCreationFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_ConnectionFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_ConnectionFailedImplCopyWith( + _$LdkNodeError_ConnectionFailedImpl value, + $Res Function(_$LdkNodeError_ConnectionFailedImpl) then) = + __$$LdkNodeError_ConnectionFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_ConnectionFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_ConnectionFailedImpl> + implements _$$LdkNodeError_ConnectionFailedImplCopyWith<$Res> { + __$$LdkNodeError_ConnectionFailedImplCopyWithImpl( + _$LdkNodeError_ConnectionFailedImpl _value, + $Res Function(_$LdkNodeError_ConnectionFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_ConnectionFailedImpl + extends LdkNodeError_ConnectionFailed { + const _$LdkNodeError_ConnectionFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.connectionFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_ConnectionFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return connectionFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return connectionFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (connectionFailed != null) { + return connectionFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return connectionFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return connectionFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (connectionFailed != null) { + return connectionFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_ConnectionFailed extends LdkNodeError { + const factory LdkNodeError_ConnectionFailed() = + _$LdkNodeError_ConnectionFailedImpl; + const LdkNodeError_ConnectionFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvoiceCreationFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_InvoiceCreationFailedImplCopyWith( + _$LdkNodeError_InvoiceCreationFailedImpl value, + $Res Function(_$LdkNodeError_InvoiceCreationFailedImpl) then) = + __$$LdkNodeError_InvoiceCreationFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvoiceCreationFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InvoiceCreationFailedImpl> + implements _$$LdkNodeError_InvoiceCreationFailedImplCopyWith<$Res> { + __$$LdkNodeError_InvoiceCreationFailedImplCopyWithImpl( + _$LdkNodeError_InvoiceCreationFailedImpl _value, + $Res Function(_$LdkNodeError_InvoiceCreationFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvoiceCreationFailedImpl + extends LdkNodeError_InvoiceCreationFailed { + const _$LdkNodeError_InvoiceCreationFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invoiceCreationFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvoiceCreationFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invoiceCreationFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invoiceCreationFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invoiceCreationFailed != null) { + return invoiceCreationFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invoiceCreationFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invoiceCreationFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invoiceCreationFailed != null) { + return invoiceCreationFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvoiceCreationFailed extends LdkNodeError { + const factory LdkNodeError_InvoiceCreationFailed() = + _$LdkNodeError_InvoiceCreationFailedImpl; + const LdkNodeError_InvoiceCreationFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_PaymentSendingFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_PaymentSendingFailedImplCopyWith( + _$LdkNodeError_PaymentSendingFailedImpl value, + $Res Function(_$LdkNodeError_PaymentSendingFailedImpl) then) = + __$$LdkNodeError_PaymentSendingFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_PaymentSendingFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_PaymentSendingFailedImpl> + implements _$$LdkNodeError_PaymentSendingFailedImplCopyWith<$Res> { + __$$LdkNodeError_PaymentSendingFailedImplCopyWithImpl( + _$LdkNodeError_PaymentSendingFailedImpl _value, + $Res Function(_$LdkNodeError_PaymentSendingFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_PaymentSendingFailedImpl + extends LdkNodeError_PaymentSendingFailed { + const _$LdkNodeError_PaymentSendingFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.paymentSendingFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_PaymentSendingFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return paymentSendingFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return paymentSendingFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (paymentSendingFailed != null) { + return paymentSendingFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return paymentSendingFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return paymentSendingFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (paymentSendingFailed != null) { + return paymentSendingFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_PaymentSendingFailed extends LdkNodeError { + const factory LdkNodeError_PaymentSendingFailed() = + _$LdkNodeError_PaymentSendingFailedImpl; + const LdkNodeError_PaymentSendingFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_ProbeSendingFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_ProbeSendingFailedImplCopyWith( + _$LdkNodeError_ProbeSendingFailedImpl value, + $Res Function(_$LdkNodeError_ProbeSendingFailedImpl) then) = + __$$LdkNodeError_ProbeSendingFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_ProbeSendingFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_ProbeSendingFailedImpl> + implements _$$LdkNodeError_ProbeSendingFailedImplCopyWith<$Res> { + __$$LdkNodeError_ProbeSendingFailedImplCopyWithImpl( + _$LdkNodeError_ProbeSendingFailedImpl _value, + $Res Function(_$LdkNodeError_ProbeSendingFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_ProbeSendingFailedImpl + extends LdkNodeError_ProbeSendingFailed { + const _$LdkNodeError_ProbeSendingFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.probeSendingFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_ProbeSendingFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return probeSendingFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return probeSendingFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (probeSendingFailed != null) { + return probeSendingFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return probeSendingFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return probeSendingFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (probeSendingFailed != null) { + return probeSendingFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_ProbeSendingFailed extends LdkNodeError { + const factory LdkNodeError_ProbeSendingFailed() = + _$LdkNodeError_ProbeSendingFailedImpl; + const LdkNodeError_ProbeSendingFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_ChannelCreationFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_ChannelCreationFailedImplCopyWith( + _$LdkNodeError_ChannelCreationFailedImpl value, + $Res Function(_$LdkNodeError_ChannelCreationFailedImpl) then) = + __$$LdkNodeError_ChannelCreationFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_ChannelCreationFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_ChannelCreationFailedImpl> + implements _$$LdkNodeError_ChannelCreationFailedImplCopyWith<$Res> { + __$$LdkNodeError_ChannelCreationFailedImplCopyWithImpl( + _$LdkNodeError_ChannelCreationFailedImpl _value, + $Res Function(_$LdkNodeError_ChannelCreationFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_ChannelCreationFailedImpl + extends LdkNodeError_ChannelCreationFailed { + const _$LdkNodeError_ChannelCreationFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.channelCreationFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_ChannelCreationFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return channelCreationFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return channelCreationFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (channelCreationFailed != null) { + return channelCreationFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return channelCreationFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return channelCreationFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (channelCreationFailed != null) { + return channelCreationFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_ChannelCreationFailed extends LdkNodeError { + const factory LdkNodeError_ChannelCreationFailed() = + _$LdkNodeError_ChannelCreationFailedImpl; + const LdkNodeError_ChannelCreationFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_ChannelClosingFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_ChannelClosingFailedImplCopyWith( + _$LdkNodeError_ChannelClosingFailedImpl value, + $Res Function(_$LdkNodeError_ChannelClosingFailedImpl) then) = + __$$LdkNodeError_ChannelClosingFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_ChannelClosingFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_ChannelClosingFailedImpl> + implements _$$LdkNodeError_ChannelClosingFailedImplCopyWith<$Res> { + __$$LdkNodeError_ChannelClosingFailedImplCopyWithImpl( + _$LdkNodeError_ChannelClosingFailedImpl _value, + $Res Function(_$LdkNodeError_ChannelClosingFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_ChannelClosingFailedImpl + extends LdkNodeError_ChannelClosingFailed { + const _$LdkNodeError_ChannelClosingFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.channelClosingFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_ChannelClosingFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return channelClosingFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return channelClosingFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (channelClosingFailed != null) { + return channelClosingFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return channelClosingFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return channelClosingFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (channelClosingFailed != null) { + return channelClosingFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_ChannelClosingFailed extends LdkNodeError { + const factory LdkNodeError_ChannelClosingFailed() = + _$LdkNodeError_ChannelClosingFailedImpl; + const LdkNodeError_ChannelClosingFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_ChannelConfigUpdateFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_ChannelConfigUpdateFailedImplCopyWith( + _$LdkNodeError_ChannelConfigUpdateFailedImpl value, + $Res Function(_$LdkNodeError_ChannelConfigUpdateFailedImpl) then) = + __$$LdkNodeError_ChannelConfigUpdateFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_ChannelConfigUpdateFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_ChannelConfigUpdateFailedImpl> + implements _$$LdkNodeError_ChannelConfigUpdateFailedImplCopyWith<$Res> { + __$$LdkNodeError_ChannelConfigUpdateFailedImplCopyWithImpl( + _$LdkNodeError_ChannelConfigUpdateFailedImpl _value, + $Res Function(_$LdkNodeError_ChannelConfigUpdateFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_ChannelConfigUpdateFailedImpl + extends LdkNodeError_ChannelConfigUpdateFailed { + const _$LdkNodeError_ChannelConfigUpdateFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.channelConfigUpdateFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_ChannelConfigUpdateFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return channelConfigUpdateFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return channelConfigUpdateFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (channelConfigUpdateFailed != null) { + return channelConfigUpdateFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return channelConfigUpdateFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return channelConfigUpdateFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (channelConfigUpdateFailed != null) { + return channelConfigUpdateFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_ChannelConfigUpdateFailed extends LdkNodeError { + const factory LdkNodeError_ChannelConfigUpdateFailed() = + _$LdkNodeError_ChannelConfigUpdateFailedImpl; + const LdkNodeError_ChannelConfigUpdateFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_PersistenceFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_PersistenceFailedImplCopyWith( + _$LdkNodeError_PersistenceFailedImpl value, + $Res Function(_$LdkNodeError_PersistenceFailedImpl) then) = + __$$LdkNodeError_PersistenceFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_PersistenceFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_PersistenceFailedImpl> + implements _$$LdkNodeError_PersistenceFailedImplCopyWith<$Res> { + __$$LdkNodeError_PersistenceFailedImplCopyWithImpl( + _$LdkNodeError_PersistenceFailedImpl _value, + $Res Function(_$LdkNodeError_PersistenceFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_PersistenceFailedImpl + extends LdkNodeError_PersistenceFailed { + const _$LdkNodeError_PersistenceFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.persistenceFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_PersistenceFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return persistenceFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return persistenceFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (persistenceFailed != null) { + return persistenceFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return persistenceFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return persistenceFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (persistenceFailed != null) { + return persistenceFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_PersistenceFailed extends LdkNodeError { + const factory LdkNodeError_PersistenceFailed() = + _$LdkNodeError_PersistenceFailedImpl; + const LdkNodeError_PersistenceFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_WalletOperationFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_WalletOperationFailedImplCopyWith( + _$LdkNodeError_WalletOperationFailedImpl value, + $Res Function(_$LdkNodeError_WalletOperationFailedImpl) then) = + __$$LdkNodeError_WalletOperationFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_WalletOperationFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_WalletOperationFailedImpl> + implements _$$LdkNodeError_WalletOperationFailedImplCopyWith<$Res> { + __$$LdkNodeError_WalletOperationFailedImplCopyWithImpl( + _$LdkNodeError_WalletOperationFailedImpl _value, + $Res Function(_$LdkNodeError_WalletOperationFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_WalletOperationFailedImpl + extends LdkNodeError_WalletOperationFailed { + const _$LdkNodeError_WalletOperationFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.walletOperationFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_WalletOperationFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return walletOperationFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return walletOperationFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (walletOperationFailed != null) { + return walletOperationFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return walletOperationFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return walletOperationFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (walletOperationFailed != null) { + return walletOperationFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_WalletOperationFailed extends LdkNodeError { + const factory LdkNodeError_WalletOperationFailed() = + _$LdkNodeError_WalletOperationFailedImpl; + const LdkNodeError_WalletOperationFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_OnchainTxSigningFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_OnchainTxSigningFailedImplCopyWith( + _$LdkNodeError_OnchainTxSigningFailedImpl value, + $Res Function(_$LdkNodeError_OnchainTxSigningFailedImpl) then) = + __$$LdkNodeError_OnchainTxSigningFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_OnchainTxSigningFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_OnchainTxSigningFailedImpl> + implements _$$LdkNodeError_OnchainTxSigningFailedImplCopyWith<$Res> { + __$$LdkNodeError_OnchainTxSigningFailedImplCopyWithImpl( + _$LdkNodeError_OnchainTxSigningFailedImpl _value, + $Res Function(_$LdkNodeError_OnchainTxSigningFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_OnchainTxSigningFailedImpl + extends LdkNodeError_OnchainTxSigningFailed { + const _$LdkNodeError_OnchainTxSigningFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.onchainTxSigningFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_OnchainTxSigningFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return onchainTxSigningFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return onchainTxSigningFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (onchainTxSigningFailed != null) { + return onchainTxSigningFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return onchainTxSigningFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return onchainTxSigningFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (onchainTxSigningFailed != null) { + return onchainTxSigningFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_OnchainTxSigningFailed extends LdkNodeError { + const factory LdkNodeError_OnchainTxSigningFailed() = + _$LdkNodeError_OnchainTxSigningFailedImpl; + const LdkNodeError_OnchainTxSigningFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_MessageSigningFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_MessageSigningFailedImplCopyWith( + _$LdkNodeError_MessageSigningFailedImpl value, + $Res Function(_$LdkNodeError_MessageSigningFailedImpl) then) = + __$$LdkNodeError_MessageSigningFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_MessageSigningFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_MessageSigningFailedImpl> + implements _$$LdkNodeError_MessageSigningFailedImplCopyWith<$Res> { + __$$LdkNodeError_MessageSigningFailedImplCopyWithImpl( + _$LdkNodeError_MessageSigningFailedImpl _value, + $Res Function(_$LdkNodeError_MessageSigningFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_MessageSigningFailedImpl + extends LdkNodeError_MessageSigningFailed { + const _$LdkNodeError_MessageSigningFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.messageSigningFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_MessageSigningFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return messageSigningFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return messageSigningFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (messageSigningFailed != null) { + return messageSigningFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return messageSigningFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return messageSigningFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (messageSigningFailed != null) { + return messageSigningFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_MessageSigningFailed extends LdkNodeError { + const factory LdkNodeError_MessageSigningFailed() = + _$LdkNodeError_MessageSigningFailedImpl; + const LdkNodeError_MessageSigningFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_TxSyncFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_TxSyncFailedImplCopyWith( + _$LdkNodeError_TxSyncFailedImpl value, + $Res Function(_$LdkNodeError_TxSyncFailedImpl) then) = + __$$LdkNodeError_TxSyncFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_TxSyncFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_TxSyncFailedImpl> + implements _$$LdkNodeError_TxSyncFailedImplCopyWith<$Res> { + __$$LdkNodeError_TxSyncFailedImplCopyWithImpl( + _$LdkNodeError_TxSyncFailedImpl _value, + $Res Function(_$LdkNodeError_TxSyncFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_TxSyncFailedImpl extends LdkNodeError_TxSyncFailed { + const _$LdkNodeError_TxSyncFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.txSyncFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_TxSyncFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return txSyncFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return txSyncFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (txSyncFailed != null) { + return txSyncFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return txSyncFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return txSyncFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (txSyncFailed != null) { + return txSyncFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_TxSyncFailed extends LdkNodeError { + const factory LdkNodeError_TxSyncFailed() = _$LdkNodeError_TxSyncFailedImpl; + const LdkNodeError_TxSyncFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_GossipUpdateFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_GossipUpdateFailedImplCopyWith( + _$LdkNodeError_GossipUpdateFailedImpl value, + $Res Function(_$LdkNodeError_GossipUpdateFailedImpl) then) = + __$$LdkNodeError_GossipUpdateFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_GossipUpdateFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_GossipUpdateFailedImpl> + implements _$$LdkNodeError_GossipUpdateFailedImplCopyWith<$Res> { + __$$LdkNodeError_GossipUpdateFailedImplCopyWithImpl( + _$LdkNodeError_GossipUpdateFailedImpl _value, + $Res Function(_$LdkNodeError_GossipUpdateFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_GossipUpdateFailedImpl + extends LdkNodeError_GossipUpdateFailed { + const _$LdkNodeError_GossipUpdateFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.gossipUpdateFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_GossipUpdateFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return gossipUpdateFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return gossipUpdateFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (gossipUpdateFailed != null) { + return gossipUpdateFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return gossipUpdateFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return gossipUpdateFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (gossipUpdateFailed != null) { + return gossipUpdateFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_GossipUpdateFailed extends LdkNodeError { + const factory LdkNodeError_GossipUpdateFailed() = + _$LdkNodeError_GossipUpdateFailedImpl; + const LdkNodeError_GossipUpdateFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidAddressImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidAddressImplCopyWith( + _$LdkNodeError_InvalidAddressImpl value, + $Res Function(_$LdkNodeError_InvalidAddressImpl) then) = + __$$LdkNodeError_InvalidAddressImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidAddressImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_InvalidAddressImpl> + implements _$$LdkNodeError_InvalidAddressImplCopyWith<$Res> { + __$$LdkNodeError_InvalidAddressImplCopyWithImpl( + _$LdkNodeError_InvalidAddressImpl _value, + $Res Function(_$LdkNodeError_InvalidAddressImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidAddressImpl extends LdkNodeError_InvalidAddress { + const _$LdkNodeError_InvalidAddressImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidAddress()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidAddressImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidAddress(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidAddress?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidAddress != null) { + return invalidAddress(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidAddress(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidAddress?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidAddress != null) { + return invalidAddress(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidAddress extends LdkNodeError { + const factory LdkNodeError_InvalidAddress() = + _$LdkNodeError_InvalidAddressImpl; + const LdkNodeError_InvalidAddress._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidSocketAddressImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidSocketAddressImplCopyWith( + _$LdkNodeError_InvalidSocketAddressImpl value, + $Res Function(_$LdkNodeError_InvalidSocketAddressImpl) then) = + __$$LdkNodeError_InvalidSocketAddressImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidSocketAddressImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InvalidSocketAddressImpl> + implements _$$LdkNodeError_InvalidSocketAddressImplCopyWith<$Res> { + __$$LdkNodeError_InvalidSocketAddressImplCopyWithImpl( + _$LdkNodeError_InvalidSocketAddressImpl _value, + $Res Function(_$LdkNodeError_InvalidSocketAddressImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidSocketAddressImpl + extends LdkNodeError_InvalidSocketAddress { + const _$LdkNodeError_InvalidSocketAddressImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidSocketAddress()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidSocketAddressImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidSocketAddress(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidSocketAddress?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidSocketAddress != null) { + return invalidSocketAddress(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidSocketAddress(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidSocketAddress?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidSocketAddress != null) { + return invalidSocketAddress(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidSocketAddress extends LdkNodeError { + const factory LdkNodeError_InvalidSocketAddress() = + _$LdkNodeError_InvalidSocketAddressImpl; + const LdkNodeError_InvalidSocketAddress._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidPublicKeyImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidPublicKeyImplCopyWith( + _$LdkNodeError_InvalidPublicKeyImpl value, + $Res Function(_$LdkNodeError_InvalidPublicKeyImpl) then) = + __$$LdkNodeError_InvalidPublicKeyImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidPublicKeyImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InvalidPublicKeyImpl> + implements _$$LdkNodeError_InvalidPublicKeyImplCopyWith<$Res> { + __$$LdkNodeError_InvalidPublicKeyImplCopyWithImpl( + _$LdkNodeError_InvalidPublicKeyImpl _value, + $Res Function(_$LdkNodeError_InvalidPublicKeyImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidPublicKeyImpl + extends LdkNodeError_InvalidPublicKey { + const _$LdkNodeError_InvalidPublicKeyImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidPublicKey()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidPublicKeyImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidPublicKey(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidPublicKey?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidPublicKey != null) { + return invalidPublicKey(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidPublicKey(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidPublicKey?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidPublicKey != null) { + return invalidPublicKey(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidPublicKey extends LdkNodeError { + const factory LdkNodeError_InvalidPublicKey() = + _$LdkNodeError_InvalidPublicKeyImpl; + const LdkNodeError_InvalidPublicKey._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidSecretKeyImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidSecretKeyImplCopyWith( + _$LdkNodeError_InvalidSecretKeyImpl value, + $Res Function(_$LdkNodeError_InvalidSecretKeyImpl) then) = + __$$LdkNodeError_InvalidSecretKeyImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidSecretKeyImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InvalidSecretKeyImpl> + implements _$$LdkNodeError_InvalidSecretKeyImplCopyWith<$Res> { + __$$LdkNodeError_InvalidSecretKeyImplCopyWithImpl( + _$LdkNodeError_InvalidSecretKeyImpl _value, + $Res Function(_$LdkNodeError_InvalidSecretKeyImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidSecretKeyImpl + extends LdkNodeError_InvalidSecretKey { + const _$LdkNodeError_InvalidSecretKeyImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidSecretKey()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidSecretKeyImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidSecretKey(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidSecretKey?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidSecretKey != null) { + return invalidSecretKey(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidSecretKey(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidSecretKey?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidSecretKey != null) { + return invalidSecretKey(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidSecretKey extends LdkNodeError { + const factory LdkNodeError_InvalidSecretKey() = + _$LdkNodeError_InvalidSecretKeyImpl; + const LdkNodeError_InvalidSecretKey._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidPaymentHashImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidPaymentHashImplCopyWith( + _$LdkNodeError_InvalidPaymentHashImpl value, + $Res Function(_$LdkNodeError_InvalidPaymentHashImpl) then) = + __$$LdkNodeError_InvalidPaymentHashImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidPaymentHashImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InvalidPaymentHashImpl> + implements _$$LdkNodeError_InvalidPaymentHashImplCopyWith<$Res> { + __$$LdkNodeError_InvalidPaymentHashImplCopyWithImpl( + _$LdkNodeError_InvalidPaymentHashImpl _value, + $Res Function(_$LdkNodeError_InvalidPaymentHashImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidPaymentHashImpl + extends LdkNodeError_InvalidPaymentHash { + const _$LdkNodeError_InvalidPaymentHashImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidPaymentHash()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidPaymentHashImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidPaymentHash(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidPaymentHash?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidPaymentHash != null) { + return invalidPaymentHash(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidPaymentHash(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidPaymentHash?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidPaymentHash != null) { + return invalidPaymentHash(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidPaymentHash extends LdkNodeError { + const factory LdkNodeError_InvalidPaymentHash() = + _$LdkNodeError_InvalidPaymentHashImpl; + const LdkNodeError_InvalidPaymentHash._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidPaymentPreimageImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidPaymentPreimageImplCopyWith( + _$LdkNodeError_InvalidPaymentPreimageImpl value, + $Res Function(_$LdkNodeError_InvalidPaymentPreimageImpl) then) = + __$$LdkNodeError_InvalidPaymentPreimageImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidPaymentPreimageImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InvalidPaymentPreimageImpl> + implements _$$LdkNodeError_InvalidPaymentPreimageImplCopyWith<$Res> { + __$$LdkNodeError_InvalidPaymentPreimageImplCopyWithImpl( + _$LdkNodeError_InvalidPaymentPreimageImpl _value, + $Res Function(_$LdkNodeError_InvalidPaymentPreimageImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidPaymentPreimageImpl + extends LdkNodeError_InvalidPaymentPreimage { + const _$LdkNodeError_InvalidPaymentPreimageImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidPaymentPreimage()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidPaymentPreimageImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidPaymentPreimage(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidPaymentPreimage?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidPaymentPreimage != null) { + return invalidPaymentPreimage(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidPaymentPreimage(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidPaymentPreimage?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidPaymentPreimage != null) { + return invalidPaymentPreimage(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidPaymentPreimage extends LdkNodeError { + const factory LdkNodeError_InvalidPaymentPreimage() = + _$LdkNodeError_InvalidPaymentPreimageImpl; + const LdkNodeError_InvalidPaymentPreimage._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidPaymentSecretImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidPaymentSecretImplCopyWith( + _$LdkNodeError_InvalidPaymentSecretImpl value, + $Res Function(_$LdkNodeError_InvalidPaymentSecretImpl) then) = + __$$LdkNodeError_InvalidPaymentSecretImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidPaymentSecretImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InvalidPaymentSecretImpl> + implements _$$LdkNodeError_InvalidPaymentSecretImplCopyWith<$Res> { + __$$LdkNodeError_InvalidPaymentSecretImplCopyWithImpl( + _$LdkNodeError_InvalidPaymentSecretImpl _value, + $Res Function(_$LdkNodeError_InvalidPaymentSecretImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidPaymentSecretImpl + extends LdkNodeError_InvalidPaymentSecret { + const _$LdkNodeError_InvalidPaymentSecretImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidPaymentSecret()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidPaymentSecretImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidPaymentSecret(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidPaymentSecret?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidPaymentSecret != null) { + return invalidPaymentSecret(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidPaymentSecret(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidPaymentSecret?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidPaymentSecret != null) { + return invalidPaymentSecret(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidPaymentSecret extends LdkNodeError { + const factory LdkNodeError_InvalidPaymentSecret() = + _$LdkNodeError_InvalidPaymentSecretImpl; + const LdkNodeError_InvalidPaymentSecret._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidAmountImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidAmountImplCopyWith( + _$LdkNodeError_InvalidAmountImpl value, + $Res Function(_$LdkNodeError_InvalidAmountImpl) then) = + __$$LdkNodeError_InvalidAmountImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidAmountImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_InvalidAmountImpl> + implements _$$LdkNodeError_InvalidAmountImplCopyWith<$Res> { + __$$LdkNodeError_InvalidAmountImplCopyWithImpl( + _$LdkNodeError_InvalidAmountImpl _value, + $Res Function(_$LdkNodeError_InvalidAmountImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidAmountImpl extends LdkNodeError_InvalidAmount { + const _$LdkNodeError_InvalidAmountImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidAmount()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidAmountImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidAmount(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidAmount?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidAmount != null) { + return invalidAmount(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidAmount(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidAmount?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidAmount != null) { + return invalidAmount(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidAmount extends LdkNodeError { + const factory LdkNodeError_InvalidAmount() = _$LdkNodeError_InvalidAmountImpl; + const LdkNodeError_InvalidAmount._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidInvoiceImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidInvoiceImplCopyWith( + _$LdkNodeError_InvalidInvoiceImpl value, + $Res Function(_$LdkNodeError_InvalidInvoiceImpl) then) = + __$$LdkNodeError_InvalidInvoiceImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidInvoiceImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_InvalidInvoiceImpl> + implements _$$LdkNodeError_InvalidInvoiceImplCopyWith<$Res> { + __$$LdkNodeError_InvalidInvoiceImplCopyWithImpl( + _$LdkNodeError_InvalidInvoiceImpl _value, + $Res Function(_$LdkNodeError_InvalidInvoiceImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidInvoiceImpl extends LdkNodeError_InvalidInvoice { + const _$LdkNodeError_InvalidInvoiceImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidInvoice()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidInvoiceImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidInvoice(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidInvoice?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidInvoice != null) { + return invalidInvoice(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidInvoice(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidInvoice?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidInvoice != null) { + return invalidInvoice(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidInvoice extends LdkNodeError { + const factory LdkNodeError_InvalidInvoice() = + _$LdkNodeError_InvalidInvoiceImpl; + const LdkNodeError_InvalidInvoice._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidChannelIdImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidChannelIdImplCopyWith( + _$LdkNodeError_InvalidChannelIdImpl value, + $Res Function(_$LdkNodeError_InvalidChannelIdImpl) then) = + __$$LdkNodeError_InvalidChannelIdImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidChannelIdImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InvalidChannelIdImpl> + implements _$$LdkNodeError_InvalidChannelIdImplCopyWith<$Res> { + __$$LdkNodeError_InvalidChannelIdImplCopyWithImpl( + _$LdkNodeError_InvalidChannelIdImpl _value, + $Res Function(_$LdkNodeError_InvalidChannelIdImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidChannelIdImpl + extends LdkNodeError_InvalidChannelId { + const _$LdkNodeError_InvalidChannelIdImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidChannelId()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidChannelIdImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidChannelId(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidChannelId?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidChannelId != null) { + return invalidChannelId(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidChannelId(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidChannelId?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidChannelId != null) { + return invalidChannelId(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidChannelId extends LdkNodeError { + const factory LdkNodeError_InvalidChannelId() = + _$LdkNodeError_InvalidChannelIdImpl; + const LdkNodeError_InvalidChannelId._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidNetworkImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidNetworkImplCopyWith( + _$LdkNodeError_InvalidNetworkImpl value, + $Res Function(_$LdkNodeError_InvalidNetworkImpl) then) = + __$$LdkNodeError_InvalidNetworkImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidNetworkImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_InvalidNetworkImpl> + implements _$$LdkNodeError_InvalidNetworkImplCopyWith<$Res> { + __$$LdkNodeError_InvalidNetworkImplCopyWithImpl( + _$LdkNodeError_InvalidNetworkImpl _value, + $Res Function(_$LdkNodeError_InvalidNetworkImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidNetworkImpl extends LdkNodeError_InvalidNetwork { + const _$LdkNodeError_InvalidNetworkImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidNetwork()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidNetworkImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidNetwork(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidNetwork?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidNetwork != null) { + return invalidNetwork(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidNetwork(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidNetwork?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidNetwork != null) { + return invalidNetwork(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidNetwork extends LdkNodeError { + const factory LdkNodeError_InvalidNetwork() = + _$LdkNodeError_InvalidNetworkImpl; + const LdkNodeError_InvalidNetwork._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_DuplicatePaymentImplCopyWith<$Res> { + factory _$$LdkNodeError_DuplicatePaymentImplCopyWith( + _$LdkNodeError_DuplicatePaymentImpl value, + $Res Function(_$LdkNodeError_DuplicatePaymentImpl) then) = + __$$LdkNodeError_DuplicatePaymentImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_DuplicatePaymentImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_DuplicatePaymentImpl> + implements _$$LdkNodeError_DuplicatePaymentImplCopyWith<$Res> { + __$$LdkNodeError_DuplicatePaymentImplCopyWithImpl( + _$LdkNodeError_DuplicatePaymentImpl _value, + $Res Function(_$LdkNodeError_DuplicatePaymentImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_DuplicatePaymentImpl + extends LdkNodeError_DuplicatePayment { + const _$LdkNodeError_DuplicatePaymentImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.duplicatePayment()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_DuplicatePaymentImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return duplicatePayment(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return duplicatePayment?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (duplicatePayment != null) { + return duplicatePayment(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return duplicatePayment(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return duplicatePayment?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (duplicatePayment != null) { + return duplicatePayment(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_DuplicatePayment extends LdkNodeError { + const factory LdkNodeError_DuplicatePayment() = + _$LdkNodeError_DuplicatePaymentImpl; + const LdkNodeError_DuplicatePayment._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InsufficientFundsImplCopyWith<$Res> { + factory _$$LdkNodeError_InsufficientFundsImplCopyWith( + _$LdkNodeError_InsufficientFundsImpl value, + $Res Function(_$LdkNodeError_InsufficientFundsImpl) then) = + __$$LdkNodeError_InsufficientFundsImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InsufficientFundsImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InsufficientFundsImpl> + implements _$$LdkNodeError_InsufficientFundsImplCopyWith<$Res> { + __$$LdkNodeError_InsufficientFundsImplCopyWithImpl( + _$LdkNodeError_InsufficientFundsImpl _value, + $Res Function(_$LdkNodeError_InsufficientFundsImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InsufficientFundsImpl + extends LdkNodeError_InsufficientFunds { + const _$LdkNodeError_InsufficientFundsImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.insufficientFunds()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InsufficientFundsImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return insufficientFunds(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return insufficientFunds?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (insufficientFunds != null) { + return insufficientFunds(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return insufficientFunds(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return insufficientFunds?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (insufficientFunds != null) { + return insufficientFunds(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InsufficientFunds extends LdkNodeError { + const factory LdkNodeError_InsufficientFunds() = + _$LdkNodeError_InsufficientFundsImpl; + const LdkNodeError_InsufficientFunds._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_FeerateEstimationUpdateFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_FeerateEstimationUpdateFailedImplCopyWith( + _$LdkNodeError_FeerateEstimationUpdateFailedImpl value, + $Res Function(_$LdkNodeError_FeerateEstimationUpdateFailedImpl) + then) = + __$$LdkNodeError_FeerateEstimationUpdateFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_FeerateEstimationUpdateFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_FeerateEstimationUpdateFailedImpl> + implements _$$LdkNodeError_FeerateEstimationUpdateFailedImplCopyWith<$Res> { + __$$LdkNodeError_FeerateEstimationUpdateFailedImplCopyWithImpl( + _$LdkNodeError_FeerateEstimationUpdateFailedImpl _value, + $Res Function(_$LdkNodeError_FeerateEstimationUpdateFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_FeerateEstimationUpdateFailedImpl + extends LdkNodeError_FeerateEstimationUpdateFailed { + const _$LdkNodeError_FeerateEstimationUpdateFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.feerateEstimationUpdateFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_FeerateEstimationUpdateFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return feerateEstimationUpdateFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return feerateEstimationUpdateFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (feerateEstimationUpdateFailed != null) { + return feerateEstimationUpdateFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return feerateEstimationUpdateFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return feerateEstimationUpdateFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (feerateEstimationUpdateFailed != null) { + return feerateEstimationUpdateFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_FeerateEstimationUpdateFailed extends LdkNodeError { + const factory LdkNodeError_FeerateEstimationUpdateFailed() = + _$LdkNodeError_FeerateEstimationUpdateFailedImpl; + const LdkNodeError_FeerateEstimationUpdateFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_LiquidityRequestFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_LiquidityRequestFailedImplCopyWith( + _$LdkNodeError_LiquidityRequestFailedImpl value, + $Res Function(_$LdkNodeError_LiquidityRequestFailedImpl) then) = + __$$LdkNodeError_LiquidityRequestFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_LiquidityRequestFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_LiquidityRequestFailedImpl> + implements _$$LdkNodeError_LiquidityRequestFailedImplCopyWith<$Res> { + __$$LdkNodeError_LiquidityRequestFailedImplCopyWithImpl( + _$LdkNodeError_LiquidityRequestFailedImpl _value, + $Res Function(_$LdkNodeError_LiquidityRequestFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_LiquidityRequestFailedImpl + extends LdkNodeError_LiquidityRequestFailed { + const _$LdkNodeError_LiquidityRequestFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.liquidityRequestFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_LiquidityRequestFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return liquidityRequestFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return liquidityRequestFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (liquidityRequestFailed != null) { + return liquidityRequestFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return liquidityRequestFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return liquidityRequestFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (liquidityRequestFailed != null) { + return liquidityRequestFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_LiquidityRequestFailed extends LdkNodeError { + const factory LdkNodeError_LiquidityRequestFailed() = + _$LdkNodeError_LiquidityRequestFailedImpl; + const LdkNodeError_LiquidityRequestFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_LiquiditySourceUnavailableImplCopyWith<$Res> { + factory _$$LdkNodeError_LiquiditySourceUnavailableImplCopyWith( + _$LdkNodeError_LiquiditySourceUnavailableImpl value, + $Res Function(_$LdkNodeError_LiquiditySourceUnavailableImpl) then) = + __$$LdkNodeError_LiquiditySourceUnavailableImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_LiquiditySourceUnavailableImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_LiquiditySourceUnavailableImpl> + implements _$$LdkNodeError_LiquiditySourceUnavailableImplCopyWith<$Res> { + __$$LdkNodeError_LiquiditySourceUnavailableImplCopyWithImpl( + _$LdkNodeError_LiquiditySourceUnavailableImpl _value, + $Res Function(_$LdkNodeError_LiquiditySourceUnavailableImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_LiquiditySourceUnavailableImpl + extends LdkNodeError_LiquiditySourceUnavailable { + const _$LdkNodeError_LiquiditySourceUnavailableImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.liquiditySourceUnavailable()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_LiquiditySourceUnavailableImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return liquiditySourceUnavailable(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return liquiditySourceUnavailable?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (liquiditySourceUnavailable != null) { + return liquiditySourceUnavailable(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return liquiditySourceUnavailable(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return liquiditySourceUnavailable?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (liquiditySourceUnavailable != null) { + return liquiditySourceUnavailable(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_LiquiditySourceUnavailable extends LdkNodeError { + const factory LdkNodeError_LiquiditySourceUnavailable() = + _$LdkNodeError_LiquiditySourceUnavailableImpl; + const LdkNodeError_LiquiditySourceUnavailable._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_LiquidityFeeTooHighImplCopyWith<$Res> { + factory _$$LdkNodeError_LiquidityFeeTooHighImplCopyWith( + _$LdkNodeError_LiquidityFeeTooHighImpl value, + $Res Function(_$LdkNodeError_LiquidityFeeTooHighImpl) then) = + __$$LdkNodeError_LiquidityFeeTooHighImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_LiquidityFeeTooHighImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_LiquidityFeeTooHighImpl> + implements _$$LdkNodeError_LiquidityFeeTooHighImplCopyWith<$Res> { + __$$LdkNodeError_LiquidityFeeTooHighImplCopyWithImpl( + _$LdkNodeError_LiquidityFeeTooHighImpl _value, + $Res Function(_$LdkNodeError_LiquidityFeeTooHighImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_LiquidityFeeTooHighImpl + extends LdkNodeError_LiquidityFeeTooHigh { + const _$LdkNodeError_LiquidityFeeTooHighImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.liquidityFeeTooHigh()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_LiquidityFeeTooHighImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return liquidityFeeTooHigh(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return liquidityFeeTooHigh?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (liquidityFeeTooHigh != null) { + return liquidityFeeTooHigh(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return liquidityFeeTooHigh(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return liquidityFeeTooHigh?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (liquidityFeeTooHigh != null) { + return liquidityFeeTooHigh(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_LiquidityFeeTooHigh extends LdkNodeError { + const factory LdkNodeError_LiquidityFeeTooHigh() = + _$LdkNodeError_LiquidityFeeTooHighImpl; + const LdkNodeError_LiquidityFeeTooHigh._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidPaymentIdImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidPaymentIdImplCopyWith( + _$LdkNodeError_InvalidPaymentIdImpl value, + $Res Function(_$LdkNodeError_InvalidPaymentIdImpl) then) = + __$$LdkNodeError_InvalidPaymentIdImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidPaymentIdImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InvalidPaymentIdImpl> + implements _$$LdkNodeError_InvalidPaymentIdImplCopyWith<$Res> { + __$$LdkNodeError_InvalidPaymentIdImplCopyWithImpl( + _$LdkNodeError_InvalidPaymentIdImpl _value, + $Res Function(_$LdkNodeError_InvalidPaymentIdImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidPaymentIdImpl + extends LdkNodeError_InvalidPaymentId { + const _$LdkNodeError_InvalidPaymentIdImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidPaymentId()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidPaymentIdImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidPaymentId(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidPaymentId?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidPaymentId != null) { + return invalidPaymentId(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidPaymentId(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidPaymentId?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidPaymentId != null) { + return invalidPaymentId(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidPaymentId extends LdkNodeError { + const factory LdkNodeError_InvalidPaymentId() = + _$LdkNodeError_InvalidPaymentIdImpl; + const LdkNodeError_InvalidPaymentId._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_DecodeImplCopyWith<$Res> { + factory _$$LdkNodeError_DecodeImplCopyWith(_$LdkNodeError_DecodeImpl value, + $Res Function(_$LdkNodeError_DecodeImpl) then) = + __$$LdkNodeError_DecodeImplCopyWithImpl<$Res>; + @useResult + $Res call({DecodeError field0}); + + $DecodeErrorCopyWith<$Res> get field0; +} + +/// @nodoc +class __$$LdkNodeError_DecodeImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_DecodeImpl> + implements _$$LdkNodeError_DecodeImplCopyWith<$Res> { + __$$LdkNodeError_DecodeImplCopyWithImpl(_$LdkNodeError_DecodeImpl _value, + $Res Function(_$LdkNodeError_DecodeImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? field0 = null, + }) { + return _then(_$LdkNodeError_DecodeImpl( + null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as DecodeError, + )); + } + + @override + @pragma('vm:prefer-inline') + $DecodeErrorCopyWith<$Res> get field0 { + return $DecodeErrorCopyWith<$Res>(_value.field0, (value) { + return _then(_value.copyWith(field0: value)); + }); + } +} + +/// @nodoc + +class _$LdkNodeError_DecodeImpl extends LdkNodeError_Decode { + const _$LdkNodeError_DecodeImpl(this.field0) : super._(); + + @override + final DecodeError field0; + + @override + String toString() { + return 'LdkNodeError.decode(field0: $field0)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_DecodeImpl && + (identical(other.field0, field0) || other.field0 == field0)); + } + + @override + int get hashCode => Object.hash(runtimeType, field0); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$LdkNodeError_DecodeImplCopyWith<_$LdkNodeError_DecodeImpl> get copyWith => + __$$LdkNodeError_DecodeImplCopyWithImpl<_$LdkNodeError_DecodeImpl>( + this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return decode(field0); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return decode?.call(field0); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (decode != null) { + return decode(field0); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return decode(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return decode?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (decode != null) { + return decode(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_Decode extends LdkNodeError { + const factory LdkNodeError_Decode(final DecodeError field0) = + _$LdkNodeError_DecodeImpl; + const LdkNodeError_Decode._() : super._(); + + DecodeError get field0; + @JsonKey(ignore: true) + _$$LdkNodeError_DecodeImplCopyWith<_$LdkNodeError_DecodeImpl> get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$LdkNodeError_Bolt12ParseImplCopyWith<$Res> { + factory _$$LdkNodeError_Bolt12ParseImplCopyWith( + _$LdkNodeError_Bolt12ParseImpl value, + $Res Function(_$LdkNodeError_Bolt12ParseImpl) then) = + __$$LdkNodeError_Bolt12ParseImplCopyWithImpl<$Res>; + @useResult + $Res call({Bolt12ParseError field0}); + + $Bolt12ParseErrorCopyWith<$Res> get field0; +} + +/// @nodoc +class __$$LdkNodeError_Bolt12ParseImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_Bolt12ParseImpl> + implements _$$LdkNodeError_Bolt12ParseImplCopyWith<$Res> { + __$$LdkNodeError_Bolt12ParseImplCopyWithImpl( + _$LdkNodeError_Bolt12ParseImpl _value, + $Res Function(_$LdkNodeError_Bolt12ParseImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? field0 = null, + }) { + return _then(_$LdkNodeError_Bolt12ParseImpl( + null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as Bolt12ParseError, + )); + } + + @override + @pragma('vm:prefer-inline') + $Bolt12ParseErrorCopyWith<$Res> get field0 { + return $Bolt12ParseErrorCopyWith<$Res>(_value.field0, (value) { + return _then(_value.copyWith(field0: value)); + }); + } +} + +/// @nodoc + +class _$LdkNodeError_Bolt12ParseImpl extends LdkNodeError_Bolt12Parse { + const _$LdkNodeError_Bolt12ParseImpl(this.field0) : super._(); + + @override + final Bolt12ParseError field0; + + @override + String toString() { + return 'LdkNodeError.bolt12Parse(field0: $field0)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_Bolt12ParseImpl && + (identical(other.field0, field0) || other.field0 == field0)); + } + + @override + int get hashCode => Object.hash(runtimeType, field0); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$LdkNodeError_Bolt12ParseImplCopyWith<_$LdkNodeError_Bolt12ParseImpl> + get copyWith => __$$LdkNodeError_Bolt12ParseImplCopyWithImpl< + _$LdkNodeError_Bolt12ParseImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return bolt12Parse(field0); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return bolt12Parse?.call(field0); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (bolt12Parse != null) { + return bolt12Parse(field0); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return bolt12Parse(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return bolt12Parse?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (bolt12Parse != null) { + return bolt12Parse(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_Bolt12Parse extends LdkNodeError { + const factory LdkNodeError_Bolt12Parse(final Bolt12ParseError field0) = + _$LdkNodeError_Bolt12ParseImpl; + const LdkNodeError_Bolt12Parse._() : super._(); + + Bolt12ParseError get field0; + @JsonKey(ignore: true) + _$$LdkNodeError_Bolt12ParseImplCopyWith<_$LdkNodeError_Bolt12ParseImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$LdkNodeError_InvoiceRequestCreationFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_InvoiceRequestCreationFailedImplCopyWith( + _$LdkNodeError_InvoiceRequestCreationFailedImpl value, + $Res Function(_$LdkNodeError_InvoiceRequestCreationFailedImpl) then) = + __$$LdkNodeError_InvoiceRequestCreationFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvoiceRequestCreationFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InvoiceRequestCreationFailedImpl> + implements _$$LdkNodeError_InvoiceRequestCreationFailedImplCopyWith<$Res> { + __$$LdkNodeError_InvoiceRequestCreationFailedImplCopyWithImpl( + _$LdkNodeError_InvoiceRequestCreationFailedImpl _value, + $Res Function(_$LdkNodeError_InvoiceRequestCreationFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvoiceRequestCreationFailedImpl + extends LdkNodeError_InvoiceRequestCreationFailed { + const _$LdkNodeError_InvoiceRequestCreationFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invoiceRequestCreationFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvoiceRequestCreationFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invoiceRequestCreationFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invoiceRequestCreationFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invoiceRequestCreationFailed != null) { + return invoiceRequestCreationFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invoiceRequestCreationFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invoiceRequestCreationFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invoiceRequestCreationFailed != null) { + return invoiceRequestCreationFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvoiceRequestCreationFailed extends LdkNodeError { + const factory LdkNodeError_InvoiceRequestCreationFailed() = + _$LdkNodeError_InvoiceRequestCreationFailedImpl; + const LdkNodeError_InvoiceRequestCreationFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_OfferCreationFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_OfferCreationFailedImplCopyWith( + _$LdkNodeError_OfferCreationFailedImpl value, + $Res Function(_$LdkNodeError_OfferCreationFailedImpl) then) = + __$$LdkNodeError_OfferCreationFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_OfferCreationFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_OfferCreationFailedImpl> + implements _$$LdkNodeError_OfferCreationFailedImplCopyWith<$Res> { + __$$LdkNodeError_OfferCreationFailedImplCopyWithImpl( + _$LdkNodeError_OfferCreationFailedImpl _value, + $Res Function(_$LdkNodeError_OfferCreationFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_OfferCreationFailedImpl + extends LdkNodeError_OfferCreationFailed { + const _$LdkNodeError_OfferCreationFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.offerCreationFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_OfferCreationFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return offerCreationFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return offerCreationFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (offerCreationFailed != null) { + return offerCreationFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return offerCreationFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return offerCreationFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (offerCreationFailed != null) { + return offerCreationFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_OfferCreationFailed extends LdkNodeError { + const factory LdkNodeError_OfferCreationFailed() = + _$LdkNodeError_OfferCreationFailedImpl; + const LdkNodeError_OfferCreationFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_RefundCreationFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_RefundCreationFailedImplCopyWith( + _$LdkNodeError_RefundCreationFailedImpl value, + $Res Function(_$LdkNodeError_RefundCreationFailedImpl) then) = + __$$LdkNodeError_RefundCreationFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_RefundCreationFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_RefundCreationFailedImpl> + implements _$$LdkNodeError_RefundCreationFailedImplCopyWith<$Res> { + __$$LdkNodeError_RefundCreationFailedImplCopyWithImpl( + _$LdkNodeError_RefundCreationFailedImpl _value, + $Res Function(_$LdkNodeError_RefundCreationFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_RefundCreationFailedImpl + extends LdkNodeError_RefundCreationFailed { + const _$LdkNodeError_RefundCreationFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.refundCreationFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_RefundCreationFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return refundCreationFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return refundCreationFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (refundCreationFailed != null) { + return refundCreationFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return refundCreationFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return refundCreationFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (refundCreationFailed != null) { + return refundCreationFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_RefundCreationFailed extends LdkNodeError { + const factory LdkNodeError_RefundCreationFailed() = + _$LdkNodeError_RefundCreationFailedImpl; + const LdkNodeError_RefundCreationFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_FeerateEstimationUpdateTimeoutImplCopyWith< + $Res> { + factory _$$LdkNodeError_FeerateEstimationUpdateTimeoutImplCopyWith( + _$LdkNodeError_FeerateEstimationUpdateTimeoutImpl value, + $Res Function(_$LdkNodeError_FeerateEstimationUpdateTimeoutImpl) + then) = + __$$LdkNodeError_FeerateEstimationUpdateTimeoutImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_FeerateEstimationUpdateTimeoutImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_FeerateEstimationUpdateTimeoutImpl> + implements + _$$LdkNodeError_FeerateEstimationUpdateTimeoutImplCopyWith<$Res> { + __$$LdkNodeError_FeerateEstimationUpdateTimeoutImplCopyWithImpl( + _$LdkNodeError_FeerateEstimationUpdateTimeoutImpl _value, + $Res Function(_$LdkNodeError_FeerateEstimationUpdateTimeoutImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_FeerateEstimationUpdateTimeoutImpl + extends LdkNodeError_FeerateEstimationUpdateTimeout { + const _$LdkNodeError_FeerateEstimationUpdateTimeoutImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.feerateEstimationUpdateTimeout()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_FeerateEstimationUpdateTimeoutImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return feerateEstimationUpdateTimeout(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return feerateEstimationUpdateTimeout?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (feerateEstimationUpdateTimeout != null) { + return feerateEstimationUpdateTimeout(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return feerateEstimationUpdateTimeout(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return feerateEstimationUpdateTimeout?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (feerateEstimationUpdateTimeout != null) { + return feerateEstimationUpdateTimeout(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_FeerateEstimationUpdateTimeout + extends LdkNodeError { + const factory LdkNodeError_FeerateEstimationUpdateTimeout() = + _$LdkNodeError_FeerateEstimationUpdateTimeoutImpl; + const LdkNodeError_FeerateEstimationUpdateTimeout._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_WalletOperationTimeoutImplCopyWith<$Res> { + factory _$$LdkNodeError_WalletOperationTimeoutImplCopyWith( + _$LdkNodeError_WalletOperationTimeoutImpl value, + $Res Function(_$LdkNodeError_WalletOperationTimeoutImpl) then) = + __$$LdkNodeError_WalletOperationTimeoutImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_WalletOperationTimeoutImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_WalletOperationTimeoutImpl> + implements _$$LdkNodeError_WalletOperationTimeoutImplCopyWith<$Res> { + __$$LdkNodeError_WalletOperationTimeoutImplCopyWithImpl( + _$LdkNodeError_WalletOperationTimeoutImpl _value, + $Res Function(_$LdkNodeError_WalletOperationTimeoutImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_WalletOperationTimeoutImpl + extends LdkNodeError_WalletOperationTimeout { + const _$LdkNodeError_WalletOperationTimeoutImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.walletOperationTimeout()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_WalletOperationTimeoutImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return walletOperationTimeout(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return walletOperationTimeout?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (walletOperationTimeout != null) { + return walletOperationTimeout(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return walletOperationTimeout(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return walletOperationTimeout?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (walletOperationTimeout != null) { + return walletOperationTimeout(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_WalletOperationTimeout extends LdkNodeError { + const factory LdkNodeError_WalletOperationTimeout() = + _$LdkNodeError_WalletOperationTimeoutImpl; + const LdkNodeError_WalletOperationTimeout._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_TxSyncTimeoutImplCopyWith<$Res> { + factory _$$LdkNodeError_TxSyncTimeoutImplCopyWith( + _$LdkNodeError_TxSyncTimeoutImpl value, + $Res Function(_$LdkNodeError_TxSyncTimeoutImpl) then) = + __$$LdkNodeError_TxSyncTimeoutImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_TxSyncTimeoutImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_TxSyncTimeoutImpl> + implements _$$LdkNodeError_TxSyncTimeoutImplCopyWith<$Res> { + __$$LdkNodeError_TxSyncTimeoutImplCopyWithImpl( + _$LdkNodeError_TxSyncTimeoutImpl _value, + $Res Function(_$LdkNodeError_TxSyncTimeoutImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_TxSyncTimeoutImpl extends LdkNodeError_TxSyncTimeout { + const _$LdkNodeError_TxSyncTimeoutImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.txSyncTimeout()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_TxSyncTimeoutImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return txSyncTimeout(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return txSyncTimeout?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (txSyncTimeout != null) { + return txSyncTimeout(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return txSyncTimeout(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return txSyncTimeout?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (txSyncTimeout != null) { + return txSyncTimeout(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_TxSyncTimeout extends LdkNodeError { + const factory LdkNodeError_TxSyncTimeout() = _$LdkNodeError_TxSyncTimeoutImpl; + const LdkNodeError_TxSyncTimeout._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_GossipUpdateTimeoutImplCopyWith<$Res> { + factory _$$LdkNodeError_GossipUpdateTimeoutImplCopyWith( + _$LdkNodeError_GossipUpdateTimeoutImpl value, + $Res Function(_$LdkNodeError_GossipUpdateTimeoutImpl) then) = + __$$LdkNodeError_GossipUpdateTimeoutImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_GossipUpdateTimeoutImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_GossipUpdateTimeoutImpl> + implements _$$LdkNodeError_GossipUpdateTimeoutImplCopyWith<$Res> { + __$$LdkNodeError_GossipUpdateTimeoutImplCopyWithImpl( + _$LdkNodeError_GossipUpdateTimeoutImpl _value, + $Res Function(_$LdkNodeError_GossipUpdateTimeoutImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_GossipUpdateTimeoutImpl + extends LdkNodeError_GossipUpdateTimeout { + const _$LdkNodeError_GossipUpdateTimeoutImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.gossipUpdateTimeout()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_GossipUpdateTimeoutImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return gossipUpdateTimeout(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return gossipUpdateTimeout?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (gossipUpdateTimeout != null) { + return gossipUpdateTimeout(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return gossipUpdateTimeout(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return gossipUpdateTimeout?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (gossipUpdateTimeout != null) { + return gossipUpdateTimeout(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_GossipUpdateTimeout extends LdkNodeError { + const factory LdkNodeError_GossipUpdateTimeout() = + _$LdkNodeError_GossipUpdateTimeoutImpl; + const LdkNodeError_GossipUpdateTimeout._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidOfferIdImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidOfferIdImplCopyWith( + _$LdkNodeError_InvalidOfferIdImpl value, + $Res Function(_$LdkNodeError_InvalidOfferIdImpl) then) = + __$$LdkNodeError_InvalidOfferIdImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidOfferIdImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_InvalidOfferIdImpl> + implements _$$LdkNodeError_InvalidOfferIdImplCopyWith<$Res> { + __$$LdkNodeError_InvalidOfferIdImplCopyWithImpl( + _$LdkNodeError_InvalidOfferIdImpl _value, + $Res Function(_$LdkNodeError_InvalidOfferIdImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidOfferIdImpl extends LdkNodeError_InvalidOfferId { + const _$LdkNodeError_InvalidOfferIdImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidOfferId()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidOfferIdImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidOfferId(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidOfferId?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidOfferId != null) { + return invalidOfferId(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidOfferId(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidOfferId?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidOfferId != null) { + return invalidOfferId(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidOfferId extends LdkNodeError { + const factory LdkNodeError_InvalidOfferId() = + _$LdkNodeError_InvalidOfferIdImpl; + const LdkNodeError_InvalidOfferId._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidNodeIdImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidNodeIdImplCopyWith( + _$LdkNodeError_InvalidNodeIdImpl value, + $Res Function(_$LdkNodeError_InvalidNodeIdImpl) then) = + __$$LdkNodeError_InvalidNodeIdImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidNodeIdImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_InvalidNodeIdImpl> + implements _$$LdkNodeError_InvalidNodeIdImplCopyWith<$Res> { + __$$LdkNodeError_InvalidNodeIdImplCopyWithImpl( + _$LdkNodeError_InvalidNodeIdImpl _value, + $Res Function(_$LdkNodeError_InvalidNodeIdImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidNodeIdImpl extends LdkNodeError_InvalidNodeId { + const _$LdkNodeError_InvalidNodeIdImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidNodeId()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidNodeIdImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidNodeId(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidNodeId?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidNodeId != null) { + return invalidNodeId(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidNodeId(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidNodeId?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidNodeId != null) { + return invalidNodeId(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidNodeId extends LdkNodeError { + const factory LdkNodeError_InvalidNodeId() = _$LdkNodeError_InvalidNodeIdImpl; + const LdkNodeError_InvalidNodeId._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidOfferImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidOfferImplCopyWith( + _$LdkNodeError_InvalidOfferImpl value, + $Res Function(_$LdkNodeError_InvalidOfferImpl) then) = + __$$LdkNodeError_InvalidOfferImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidOfferImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_InvalidOfferImpl> + implements _$$LdkNodeError_InvalidOfferImplCopyWith<$Res> { + __$$LdkNodeError_InvalidOfferImplCopyWithImpl( + _$LdkNodeError_InvalidOfferImpl _value, + $Res Function(_$LdkNodeError_InvalidOfferImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidOfferImpl extends LdkNodeError_InvalidOffer { + const _$LdkNodeError_InvalidOfferImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidOffer()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidOfferImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidOffer(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidOffer?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidOffer != null) { + return invalidOffer(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidOffer(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidOffer?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidOffer != null) { + return invalidOffer(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidOffer extends LdkNodeError { + const factory LdkNodeError_InvalidOffer() = _$LdkNodeError_InvalidOfferImpl; + const LdkNodeError_InvalidOffer._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidRefundImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidRefundImplCopyWith( + _$LdkNodeError_InvalidRefundImpl value, + $Res Function(_$LdkNodeError_InvalidRefundImpl) then) = + __$$LdkNodeError_InvalidRefundImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidRefundImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_InvalidRefundImpl> + implements _$$LdkNodeError_InvalidRefundImplCopyWith<$Res> { + __$$LdkNodeError_InvalidRefundImplCopyWithImpl( + _$LdkNodeError_InvalidRefundImpl _value, + $Res Function(_$LdkNodeError_InvalidRefundImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidRefundImpl extends LdkNodeError_InvalidRefund { + const _$LdkNodeError_InvalidRefundImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidRefund()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidRefundImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidRefund(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidRefund?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidRefund != null) { + return invalidRefund(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidRefund(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidRefund?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidRefund != null) { + return invalidRefund(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidRefund extends LdkNodeError { + const factory LdkNodeError_InvalidRefund() = _$LdkNodeError_InvalidRefundImpl; + const LdkNodeError_InvalidRefund._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_UnsupportedCurrencyImplCopyWith<$Res> { + factory _$$LdkNodeError_UnsupportedCurrencyImplCopyWith( + _$LdkNodeError_UnsupportedCurrencyImpl value, + $Res Function(_$LdkNodeError_UnsupportedCurrencyImpl) then) = + __$$LdkNodeError_UnsupportedCurrencyImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_UnsupportedCurrencyImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_UnsupportedCurrencyImpl> + implements _$$LdkNodeError_UnsupportedCurrencyImplCopyWith<$Res> { + __$$LdkNodeError_UnsupportedCurrencyImplCopyWithImpl( + _$LdkNodeError_UnsupportedCurrencyImpl _value, + $Res Function(_$LdkNodeError_UnsupportedCurrencyImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_UnsupportedCurrencyImpl + extends LdkNodeError_UnsupportedCurrency { + const _$LdkNodeError_UnsupportedCurrencyImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.unsupportedCurrency()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_UnsupportedCurrencyImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return unsupportedCurrency(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return unsupportedCurrency?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (unsupportedCurrency != null) { + return unsupportedCurrency(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return unsupportedCurrency(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return unsupportedCurrency?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (unsupportedCurrency != null) { + return unsupportedCurrency(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_UnsupportedCurrency extends LdkNodeError { + const factory LdkNodeError_UnsupportedCurrency() = + _$LdkNodeError_UnsupportedCurrencyImpl; + const LdkNodeError_UnsupportedCurrency._() : super._(); +} diff --git a/rust/src/api/error.rs b/rust/src/api/error.rs deleted file mode 100644 index 0cceb27..0000000 --- a/rust/src/api/error.rs +++ /dev/null @@ -1,182 +0,0 @@ -use ldk_node::{ BuildError, NodeError }; - - -#[derive(Debug, PartialEq)] -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. - NotRunning, - /// An on-chain transaction could not be created. - OnchainTxCreationFailed, - /// A network connection has been closed. - ConnectionFailed, - /// Invoice creation failed. - InvoiceCreationFailed, - /// Sending a payment has failed. - PaymentSendingFailed, - /// Sending a payment probe has failed. - ProbeSendingFailed, - /// A channel could not be opened. - ChannelCreationFailed, - /// A channel could not be closed. - ChannelClosingFailed, - /// A channel config could not be updated. - ChannelConfigUpdateFailed, - /// Persistence failed. - PersistenceFailed, - /// A wallet operation failed. - WalletOperationFailed, - /// A signing operation for transaction failed. - OnchainTxSigningFailed, - /// A signing operation for message failed. - MessageSigningFailed, - /// A transaction sync operation failed. - TxSyncFailed, - /// A gossip updating operation failed. - GossipUpdateFailed, - /// The given address is invalid. - InvalidAddress, - /// The given network address is invalid. - InvalidSocketAddress, - /// The given public key is invalid. - InvalidPublicKey, - /// The given secret key is invalid. - InvalidSecretKey, - /// The given payment hash is invalid. - InvalidPaymentHash, - /// The given payment preimage is invalid. - InvalidPaymentPreimage, - /// The given payment secret is invalid. - InvalidPaymentSecret, - /// The given amount is invalid. - InvalidAmount, - /// The given invoice is invalid. - InvalidInvoice, - /// The given channel ID is invalid. - InvalidChannelId, - /// The given network is invalid. - InvalidNetwork, - /// A payment with the given hash has already been initiated. - DuplicatePayment, - /// There are insufficient funds to complete the given operation. - InsufficientFunds, - ///A fee rate estimation update failed. - FeerateEstimationUpdateFailed, - ///A liquidity request operation failed. - LiquidityRequestFailed, - ///The given operation failed due to the required liquidity source being unavailable. - LiquiditySourceUnavailable, - ///The given operation failed due to the LSP's required opening fee being too high. - LiquidityFeeTooHigh, - ///The given payment id is invalid. - InvalidPaymentId, - ///An error in decoding a message or struct. - DecodeError, -} -#[allow(dead_code)] -#[derive(Debug)] -pub enum BuilderException { - SocketAddressParseError, - /// The given seed bytes are invalid, e.g., have invalid length. - InvalidSeedBytes, - /// The given seed file is invalid, e.g., has invalid length, or could not be read. - InvalidSeedFile, - /// The current system time is invalid, clocks might have gone backwards. - InvalidSystemTime, - /// The a read channel monitor is invalid. - InvalidChannelMonitor, - /// The given listening addresses are invalid, e.g. too many were passed. - InvalidListeningAddress, - /// We failed to read data from the [`KVStore`]. - ReadFailed, - /// We failed to write data to the [`KVStore`]. - WriteFailed, - /// We failed to access the given `storage_dir_path`. - StoragePathAccessFailed, - /// We failed to setup our [`KVStore`]. - KVStoreSetupFailed, - /// We failed to setup the onchain wallet. - WalletSetupFailed, - /// We failed to setup the logger. - LoggerSetupFailed, - - InvalidPublicKey, -} - -impl From for NodeException { - fn from(value: NodeError) -> Self { - match value { - 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 => NodeException::FeerateEstimationUpdateFailed, - NodeError::LiquidityRequestFailed => NodeException::LiquidityRequestFailed, - NodeError::LiquiditySourceUnavailable => NodeException::LiquiditySourceUnavailable, - NodeError::LiquidityFeeTooHigh => NodeException::LiquidityFeeTooHigh, - NodeError::InvalidPaymentId => NodeException::InvalidPaymentId - } - } -} -impl From for BuilderException { - fn from(value: BuildError) -> Self { - match value { - 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, - } - } -} - -impl From for NodeException { - fn from(_: ldk_node::lightning::ln::msgs::DecodeError) -> Self { - NodeException::DecodeError - } -} diff --git a/rust/src/utils/error.rs b/rust/src/utils/error.rs new file mode 100644 index 0000000..360f9fd --- /dev/null +++ b/rust/src/utils/error.rs @@ -0,0 +1,256 @@ +use ldk_node::{ BuildError, NodeError }; + + + +#[derive(Debug, PartialEq)] +pub enum LdkNodeError { + InvalidTxid, + /// Returned when trying to start [Node] while it is already running. + AlreadyRunning, + /// Returned when trying to stop [Node] while it is not running. + NotRunning, + /// An on-chain transaction could not be created. + OnchainTxCreationFailed, + /// A network connection has been closed. + ConnectionFailed, + /// Invoice creation failed. + InvoiceCreationFailed, + /// Sending a payment has failed. + PaymentSendingFailed, + /// Sending a payment probe has failed. + ProbeSendingFailed, + /// A channel could not be opened. + ChannelCreationFailed, + /// A channel could not be closed. + ChannelClosingFailed, + /// A channel config could not be updated. + ChannelConfigUpdateFailed, + /// Persistence failed. + PersistenceFailed, + /// A wallet operation failed. + WalletOperationFailed, + /// A signing operation for transaction failed. + OnchainTxSigningFailed, + /// A signing operation for message failed. + MessageSigningFailed, + /// A transaction sync operation failed. + TxSyncFailed, + /// A gossip updating operation failed. + GossipUpdateFailed, + /// The given address is invalid. + InvalidAddress, + /// The given network address is invalid. + InvalidSocketAddress, + /// The given public key is invalid. + InvalidPublicKey, + /// The given secret key is invalid. + InvalidSecretKey, + /// The given payment hash is invalid. + InvalidPaymentHash, + /// The given payment preimage is invalid. + InvalidPaymentPreimage, + /// The given payment secret is invalid. + InvalidPaymentSecret, + /// The given amount is invalid. + InvalidAmount, + /// The given invoice is invalid. + InvalidInvoice, + /// The given channel ID is invalid. + InvalidChannelId, + /// The given network is invalid. + InvalidNetwork, + /// A payment with the given hash has already been initiated. + DuplicatePayment, + /// There are insufficient funds to complete the given operation. + InsufficientFunds, + ///A fee rate estimation update failed. + FeerateEstimationUpdateFailed, + ///A liquidity request operation failed. + LiquidityRequestFailed, + ///The given operation failed due to the required liquidity source being unavailable. + LiquiditySourceUnavailable, + ///The given operation failed due to the LSP's required opening fee being too high. + LiquidityFeeTooHigh, + ///The given payment id is invalid. + InvalidPaymentId, + ///An error in decoding a message or struct. + Decode(DecodeError), + ///An error in decoding the Bolt12 offer. + Bolt12Parse(Bolt12ParseError), + InvoiceRequestCreationFailed, + OfferCreationFailed, + RefundCreationFailed , + FeerateEstimationUpdateTimeout , + WalletOperationTimeout , + TxSyncTimeout , + GossipUpdateTimeout, + InvalidOfferId, + InvalidNodeId, + InvalidOffer, + InvalidRefund, + UnsupportedCurrency +} +#[allow(dead_code)] +#[derive(Debug)] +pub enum LdkBuilderError { + SocketAddressParseError, + /// The given seed bytes are invalid, e.g., have invalid length. + InvalidSeedBytes, + /// The given seed file is invalid, e.g., has invalid length, or could not be read. + InvalidSeedFile, + /// The current system time is invalid, clocks might have gone backwards. + InvalidSystemTime, + /// The a read channel monitor is invalid. + InvalidChannelMonitor, + /// The given listening addresses are invalid, e.g. too many were passed. + InvalidListeningAddress, + /// We failed to read data from the [`KVStore`]. + ReadFailed, + /// We failed to write data to the [`KVStore`]. + WriteFailed, + /// We failed to access the given `storage_dir_path`. + StoragePathAccessFailed, + /// We failed to setup our [`KVStore`]. + KVStoreSetupFailed, + /// We failed to setup the onchain wallet. + WalletSetupFailed, + /// We failed to setup the logger. + LoggerSetupFailed, + + InvalidPublicKey, +} + +impl From for LdkNodeError { + fn from(value: NodeError) -> Self { + match value { + NodeError::AlreadyRunning => LdkNodeError::AlreadyRunning, + NodeError::NotRunning => LdkNodeError::NotRunning, + NodeError::OnchainTxCreationFailed => LdkNodeError::OnchainTxCreationFailed, + NodeError::ConnectionFailed => LdkNodeError::ConnectionFailed, + NodeError::InvoiceCreationFailed => LdkNodeError::InvoiceCreationFailed, + NodeError::PaymentSendingFailed => LdkNodeError::PaymentSendingFailed, + NodeError::ProbeSendingFailed => LdkNodeError::ProbeSendingFailed, + NodeError::ChannelCreationFailed => LdkNodeError::ChannelCreationFailed, + NodeError::ChannelClosingFailed => LdkNodeError::ChannelClosingFailed, + NodeError::ChannelConfigUpdateFailed => LdkNodeError::ChannelConfigUpdateFailed, + NodeError::PersistenceFailed => LdkNodeError::PersistenceFailed, + NodeError::WalletOperationFailed => LdkNodeError::WalletOperationFailed, + NodeError::OnchainTxSigningFailed => LdkNodeError::OnchainTxSigningFailed, + NodeError::MessageSigningFailed => LdkNodeError::MessageSigningFailed, + NodeError::TxSyncFailed => LdkNodeError::TxSyncFailed, + NodeError::GossipUpdateFailed => LdkNodeError::GossipUpdateFailed, + NodeError::InvalidAddress => LdkNodeError::InvalidAddress, + NodeError::InvalidSocketAddress => LdkNodeError::InvalidSocketAddress, + NodeError::InvalidPublicKey => LdkNodeError::InvalidPublicKey, + NodeError::InvalidSecretKey => LdkNodeError::InvalidSecretKey, + NodeError::InvalidPaymentHash => LdkNodeError::InvalidPaymentHash, + NodeError::InvalidPaymentPreimage => LdkNodeError::InvalidPaymentPreimage, + NodeError::InvalidPaymentSecret => LdkNodeError::InvalidPaymentSecret, + NodeError::InvalidAmount => LdkNodeError::InvalidAmount, + NodeError::InvalidInvoice => LdkNodeError::InvalidInvoice, + NodeError::InvalidChannelId => LdkNodeError::InvalidChannelId, + NodeError::InvalidNetwork => LdkNodeError::InvalidNetwork, + NodeError::DuplicatePayment => LdkNodeError::DuplicatePayment, + NodeError::InsufficientFunds => LdkNodeError::InsufficientFunds, + NodeError::FeerateEstimationUpdateFailed => LdkNodeError::FeerateEstimationUpdateFailed, + NodeError::LiquidityRequestFailed => LdkNodeError::LiquidityRequestFailed, + NodeError::LiquiditySourceUnavailable => LdkNodeError::LiquiditySourceUnavailable, + NodeError::LiquidityFeeTooHigh => LdkNodeError::LiquidityFeeTooHigh, + NodeError::InvalidPaymentId => LdkNodeError::InvalidPaymentId, + NodeError::InvoiceRequestCreationFailed =>LdkNodeError::InvoiceRequestCreationFailed, + NodeError::OfferCreationFailed => LdkNodeError::OfferCreationFailed, + NodeError::RefundCreationFailed => LdkNodeError::RefundCreationFailed, + NodeError::FeerateEstimationUpdateTimeout => LdkNodeError::FeerateEstimationUpdateTimeout, + NodeError::WalletOperationTimeout =>LdkNodeError::WalletOperationTimeout, + NodeError::TxSyncTimeout =>LdkNodeError::TxSyncTimeout, + NodeError::GossipUpdateTimeout => LdkNodeError::GossipUpdateTimeout, + NodeError::InvalidOfferId => LdkNodeError::InvalidOfferId, + NodeError::InvalidNodeId =>LdkNodeError::InvalidNodeId, + NodeError::InvalidOffer => LdkNodeError::InvalidOffer, + NodeError::InvalidRefund => LdkNodeError::InvalidRefund, + NodeError::UnsupportedCurrency => LdkNodeError::UnsupportedCurrency, + } + } +} +impl From for LdkBuilderError { + fn from(value: BuildError) -> Self { + match value { + BuildError::InvalidSeedBytes => LdkBuilderError::InvalidSeedBytes, + BuildError::InvalidSeedFile => LdkBuilderError::InvalidSeedFile, + BuildError::InvalidSystemTime => LdkBuilderError::InvalidSystemTime, + BuildError::ReadFailed => LdkBuilderError::ReadFailed, + BuildError::WriteFailed => LdkBuilderError::WriteFailed, + BuildError::StoragePathAccessFailed => LdkBuilderError::StoragePathAccessFailed, + BuildError::WalletSetupFailed => LdkBuilderError::WalletSetupFailed, + BuildError::LoggerSetupFailed => LdkBuilderError::LoggerSetupFailed, + BuildError::InvalidChannelMonitor => LdkBuilderError::InvalidChannelMonitor, + BuildError::KVStoreSetupFailed => LdkBuilderError::KVStoreSetupFailed, + BuildError::InvalidListeningAddresses => LdkBuilderError::InvalidListeningAddress, + } + } +} + +impl From for LdkBuilderError { + fn from(value: ldk_node::bip39::Error) -> Self { + match value { + ldk_node::bip39::Error::BadWordCount(_) => LdkBuilderError::InvalidSeedBytes, + ldk_node::bip39::Error::UnknownWord(_) => LdkBuilderError::InvalidSeedBytes, + ldk_node::bip39::Error::BadEntropyBitCount(_) => LdkBuilderError::InvalidSeedBytes, + ldk_node::bip39::Error::InvalidChecksum => LdkBuilderError::InvalidSeedBytes, + ldk_node::bip39::Error::AmbiguousLanguages(_) => LdkBuilderError::InvalidSeedBytes, + } + } +} +impl From for LdkNodeError { + fn from(value: ldk_node::lightning::ln::msgs::DecodeError) -> Self { + LdkNodeError::Decode(value.into()) + } +} +impl From for DecodeError { + fn from(e: ldk_node::lightning::ln::msgs::DecodeError) -> Self { + match e { + ldk_node::lightning::ln::msgs::DecodeError::UnknownVersion => DecodeError::UnknownVersion, + ldk_node::lightning::ln::msgs::DecodeError::UnknownRequiredFeature => DecodeError::UnknownRequiredFeature, + ldk_node::lightning::ln::msgs::DecodeError::InvalidValue => DecodeError::InvalidValue, + ldk_node::lightning::ln::msgs:: DecodeError::ShortRead => DecodeError::ShortRead, + ldk_node::lightning::ln::msgs::DecodeError::BadLengthDescriptor => DecodeError::BadLengthDescriptor, + ldk_node::lightning::ln::msgs::DecodeError::Io(e) => DecodeError::Io(e.to_string()), + ldk_node::lightning::ln::msgs::DecodeError::UnsupportedCompression => DecodeError::UnsupportedCompression, + ldk_node::lightning::ln::msgs::DecodeError::DangerousValue => DecodeError::DangerousValue, + } + } +} +#[derive(Debug, PartialEq)] +pub enum DecodeError { + UnknownVersion, + UnknownRequiredFeature, + InvalidValue, + ShortRead, + BadLengthDescriptor, + Io(String), + UnsupportedCompression, + DangerousValue, +} + +#[derive(Debug, PartialEq)] +pub enum Bolt12ParseError { + InvalidContinuation, + InvalidBech32Hrp, + Bech32(String), + Decode(DecodeError), + InvalidSemantics(String), + InvalidSignature(String), +} +impl From for LdkNodeError { + fn from(value: ldk_node::lightning::offers::parse::Bolt12ParseError) -> Self { + match value{ + ldk_node::lightning::offers::parse::Bolt12ParseError::InvalidContinuation => LdkNodeError::Bolt12Parse(Bolt12ParseError::InvalidContinuation), + ldk_node::lightning::offers::parse::Bolt12ParseError::InvalidBech32Hrp => LdkNodeError::Bolt12Parse(Bolt12ParseError::InvalidBech32Hrp), + ldk_node::lightning::offers::parse::Bolt12ParseError::Bech32(e) =>LdkNodeError::Bolt12Parse(Bolt12ParseError::Bech32(e.to_string())), + ldk_node::lightning::offers::parse::Bolt12ParseError::Decode(e) => LdkNodeError::Bolt12Parse(Bolt12ParseError::Decode(e.into())), + ldk_node::lightning::offers::parse::Bolt12ParseError::InvalidSemantics(e) => LdkNodeError::Bolt12Parse( + Bolt12ParseError::InvalidSemantics(format!("{:?}", e))), + ldk_node::lightning::offers::parse::Bolt12ParseError::InvalidSignature(e) => LdkNodeError::Bolt12Parse(Bolt12ParseError::InvalidSignature(e.to_string())), + } + } +} diff --git a/rust/src/utils/mod.rs b/rust/src/utils/mod.rs new file mode 100644 index 0000000..a281f3e --- /dev/null +++ b/rust/src/utils/mod.rs @@ -0,0 +1 @@ +pub mod error; \ No newline at end of file From 1d27ead20b497905e75130daf52c0973ab267fea Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Wed, 26 Jun 2024 09:10:00 -0400 Subject: [PATCH 11/48] feat: Exposed NetworkGraph functions --- lib/src/generated/api/graph.dart | 183 +++++++++++++++++++++++++++++++ rust/src/api/graph.rs | 146 ++++++++++++++++++++++++ 2 files changed, 329 insertions(+) create mode 100644 lib/src/generated/api/graph.dart create mode 100644 rust/src/api/graph.rs diff --git a/lib/src/generated/api/graph.dart b/lib/src/generated/api/graph.dart new file mode 100644 index 0000000..58338f6 --- /dev/null +++ b/lib/src/generated/api/graph.dart @@ -0,0 +1,183 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0. + +// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import + +import '../frb_generated.dart'; +import '../lib.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; + +// These types are ignored because they are not used by any `pub` functions: `NodeAnnouncementInfo`, `NodeInfo` +// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `from`, `from`, `from`, `from`, `from`, `from`, `from`, `try_from` + +///Details about a channel (both directions). Received within a channel announcement. +class ChannelInfo { + ///Source node of the first direction of a channel + final NodeId nodeOne; + + ///Details about the first direction of a channel + final ChannelUpdateInfo? oneToTwo; + + ///Source node of the second direction of a channel + final NodeId nodeTwo; + + ///Details about the second direction of a channel + final ChannelUpdateInfo? twoToOne; + + ///The channel capacity as seen on-chain, if chain lookup is available. + final BigInt? capacitySats; + + const ChannelInfo({ + required this.nodeOne, + this.oneToTwo, + required this.nodeTwo, + this.twoToOne, + this.capacitySats, + }); + + @override + int get hashCode => + nodeOne.hashCode ^ + oneToTwo.hashCode ^ + nodeTwo.hashCode ^ + twoToOne.hashCode ^ + capacitySats.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ChannelInfo && + runtimeType == other.runtimeType && + nodeOne == other.nodeOne && + oneToTwo == other.oneToTwo && + nodeTwo == other.nodeTwo && + twoToOne == other.twoToOne && + capacitySats == other.capacitySats; +} + +class ChannelUpdateInfo { + ///When the last update to the channel direction was issued. Value is opaque, as set in the announcement. + final int lastUpdate; + + ///Whether the channel can be currently used for payments (in this one direction). + final bool enabled; + + ///The difference in CLTV values that you must have when routing through this channel. + final int cltvExpiryDelta; + + ///The minimum value, which must be relayed to the next hop via the channel + final BigInt htlcMinimumMsat; + + ///The maximum value which may be relayed to the next hop via the channel. + final BigInt htlcMaximumMsat; + final RoutingFees fees; + + const ChannelUpdateInfo({ + required this.lastUpdate, + required this.enabled, + required this.cltvExpiryDelta, + required this.htlcMinimumMsat, + required this.htlcMaximumMsat, + required this.fees, + }); + + @override + int get hashCode => + lastUpdate.hashCode ^ + enabled.hashCode ^ + cltvExpiryDelta.hashCode ^ + htlcMinimumMsat.hashCode ^ + htlcMaximumMsat.hashCode ^ + fees.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ChannelUpdateInfo && + runtimeType == other.runtimeType && + lastUpdate == other.lastUpdate && + enabled == other.enabled && + cltvExpiryDelta == other.cltvExpiryDelta && + htlcMinimumMsat == other.htlcMinimumMsat && + htlcMaximumMsat == other.htlcMaximumMsat && + fees == other.fees; +} + +class LdkNetworkGraph { + final NetworkGraph inner; + + const LdkNetworkGraph({ + required this.inner, + }); + + /// Returns information on a channel with the given id. + Future channel({required BigInt shortChannelId}) => + core.instance.api.crateApiGraphLdkNetworkGraphChannel( + that: this, shortChannelId: shortChannelId); + + /// Returns the list of channels in the graph + Future listChannels() => + core.instance.api.crateApiGraphLdkNetworkGraphListChannels( + that: this, + ); + + /// Returns the list of nodes in the graph + Future> listNodes() => + core.instance.api.crateApiGraphLdkNetworkGraphListNodes( + that: this, + ); + + @override + int get hashCode => inner.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LdkNetworkGraph && + runtimeType == other.runtimeType && + inner == other.inner; +} + +///Represents the compressed public key of a node +class NodeId { + final Uint8List compressed; + + const NodeId({ + required this.compressed, + }); + + @override + int get hashCode => compressed.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is NodeId && + runtimeType == other.runtimeType && + compressed == other.compressed; +} + +///Fees for routing via a given channel or a node +class RoutingFees { + ///Flat routing fee in millisatoshis. + final int baseMsat; + + ///Liquidity-based routing fee in millionths of a routed amount. In other words, 10000 is 1%. + final int proportionalMillionths; + + const RoutingFees({ + required this.baseMsat, + required this.proportionalMillionths, + }); + + @override + int get hashCode => baseMsat.hashCode ^ proportionalMillionths.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is RoutingFees && + runtimeType == other.runtimeType && + baseMsat == other.baseMsat && + proportionalMillionths == other.proportionalMillionths; +} diff --git a/rust/src/api/graph.rs b/rust/src/api/graph.rs new file mode 100644 index 0000000..7482cd8 --- /dev/null +++ b/rust/src/api/graph.rs @@ -0,0 +1,146 @@ +use ldk_node::lightning::ln::msgs::SocketAddress; +use ldk_node::lightning::util::ser::Writeable; +use crate::frb_generated::RustOpaque; +use crate::utils::error::LdkNodeError; + +///Represents the compressed public key of a node +pub struct NodeId{pub compressed: Vec } + +impl From for NodeId{ + fn from(value: ldk_node::lightning::routing::gossip::NodeId) -> Self { + Self{compressed: value.encode()} + } +} +impl TryFrom for ldk_node::lightning::routing::gossip::NodeId{ + type Error = LdkNodeError; + + fn try_from(value: NodeId) -> Result { + ldk_node::lightning::routing::gossip::NodeId::from_slice(value.compressed.as_slice()).map_err(|e| e.into()) + } +} +///Fees for routing via a given channel or a node +pub struct RoutingFees { + ///Flat routing fee in millisatoshis. + pub base_msat: u32, + ///Liquidity-based routing fee in millionths of a routed amount. In other words, 10000 is 1%. + pub proportional_millionths: u32, +} +impl From for RoutingFees{ + fn from(value: ldk_node::lightning_invoice::RoutingFees) -> Self { + Self{ base_msat: value.base_msat, proportional_millionths: value.proportional_millionths } + } +} +pub struct ChannelUpdateInfo { + ///When the last update to the channel direction was issued. Value is opaque, as set in the announcement. + pub last_update: u32, + ///Whether the channel can be currently used for payments (in this one direction). + pub enabled: bool, + ///The difference in CLTV values that you must have when routing through this channel. + pub cltv_expiry_delta: u16, + ///The minimum value, which must be relayed to the next hop via the channel + pub htlc_minimum_msat: u64, + ///The maximum value which may be relayed to the next hop via the channel. + pub htlc_maximum_msat: u64, + ////Fees charged when the channel is used for routing + pub fees: RoutingFees, +} + +///Details about a channel (both directions). Received within a channel announcement. +pub struct ChannelInfo{ + ///Source node of the first direction of a channel + pub node_one: NodeId, + ///Details about the first direction of a channel + pub one_to_two: Option, + ///Source node of the second direction of a channel + pub node_two: NodeId, + ///Details about the second direction of a channel + pub two_to_one: Option, + ///The channel capacity as seen on-chain, if chain lookup is available. + pub capacity_sats: Option, +} +impl From for ChannelInfo{ + fn from(value: ldk_node::lightning::routing::gossip::ChannelInfo) -> Self { + Self{ + node_one:value.node_one.into(), + one_to_two: value.one_to_two.map(|e| e.into()), + node_two: value.node_two.into(), + two_to_one:value.two_to_one.map(|e| e.into()), + capacity_sats: value.capacity_sats, + } + } +} + +impl From for ChannelUpdateInfo { + fn from(value: ldk_node::lightning::routing::gossip::ChannelUpdateInfo) -> Self { + ChannelUpdateInfo{ + last_update: value.last_update, + enabled: value.enabled, + cltv_expiry_delta: value.cltv_expiry_delta, + htlc_minimum_msat: value.htlc_minimum_msat, + htlc_maximum_msat: value.htlc_maximum_msat, + fees: value.fees.into(), + } + } +} +///Details about a node in the network, known from the network announcement. +pub struct NodeInfo { + pub channels: Vec, + ///More information about a node from node_announcement. Optional because we store a Node entry after learning about it from a channel announcement, but before receiving a node announcement. + pub announcement_info: Option, +} + +impl From for NodeInfo{ + fn from(value: ldk_node::lightning::routing::gossip::NodeInfo) -> Self { + NodeInfo{ channels: value.channels, announcement_info: value.announcement_info.map(|e| e.into()) } + } +} +pub struct NodeAnnouncementInfo { + /// When the last known update to the node state was issued. + /// Value is opaque, as set in the announcement. + pub last_update: u32, + /// Moniker assigned to the node. + /// May be invalid or malicious (eg control chars), + /// should not be exposed to the user. + pub alias: String, + /// List of addresses on which this node is reachable + pub addresses: Vec, +} + +impl From for NodeAnnouncementInfo{ + fn from(value: ldk_node::lightning::routing::gossip::NodeAnnouncementInfo) -> Self { + Self{ + last_update: value.last_update, + alias: value.alias.to_string(), + addresses: value.addresses().iter().map(|e| e.to_owned().into()).collect(), + } + } +} +pub struct LdkNetworkGraph {pub inner: RustOpaque } +impl From for LdkNetworkGraph { + fn from(value: ldk_node::graph::NetworkGraph) -> Self { + LdkNetworkGraph {inner: RustOpaque::new(value)} + } +} + +impl LdkNetworkGraph { + + /// Returns the list of channels in the graph + pub fn list_channels(&self) -> Vec { + self.inner.list_channels() + } + + /// Returns information on a channel with the given id. + pub fn channel(&self, short_channel_id: u64) -> Option { + self.inner.channel(short_channel_id).map(|e| e.into()) + } + + /// Returns the list of nodes in the graph + pub fn list_nodes(&self) -> Vec { + self.inner.list_nodes().iter().map(|e| e.to_owned().into()).collect() + } + + // Returns information on a node with the given id. + // pub fn node(&self, node_id: NodeId) -> Result, NodeException> { + // Ok(self.inner.node(node_id.try_into().unwrap()).map(|e| e.into())) + // } +} \ No newline at end of file From bbd95fabb9ea9ad7206fe3dbdfd7ffce2d512873 Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Wed, 26 Jun 2024 11:07:00 -0400 Subject: [PATCH 12/48] fix: resolve map exceptions error --- lib/ldk_node.dart | 2 +- lib/src/generated/lib.dart | 90 ++++++++++++ lib/src/generated/utils/error.dart | 24 ++++ lib/src/utils/exceptions.dart | 217 ++++++++++++++++------------- rust/src/utils/error.rs | 12 ++ 5 files changed, 249 insertions(+), 96 deletions(-) create mode 100644 lib/src/generated/lib.dart diff --git a/lib/ldk_node.dart b/lib/ldk_node.dart index 02781e3..a21be42 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, mapBuilderException, mapNodeException, Frb; + hide ExceptionBase, mapLdkBuilderError, mapLdkNodeError, Frb; diff --git a/lib/src/generated/lib.dart b/lib/src/generated/lib.dart new file mode 100644 index 0000000..1672b4b --- /dev/null +++ b/lib/src/generated/lib.dart @@ -0,0 +1,90 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0. + +// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import + +import 'frb_generated.dart'; +import 'package:collection/collection.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; + +// Rust type: RustOpaqueNom +abstract class NetworkGraph implements RustOpaqueInterface {} + +// Rust type: RustOpaqueNom +abstract class Bolt11Payment implements RustOpaqueInterface {} + +// Rust type: RustOpaqueNom +abstract class OnchainPayment implements RustOpaqueInterface {} + +// Rust type: RustOpaqueNom +abstract class SpontaneousPayment implements RustOpaqueInterface {} + +class U8Array12 extends NonGrowableListView { + static const arraySize = 12; + + @internal + Uint8List get inner => _inner; + final Uint8List _inner; + + U8Array12(this._inner) + : assert(_inner.length == arraySize), + super(_inner); + + U8Array12.init() : this(Uint8List(arraySize)); +} + +class U8Array16 extends NonGrowableListView { + static const arraySize = 16; + + @internal + Uint8List get inner => _inner; + final Uint8List _inner; + + U8Array16(this._inner) + : assert(_inner.length == arraySize), + super(_inner); + + U8Array16.init() : this(Uint8List(arraySize)); +} + +class U8Array32 extends NonGrowableListView { + static const arraySize = 32; + + @internal + Uint8List get inner => _inner; + final Uint8List _inner; + + U8Array32(this._inner) + : assert(_inner.length == arraySize), + super(_inner); + + U8Array32.init() : this(Uint8List(arraySize)); +} + +class U8Array4 extends NonGrowableListView { + static const arraySize = 4; + + @internal + Uint8List get inner => _inner; + final Uint8List _inner; + + U8Array4(this._inner) + : assert(_inner.length == arraySize), + super(_inner); + + U8Array4.init() : this(Uint8List(arraySize)); +} + +class U8Array64 extends NonGrowableListView { + static const arraySize = 64; + + @internal + Uint8List get inner => _inner; + final Uint8List _inner; + + U8Array64(this._inner) + : assert(_inner.length == arraySize), + super(_inner); + + U8Array64.init() : this(Uint8List(arraySize)); +} diff --git a/lib/src/generated/utils/error.dart b/lib/src/generated/utils/error.dart index a6e5d22..4579b40 100644 --- a/lib/src/generated/utils/error.dart +++ b/lib/src/generated/utils/error.dart @@ -226,23 +226,47 @@ sealed class LdkNodeError with _$LdkNodeError implements FrbException { const factory LdkNodeError.bolt12Parse( Bolt12ParseError field0, ) = LdkNodeError_Bolt12Parse; + + ///Invoice request creation failed. const factory LdkNodeError.invoiceRequestCreationFailed() = LdkNodeError_InvoiceRequestCreationFailed; + + ///Offer creation failed. const factory LdkNodeError.offerCreationFailed() = LdkNodeError_OfferCreationFailed; + + ///Refund creation failed. const factory LdkNodeError.refundCreationFailed() = LdkNodeError_RefundCreationFailed; + + ///A fee rate estimation update timed out. const factory LdkNodeError.feerateEstimationUpdateTimeout() = LdkNodeError_FeerateEstimationUpdateTimeout; + + ///A wallet operation timed out. const factory LdkNodeError.walletOperationTimeout() = LdkNodeError_WalletOperationTimeout; + + ///A transaction sync operation timed out. const factory LdkNodeError.txSyncTimeout() = LdkNodeError_TxSyncTimeout; + + ///A gossip updating operation timed out. const factory LdkNodeError.gossipUpdateTimeout() = LdkNodeError_GossipUpdateTimeout; + + ///The given offer id is invalid. const factory LdkNodeError.invalidOfferId() = LdkNodeError_InvalidOfferId; + + ///The given node id is invalid. const factory LdkNodeError.invalidNodeId() = LdkNodeError_InvalidNodeId; + + ///The given offer is invalid. const factory LdkNodeError.invalidOffer() = LdkNodeError_InvalidOffer; + + ///The given refund is invalid. const factory LdkNodeError.invalidRefund() = LdkNodeError_InvalidRefund; + + ///The provided offer was denominated in an unsupported currency. const factory LdkNodeError.unsupportedCurrency() = LdkNodeError_UnsupportedCurrency; } diff --git a/lib/src/utils/exceptions.dart b/lib/src/utils/exceptions.dart index a191ac0..c2879b6 100644 --- a/lib/src/utils/exceptions.dart +++ b/lib/src/utils/exceptions.dart @@ -1,4 +1,4 @@ -import '../generated/api/error.dart' as bridge; +import '../generated/utils/error.dart' as error; abstract class ExceptionBase implements Exception { String? message; @@ -17,127 +17,154 @@ class BuilderException extends ExceptionBase { BuilderException({super.message}); } -BuilderException mapBuilderException(bridge.BuilderException e) { +BuilderException mapLdkBuilderError(error.LdkBuilderError e) { switch (e) { - case bridge.BuilderException.invalidSeedBytes: + case error.LdkBuilderError.invalidSeedBytes: return BuilderException(message: "Given seed bytes are invalid."); - case bridge.BuilderException.invalidSeedFile: + case error.LdkBuilderError.invalidSeedFile: return BuilderException( message: "Given seed file is invalid or could not be read."); - case bridge.BuilderException.invalidSystemTime: + case error.LdkBuilderError.invalidSystemTime: return BuilderException( message: "System time is invalid. Clocks might have gone back in time."); - case bridge.BuilderException.readFailed: + case error.LdkBuilderError.readFailed: return BuilderException(message: "Failed to read from store."); - case bridge.BuilderException.writeFailed: + case error.LdkBuilderError.writeFailed: return BuilderException(message: "Failed to write to store."); - case bridge.BuilderException.storagePathAccessFailed: + case error.LdkBuilderError.storagePathAccessFailed: return BuilderException( message: "Failed to access the given storage path."); - case bridge.BuilderException.walletSetupFailed: + case error.LdkBuilderError.walletSetupFailed: return BuilderException(message: "Failed to setup onchain wallet."); - case bridge.BuilderException.loggerSetupFailed: + case error.LdkBuilderError.loggerSetupFailed: return BuilderException(message: "Failed to setup the logger."); - case bridge.BuilderException.invalidChannelMonitor: + case error.LdkBuilderError.invalidChannelMonitor: return BuilderException( message: "Failed to watch a deserialized ChannelMonitor."); - case bridge.BuilderException.invalidListeningAddress: + case error.LdkBuilderError.invalidListeningAddress: return BuilderException( message: "Given listening addresses are invalid."); - case bridge.BuilderException.kvStoreSetupFailed: + case error.LdkBuilderError.kvStoreSetupFailed: return BuilderException(message: "Failed to setup KVStore."); - case bridge.BuilderException.socketAddressParseError: + case error.LdkBuilderError.socketAddressParseError: return BuilderException(message: "Invalid SocketAddress."); - case bridge.BuilderException.invalidPublicKey: + case error.LdkBuilderError.invalidPublicKey: return BuilderException(message: "Invalid PublicKey."); } } -NodeException mapNodeException(bridge.NodeException e) { - switch (e) { - case bridge.NodeException.alreadyRunning: - return NodeException(message: "Node is already running."); - case bridge.NodeException.notRunning: - return NodeException(message: "Node is not running."); - case bridge.NodeException.onchainTxCreationFailed: - return NodeException( - message: "On-chain transaction could not be created."); - case bridge.NodeException.connectionFailed: - return NodeException(message: "Network connection closed."); - case bridge.NodeException.paymentSendingFailed: - return NodeException(message: "Failed to send the given payment."); - case bridge.NodeException.probeSendingFailed: - return NodeException(message: "Failed to send the given payment probe."); - case bridge.NodeException.channelCreationFailed: - return NodeException(message: "Failed to create channel."); - case bridge.NodeException.channelClosingFailed: - return NodeException(message: "Failed to close channel."); - case bridge.NodeException.channelConfigUpdateFailed: - return NodeException(message: "Failed to update channel config."); - case bridge.NodeException.persistenceFailed: - return NodeException(message: "Failed to persist data."); - case bridge.NodeException.walletOperationFailed: - return NodeException(message: "Failed to conduct wallet operation."); - case bridge.NodeException.onchainTxSigningFailed: - return NodeException(message: "Failed to sign given transaction."); - case bridge.NodeException.messageSigningFailed: - return NodeException(message: "Failed to sign given message."); - case bridge.NodeException.txSyncFailed: - return NodeException(message: "Failed to sync transactions."); - case bridge.NodeException.gossipUpdateFailed: - return NodeException(message: "Failed to update gossip data."); - case bridge.NodeException.invalidAddress: - return NodeException(message: "The given address is invalid."); - case bridge.NodeException.invalidSocketAddress: - return NodeException(message: "The given network address is invalid."); - case bridge.NodeException.invalidPublicKey: - return NodeException(message: "The given public key is invalid."); - case bridge.NodeException.invalidSecretKey: - return NodeException(message: "The given secret key is invalid."); - case bridge.NodeException.invalidPaymentHash: - return NodeException(message: "The given payment hash is invalid."); - case bridge.NodeException.invalidPaymentPreimage: - return NodeException(message: "The given payment preimage is invalid."); - case bridge.NodeException.invalidPaymentSecret: - return NodeException(message: "The given payment secret is invalid."); - case bridge.NodeException.invalidAmount: - return NodeException(message: "The given amount is invalid."); - case bridge.NodeException.invalidInvoice: - return NodeException(message: "The given invoice is invalid."); - case bridge.NodeException.invalidChannelId: - return NodeException(message: "The given channel ID is invalid."); - case bridge.NodeException.invoiceCreationFailed: - return NodeException(message: "Failed to create invoice."); - case bridge.NodeException.invalidNetwork: - return NodeException(message: "The given network is invalid."); - case bridge.NodeException.duplicatePayment: - return NodeException( - message: "A payment with the given hash has already been initiated."); +NodeException mapLdkNodeError(error.LdkNodeError e) { + return e.map( + alreadyRunning: (_) => NodeException(message: "Node is already running."), + notRunning: (_) => NodeException(message: "Node is not running."), + onchainTxCreationFailed: (_) => + NodeException(message: "On-chain transaction could not be created."), + connectionFailed: (_) => + NodeException(message: "Network connection closed."), + paymentSendingFailed: (_) => + NodeException(message: "Failed to send the given payment."), + probeSendingFailed: (_) => + NodeException(message: "Failed to send the given payment probe."), + channelCreationFailed: (_) => + NodeException(message: "Failed to create channel."), + channelClosingFailed: (_) => + NodeException(message: "Failed to close channel."), + channelConfigUpdateFailed: (_) => + NodeException(message: "Failed to update channel config."), + persistenceFailed: (_) => + NodeException(message: "Failed to persist data."), + walletOperationFailed: (_) => + NodeException(message: "Failed to conduct wallet operation."), + onchainTxSigningFailed: (_) => + NodeException(message: "Failed to sign given transaction."), + messageSigningFailed: (_) => + NodeException(message: "Failed to sign given message."), + txSyncFailed: (_) => + NodeException(message: "Failed to sync transactions."), + gossipUpdateFailed: (_) => + NodeException(message: "Failed to update gossip data."), + invalidAddress: (_) => + NodeException(message: "The given address is invalid."), + invalidSocketAddress: (_) => + NodeException(message: "The given network address is invalid."), + invalidPublicKey: (_) => + NodeException(message: "The given public key is invalid."), + invalidSecretKey: (_) => + NodeException(message: "The given secret key is invalid."), + invalidPaymentHash: (_) => + NodeException(message: "The given payment hash is invalid."), + invalidPaymentPreimage: (_) => + NodeException(message: "The given payment preimage is invalid."), + invalidPaymentSecret: (_) => + NodeException(message: "The given payment secret is invalid."), + invalidAmount: (_) => + NodeException(message: "The given amount is invalid."), + invalidInvoice: (_) => + NodeException(message: "The given invoice is invalid."), + invalidChannelId: (_) => + NodeException(message: "The given channel ID is invalid."), + invoiceCreationFailed: (_) => + NodeException(message: "Failed to create invoice."), + invalidNetwork: (_) => + NodeException(message: "The given network is invalid."), + duplicatePayment: (_) => NodeException( + message: "A payment with the given hash has already been initiated."), + insufficientFunds: (_) => NodeException( + message: + "There are insufficient funds to complete the given operation."), + feerateEstimationUpdateFailed: (_) => + NodeException(message: "Failed to update fee rate estimation."), + liquidityRequestFailed: (_) => + NodeException(message: "Liquidity request operation failed."), + liquiditySourceUnavailable: (_) => NodeException( + message: + "Liquidity operation failed due to the required liquidity source being unavailable."), + liquidityFeeTooHigh: (_) => NodeException( + message: + "Liquidity operation failed due to the LSP's required opening fee being too high."), + invalidTxid: (_) => + NodeException(message: "The given transaction id is Invalid."), + invalidPaymentId: (_) => NodeException(message: "The given paymentId is invalid."), + decode: (e) => mapLdkDecodeError(e.field0), + //TODO; + bolt12Parse: (e) => NodeException(message: e.toString()), + walletOperationTimeout: (e) => NodeException(message: "A wallet operation timed out."), + invoiceRequestCreationFailed: (e) => NodeException(message: "Invoice request creation failed."), + offerCreationFailed: (e) => NodeException(message: "Offer creation failed."), + refundCreationFailed: (e) => NodeException(message: "Refund creation failed."), + feerateEstimationUpdateTimeout: (e) => NodeException(message: "A fee rate estimation update timed out."), + txSyncTimeout: (e) => NodeException(message: "A transaction sync operation timed out."), + gossipUpdateTimeout: (e) => NodeException(message: "A gossip updating operation timed out."), + invalidOfferId: (e) => NodeException(message: "The given offer id is invalid."), + invalidNodeId: (e) => NodeException(message: "The given node id is invalid."), + invalidOffer: (e) => NodeException(message: "The given offer is invalid."), + invalidRefund: (e) => NodeException(message: "The given refund is invalid."), + unsupportedCurrency: (e) => NodeException(message: "The provided offer was denominated in an unsupported currency.")); +} - case bridge.NodeException.insufficientFunds: - return NodeException( +NodeException mapLdkDecodeError(error.DecodeError e) { + return e.map( + unknownVersion: (e) => NodeException( message: - "There are insufficient funds to complete the given operation."); - case bridge.NodeException.feerateEstimationUpdateFailed: - return NodeException(message: "Failed to update fee rate estimation. "); - case bridge.NodeException.liquidityRequestFailed: - return NodeException(message: "Liquidity request operation failed. "); - case bridge.NodeException.liquiditySourceUnavailable: - return NodeException( + "A version byte specified something we don’t know how to handle. Includes unknown realm byte in an onion hop data packet."), + unknownRequiredFeature: (e) => NodeException( message: - "Liquidity operation failed due to the required liquidity source being unavailable. "); - case bridge.NodeException.liquidityFeeTooHigh: - return NodeException( + "Unknown feature mandating we fail to parse message (e.g., TLV with an even, unknown type)."), + invalidValue: (e) => NodeException( message: - "Liquidity operation failed due to the LSP's required opening fee being too high. "); - case bridge.NodeException.invalidTxid: - return NodeException(message: "The given transaction id is Invalid. "); - case bridge.NodeException.invalidPaymentId: - return NodeException(message: "The given paymentId is invalid. "); - case bridge.NodeException.decodeError: - return NodeException(message: "Failed to decode the data. "); - } + "Invalid value, a byte which was supposed to be a bool was something other than a 0 or 1, a public key/private key/signature was invalid, text wasn’t UTF-8, TLV was syntactically incorrect, etc."), + shortRead: (e) => + NodeException(message: "The buffer to be read was too short."), + badLengthDescriptor: (e) => NodeException( + message: + "A length descriptor in the packet didn’t describe the later data correctly. "), + io: (e) => NodeException(message: "Io: ${e.toString()}"), + unsupportedCompression: (e) => NodeException( + message: + "The message included zlib-compressed values, which we don’t support. "), + dangerousValue: (e) => NodeException( + message: "Value is validly encoded but is dangerous to use. ")); } diff --git a/rust/src/utils/error.rs b/rust/src/utils/error.rs index 360f9fd..a5a11e0 100644 --- a/rust/src/utils/error.rs +++ b/rust/src/utils/error.rs @@ -77,17 +77,29 @@ pub enum LdkNodeError { Decode(DecodeError), ///An error in decoding the Bolt12 offer. Bolt12Parse(Bolt12ParseError), + ///Invoice request creation failed. InvoiceRequestCreationFailed, + ///Offer creation failed. OfferCreationFailed, + ///Refund creation failed. RefundCreationFailed , + ///A fee rate estimation update timed out. FeerateEstimationUpdateTimeout , + ///A wallet operation timed out. WalletOperationTimeout , + ///A transaction sync operation timed out. TxSyncTimeout , + ///A gossip updating operation timed out. GossipUpdateTimeout, + ///The given offer id is invalid. InvalidOfferId, + ///The given node id is invalid. InvalidNodeId, + ///The given offer is invalid. InvalidOffer, + ///The given refund is invalid. InvalidRefund, + ///The provided offer was denominated in an unsupported currency. UnsupportedCurrency } #[allow(dead_code)] From 63b41106c5f11a55784d94c20bbba3fce9745f70 Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Wed, 26 Jun 2024 13:07:00 -0400 Subject: [PATCH 13/48] imports optimized --- rust/src/api/mod.rs | 7 ++++++- rust/src/lib.rs | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/rust/src/api/mod.rs b/rust/src/api/mod.rs index 05b9af3..8da3638 100644 --- a/rust/src/api/mod.rs +++ b/rust/src/api/mod.rs @@ -1,3 +1,8 @@ -pub mod error; pub mod node; pub mod types; +pub mod graph; +pub mod bolt12; +pub mod bolt11; +pub mod on_chain; +pub mod spontaneous; +pub mod builder; diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 0458c57..bdb0d23 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -1,3 +1,4 @@ mod frb_generated; /* AUTO INJECTED BY flutter_rust_bridge. This line may not be accurate, and you can change it according to your needs. */ pub mod api; +pub mod utils; From a25fb8c85fb84c5bc73c16f7c278b20f30977efe Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Wed, 26 Jun 2024 15:05:00 -0400 Subject: [PATCH 14/48] refactor: TODO updated --- lib/src/utils/exceptions.dart | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/src/utils/exceptions.dart b/lib/src/utils/exceptions.dart index c2879b6..0af8206 100644 --- a/lib/src/utils/exceptions.dart +++ b/lib/src/utils/exceptions.dart @@ -119,17 +119,11 @@ NodeException mapLdkNodeError(error.LdkNodeError e) { NodeException(message: "Failed to update fee rate estimation."), liquidityRequestFailed: (_) => NodeException(message: "Liquidity request operation failed."), - liquiditySourceUnavailable: (_) => NodeException( - message: - "Liquidity operation failed due to the required liquidity source being unavailable."), - liquidityFeeTooHigh: (_) => NodeException( - message: - "Liquidity operation failed due to the LSP's required opening fee being too high."), - invalidTxid: (_) => - NodeException(message: "The given transaction id is Invalid."), + liquiditySourceUnavailable: (_) => NodeException(message: "Liquidity operation failed due to the required liquidity source being unavailable."), + liquidityFeeTooHigh: (_) => NodeException(message: "Liquidity operation failed due to the LSP's required opening fee being too high."), + invalidTxid: (_) => NodeException(message: "The given transaction id is Invalid."), invalidPaymentId: (_) => NodeException(message: "The given paymentId is invalid."), decode: (e) => mapLdkDecodeError(e.field0), - //TODO; bolt12Parse: (e) => NodeException(message: e.toString()), walletOperationTimeout: (e) => NodeException(message: "A wallet operation timed out."), invoiceRequestCreationFailed: (e) => NodeException(message: "Invoice request creation failed."), From 25a410a36ea3421da8752bcc275594e05f5e58a1 Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Wed, 26 Jun 2024 21:55:00 -0400 Subject: [PATCH 15/48] feat(Node): added forceCloseChannel --- lib/src/generated/api/node.dart | 555 +++++++------------------------- lib/src/root.dart | 253 ++++++++------- rust/src/api/node.rs | 305 ++---------------- 3 files changed, 295 insertions(+), 818 deletions(-) diff --git a/lib/src/generated/api/node.dart b/lib/src/generated/api/node.dart index 4593005..dfd96a4 100644 --- a/lib/src/generated/api/node.dart +++ b/lib/src/generated/api/node.dart @@ -1,237 +1,24 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. +// Generated by `flutter_rust_bridge`@ 2.0.0. // ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import import '../frb_generated.dart'; -import 'error.dart'; -import 'package:collection/collection.dart'; +import '../lib.dart'; +import '../utils/error.dart'; +import 'bolt11.dart'; +import 'bolt12.dart'; +import 'graph.dart'; +import 'on_chain.dart'; import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; +import 'spontaneous.dart'; import 'types.dart'; -// Rust type: RustOpaqueNom -@sealed -class Node extends RustOpaque { - Node.dcoDecode(List wire) : super.dcoDecode(wire, _kStaticData); - - Node.sseDecode(int ptr, int externalSizeOnNative) - : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); - - static final _kStaticData = RustArcStaticData( - rustArcIncrementStrongCount: - LdkCore.instance.api.rust_arc_increment_strong_count_Node, - rustArcDecrementStrongCount: - LdkCore.instance.api.rust_arc_decrement_strong_count_Node, - rustArcDecrementStrongCountPtr: - LdkCore.instance.api.rust_arc_decrement_strong_count_NodePtr, - ); -} - -// Rust type: RustOpaqueNom> -@sealed -class NodeBuilder extends RustOpaque { - NodeBuilder.dcoDecode(List wire) - : super.dcoDecode(wire, _kStaticData); - - NodeBuilder.sseDecode(int ptr, int externalSizeOnNative) - : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); - - static final _kStaticData = RustArcStaticData( - rustArcIncrementStrongCount: - LdkCore.instance.api.rust_arc_increment_strong_count_NodeBuilder, - rustArcDecrementStrongCount: - LdkCore.instance.api.rust_arc_decrement_strong_count_NodeBuilder, - rustArcDecrementStrongCountPtr: - LdkCore.instance.api.rust_arc_decrement_strong_count_NodeBuilderPtr, - ); - - Future build({dynamic hint}) => - LdkCore.instance.api.nodeBuilderBuild(that: this, hint: hint); - - Future buildWithFsStore({dynamic hint}) => - LdkCore.instance.api.nodeBuilderBuildWithFsStore(that: this, hint: hint); - - static Future createBuilder( - {required Config config, - ChainDataSourceConfig? chainDataSourceConfig, - EntropySourceConfig? entropySourceConfig, - GossipSourceConfig? gossipSourceConfig, - LiquiditySourceConfig? liquiditySourceConfig, - dynamic hint}) => - LdkCore.instance.api.nodeBuilderCreateBuilder( - config: config, - chainDataSourceConfig: chainDataSourceConfig, - entropySourceConfig: entropySourceConfig, - gossipSourceConfig: gossipSourceConfig, - liquiditySourceConfig: liquiditySourceConfig, - hint: hint); -} - -// Rust type: RustOpaqueNom -@sealed -class LdkNodePaymentBolt11Payment extends RustOpaque { - LdkNodePaymentBolt11Payment.dcoDecode(List wire) - : super.dcoDecode(wire, _kStaticData); - - LdkNodePaymentBolt11Payment.sseDecode(int ptr, int externalSizeOnNative) - : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); - - static final _kStaticData = RustArcStaticData( - rustArcIncrementStrongCount: LdkCore.instance.api - .rust_arc_increment_strong_count_LdkNodePaymentBolt11Payment, - rustArcDecrementStrongCount: LdkCore.instance.api - .rust_arc_decrement_strong_count_LdkNodePaymentBolt11Payment, - rustArcDecrementStrongCountPtr: LdkCore.instance.api - .rust_arc_decrement_strong_count_LdkNodePaymentBolt11PaymentPtr, - ); -} - -// Rust type: RustOpaqueNom -@sealed -class LdkNodePaymentOnchainPayment extends RustOpaque { - LdkNodePaymentOnchainPayment.dcoDecode(List wire) - : super.dcoDecode(wire, _kStaticData); - - LdkNodePaymentOnchainPayment.sseDecode(int ptr, int externalSizeOnNative) - : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); - - static final _kStaticData = RustArcStaticData( - rustArcIncrementStrongCount: LdkCore.instance.api - .rust_arc_increment_strong_count_LdkNodePaymentOnchainPayment, - rustArcDecrementStrongCount: LdkCore.instance.api - .rust_arc_decrement_strong_count_LdkNodePaymentOnchainPayment, - rustArcDecrementStrongCountPtr: LdkCore.instance.api - .rust_arc_decrement_strong_count_LdkNodePaymentOnchainPaymentPtr, - ); -} - -// Rust type: RustOpaqueNom -@sealed -class LdkNodePaymentSpontaneousPayment extends RustOpaque { - LdkNodePaymentSpontaneousPayment.dcoDecode(List wire) - : super.dcoDecode(wire, _kStaticData); - - LdkNodePaymentSpontaneousPayment.sseDecode(int ptr, int externalSizeOnNative) - : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); - - static final _kStaticData = RustArcStaticData( - rustArcIncrementStrongCount: LdkCore.instance.api - .rust_arc_increment_strong_count_LdkNodePaymentSpontaneousPayment, - rustArcDecrementStrongCount: LdkCore.instance.api - .rust_arc_decrement_strong_count_LdkNodePaymentSpontaneousPayment, - rustArcDecrementStrongCountPtr: LdkCore.instance.api - .rust_arc_decrement_strong_count_LdkNodePaymentSpontaneousPaymentPtr, - ); -} - -class LdkBolt11Payment { - final LdkNodePaymentBolt11Payment ptr; - - const LdkBolt11Payment({ - required this.ptr, - }); +// Rust type: RustOpaqueNom> +abstract class ArcBolt12Payment implements RustOpaqueInterface {} - Future receive( - {required int amountMsat, - required String description, - required int expirySecs, - dynamic hint}) => - LdkCore.instance.api.ldkBolt11PaymentReceive( - that: this, - amountMsat: amountMsat, - description: description, - expirySecs: expirySecs, - hint: hint); - - Future receiveVariableAmount( - {required String description, - required int expirySecs, - dynamic hint}) => - LdkCore.instance.api.ldkBolt11PaymentReceiveVariableAmount( - that: this, - description: description, - expirySecs: expirySecs, - hint: hint); - - Future receiveVariableAmountViaJitChannel( - {required String description, - required int expirySecs, - int? maxProportionalLspFeeLimitPpmMsat, - dynamic hint}) => - LdkCore.instance.api.ldkBolt11PaymentReceiveVariableAmountViaJitChannel( - that: this, - description: description, - expirySecs: expirySecs, - maxProportionalLspFeeLimitPpmMsat: maxProportionalLspFeeLimitPpmMsat, - hint: hint); - - Future receiveViaJitChannel( - {required int amountMsat, - required String description, - required int expirySecs, - int? maxTotalLspFeeLimitMsat, - dynamic hint}) => - LdkCore.instance.api.ldkBolt11PaymentReceiveViaJitChannel( - that: this, - amountMsat: amountMsat, - description: description, - expirySecs: expirySecs, - maxTotalLspFeeLimitMsat: maxTotalLspFeeLimitMsat, - hint: hint); - - Future send({required Bolt11Invoice invoice, dynamic hint}) => - LdkCore.instance.api - .ldkBolt11PaymentSend(that: this, invoice: invoice, hint: hint); - - Future sendProbes({required Bolt11Invoice invoice, dynamic hint}) => - LdkCore.instance.api - .ldkBolt11PaymentSendProbes(that: this, invoice: invoice, hint: hint); - - Future sendProbesUsingAmount( - {required Bolt11Invoice invoice, - required int amountMsat, - dynamic hint}) => - LdkCore.instance.api.ldkBolt11PaymentSendProbesUsingAmount( - that: this, invoice: invoice, amountMsat: amountMsat, hint: hint); - - Future sendUsingAmount( - {required Bolt11Invoice invoice, - required int amountMsat, - dynamic hint}) => - LdkCore.instance.api.ldkBolt11PaymentSendUsingAmount( - that: this, invoice: invoice, amountMsat: amountMsat, hint: hint); - - @override - int get hashCode => ptr.hashCode; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is LdkBolt11Payment && - runtimeType == other.runtimeType && - ptr == other.ptr; -} - -class LdkMnemonic { - final String seedPhrase; - - const LdkMnemonic({ - required this.seedPhrase, - }); - - static Future generate({dynamic hint}) => - LdkCore.instance.api.ldkMnemonicGenerate(hint: hint); - - @override - int get hashCode => seedPhrase.hashCode; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is LdkMnemonic && - runtimeType == other.runtimeType && - seedPhrase == other.seedPhrase; -} +// Rust type: RustOpaqueNom +abstract class Node implements RustOpaqueInterface {} class LdkNode { final Node ptr; @@ -240,144 +27,168 @@ class LdkNode { required this.ptr, }); - static Future bolt11Payment( - {required LdkNode ptr, dynamic hint}) => - LdkCore.instance.api.ldkNodeBolt11Payment(ptr: ptr, hint: hint); + static Future bolt11Payment({required LdkNode ptr}) => + core.instance.api.crateApiNodeLdkNodeBolt11Payment(ptr: ptr); + + static Future bolt12Payment({required LdkNode ptr}) => + core.instance.api.crateApiNodeLdkNodeBolt12Payment(ptr: ptr); Future closeChannel( {required UserChannelId userChannelId, - required PublicKey counterpartyNodeId, - dynamic hint}) => - LdkCore.instance.api.ldkNodeCloseChannel( + required PublicKey counterpartyNodeId}) => + core.instance.api.crateApiNodeLdkNodeCloseChannel( that: this, userChannelId: userChannelId, - counterpartyNodeId: counterpartyNodeId, - hint: hint); + counterpartyNodeId: counterpartyNodeId); - Future config({dynamic hint}) => - LdkCore.instance.api.ldkNodeConfig(that: this, hint: hint); + Future config() => core.instance.api.crateApiNodeLdkNodeConfig( + that: this, + ); Future connect( {required PublicKey nodeId, required SocketAddress address, - required bool persist, - dynamic hint}) => - LdkCore.instance.api.ldkNodeConnect( - that: this, - nodeId: nodeId, - address: address, - persist: persist, - hint: hint); + required bool persist}) => + core.instance.api.crateApiNodeLdkNodeConnect( + that: this, nodeId: nodeId, address: address, persist: persist); Future connectOpenChannel( {required SocketAddress socketAddress, required PublicKey nodeId, - required int channelAmountSats, - int? pushToCounterpartyMsat, + required BigInt channelAmountSats, + BigInt? pushToCounterpartyMsat, required bool announceChannel, - ChannelConfig? channelConfig, - dynamic hint}) => - LdkCore.instance.api.ldkNodeConnectOpenChannel( + ChannelConfig? channelConfig}) => + core.instance.api.crateApiNodeLdkNodeConnectOpenChannel( that: this, socketAddress: socketAddress, nodeId: nodeId, channelAmountSats: channelAmountSats, pushToCounterpartyMsat: pushToCounterpartyMsat, announceChannel: announceChannel, - channelConfig: channelConfig, - hint: hint); + channelConfig: channelConfig); + + Future disconnect({required PublicKey counterpartyNodeId}) => + core.instance.api.crateApiNodeLdkNodeDisconnect( + that: this, counterpartyNodeId: counterpartyNodeId); - Future disconnect( - {required PublicKey counterpartyNodeId, dynamic hint}) => - LdkCore.instance.api.ldkNodeDisconnect( - that: this, counterpartyNodeId: counterpartyNodeId, hint: hint); + Future eventHandled() => + core.instance.api.crateApiNodeLdkNodeEventHandled( + that: this, + ); - Future eventHandled({dynamic hint}) => - LdkCore.instance.api.ldkNodeEventHandled(that: this, hint: hint); + Future forceCloseChannel( + {required UserChannelId userChannelId, + required PublicKey counterpartyNodeId}) => + core.instance.api.crateApiNodeLdkNodeForceCloseChannel( + that: this, + userChannelId: userChannelId, + counterpartyNodeId: counterpartyNodeId); - Future listBalances({dynamic hint}) => - LdkCore.instance.api.ldkNodeListBalances(that: this, hint: hint); + Future listBalances() => + core.instance.api.crateApiNodeLdkNodeListBalances( + that: this, + ); - Future> listChannels({dynamic hint}) => - LdkCore.instance.api.ldkNodeListChannels(that: this, hint: hint); + Future> listChannels() => + core.instance.api.crateApiNodeLdkNodeListChannels( + that: this, + ); - Future> listPayments({dynamic hint}) => - LdkCore.instance.api.ldkNodeListPayments(that: this, hint: hint); + Future> listPayments() => + core.instance.api.crateApiNodeLdkNodeListPayments( + that: this, + ); Future> listPaymentsWithFilter( - {required PaymentDirection paymentDirection, dynamic hint}) => - LdkCore.instance.api.ldkNodeListPaymentsWithFilter( - that: this, paymentDirection: paymentDirection, hint: hint); + {required PaymentDirection paymentDirection}) => + core.instance.api.crateApiNodeLdkNodeListPaymentsWithFilter( + that: this, paymentDirection: paymentDirection); + + Future> listPeers() => + core.instance.api.crateApiNodeLdkNodeListPeers( + that: this, + ); - Future> listPeers({dynamic hint}) => - LdkCore.instance.api.ldkNodeListPeers(that: this, hint: hint); + Future?> listeningAddresses() => + core.instance.api.crateApiNodeLdkNodeListeningAddresses( + that: this, + ); - Future?> listeningAddresses({dynamic hint}) => - LdkCore.instance.api.ldkNodeListeningAddresses(that: this, hint: hint); + Future networkGraph() => + core.instance.api.crateApiNodeLdkNodeNetworkGraph( + that: this, + ); - Future nextEvent({dynamic hint}) => - LdkCore.instance.api.ldkNodeNextEvent(that: this, hint: hint); + Future nextEvent() => core.instance.api.crateApiNodeLdkNodeNextEvent( + that: this, + ); - Future nextEventAsync({dynamic hint}) => - LdkCore.instance.api.ldkNodeNextEventAsync(that: this, hint: hint); + Future nextEventAsync() => + core.instance.api.crateApiNodeLdkNodeNextEventAsync( + that: this, + ); - Future nodeId({dynamic hint}) => - LdkCore.instance.api.ldkNodeNodeId(that: this, hint: hint); + Future nodeId() => core.instance.api.crateApiNodeLdkNodeNodeId( + that: this, + ); - static Future onChainPayment( - {required LdkNode ptr, dynamic hint}) => - LdkCore.instance.api.ldkNodeOnChainPayment(ptr: ptr, hint: hint); + static Future onChainPayment({required LdkNode ptr}) => + core.instance.api.crateApiNodeLdkNodeOnChainPayment(ptr: ptr); - Future payment( - {required PaymentId paymentId, dynamic hint}) => - LdkCore.instance.api - .ldkNodePayment(that: this, paymentId: paymentId, hint: hint); + Future payment({required PaymentId paymentId}) => + core.instance.api + .crateApiNodeLdkNodePayment(that: this, paymentId: paymentId); - Future removePayment({required PaymentId paymentId, dynamic hint}) => - LdkCore.instance.api - .ldkNodeRemovePayment(that: this, paymentId: paymentId, hint: hint); + Future removePayment({required PaymentId paymentId}) => + core.instance.api + .crateApiNodeLdkNodeRemovePayment(that: this, paymentId: paymentId); - Future signMessage({required List msg, dynamic hint}) => - LdkCore.instance.api.ldkNodeSignMessage(that: this, msg: msg, hint: hint); + Future signMessage({required List msg}) => + core.instance.api.crateApiNodeLdkNodeSignMessage(that: this, msg: msg); static Future spontaneousPayment( - {required LdkNode ptr, dynamic hint}) => - LdkCore.instance.api.ldkNodeSpontaneousPayment(ptr: ptr, hint: hint); + {required LdkNode ptr}) => + core.instance.api.crateApiNodeLdkNodeSpontaneousPayment(ptr: ptr); - Future start({dynamic hint}) => - LdkCore.instance.api.ldkNodeStart(that: this, hint: hint); + Future start() => core.instance.api.crateApiNodeLdkNodeStart( + that: this, + ); - Future status({dynamic hint}) => - LdkCore.instance.api.ldkNodeStatus(that: this, hint: hint); + Future status() => core.instance.api.crateApiNodeLdkNodeStatus( + that: this, + ); - Future stop({dynamic hint}) => - LdkCore.instance.api.ldkNodeStop(that: this, hint: hint); + Future stop() => core.instance.api.crateApiNodeLdkNodeStop( + that: this, + ); - Future syncWallets({dynamic hint}) => - LdkCore.instance.api.ldkNodeSyncWallets(that: this, hint: hint); + Future syncWallets() => + core.instance.api.crateApiNodeLdkNodeSyncWallets( + that: this, + ); Future updateChannelConfig( {required UserChannelId userChannelId, required PublicKey counterpartyNodeId, - required ChannelConfig channelConfig, - dynamic hint}) => - LdkCore.instance.api.ldkNodeUpdateChannelConfig( + required ChannelConfig channelConfig}) => + core.instance.api.crateApiNodeLdkNodeUpdateChannelConfig( that: this, userChannelId: userChannelId, counterpartyNodeId: counterpartyNodeId, - channelConfig: channelConfig, - hint: hint); + channelConfig: channelConfig); Future verifySignature( {required List msg, required String sig, - required PublicKey publicKey, - dynamic hint}) => - LdkCore.instance.api.ldkNodeVerifySignature( - that: this, msg: msg, sig: sig, publicKey: publicKey, hint: hint); + required PublicKey publicKey}) => + core.instance.api.crateApiNodeLdkNodeVerifySignature( + that: this, msg: msg, sig: sig, publicKey: publicKey); - Future waitNextEvent({dynamic hint}) => - LdkCore.instance.api.ldkNodeWaitNextEvent(that: this, hint: hint); + Future waitNextEvent() => + core.instance.api.crateApiNodeLdkNodeWaitNextEvent( + that: this, + ); @override int get hashCode => ptr.hashCode; @@ -387,131 +198,3 @@ class LdkNode { identical(this, other) || other is LdkNode && runtimeType == other.runtimeType && ptr == other.ptr; } - -class LdkOnChainPayment { - final LdkNodePaymentOnchainPayment ptr; - - const LdkOnChainPayment({ - required this.ptr, - }); - - Future
newAddress({dynamic hint}) => - LdkCore.instance.api.ldkOnChainPaymentNewAddress(that: this, hint: hint); - - Future sendAllToAddress({required Address address, dynamic hint}) => - LdkCore.instance.api.ldkOnChainPaymentSendAllToAddress( - that: this, address: address, hint: hint); - - Future sendToAddress( - {required Address address, required int amountSats, dynamic hint}) => - LdkCore.instance.api.ldkOnChainPaymentSendToAddress( - that: this, address: address, amountSats: amountSats, hint: hint); - - @override - int get hashCode => ptr.hashCode; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is LdkOnChainPayment && - runtimeType == other.runtimeType && - ptr == other.ptr; -} - -class LdkSpontaneousPayment { - final LdkNodePaymentSpontaneousPayment ptr; - - const LdkSpontaneousPayment({ - required this.ptr, - }); - - Future send( - {required int amountMsat, required PublicKey nodeId, dynamic hint}) => - LdkCore.instance.api.ldkSpontaneousPaymentSend( - that: this, amountMsat: amountMsat, nodeId: nodeId, hint: hint); - - Future sendProbes( - {required int amountMsat, required PublicKey nodeId, dynamic hint}) => - LdkCore.instance.api.ldkSpontaneousPaymentSendProbes( - that: this, amountMsat: amountMsat, nodeId: nodeId, hint: hint); - - @override - int get hashCode => ptr.hashCode; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is LdkSpontaneousPayment && - runtimeType == other.runtimeType && - ptr == other.ptr; -} - -class U8Array12 extends NonGrowableListView { - static const arraySize = 12; - - @internal - Uint8List get inner => _inner; - final Uint8List _inner; - - U8Array12(this._inner) - : assert(_inner.length == arraySize), - super(_inner); - - U8Array12.init() : this(Uint8List(arraySize)); -} - -class U8Array16 extends NonGrowableListView { - static const arraySize = 16; - - @internal - Uint8List get inner => _inner; - final Uint8List _inner; - - U8Array16(this._inner) - : assert(_inner.length == arraySize), - super(_inner); - - U8Array16.init() : this(Uint8List(arraySize)); -} - -class U8Array32 extends NonGrowableListView { - static const arraySize = 32; - - @internal - Uint8List get inner => _inner; - final Uint8List _inner; - - U8Array32(this._inner) - : assert(_inner.length == arraySize), - super(_inner); - - U8Array32.init() : this(Uint8List(arraySize)); -} - -class U8Array4 extends NonGrowableListView { - static const arraySize = 4; - - @internal - Uint8List get inner => _inner; - final Uint8List _inner; - - U8Array4(this._inner) - : assert(_inner.length == arraySize), - super(_inner); - - U8Array4.init() : this(Uint8List(arraySize)); -} - -class U8Array64 extends NonGrowableListView { - static const arraySize = 64; - - @internal - Uint8List get inner => _inner; - final Uint8List _inner; - - U8Array64(this._inner) - : assert(_inner.length == arraySize), - super(_inner); - - U8Array64.init() : this(Uint8List(arraySize)); -} diff --git a/lib/src/root.dart b/lib/src/root.dart index defa30e..cad7ad7 100644 --- a/lib/src/root.dart +++ b/lib/src/root.dart @@ -1,9 +1,14 @@ -import 'package:ldk_node/src/generated/api/error.dart' as error; import 'package:ldk_node/src/generated/api/types.dart' as types; +import 'package:ldk_node/src/generated/utils/error.dart' as error; import 'package:ldk_node/src/utils/utils.dart'; import 'package:path_provider/path_provider.dart'; +import 'generated/api/bolt11.dart'; +import 'generated/api/builder.dart'; import 'generated/api/node.dart'; +import 'generated/api/on_chain.dart'; +import 'generated/api/spontaneous.dart'; +import 'generated/lib.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. @@ -15,8 +20,8 @@ class Mnemonic extends LdkMnemonic { await Frb.verifyInit(); final res = await LdkMnemonic.generate(); return Mnemonic(seedPhrase: res.seedPhrase); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } } @@ -37,8 +42,8 @@ class Node extends LdkNode { Future start({hint}) async { try { return super.start(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -50,8 +55,8 @@ class Node extends LdkNode { Future stop({hint}) async { try { await super.stop(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -60,8 +65,8 @@ class Node extends LdkNode { Future status({hint}) async { try { return await super.status(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -72,8 +77,8 @@ class Node extends LdkNode { Future eventHandled({hint}) async { try { await super.eventHandled(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -84,8 +89,8 @@ class Node extends LdkNode { Future nextEvent({hint}) async { try { return await super.nextEvent(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -98,8 +103,8 @@ class Node extends LdkNode { Future waitNextHandled({hint}) async { try { return await super.waitNextEvent(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -110,8 +115,8 @@ class Node extends LdkNode { Future nextEventAsync({hint}) async { try { return await super.nextEventAsync(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -120,8 +125,8 @@ class Node extends LdkNode { Future nodeId({hint}) async { try { return await super.nodeId(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -130,8 +135,8 @@ class Node extends LdkNode { Future?> listeningAddresses({hint}) async { try { return await super.listeningAddresses(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -140,8 +145,8 @@ class Node extends LdkNode { Future listBalances({hint}) { try { return super.listBalances(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -150,8 +155,8 @@ class Node extends LdkNode { Future config({hint}) { try { return super.config(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -160,8 +165,8 @@ class Node extends LdkNode { Future> listChannels({hint}) async { try { return await super.listChannels(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -177,8 +182,8 @@ class Node extends LdkNode { try { return await super .connect(address: address, nodeId: nodeId, persist: persist); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -193,8 +198,8 @@ class Node extends LdkNode { await super.disconnect( counterpartyNodeId: counterpartyNodeId, ); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -211,10 +216,10 @@ class Node extends LdkNode { Future connectOpenChannel( {required types.SocketAddress socketAddress, required types.PublicKey nodeId, - required int channelAmountSats, + required BigInt channelAmountSats, required bool announceChannel, types.ChannelConfig? channelConfig, - int? pushToCounterpartyMsat, + BigInt? pushToCounterpartyMsat, hint}) async { try { return await super.connectOpenChannel( @@ -224,8 +229,8 @@ class Node extends LdkNode { channelAmountSats: channelAmountSats, channelConfig: channelConfig, announceChannel: announceChannel); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -235,8 +240,8 @@ class Node extends LdkNode { Future syncWallets({hint}) async { try { await super.syncWallets(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -251,8 +256,27 @@ class Node extends LdkNode { userChannelId: userChannelId, counterpartyNodeId: counterpartyNodeId, ); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Force-close a previously opened channel. + /// Will force-close the channel, potentially broadcasting our latest state. Note that in contrast to cooperative closure, force-closing will have the channel funds time-locked, i. e., they will only be available after the counterparty had time to contest our claim. + /// Force-closing channels also more costly in terms of on-chain fees. So cooperative closure should always be preferred (and tried first). + /// Broadcasting the closing transactions will be omitted for Anchor channels if we trust the counterparty to broadcast for us. + @override + Future forceCloseChannel( + {required types.PublicKey counterpartyNodeId, + required types.UserChannelId userChannelId, + hint}) async { + try { + await super.forceCloseChannel( + userChannelId: userChannelId, + counterpartyNodeId: counterpartyNodeId, + ); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -270,8 +294,8 @@ class Node extends LdkNode { counterpartyNodeId: counterpartyNodeId, channelConfig: channelConfig, ); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -283,8 +307,8 @@ class Node extends LdkNode { {required types.PaymentId paymentId, hint}) async { try { return await super.payment(paymentId: paymentId); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -293,8 +317,8 @@ class Node extends LdkNode { Future removePayment({required types.PaymentId paymentId, hint}) async { try { return await super.removePayment(paymentId: paymentId); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -305,8 +329,8 @@ class Node extends LdkNode { try { return await super .listPaymentsWithFilter(paymentDirection: paymentDirection); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -315,8 +339,8 @@ class Node extends LdkNode { Future> listPayments({hint}) async { try { return super.listPayments(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -325,8 +349,8 @@ class Node extends LdkNode { Future> listPeers({hint}) async { try { return await super.listPeers(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -340,8 +364,8 @@ class Node extends LdkNode { Future signMessage({required List msg, hint}) async { try { return await super.signMessage(msg: msg); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -356,8 +380,8 @@ class Node extends LdkNode { try { return await super .verifySignature(msg: msg, sig: sig, publicKey: publicKey); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -365,8 +389,8 @@ class Node extends LdkNode { try { final res = await LdkNode.bolt11Payment(ptr: this); return Bolt11Payment._(ptr: res.ptr); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -374,8 +398,8 @@ class Node extends LdkNode { try { final res = await LdkNode.onChainPayment(ptr: this); return OnChainPayment._(ptr: res.ptr); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -383,8 +407,8 @@ class Node extends LdkNode { try { final res = await LdkNode.spontaneousPayment(ptr: this); return SpontaneousPayment._(ptr: res.ptr); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } } @@ -393,23 +417,23 @@ class SpontaneousPayment extends LdkSpontaneousPayment { SpontaneousPayment._({required super.ptr}); @override Future sendProbes( - {required int amountMsat, required types.PublicKey nodeId, hint}) { + {required BigInt amountMsat, required types.PublicKey nodeId, hint}) { try { return super.sendProbes(amountMsat: amountMsat, nodeId: nodeId); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @override Future send( - {required int amountMsat, + {required BigInt amountMsat, required types.PublicKey nodeId, dynamic hint}) { try { return super.send(amountMsat: amountMsat, nodeId: nodeId); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } } @@ -420,8 +444,8 @@ class OnChainPayment extends LdkOnChainPayment { Future newAddress({hint}) { try { return super.newAddress(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -429,18 +453,18 @@ class OnChainPayment extends LdkOnChainPayment { Future sendAllToAddress({required types.Address address, hint}) { try { return super.sendAllToAddress(address: address); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @override Future sendToAddress( - {required types.Address address, required int amountSats, hint}) { + {required types.Address address, required BigInt amountSats, hint}) { try { return super.sendToAddress(address: address, amountSats: amountSats); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } } @@ -449,7 +473,7 @@ class Bolt11Payment extends LdkBolt11Payment { Bolt11Payment._({required super.ptr}); @override Future receive( - {required int amountMsat, + {required BigInt amountMsat, required String description, required int expirySecs, hint}) { @@ -458,8 +482,8 @@ class Bolt11Payment extends LdkBolt11Payment { amountMsat: amountMsat, description: description, expirySecs: expirySecs); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -469,8 +493,8 @@ class Bolt11Payment extends LdkBolt11Payment { try { return super.receiveVariableAmount( description: description, expirySecs: expirySecs); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -478,24 +502,24 @@ class Bolt11Payment extends LdkBolt11Payment { Future receiveVariableAmountViaJitChannel( {required String description, required int expirySecs, - int? maxProportionalLspFeeLimitPpmMsat, + BigInt? maxProportionalLspFeeLimitPpmMsat, hint}) { try { return super.receiveVariableAmountViaJitChannel( description: description, expirySecs: expirySecs, maxProportionalLspFeeLimitPpmMsat: maxProportionalLspFeeLimitPpmMsat); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @override Future receiveViaJitChannel( - {required int amountMsat, + {required BigInt amountMsat, required String description, required int expirySecs, - int? maxTotalLspFeeLimitMsat, + BigInt? maxTotalLspFeeLimitMsat, hint}) { try { return super.receiveViaJitChannel( @@ -503,8 +527,8 @@ class Bolt11Payment extends LdkBolt11Payment { expirySecs: expirySecs, maxTotalLspFeeLimitMsat: maxTotalLspFeeLimitMsat, amountMsat: amountMsat); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -512,8 +536,8 @@ class Bolt11Payment extends LdkBolt11Payment { Future send({required types.Bolt11Invoice invoice, hint}) { try { return super.send(invoice: invoice); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -521,29 +545,33 @@ class Bolt11Payment extends LdkBolt11Payment { Future sendProbes({required types.Bolt11Invoice invoice, hint}) { try { return super.sendProbes(invoice: invoice); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @override Future sendProbesUsingAmount( - {required types.Bolt11Invoice invoice, required int amountMsat, hint}) { + {required types.Bolt11Invoice invoice, + required BigInt amountMsat, + hint}) { try { return super .sendProbesUsingAmount(invoice: invoice, amountMsat: amountMsat); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @override Future sendUsingAmount( - {required types.Bolt11Invoice invoice, required int amountMsat, hint}) { + {required types.Bolt11Invoice invoice, + required BigInt amountMsat, + hint}) { try { return super.sendUsingAmount(invoice: invoice, amountMsat: amountMsat); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } } @@ -574,18 +602,19 @@ class Builder { /// factory Builder() { return Builder._(types.Config( - storageDirPath: '', - network: types.Network.bitcoin, - listeningAddresses: [ - types.SocketAddress.hostname(addr: "0.0.0.0", port: 9735) - ], - onchainWalletSyncIntervalSecs: 60, - walletSyncIntervalSecs: 20, - feeRateCacheUpdateIntervalSecs: 600, - logLevel: types.LogLevel.debug, - defaultCltvExpiryDelta: 144, - trustedPeers0Conf: [], - probingLiquidityLimitMultiplier: 3)); + storageDirPath: '', + network: types.Network.bitcoin, + listeningAddresses: [ + types.SocketAddress.hostname(addr: "0.0.0.0", port: 9735) + ], + onchainWalletSyncIntervalSecs: BigInt.from(60), + walletSyncIntervalSecs: BigInt.from(20), + feeRateCacheUpdateIntervalSecs: BigInt.from(200), + logLevel: types.LogLevel.debug, + defaultCltvExpiryDelta: 144, + trustedPeers0Conf: [], + probingLiquidityLimitMultiplier: BigInt.from(3), + )); } /// Configures the [Node] instance to source its wallet entropy from a seed file on disk. @@ -700,8 +729,8 @@ class Builder { gossipSourceConfig: _gossipSourceConfig); final res = await builder.build(); return Node._(ptr: res.ptr); - } on error.BuilderException catch (e) { - throw mapBuilderException(e); + } on error.LdkBuilderError catch (e) { + throw mapLdkBuilderError(e); } } @@ -722,8 +751,8 @@ class Builder { gossipSourceConfig: _gossipSourceConfig); final res = await builder.buildWithFsStore(); return Node._(ptr: res.ptr); - } on error.BuilderException catch (e) { - throw mapBuilderException(e); + } on error.LdkBuilderError catch (e) { + throw mapLdkBuilderError(e); } } } diff --git a/rust/src/api/node.rs b/rust/src/api/node.rs index 1d29441..d2c02ac 100644 --- a/rust/src/api/node.rs +++ b/rust/src/api/node.rs @@ -1,125 +1,15 @@ -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; pub use ldk_node::Node; -use std::str::FromStr; pub use std::sync::{ Arc, Mutex }; -use flutter_rust_bridge::frb; +use crate::api::bolt11::LdkBolt11Payment; +use crate::api::bolt12::LdkBolt12Payment; +use crate::api::graph::LdkNetworkGraph; +use crate::api::on_chain::LdkOnChainPayment; +use crate::api::spontaneous::LdkSpontaneousPayment; +use crate::utils::error::{LdkNodeError}; -#[derive(Debug, Clone)] -pub struct LdkMnemonic { - pub seed_phrase: String, -} - -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 LdkMnemonic { - fn from(value: ldk_node::bip39::Mnemonic) -> Self { - LdkMnemonic { - seed_phrase: value.to_string(), - } - } -} -impl LdkMnemonic { - pub fn generate() -> LdkMnemonic { - ldk_node::generate_entropy_mnemonic().into() - } -} - - #[frb(opaque)] -pub struct NodeBuilder { - pub builder: RustOpaque -} - -impl NodeBuilder { - pub fn create_builder( - config: Config, - 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.try_into()?); - if let Some(source) = entropy_source_config { - match source { - EntropySourceConfig::SeedFile(e) => builder.set_entropy_seed_path(e), - EntropySourceConfig::SeedBytes(e) => builder.set_entropy_seed_bytes(e.encode())?, - EntropySourceConfig::Bip39Mnemonic { - mnemonic, - passphrase, - } => builder.set_entropy_bip39_mnemonic(>::try_into(mnemonic)?, passphrase), - }; - } - if let Some(source) = chain_data_source_config { - match source { - ChainDataSourceConfig::Esplora(e) => builder.set_esplora_server(e), - }; - } - if let Some(source) = gossip_source_config { - match source { - GossipSourceConfig::P2PNetwork => builder.set_gossip_source_p2p(), - 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.try_into()?, - liquidity.lsps2_service.1.try_into().map_err(|_| BuilderException::InvalidPublicKey)?, - liquidity.lsps2_service.2, - ); - } - Ok(NodeBuilder { builder: RustOpaque::new(builder) }) - } - pub fn build( - self - ) -> anyhow::Result { - - match self.builder.build() { - Ok(e) => Ok(LdkNode { - ptr: RustOpaque::new(e), - }), - Err(e) => Err(e.into()), - } - } - pub fn build_with_fs_store( - self - ) -> anyhow::Result { - - match self.builder.build_with_fs_store() { - Ok(e) => Ok(LdkNode { - ptr: RustOpaque::new(e), - }), - Err(e) => Err(e.into()), - } - } -// fn build_with_store( -// self -// ) -> anyhow::Result { -// match self.builder.build_with_store(Arc::new(())) { -// Ok(e) => Ok(LdkNode { -// ptr: RustOpaque::new(e), -// }), -// Err(e) => Err(e.into()), -// } -// } -} - // pub fn build_with_vss_store( - // self, url: String, store_id: String - // ) -> anyhow::Result { - // match self.builder.build_with_vss_store(url, store_id) { - // Ok(e) => Ok(LdkNode { - // ptr: RustOpaque::new(e), - // }), - // Err(e) => Err(e.into()), - // } - // } @@ -127,11 +17,11 @@ pub struct LdkNode { pub ptr: RustOpaque, } impl LdkNode { - pub fn start(&self) -> anyhow::Result<(), NodeException> { + pub fn start(&self) -> anyhow::Result<(), LdkNodeError> { self.ptr.start().map_err(|e| e.into()) } - pub fn stop(&self) -> anyhow::Result<(), NodeException> { + pub fn stop(&self) -> anyhow::Result<(), LdkNodeError> { self.ptr.stop().map_err(|e| e.into()) } pub fn status(&self) -> NodeStatus { @@ -170,7 +60,7 @@ impl LdkNode { }) } - pub fn list_balances(&self) -> anyhow::Result { + pub fn list_balances(&self) -> anyhow::Result { Ok(self.ptr.list_balances().into()) } @@ -188,19 +78,19 @@ impl LdkNode { node_id: PublicKey, address: SocketAddress, persist: bool, - ) -> anyhow::Result<(), NodeException> { + ) -> anyhow::Result<(), LdkNodeError> { self.ptr .connect( node_id.try_into()?, address .try_into() - .map_err(|_| NodeException::InvalidAddress)?, + .map_err(|_| LdkNodeError::InvalidAddress)?, persist, ) .map_err(|e| e.into()) } - pub fn disconnect(&self, counterparty_node_id: PublicKey) -> anyhow::Result<(), NodeException> { + pub fn disconnect(&self, counterparty_node_id: PublicKey) -> anyhow::Result<(), LdkNodeError> { self.ptr .disconnect(counterparty_node_id.try_into()?) .map_err(|e| e.into()) @@ -214,13 +104,13 @@ impl LdkNode { push_to_counterparty_msat: Option, announce_channel: bool, channel_config: Option, - ) -> Result { + ) -> Result { self.ptr .connect_open_channel( node_id.try_into()?, socket_address .try_into() - .map_err(|_| NodeException::InvalidAddress)?, + .map_err(|_| LdkNodeError::InvalidAddress)?, channel_amount_sats, push_to_counterparty_msat, channel_config.map(|x| Arc::new(x.into())), @@ -230,7 +120,7 @@ impl LdkNode { .map(|e| e.into()) } - pub fn sync_wallets(&self) -> anyhow::Result<(), NodeException> { + pub fn sync_wallets(&self) -> anyhow::Result<(), LdkNodeError> { self.ptr.sync_wallets().map_err(|e| e.into()) } @@ -238,18 +128,30 @@ impl LdkNode { &self, user_channel_id: UserChannelId, counterparty_node_id: PublicKey, - ) -> anyhow::Result<(), NodeException> { + ) -> anyhow::Result<(), LdkNodeError> { self.ptr .close_channel(&(user_channel_id.try_into()?), counterparty_node_id.try_into()?) .map_err(|e| e.into()) } + pub fn force_close_channel( + &self, + user_channel_id: UserChannelId, + counterparty_node_id: PublicKey, + ) -> anyhow::Result<(), LdkNodeError> { + self.ptr + .force_close_channel(&(user_channel_id.try_into()?), counterparty_node_id.try_into()?) + .map_err(|e| e.into()) + } + pub fn network_graph(&self)-> LdkNetworkGraph { + self.ptr.network_graph().into() + } pub fn update_channel_config( &self, user_channel_id: UserChannelId, counterparty_node_id: PublicKey, channel_config: ChannelConfig - ) -> anyhow::Result<(), NodeException> { + ) -> anyhow::Result<(), LdkNodeError> { self.ptr .update_channel_config( &(user_channel_id.try_into()?), @@ -266,7 +168,7 @@ impl LdkNode { } } - pub fn remove_payment(&self, payment_id: PaymentId) -> Result<(), NodeException> { + pub fn remove_payment(&self, payment_id: PaymentId) -> Result<(), LdkNodeError> { self.ptr.remove_payment(&(payment_id.into())).map_err(|e| e.into()) } @@ -297,7 +199,7 @@ impl LdkNode { .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()) } pub fn bolt11_payment(ptr: Self) -> LdkBolt11Payment { @@ -309,154 +211,17 @@ impl LdkNode { pub fn spontaneous_payment(ptr: Self) -> LdkSpontaneousPayment { ptr.ptr.spontaneous_payment().into() } + pub fn bolt12_payment(ptr: Self) -> LdkBolt12Payment { + LdkBolt12Payment{ptr:RustOpaque::new(ptr.ptr.bolt12_payment())} + } pub fn verify_signature( &self, msg: Vec, sig: String, public_key: PublicKey - ) -> anyhow::Result { + ) -> anyhow::Result { Ok(self.ptr.verify_signature(msg.as_slice(), sig.as_str(), &public_key.try_into()?)) } } -pub struct LdkSpontaneousPayment { - pub ptr:RustOpaque -} -impl From for LdkSpontaneousPayment { - fn from(value: ldk_node::payment::SpontaneousPayment) -> Self { - Self{ptr:RustOpaque::new(value)} - } -} -impl LdkSpontaneousPayment { - pub fn send(&self, amount_msat: u64, node_id: PublicKey) -> Result { - self.ptr.send(amount_msat, node_id.try_into()?).map_err(|e| e.into()).map(|e| e.into()) - } - pub fn send_probes(&self, amount_msat: u64, node_id: PublicKey) -> Result<(), NodeException> { - self.ptr.send_probes(amount_msat, node_id.try_into()?).map_err(|e| e.into()).map(|e| e.into()) - } -} -pub struct LdkBolt11Payment { - pub ptr:RustOpaque -} -impl From for LdkBolt11Payment { - fn from(value: ldk_node::payment::Bolt11Payment) -> Self { - LdkBolt11Payment {ptr:RustOpaque::new(value)} - } -} - - -impl LdkBolt11Payment { - pub fn receive( - &self, - amount_msat: u64, - description: String, - expiry_secs: u32, - ) -> anyhow::Result { - self.ptr - .receive(amount_msat, description.as_str(), expiry_secs) - .map_err(|e| e.into()) - .map(|e| e.into()) - } - pub fn receive_variable_amount( - &self, - description: String, - expiry_secs: u32, - ) -> anyhow::Result { - self.ptr - .receive_variable_amount - (description.as_str(), expiry_secs) - .map_err(|e| e.into()) - .map(|e| e.into()) - } - pub fn receive_variable_amount_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_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_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_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 send_probes(&self, invoice: Bolt11Invoice) -> anyhow::Result<(), NodeException> { - self.ptr - .send_probes(&(invoice.try_into()?)) - .map_err(|e| e.into()) - } - - - pub fn send_probes_using_amount( - &self, - invoice: Bolt11Invoice, - amount_msat: u64, - ) -> Result<(), NodeException> { - self.ptr - .send_probes_using_amount(&(invoice.try_into()?), amount_msat) - .map_err(|e| e.into()) - } - - pub fn send(&self, invoice: Bolt11Invoice) -> Result { - self.ptr.send(&(invoice.try_into()?)).map_err(|e| e.into()).map(|e| e.into()) - } - pub fn send_using_amount( - &self, - invoice: Bolt11Invoice, - amount_msat: u64, - ) -> anyhow::Result { - self.ptr - .send_using_amount(&(invoice.try_into()?), amount_msat) - .map_err(|e| e.into()) - .map(|e| e.into()) - } -} -pub struct LdkOnChainPayment { - pub ptr:RustOpaque -} -impl From for LdkOnChainPayment { - fn from(value: ldk_node::payment::OnchainPayment) -> Self { - LdkOnChainPayment {ptr:RustOpaque::new(value)} - } -} - -impl LdkOnChainPayment { - pub fn new_address(&self) -> Result { - self.ptr.new_address().map_err(|e| e.into()).map(|e| e.into()) - } - pub fn send_to_address( - &self, address: Address, amount_sats: u64, - ) -> Result { - self.ptr.send_to_address(&(address.try_into()?), amount_sats).map_err(|e| e.into()).map(|e| e.into()) - } - pub fn send_all_to_address( - &self, address: Address, - ) -> Result { - self.ptr.send_all_to_address(&(address.try_into()?)).map_err(|e| e.into()).map(|e| e.into()) - } - -} \ No newline at end of file From 80b85d2bd2a15c15c34e061a6d3865594c295cde Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Thu, 27 Jun 2024 07:55:00 -0400 Subject: [PATCH 16/48] refactor: code cleanup --- example/lib/main.dart | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/example/lib/main.dart b/example/lib/main.dart index 5b01d7c..8097cd2 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -48,14 +48,14 @@ class _MyAppState extends State { final directory = await getApplicationDocumentsDirectory(); final nodePath = "${directory.path}/ldk_cache/$path"; final config = ldk.Config( - probingLiquidityLimitMultiplier: 3, + probingLiquidityLimitMultiplier: BigInt.from(3), trustedPeers0Conf: [], storageDirPath: nodePath, network: ldk.Network.regtest, listeningAddresses: [address], - onchainWalletSyncIntervalSecs: 60, - walletSyncIntervalSecs: 20, - feeRateCacheUpdateIntervalSecs: 600, + onchainWalletSyncIntervalSecs: BigInt.from(60), + walletSyncIntervalSecs: BigInt.from(20), + feeRateCacheUpdateIntervalSecs: BigInt.from(600), logLevel: ldk.LogLevel.debug, defaultCltvExpiryDelta: 144); return config; @@ -122,7 +122,7 @@ class _MyAppState extends State { print("bob's spendable balance: ${bob.spendableOnchainBalanceSats}"); } setState(() { - aliceBalance = alice.spendableOnchainBalanceSats; + aliceBalance = alice.spendableOnchainBalanceSats.toInt(); }); } @@ -211,10 +211,10 @@ class _MyAppState extends State { final funding_amount_sat = 80000; final push_msat = (funding_amount_sat / 2) * 1000; userChannelId = await aliceNode.connectOpenChannel( - channelAmountSats: funding_amount_sat, + channelAmountSats: BigInt.from(funding_amount_sat), announceChannel: true, socketAddress: bobAddr!, - pushToCounterpartyMsat: push_msat.toInt(), + pushToCounterpartyMsat: BigInt.from(push_msat), nodeId: bobNodeId!); } @@ -222,7 +222,9 @@ class _MyAppState extends State { final bobBolt11Handler = await bobNode.bolt11Payment(); final aliceBolt11Handler = await aliceNode.bolt11Payment(); invoice = await bobBolt11Handler.receive( - amountMsat: 2500000, description: 'asdf', expirySecs: 9217); + amountMsat: BigInt.from(2500000), + description: 'asdf', + expirySecs: 9217); setState(() { displayText = invoice.toString(); }); @@ -268,6 +270,11 @@ class _MyAppState extends State { print( "channelClosed: ${e.channelId.data}, userChannelId: ${e.userChannelId.data}"); } + }, paymentClaimable: (e) { + if (kDebugMode) { + print( + "paymentId: ${e.paymentId.field0.toString()}, claimableAmountMsat: ${e.claimableAmountMsat}, userChannelId: ${e.claimDeadline}"); + } }); await node.eventHandled(); } From ad5a6b7f37f5d4157e2d3b61767762bffe9df883 Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Thu, 27 Jun 2024 08:17:00 -0400 Subject: [PATCH 17/48] refactor(bolt11): moved Bolt11Invoice --- lib/src/generated/api/bolt11.dart | 22 +++++++++++++++++++++- lib/src/generated/api/types.dart | 22 +--------------------- rust/src/api/bolt11.rs | 25 ++++++++++++++++++++++++- rust/src/api/types.rs | 22 ---------------------- 4 files changed, 46 insertions(+), 45 deletions(-) diff --git a/lib/src/generated/api/bolt11.dart b/lib/src/generated/api/bolt11.dart index 86a85eb..8cf3a2e 100644 --- a/lib/src/generated/api/bolt11.dart +++ b/lib/src/generated/api/bolt11.dart @@ -9,7 +9,27 @@ import '../utils/error.dart'; import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; import 'types.dart'; -// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `from` +// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `assert_receiver_is_total_eq`, `clone`, `eq`, `fmt`, `from`, `from`, `try_from` + +///Represents a syntactically and semantically correct lightning BOLT11 invoice. +/// +class Bolt11Invoice { + final String signedRawInvoice; + + const Bolt11Invoice({ + required this.signedRawInvoice, + }); + + @override + int get hashCode => signedRawInvoice.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Bolt11Invoice && + runtimeType == other.runtimeType && + signedRawInvoice == other.signedRawInvoice; +} class LdkBolt11Payment { final Bolt11Payment ptr; diff --git a/lib/src/generated/api/types.dart b/lib/src/generated/api/types.dart index 48f43b2..46a07c6 100644 --- a/lib/src/generated/api/types.dart +++ b/lib/src/generated/api/types.dart @@ -10,7 +10,7 @@ import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; import 'package:freezed_annotation/freezed_annotation.dart' hide protected; part 'types.freezed.dart'; -// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `default`, `default`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `hash`, `hash`, `hash`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from` +// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `default`, `default`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `hash`, `hash`, `hash`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from` /// A Bitcoin address. /// @@ -193,26 +193,6 @@ class BestBlock { height == other.height; } -///Represents a syntactically and semantically correct lightning BOLT11 invoice. -/// -class Bolt11Invoice { - final String signedRawInvoice; - - const Bolt11Invoice({ - required this.signedRawInvoice, - }); - - @override - int get hashCode => signedRawInvoice.hashCode; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is Bolt11Invoice && - runtimeType == other.runtimeType && - signedRawInvoice == other.signedRawInvoice; -} - @freezed sealed class ChainDataSourceConfig with _$ChainDataSourceConfig { const ChainDataSourceConfig._(); diff --git a/rust/src/api/bolt11.rs b/rust/src/api/bolt11.rs index 71d2342..0df9352 100644 --- a/rust/src/api/bolt11.rs +++ b/rust/src/api/bolt11.rs @@ -1,4 +1,5 @@ -use crate::api::types::{Bolt11Invoice, PaymentId}; +use std::str::FromStr; +use crate::api::types::{ PaymentId}; use crate::frb_generated::RustOpaque; use crate::utils::error::LdkNodeError; @@ -10,7 +11,29 @@ impl From for LdkBolt11Payment { LdkBolt11Payment {ptr:RustOpaque::new(value)} } } +#[derive(Debug, Clone, PartialEq, Eq)] +///Represents a syntactically and semantically correct lightning BOLT11 invoice. +/// +pub struct Bolt11Invoice { + pub signed_raw_invoice: String, +} + +impl TryFrom for ldk_node::lightning_invoice::Bolt11Invoice { + type Error = LdkNodeError; + fn try_from(value: Bolt11Invoice) -> Result { + ldk_node::lightning_invoice::Bolt11Invoice + ::from_str(value.signed_raw_invoice.as_str()) + .map_err(|_| LdkNodeError::InvalidInvoice) + } +} +impl From for Bolt11Invoice { + fn from(value: ldk_node::lightning_invoice::Bolt11Invoice) -> Self { + Bolt11Invoice { + signed_raw_invoice: value.to_string(), + } + } +} impl LdkBolt11Payment { pub fn receive( diff --git a/rust/src/api/types.rs b/rust/src/api/types.rs index 88e35f8..a7e748c 100644 --- a/rust/src/api/types.rs +++ b/rust/src/api/types.rs @@ -881,29 +881,7 @@ impl From for PaymentKind { } } } -#[derive(Debug, Clone, PartialEq, Eq)] -///Represents a syntactically and semantically correct lightning BOLT11 invoice. -/// -pub struct Bolt11Invoice { - pub signed_raw_invoice: String, -} - -impl TryFrom for ldk_node::lightning_invoice::Bolt11Invoice { - type Error = LdkNodeError; - fn try_from(value: Bolt11Invoice) -> Result { - ldk_node::lightning_invoice::Bolt11Invoice - ::from_str(value.signed_raw_invoice.as_str()) - .map_err(|_| LdkNodeError::InvalidInvoice) - } -} -impl From for Bolt11Invoice { - fn from(value: ldk_node::lightning_invoice::Bolt11Invoice) -> Self { - Bolt11Invoice { - signed_raw_invoice: value.to_string(), - } - } -} ///A Secp256k1 public key, used for verification of signatures. /// #[derive(Debug, Clone, PartialEq, Eq)] From 3ba53df392fe5c476bca640467f8cbf751cd68a9 Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Thu, 27 Jun 2024 09:50:00 -0400 Subject: [PATCH 18/48] feat: Added Bolt12Payment handler --- lib/src/generated/api/bolt12.dart | 126 ++++++++++++++++++++++++++++ lib/src/generated/api/node.dart | 3 - lib/src/root.dart | 101 ++++++++++++++++++++--- rust/src/api/bolt12.rs | 132 ++++++++++++++++++++++++++++++ 4 files changed, 349 insertions(+), 13 deletions(-) create mode 100644 lib/src/generated/api/bolt12.dart create mode 100644 rust/src/api/bolt12.rs diff --git a/lib/src/generated/api/bolt12.dart b/lib/src/generated/api/bolt12.dart new file mode 100644 index 0000000..08f6999 --- /dev/null +++ b/lib/src/generated/api/bolt12.dart @@ -0,0 +1,126 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0. + +// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import + +import '../frb_generated.dart'; +import '../lib.dart'; +import '../utils/error.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; +import 'types.dart'; + +// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `assert_receiver_is_total_eq`, `clone`, `eq`, `fmt`, `from`, `from`, `from`, `try_from`, `try_from`, `try_from` + +// Rust type: RustOpaqueNom> +abstract class ArcBolt12Payment implements RustOpaqueInterface {} + +///A Bolt12Invoice is a payment request, typically corresponding to an Offer or a Refund. +class Bolt12Invoice { + final Uint8List data; + + const Bolt12Invoice({ + required this.data, + }); + + @override + int get hashCode => data.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Bolt12Invoice && + runtimeType == other.runtimeType && + data == other.data; +} + +class LdkBolt12Payment { + final ArcBolt12Payment ptr; + + const LdkBolt12Payment({ + required this.ptr, + }); + + Future initiateRefund( + {required BigInt amountMsat, required int expirySecs}) => + core.instance.api.crateApiBolt12LdkBolt12PaymentInitiateRefund( + that: this, amountMsat: amountMsat, expirySecs: expirySecs); + + Future receive( + {required BigInt amountMsat, required String description}) => + core.instance.api.crateApiBolt12LdkBolt12PaymentReceive( + that: this, amountMsat: amountMsat, description: description); + + Future receiveVariableAmount({required String description}) => + core.instance.api.crateApiBolt12LdkBolt12PaymentReceiveVariableAmount( + that: this, description: description); + + Future requestRefundPayment({required Refund refund}) => + core.instance.api.crateApiBolt12LdkBolt12PaymentRequestRefundPayment( + that: this, refund: refund); + + Future send({required Offer offer, String? payerNote}) => + core.instance.api.crateApiBolt12LdkBolt12PaymentSend( + that: this, offer: offer, payerNote: payerNote); + + Future sendUsingAmount( + {required Offer offer, + String? payerNote, + required BigInt amountMsat}) => + core.instance.api.crateApiBolt12LdkBolt12PaymentSendUsingAmount( + that: this, + offer: offer, + payerNote: payerNote, + amountMsat: amountMsat); + + @override + int get hashCode => ptr.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LdkBolt12Payment && + runtimeType == other.runtimeType && + ptr == other.ptr; +} + +/// An `Offer` is a potentially long-lived proposal for payment of a good or service. +/// +/// An offer is a precursor to an [InvoiceRequest]. A merchant publishes an offer from which a +/// customer may request an [Bolt12Invoice] for a specific quantity and using an amount sufficient +/// to cover that quantity (i.e., at least `quantity * amount`). +/// +/// Offers may be denominated in currency other than bitcoin but are ultimately paid using the +/// latter. +/// +class Offer { + final String s; + + const Offer({ + required this.s, + }); + + @override + int get hashCode => s.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Offer && runtimeType == other.runtimeType && s == other.s; +} + +///A Refund is a request to send an `Bolt12Invoice` without a preceding `Offer`. +class Refund { + final String s; + + const Refund({ + required this.s, + }); + + @override + int get hashCode => s.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Refund && runtimeType == other.runtimeType && s == other.s; +} diff --git a/lib/src/generated/api/node.dart b/lib/src/generated/api/node.dart index dfd96a4..d04f6fa 100644 --- a/lib/src/generated/api/node.dart +++ b/lib/src/generated/api/node.dart @@ -14,9 +14,6 @@ import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; import 'spontaneous.dart'; import 'types.dart'; -// Rust type: RustOpaqueNom> -abstract class ArcBolt12Payment implements RustOpaqueInterface {} - // Rust type: RustOpaqueNom abstract class Node implements RustOpaqueInterface {} diff --git a/lib/src/root.dart b/lib/src/root.dart index cad7ad7..99c1b8e 100644 --- a/lib/src/root.dart +++ b/lib/src/root.dart @@ -1,9 +1,10 @@ +import 'package:ldk_node/src/generated/api/bolt11.dart' as bolt11; +import 'package:ldk_node/src/generated/api/bolt12.dart' as bolt12; import 'package:ldk_node/src/generated/api/types.dart' as types; import 'package:ldk_node/src/generated/utils/error.dart' as error; import 'package:ldk_node/src/utils/utils.dart'; import 'package:path_provider/path_provider.dart'; -import 'generated/api/bolt11.dart'; import 'generated/api/builder.dart'; import 'generated/api/node.dart'; import 'generated/api/on_chain.dart'; @@ -469,10 +470,11 @@ class OnChainPayment extends LdkOnChainPayment { } } -class Bolt11Payment extends LdkBolt11Payment { +///Represents a syntactically and semantically correct lightning BOLT11 invoice. +class Bolt11Payment extends bolt11.LdkBolt11Payment { Bolt11Payment._({required super.ptr}); @override - Future receive( + Future receive( {required BigInt amountMsat, required String description, required int expirySecs, @@ -488,7 +490,7 @@ class Bolt11Payment extends LdkBolt11Payment { } @override - Future receiveVariableAmount( + Future receiveVariableAmount( {required String description, required int expirySecs, hint}) { try { return super.receiveVariableAmount( @@ -499,7 +501,7 @@ class Bolt11Payment extends LdkBolt11Payment { } @override - Future receiveVariableAmountViaJitChannel( + Future receiveVariableAmountViaJitChannel( {required String description, required int expirySecs, BigInt? maxProportionalLspFeeLimitPpmMsat, @@ -515,7 +517,7 @@ class Bolt11Payment extends LdkBolt11Payment { } @override - Future receiveViaJitChannel( + Future receiveViaJitChannel( {required BigInt amountMsat, required String description, required int expirySecs, @@ -533,7 +535,7 @@ class Bolt11Payment extends LdkBolt11Payment { } @override - Future send({required types.Bolt11Invoice invoice, hint}) { + Future send({required bolt11.Bolt11Invoice invoice, hint}) { try { return super.send(invoice: invoice); } on error.LdkNodeError catch (e) { @@ -542,7 +544,7 @@ class Bolt11Payment extends LdkBolt11Payment { } @override - Future sendProbes({required types.Bolt11Invoice invoice, hint}) { + Future sendProbes({required bolt11.Bolt11Invoice invoice, hint}) { try { return super.sendProbes(invoice: invoice); } on error.LdkNodeError catch (e) { @@ -552,7 +554,7 @@ class Bolt11Payment extends LdkBolt11Payment { @override Future sendProbesUsingAmount( - {required types.Bolt11Invoice invoice, + {required bolt11.Bolt11Invoice invoice, required BigInt amountMsat, hint}) { try { @@ -565,7 +567,7 @@ class Bolt11Payment extends LdkBolt11Payment { @override Future sendUsingAmount( - {required types.Bolt11Invoice invoice, + {required bolt11.Bolt11Invoice invoice, required BigInt amountMsat, hint}) { try { @@ -576,6 +578,85 @@ class Bolt11Payment extends LdkBolt11Payment { } } +///A payment handler allowing to create and pay BOLT 12 offers and refunds. +class Bolt12Payment extends bolt12.LdkBolt12Payment { + Bolt12Payment._({required super.ptr}); + + ///Returns a Refund object that can be used to offer a refund payment of the amount given. + @override + Future initiateRefund( + {required BigInt amountMsat, required int expirySecs}) { + try { + return super + .initiateRefund(amountMsat: amountMsat, expirySecs: expirySecs); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Returns a payable offer that can be used to request and receive a payment of the amount given. + @override + Future receive( + {required BigInt amountMsat, required String description}) { + try { + return super.receive(amountMsat: amountMsat, description: description); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Returns a payable offer that can be used to request and receive a payment for which the amount is to be determined by the user, also known as a "zero-amount" offer. + @override + Future receiveVariableAmount({required String description}) { + try { + return super.receiveVariableAmount(description: description); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Requests a refund payment for the given Refund. + /// The returned `Bolt12Invoice` is for informational purposes only (i. e., isn't needed to retrieve the refund). + @override + Future requestRefundPayment( + {required bolt12.Refund refund}) { + try { + return super.requestRefundPayment(refund: refund); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Send a payment given an offer and an amount in millisatoshi. + /// This will fail if the amount given is less than the value required by the given offer. + /// This can be used to pay a so-called "zero-amount" offers, i. e., an offer that leaves the amount paid to be determined by the user. + /// If payer_note is Some it will be seen by the recipient and reflected back in the invoice response. + @override + Future sendUsingAmount( + {required bolt12.Offer offer, + String? payerNote, + required BigInt amountMsat}) { + try { + return super.sendUsingAmount( + offer: offer, payerNote: payerNote, amountMsat: amountMsat); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Send a payment given an offer. + /// If payer_note is Some it will be seen by the recipient and reflected back in the invoice response. + @override + Future send( + {required bolt12.Offer offer, String? payerNote}) { + try { + return super.send(offer: offer, payerNote: payerNote); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } +} + /// A builder for an [Node] instance, allowing to set some configuration and module choices from /// the get-go. /// diff --git a/rust/src/api/bolt12.rs b/rust/src/api/bolt12.rs new file mode 100644 index 0000000..42ccc5d --- /dev/null +++ b/rust/src/api/bolt12.rs @@ -0,0 +1,132 @@ +use std::str::FromStr; +use std::sync::Arc; +use ldk_node::lightning::util::ser::Writeable; +use crate::api::types::{ PaymentId}; + +use crate::frb_generated::RustOpaque; +use crate::utils::error::LdkNodeError; +/// An `Offer` is a potentially long-lived proposal for payment of a good or service. +/// +/// An offer is a precursor to an [InvoiceRequest]. A merchant publishes an offer from which a +/// customer may request an [Bolt12Invoice] for a specific quantity and using an amount sufficient +/// to cover that quantity (i.e., at least `quantity * amount`). +/// +/// Offers may be denominated in currency other than bitcoin but are ultimately paid using the +/// latter. +/// + +pub struct Offer{pub s: String } +impl TryFrom for ldk_node::lightning::offers::offer::Offer{ + type Error = LdkNodeError; + + fn try_from(value: Offer) -> Result { + ldk_node::lightning::offers::offer::Offer::from_str(value.s.as_str()).map_err(|e| e.into()) + } +} +impl From for Offer{ + fn from(value: ldk_node::lightning::offers::offer::Offer) -> Self { + Offer{s: value.to_string()} + } +} +///A Refund is a request to send an `Bolt12Invoice` without a preceding `Offer`. +// +// Typically, after an invoice is paid, the recipient may publish a refund allowing the sender to recoup their funds. +// A refund may be used more generally as an “offer for money”, such as with a bitcoin ATM. + +pub struct Refund{pub s: String } + +impl TryFrom for ldk_node::lightning::offers::refund::Refund{ + type Error = LdkNodeError; + + fn try_from(value: Refund) -> Result { + ldk_node::lightning::offers::refund::Refund::from_str(value.s.as_str()).map_err(|e| e.into()) + } +} +impl From for Refund{ + fn from(value: ldk_node::lightning::offers::refund::Refund) -> Self { + Refund{s: value.to_string()} + } +} + + +#[derive(Debug, Clone, PartialEq, Eq)] +///A Bolt12Invoice is a payment request, typically corresponding to an Offer or a Refund. +// An invoice may be sent in response to an InvoiceRequest in the case of an offer or sent directly after scanning a refund. It includes all the information needed to pay a recipient. +pub struct Bolt12Invoice { + pub data: Vec +} + +impl TryFrom for ldk_node::lightning::offers::invoice::Bolt12Invoice { + type Error = LdkNodeError; + + fn try_from(value: Bolt12Invoice) -> Result { + ldk_node::lightning::offers::invoice::Bolt12Invoice::try_from(value.data) + .map_err(|_| LdkNodeError::InvalidInvoice) + } +} +impl From< ldk_node::lightning::offers::invoice::Bolt12Invoice> for Bolt12Invoice { + fn from(value: ldk_node::lightning::offers::invoice::Bolt12Invoice) -> Self { + Bolt12Invoice { + data: value.encode(), + } + } +} +pub struct LdkBolt12Payment{ + pub ptr: RustOpaque> +} +impl LdkBolt12Payment{ + pub fn send(&self, offer:Offer, payer_note: Option)-> Result { + self.ptr.send(&(offer.try_into()?), payer_note).map_err(|e| e.into()).map(|e| e.into()) + } + pub fn send_using_amount( + &self, offer: Offer, payer_note: Option, amount_msat: u64 + ) -> anyhow::Result { + self.ptr + .send_using_amount(&(offer.try_into()?), payer_note, amount_msat) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + pub fn receive( + &self, + amount_msat: u64, + description: String, + ) -> anyhow::Result { + self.ptr + .receive(amount_msat, description.as_str()) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + pub fn receive_variable_amount( + &self, + description: String, + ) -> anyhow::Result { + self.ptr + .receive_variable_amount + (description.as_str()) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + + pub fn request_refund_payment( + &self, + refund: Refund, + ) -> anyhow::Result { + self.ptr + .request_refund_payment + (&(refund.try_into()?)) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + + pub fn initiate_refund( + &self, amount_msat: u64, expiry_secs: u32 + ) -> anyhow::Result { + self.ptr + .initiate_refund + (amount_msat, expiry_secs) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + + +} From f328a69c2d745139a3025e257cf9a078a6e1e76a Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Thu, 27 Jun 2024 10:11:00 -0400 Subject: [PATCH 19/48] code cleanup --- lib/src/root.dart | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/lib/src/root.dart b/lib/src/root.dart index 99c1b8e..fb8577f 100644 --- a/lib/src/root.dart +++ b/lib/src/root.dart @@ -5,21 +5,21 @@ import 'package:ldk_node/src/generated/utils/error.dart' as error; import 'package:ldk_node/src/utils/utils.dart'; import 'package:path_provider/path_provider.dart'; -import 'generated/api/builder.dart'; +import 'generated/api/builder.dart' as builder; import 'generated/api/node.dart'; -import 'generated/api/on_chain.dart'; -import 'generated/api/spontaneous.dart'; +import 'generated/api/on_chain.dart' as on_chain; +import 'generated/api/spontaneous.dart' as spontaneous; import 'generated/lib.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 LdkMnemonic { +class Mnemonic extends builder.LdkMnemonic { Mnemonic({required super.seedPhrase}); static Future generate() async { try { await Frb.verifyInit(); - final res = await LdkMnemonic.generate(); + final res = await builder.LdkMnemonic.generate(); return Mnemonic(seedPhrase: res.seedPhrase); } on error.LdkNodeError catch (e) { throw mapLdkNodeError(e); @@ -414,7 +414,7 @@ class Node extends LdkNode { } } -class SpontaneousPayment extends LdkSpontaneousPayment { +class SpontaneousPayment extends spontaneous.LdkSpontaneousPayment { SpontaneousPayment._({required super.ptr}); @override Future sendProbes( @@ -439,7 +439,7 @@ class SpontaneousPayment extends LdkSpontaneousPayment { } } -class OnChainPayment extends LdkOnChainPayment { +class OnChainPayment extends on_chain.LdkOnChainPayment { OnChainPayment._({required super.ptr}); @override Future newAddress({hint}) { @@ -802,13 +802,13 @@ class Builder { final nodePath = "${directory.path}/ldk_cache/"; _config!.storageDirPath = nodePath; } - final builder = await NodeBuilder.createBuilder( - config: _config ?? Builder()._config!, - chainDataSourceConfig: _chainDataSourceConfig, - entropySourceConfig: _entropySource, - liquiditySourceConfig: _liquiditySourceConfig, - gossipSourceConfig: _gossipSourceConfig); - final res = await builder.build(); + final res = await (await builder.NodeBuilder.createBuilder( + config: _config ?? Builder()._config!, + chainDataSourceConfig: _chainDataSourceConfig, + entropySourceConfig: _entropySource, + liquiditySourceConfig: _liquiditySourceConfig, + gossipSourceConfig: _gossipSourceConfig)) + .build(); return Node._(ptr: res.ptr); } on error.LdkBuilderError catch (e) { throw mapLdkBuilderError(e); @@ -824,13 +824,13 @@ class Builder { final nodePath = "${directory.path}/ldk_cache/"; _config!.storageDirPath = nodePath; } - final builder = await NodeBuilder.createBuilder( - config: _config ?? Builder()._config!, - chainDataSourceConfig: _chainDataSourceConfig, - entropySourceConfig: _entropySource, - liquiditySourceConfig: _liquiditySourceConfig, - gossipSourceConfig: _gossipSourceConfig); - final res = await builder.buildWithFsStore(); + final res = await (await builder.NodeBuilder.createBuilder( + config: _config ?? Builder()._config!, + chainDataSourceConfig: _chainDataSourceConfig, + entropySourceConfig: _entropySource, + liquiditySourceConfig: _liquiditySourceConfig, + gossipSourceConfig: _gossipSourceConfig)) + .buildWithFsStore(); return Node._(ptr: res.ptr); } on error.LdkBuilderError catch (e) { throw mapLdkBuilderError(e); From d8ed93e7006ce15f1f6f53be11714211cb663faf Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Thu, 27 Jun 2024 14:22:00 -0400 Subject: [PATCH 20/48] bindings updated --- ios/Classes/frb_generated.h | 644 ++-- lib/src/generated/frb_generated.dart | 3519 +++++++++++++++++----- lib/src/generated/frb_generated.io.dart | 3195 +++++++++++++++----- lib/src/generated/frb_generated.web.dart | 2905 ------------------ rust/src/frb_generated.io.rs | 1418 +++++++-- rust/src/frb_generated.rs | 2932 ++++++++++++++---- rust/src/frb_generated.web.rs | 848 ++++-- 7 files changed, 9988 insertions(+), 5473 deletions(-) delete mode 100644 lib/src/generated/frb_generated.web.dart diff --git a/ios/Classes/frb_generated.h b/ios/Classes/frb_generated.h index 79ea5f8..1075592 100644 --- a/ios/Classes/frb_generated.h +++ b/ios/Classes/frb_generated.h @@ -14,11 +14,31 @@ void store_dart_post_cobject(DartPostCObjectFnType ptr); // EXTRA END typedef struct _Dart_Handle* Dart_Handle; +typedef struct wire_cst_ldk_bolt_11_payment { + uintptr_t ptr; +} wire_cst_ldk_bolt_11_payment; + 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_bolt_11_invoice { + struct wire_cst_list_prim_u_8_strict *signed_raw_invoice; +} wire_cst_bolt_11_invoice; + +typedef struct wire_cst_ldk_bolt_12_payment { + uintptr_t ptr; +} wire_cst_ldk_bolt_12_payment; + +typedef struct wire_cst_refund { + struct wire_cst_list_prim_u_8_strict *s; +} wire_cst_refund; + +typedef struct wire_cst_offer { + struct wire_cst_list_prim_u_8_strict *s; +} wire_cst_offer; + typedef struct wire_cst_SocketAddress_TcpIpV4 { struct wire_cst_list_prim_u_8_strict *addr; uint16_t port; @@ -72,6 +92,11 @@ typedef struct wire_cst_list_public_key { int32_t len; } wire_cst_list_public_key; +typedef struct wire_cst_anchor_channels_config { + struct wire_cst_list_public_key *trusted_peers_no_reserve; + uint64_t per_channel_reserve_sats; +} wire_cst_anchor_channels_config; + typedef struct wire_cst_config { struct wire_cst_list_prim_u_8_strict *storage_dir_path; struct wire_cst_list_prim_u_8_strict *log_dir_path; @@ -84,6 +109,7 @@ typedef struct wire_cst_config { struct wire_cst_list_public_key *trusted_peers_0conf; uint64_t probing_liquidity_limit_multiplier; int32_t log_level; + struct wire_cst_anchor_channels_config *anchor_channels_config; } wire_cst_config; typedef struct wire_cst_ChainDataSourceConfig_Esplora { @@ -150,13 +176,9 @@ 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_bolt_11_payment { - uintptr_t ptr; -} wire_cst_ldk_bolt_11_payment; - -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_ldk_network_graph { + uintptr_t inner; +} wire_cst_ldk_network_graph; typedef struct wire_cst_ldk_node { uintptr_t ptr; @@ -214,10 +236,77 @@ typedef struct wire_cst_ldk_spontaneous_payment { uintptr_t ptr; } wire_cst_ldk_spontaneous_payment; +typedef struct wire_cst_Bolt12ParseError_Bech32 { + struct wire_cst_list_prim_u_8_strict *field0; +} wire_cst_Bolt12ParseError_Bech32; + +typedef struct wire_cst_DecodeError_Io { + struct wire_cst_list_prim_u_8_strict *field0; +} wire_cst_DecodeError_Io; + +typedef union DecodeErrorKind { + struct wire_cst_DecodeError_Io Io; +} DecodeErrorKind; + +typedef struct wire_cst_decode_error { + int32_t tag; + union DecodeErrorKind kind; +} wire_cst_decode_error; + +typedef struct wire_cst_Bolt12ParseError_Decode { + struct wire_cst_decode_error *field0; +} wire_cst_Bolt12ParseError_Decode; + +typedef struct wire_cst_Bolt12ParseError_InvalidSemantics { + struct wire_cst_list_prim_u_8_strict *field0; +} wire_cst_Bolt12ParseError_InvalidSemantics; + +typedef struct wire_cst_Bolt12ParseError_InvalidSignature { + struct wire_cst_list_prim_u_8_strict *field0; +} wire_cst_Bolt12ParseError_InvalidSignature; + +typedef union Bolt12ParseErrorKind { + struct wire_cst_Bolt12ParseError_Bech32 Bech32; + struct wire_cst_Bolt12ParseError_Decode Decode; + struct wire_cst_Bolt12ParseError_InvalidSemantics InvalidSemantics; + struct wire_cst_Bolt12ParseError_InvalidSignature InvalidSignature; +} Bolt12ParseErrorKind; + +typedef struct wire_cst_bolt_12_parse_error { + int32_t tag; + union Bolt12ParseErrorKind kind; +} wire_cst_bolt_12_parse_error; + typedef struct wire_cst_channel_id { struct wire_cst_list_prim_u_8_strict *data; } wire_cst_channel_id; +typedef struct wire_cst_node_id { + struct wire_cst_list_prim_u_8_strict *compressed; +} wire_cst_node_id; + +typedef struct wire_cst_routing_fees { + uint32_t base_msat; + uint32_t proportional_millionths; +} wire_cst_routing_fees; + +typedef struct wire_cst_channel_update_info { + uint32_t last_update; + bool enabled; + uint16_t cltv_expiry_delta; + uint64_t htlc_minimum_msat; + uint64_t htlc_maximum_msat; + struct wire_cst_routing_fees fees; +} wire_cst_channel_update_info; + +typedef struct wire_cst_channel_info { + struct wire_cst_node_id node_one; + struct wire_cst_channel_update_info *one_to_two; + struct wire_cst_node_id node_two; + struct wire_cst_channel_update_info *two_to_one; + uint64_t *capacity_sats; +} wire_cst_channel_info; + typedef struct wire_cst_ClosureReason_CounterpartyForceClosed { struct wire_cst_list_prim_u_8_strict *peer_msg; } wire_cst_ClosureReason_CounterpartyForceClosed; @@ -240,6 +329,13 @@ typedef struct wire_cst_payment_hash { struct wire_cst_list_prim_u_8_strict *data; } wire_cst_payment_hash; +typedef struct wire_cst_Event_PaymentClaimable { + struct wire_cst_payment_id *payment_id; + struct wire_cst_payment_hash *payment_hash; + uint64_t claimable_amount_msat; + uint32_t *claim_deadline; +} wire_cst_Event_PaymentClaimable; + typedef struct wire_cst_Event_PaymentSuccessful { struct wire_cst_payment_id *payment_id; struct wire_cst_payment_hash *payment_hash; @@ -289,6 +385,7 @@ typedef struct wire_cst_Event_ChannelClosed { } wire_cst_Event_ChannelClosed; typedef union EventKind { + struct wire_cst_Event_PaymentClaimable PaymentClaimable; struct wire_cst_Event_PaymentSuccessful PaymentSuccessful; struct wire_cst_Event_PaymentFailed PaymentFailed; struct wire_cst_Event_PaymentReceived PaymentReceived; @@ -307,6 +404,10 @@ typedef struct wire_cst_lsp_fee_limits { uint64_t *max_proportional_opening_fee_ppm_msat; } wire_cst_lsp_fee_limits; +typedef struct wire_cst_offer_id { + struct wire_cst_list_prim_u_8_strict *field0; +} wire_cst_offer_id; + typedef struct wire_cst_payment_preimage { struct wire_cst_list_prim_u_8_strict *data; } wire_cst_payment_preimage; @@ -333,10 +434,25 @@ typedef struct wire_cst_PaymentKind_Spontaneous { struct wire_cst_payment_preimage *preimage; } wire_cst_PaymentKind_Spontaneous; +typedef struct wire_cst_PaymentKind_Bolt12Offer { + struct wire_cst_payment_hash *hash; + struct wire_cst_payment_preimage *preimage; + struct wire_cst_payment_secret *secret; + struct wire_cst_offer_id *offer_id; +} wire_cst_PaymentKind_Bolt12Offer; + +typedef struct wire_cst_PaymentKind_Bolt12Refund { + struct wire_cst_payment_hash *hash; + struct wire_cst_payment_preimage *preimage; + struct wire_cst_payment_secret *secret; +} wire_cst_PaymentKind_Bolt12Refund; + typedef union PaymentKindKind { struct wire_cst_PaymentKind_Bolt11 Bolt11; struct wire_cst_PaymentKind_Bolt11Jit Bolt11Jit; struct wire_cst_PaymentKind_Spontaneous Spontaneous; + struct wire_cst_PaymentKind_Bolt12Offer Bolt12Offer; + struct wire_cst_PaymentKind_Bolt12Refund Bolt12Refund; } PaymentKindKind; typedef struct wire_cst_payment_kind { @@ -451,6 +567,11 @@ typedef struct wire_cst_list_lightning_balance { int32_t len; } wire_cst_list_lightning_balance; +typedef struct wire_cst_list_node_id { + struct wire_cst_node_id *ptr; + int32_t len; +} wire_cst_list_node_id; + typedef struct wire_cst_list_payment_details { struct wire_cst_payment_details *ptr; int32_t len; @@ -503,6 +624,11 @@ typedef struct wire_cst_list_pending_sweep_balance { int32_t len; } wire_cst_list_pending_sweep_balance; +typedef struct wire_cst_list_prim_u_64_strict { + uint64_t *ptr; + int32_t len; +} wire_cst_list_prim_u_64_strict; + typedef struct wire_cst_balance_details { uint64_t total_onchain_balance_sats; uint64_t spendable_onchain_balance_sats; @@ -516,6 +642,28 @@ typedef struct wire_cst_best_block { uint32_t height; } wire_cst_best_block; +typedef struct wire_cst_bolt_12_invoice { + struct wire_cst_list_prim_u_8_strict *data; +} wire_cst_bolt_12_invoice; + +typedef struct wire_cst_LdkNodeError_Decode { + struct wire_cst_decode_error *field0; +} wire_cst_LdkNodeError_Decode; + +typedef struct wire_cst_LdkNodeError_Bolt12Parse { + struct wire_cst_bolt_12_parse_error *field0; +} wire_cst_LdkNodeError_Bolt12Parse; + +typedef union LdkNodeErrorKind { + struct wire_cst_LdkNodeError_Decode Decode; + struct wire_cst_LdkNodeError_Bolt12Parse Bolt12Parse; +} LdkNodeErrorKind; + +typedef struct wire_cst_ldk_node_error { + int32_t tag; + union LdkNodeErrorKind kind; +} wire_cst_ldk_node_error; + typedef struct wire_cst_node_status { bool is_running; bool is_listening; @@ -527,180 +675,264 @@ typedef struct wire_cst_node_status { uint64_t *latest_node_announcement_broadcast_timestamp; } wire_cst_node_status; -void frbgen_ldk_node_wire_NodeBuilder_build(int64_t port_, uintptr_t that); +void frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + uint64_t amount_msat, + struct wire_cst_list_prim_u_8_strict *description, + uint32_t expiry_secs); + +void frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + struct wire_cst_list_prim_u_8_strict *description, + uint32_t expiry_secs); + +void frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *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__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *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__crate__api__bolt11__ldk_bolt_11_payment_send(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + struct wire_cst_bolt_11_invoice *invoice); + +void frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + struct wire_cst_bolt_11_invoice *invoice); + +void frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + struct wire_cst_bolt_11_invoice *invoice, + uint64_t amount_msat); + +void frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + struct wire_cst_bolt_11_invoice *invoice, + uint64_t amount_msat); + +void frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refund(int64_t port_, + struct wire_cst_ldk_bolt_12_payment *that, + uint64_t amount_msat, + uint32_t expiry_secs); + +void frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_receive(int64_t port_, + struct wire_cst_ldk_bolt_12_payment *that, + uint64_t amount_msat, + struct wire_cst_list_prim_u_8_strict *description); + +void frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amount(int64_t port_, + struct wire_cst_ldk_bolt_12_payment *that, + struct wire_cst_list_prim_u_8_strict *description); + +void frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_payment(int64_t port_, + struct wire_cst_ldk_bolt_12_payment *that, + struct wire_cst_refund *refund); + +void frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_send(int64_t port_, + struct wire_cst_ldk_bolt_12_payment *that, + struct wire_cst_offer *offer, + struct wire_cst_list_prim_u_8_strict *payer_note); + +void frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amount(int64_t port_, + struct wire_cst_ldk_bolt_12_payment *that, + struct wire_cst_offer *offer, + struct wire_cst_list_prim_u_8_strict *payer_note, + uint64_t amount_msat); + +WireSyncRust2DartDco frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder(uintptr_t that); -void frbgen_ldk_node_wire_NodeBuilder_build_with_fs_store(int64_t port_, uintptr_t that); +WireSyncRust2DartDco frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder(uintptr_t that, + uintptr_t builder); -void frbgen_ldk_node_wire_NodeBuilder_create_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__crate__api__builder__NodeBuilder_build(int64_t port_, uintptr_t that); -void frbgen_ldk_node_wire_ldk_bolt_11_payment_receive(int64_t port_, - struct wire_cst_ldk_bolt_11_payment *that, - uint64_t amount_msat, - struct wire_cst_list_prim_u_8_strict *description, - uint32_t expiry_secs); +void frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_build_with_fs_store(int64_t port_, + uintptr_t that); -void frbgen_ldk_node_wire_ldk_bolt_11_payment_receive_variable_amount(int64_t port_, - struct wire_cst_ldk_bolt_11_payment *that, - struct wire_cst_list_prim_u_8_strict *description, - uint32_t expiry_secs); +void frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_create_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_ldk_bolt_11_payment_receive_variable_amount_via_jit_channel(int64_t port_, - struct wire_cst_ldk_bolt_11_payment *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__crate__api__builder__ldk_mnemonic_generate(int64_t port_); -void frbgen_ldk_node_wire_ldk_bolt_11_payment_receive_via_jit_channel(int64_t port_, - struct wire_cst_ldk_bolt_11_payment *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__crate__api__graph__ldk_network_graph_channel(int64_t port_, + struct wire_cst_ldk_network_graph *that, + uint64_t short_channel_id); -void frbgen_ldk_node_wire_ldk_bolt_11_payment_send(int64_t port_, - struct wire_cst_ldk_bolt_11_payment *that, - struct wire_cst_bolt_11_invoice *invoice); +void frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_list_channels(int64_t port_, + struct wire_cst_ldk_network_graph *that); -void frbgen_ldk_node_wire_ldk_bolt_11_payment_send_probes(int64_t port_, - struct wire_cst_ldk_bolt_11_payment *that, - struct wire_cst_bolt_11_invoice *invoice); +void frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_list_nodes(int64_t port_, + struct wire_cst_ldk_network_graph *that); -void frbgen_ldk_node_wire_ldk_bolt_11_payment_send_probes_using_amount(int64_t port_, - struct wire_cst_ldk_bolt_11_payment *that, - struct wire_cst_bolt_11_invoice *invoice, - uint64_t amount_msat); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_bolt11_payment(int64_t port_, + struct wire_cst_ldk_node *ptr); -void frbgen_ldk_node_wire_ldk_bolt_11_payment_send_using_amount(int64_t port_, - struct wire_cst_ldk_bolt_11_payment *that, - struct wire_cst_bolt_11_invoice *invoice, - uint64_t amount_msat); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_bolt12_payment(int64_t port_, + struct wire_cst_ldk_node *ptr); -void frbgen_ldk_node_wire_ldk_mnemonic_generate(int64_t port_); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_close_channel(int64_t port_, + struct wire_cst_ldk_node *that, + struct wire_cst_user_channel_id *user_channel_id, + struct wire_cst_public_key *counterparty_node_id); -void frbgen_ldk_node_wire_ldk_node_bolt11_payment(int64_t port_, struct wire_cst_ldk_node *ptr); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_config(int64_t port_, + struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_ldk_node_close_channel(int64_t port_, - struct wire_cst_ldk_node *that, - struct wire_cst_user_channel_id *user_channel_id, - struct wire_cst_public_key *counterparty_node_id); +void frbgen_ldk_node_wire__crate__api__node__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_ldk_node_config(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__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_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__crate__api__node__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_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__crate__api__node__ldk_node_event_handled(int64_t port_, + struct wire_cst_ldk_node *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__crate__api__node__ldk_node_force_close_channel(int64_t port_, + struct wire_cst_ldk_node *that, + struct wire_cst_user_channel_id *user_channel_id, + struct wire_cst_public_key *counterparty_node_id); -void frbgen_ldk_node_wire_ldk_node_event_handled(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_list_balances(int64_t port_, + struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_ldk_node_list_balances(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_list_channels(int64_t port_, + struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_ldk_node_list_channels(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_list_payments(int64_t port_, + struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_ldk_node_list_payments(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_list_payments_with_filter(int64_t port_, + struct wire_cst_ldk_node *that, + int32_t payment_direction); -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__crate__api__node__ldk_node_list_peers(int64_t port_, + struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_ldk_node_list_peers(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_listening_addresses(int64_t port_, + struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_ldk_node_listening_addresses(int64_t port_, - struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_network_graph(int64_t port_, + struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_ldk_node_next_event(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_next_event(int64_t port_, + struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_ldk_node_next_event_async(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_next_event_async(int64_t port_, + struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_ldk_node_node_id(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_node_id(int64_t port_, + struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_ldk_node_on_chain_payment(int64_t port_, struct wire_cst_ldk_node *ptr); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_on_chain_payment(int64_t port_, + struct wire_cst_ldk_node *ptr); -void frbgen_ldk_node_wire_ldk_node_payment(int64_t port_, - struct wire_cst_ldk_node *that, - struct wire_cst_payment_id *payment_id); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_payment(int64_t port_, + struct wire_cst_ldk_node *that, + struct wire_cst_payment_id *payment_id); -void frbgen_ldk_node_wire_ldk_node_remove_payment(int64_t port_, - struct wire_cst_ldk_node *that, - struct wire_cst_payment_id *payment_id); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_remove_payment(int64_t port_, + struct wire_cst_ldk_node *that, + struct wire_cst_payment_id *payment_id); -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__crate__api__node__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_ldk_node_spontaneous_payment(int64_t port_, - struct wire_cst_ldk_node *ptr); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_spontaneous_payment(int64_t port_, + struct wire_cst_ldk_node *ptr); -void frbgen_ldk_node_wire_ldk_node_start(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_start(int64_t port_, + struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_ldk_node_status(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_status(int64_t port_, + struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_ldk_node_stop(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_stop(int64_t port_, + struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_ldk_node_sync_wallets(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_sync_wallets(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_user_channel_id *user_channel_id, - struct wire_cst_public_key *counterparty_node_id, - struct wire_cst_channel_config *channel_config); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_update_channel_config(int64_t port_, + struct wire_cst_ldk_node *that, + struct wire_cst_user_channel_id *user_channel_id, + struct wire_cst_public_key *counterparty_node_id, + struct wire_cst_channel_config *channel_config); -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 *public_key); +void frbgen_ldk_node_wire__crate__api__node__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 *public_key); -void frbgen_ldk_node_wire_ldk_node_wait_next_event(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_wait_next_event(int64_t port_, + struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_ldk_on_chain_payment_new_address(int64_t port_, - struct wire_cst_ldk_on_chain_payment *that); +void frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_new_address(int64_t port_, + struct wire_cst_ldk_on_chain_payment *that); -void frbgen_ldk_node_wire_ldk_on_chain_payment_send_all_to_address(int64_t port_, - struct wire_cst_ldk_on_chain_payment *that, - struct wire_cst_address *address); +void frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address(int64_t port_, + struct wire_cst_ldk_on_chain_payment *that, + struct wire_cst_address *address); -void frbgen_ldk_node_wire_ldk_on_chain_payment_send_to_address(int64_t port_, - struct wire_cst_ldk_on_chain_payment *that, - struct wire_cst_address *address, - uint64_t amount_sats); +void frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address(int64_t port_, + struct wire_cst_ldk_on_chain_payment *that, + struct wire_cst_address *address, + uint64_t amount_sats); -void frbgen_ldk_node_wire_ldk_spontaneous_payment_send(int64_t port_, - struct wire_cst_ldk_spontaneous_payment *that, - uint64_t amount_msat, - struct wire_cst_public_key *node_id); +void frbgen_ldk_node_wire__crate__api__spontaneous__ldk_spontaneous_payment_send(int64_t port_, + struct wire_cst_ldk_spontaneous_payment *that, + uint64_t amount_msat, + struct wire_cst_public_key *node_id); -void frbgen_ldk_node_wire_ldk_spontaneous_payment_send_probes(int64_t port_, - struct wire_cst_ldk_spontaneous_payment *that, - uint64_t amount_msat, - struct wire_cst_public_key *node_id); +void frbgen_ldk_node_wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes(int64_t port_, + struct wire_cst_ldk_spontaneous_payment *that, + uint64_t amount_msat, + struct wire_cst_public_key *node_id); + +void frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment(const void *ptr); + +void frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment(const void *ptr); void frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_Node(const void *ptr); void frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_Node(const void *ptr); -void frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder(const void *ptr); +void frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder(const void *ptr); + +void frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder(const void *ptr); -void frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder(const void *ptr); +void frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilder(const void *ptr); + +void frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilder(const void *ptr); + +void frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraph(const void *ptr); + +void frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraph(const void *ptr); void frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment(const void *ptr); @@ -716,18 +948,28 @@ void frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentS struct wire_cst_address *frbgen_ldk_node_cst_new_box_autoadd_address(void); +struct wire_cst_anchor_channels_config *frbgen_ldk_node_cst_new_box_autoadd_anchor_channels_config(void); + struct wire_cst_bolt_11_invoice *frbgen_ldk_node_cst_new_box_autoadd_bolt_11_invoice(void); +struct wire_cst_bolt_12_parse_error *frbgen_ldk_node_cst_new_box_autoadd_bolt_12_parse_error(void); + struct wire_cst_chain_data_source_config *frbgen_ldk_node_cst_new_box_autoadd_chain_data_source_config(void); struct wire_cst_channel_config *frbgen_ldk_node_cst_new_box_autoadd_channel_config(void); struct wire_cst_channel_id *frbgen_ldk_node_cst_new_box_autoadd_channel_id(void); +struct wire_cst_channel_info *frbgen_ldk_node_cst_new_box_autoadd_channel_info(void); + +struct wire_cst_channel_update_info *frbgen_ldk_node_cst_new_box_autoadd_channel_update_info(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_decode_error *frbgen_ldk_node_cst_new_box_autoadd_decode_error(void); + struct wire_cst_entropy_source_config *frbgen_ldk_node_cst_new_box_autoadd_entropy_source_config(void); struct wire_cst_event *frbgen_ldk_node_cst_new_box_autoadd_event(void); @@ -736,8 +978,12 @@ struct wire_cst_gossip_source_config *frbgen_ldk_node_cst_new_box_autoadd_gossip struct wire_cst_ldk_bolt_11_payment *frbgen_ldk_node_cst_new_box_autoadd_ldk_bolt_11_payment(void); +struct wire_cst_ldk_bolt_12_payment *frbgen_ldk_node_cst_new_box_autoadd_ldk_bolt_12_payment(void); + struct wire_cst_ldk_mnemonic *frbgen_ldk_node_cst_new_box_autoadd_ldk_mnemonic(void); +struct wire_cst_ldk_network_graph *frbgen_ldk_node_cst_new_box_autoadd_ldk_network_graph(void); + struct wire_cst_ldk_node *frbgen_ldk_node_cst_new_box_autoadd_ldk_node(void); struct wire_cst_ldk_on_chain_payment *frbgen_ldk_node_cst_new_box_autoadd_ldk_on_chain_payment(void); @@ -750,6 +996,10 @@ struct wire_cst_lsp_fee_limits *frbgen_ldk_node_cst_new_box_autoadd_lsp_fee_limi struct wire_cst_max_dust_htlc_exposure *frbgen_ldk_node_cst_new_box_autoadd_max_dust_htlc_exposure(void); +struct wire_cst_offer *frbgen_ldk_node_cst_new_box_autoadd_offer(void); + +struct wire_cst_offer_id *frbgen_ldk_node_cst_new_box_autoadd_offer_id(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); @@ -766,6 +1016,8 @@ struct wire_cst_payment_secret *frbgen_ldk_node_cst_new_box_autoadd_payment_secr struct wire_cst_public_key *frbgen_ldk_node_cst_new_box_autoadd_public_key(void); +struct wire_cst_refund *frbgen_ldk_node_cst_new_box_autoadd_refund(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); @@ -782,12 +1034,16 @@ struct wire_cst_list_channel_details *frbgen_ldk_node_cst_new_list_channel_detai struct wire_cst_list_lightning_balance *frbgen_ldk_node_cst_new_list_lightning_balance(int32_t len); +struct wire_cst_list_node_id *frbgen_ldk_node_cst_new_list_node_id(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_64_strict *frbgen_ldk_node_cst_new_list_prim_u_64_strict(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); @@ -798,23 +1054,32 @@ struct wire_cst_list_socket_address *frbgen_ldk_node_cst_new_list_socket_address static int64_t dummy_method_to_enforce_bundling(void) { int64_t dummy_var = 0; dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_address); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_anchor_channels_config); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_bolt_11_invoice); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_bolt_12_parse_error); 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_channel_info); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_channel_update_info); 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_decode_error); 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_ldk_bolt_11_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_ldk_bolt_12_payment); 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_network_graph); 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_ldk_on_chain_payment); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_ldk_spontaneous_payment); 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_lsp_fee_limits); 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_offer); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_offer_id); 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); @@ -823,6 +1088,7 @@ static int64_t dummy_method_to_enforce_bundling(void) { 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_refund); 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); @@ -831,68 +1097,90 @@ static int64_t dummy_method_to_enforce_bundling(void) { 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_node_id); 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_64_strict); 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_Arcldk_nodepaymentBolt12Payment); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_Node); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilder); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraph); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_Node); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilder); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraph); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBuilder_build); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBuilder_build_with_fs_store); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBuilder_create_builder); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_bolt_11_payment_receive); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_bolt_11_payment_receive_variable_amount); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_bolt_11_payment_receive_variable_amount_via_jit_channel); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_bolt_11_payment_receive_via_jit_channel); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_bolt_11_payment_send); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_bolt_11_payment_send_probes); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_bolt_11_payment_send_probes_using_amount); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_bolt_11_payment_send_using_amount); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_mnemonic_generate); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_bolt11_payment); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_close_channel); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_config); - 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_list_balances); - 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_next_event); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_next_event_async); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_node_id); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_on_chain_payment); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_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_sign_message); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_spontaneous_payment); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_start); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_status); - 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_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_ldk_on_chain_payment_new_address); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_on_chain_payment_send_all_to_address); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_on_chain_payment_send_to_address); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_spontaneous_payment_send); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_spontaneous_payment_send_probes); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refund); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_receive); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amount); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_send); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amount); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_build); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_build_with_fs_store); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_create_builder); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__builder__ldk_mnemonic_generate); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_channel); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_list_channels); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_list_nodes); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_bolt11_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_bolt12_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_close_channel); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_config); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_connect); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_connect_open_channel); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_disconnect); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_event_handled); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_force_close_channel); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_list_balances); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_list_channels); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_list_payments); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_list_payments_with_filter); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_list_peers); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_listening_addresses); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_network_graph); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_next_event); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_next_event_async); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_node_id); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_on_chain_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_remove_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_sign_message); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_spontaneous_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_start); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_status); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_stop); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_sync_wallets); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_update_channel_config); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_verify_signature); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_wait_next_event); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_new_address); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__spontaneous__ldk_spontaneous_payment_send); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes); dummy_var ^= ((int64_t) (void*) store_dart_post_cobject); return dummy_var; } diff --git a/lib/src/generated/frb_generated.dart b/lib/src/generated/frb_generated.dart index df00a7e..0849deb 100644 --- a/lib/src/generated/frb_generated.dart +++ b/lib/src/generated/frb_generated.dart @@ -1,26 +1,35 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. +// Generated by `flutter_rust_bridge`@ 2.0.0. // 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 -import 'api/error.dart'; +import 'api/bolt11.dart'; +import 'api/bolt12.dart'; +import 'api/builder.dart'; +import 'api/graph.dart'; import 'api/node.dart'; +import 'api/on_chain.dart'; +import 'api/spontaneous.dart'; import 'api/types.dart'; import 'dart:async'; import 'dart:convert'; -import 'frb_generated.io.dart' if (dart.library.html) 'frb_generated.web.dart'; +import 'frb_generated.dart'; +import 'frb_generated.io.dart' + if (dart.library.js_interop) 'frb_generated.web.dart'; +import 'lib.dart'; import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; +import 'utils/error.dart'; /// Main entrypoint of the Rust API -class LdkCore extends BaseEntrypoint { +class core extends BaseEntrypoint { @internal - static final instance = LdkCore._(); + static final instance = core._(); - LdkCore._(); + core._(); /// Initialize flutter_rust_bridge static Future init({ - LdkCoreApi? api, + coreApi? api, BaseHandler? handler, ExternalLibrary? externalLibrary, }) async { @@ -38,12 +47,11 @@ class LdkCore extends BaseEntrypoint { static void dispose() => instance.disposeImpl(); @override - ApiImplConstructor get apiImplConstructor => - LdkCoreApiImpl.new; + ApiImplConstructor get apiImplConstructor => + coreApiImpl.new; @override - WireConstructor get wireConstructor => - LdkCoreWire.fromExternalLibrary; + WireConstructor get wireConstructor => coreWire.fromExternalLibrary; @override Future executeRustInitializers() async {} @@ -53,7 +61,10 @@ class LdkCore extends BaseEntrypoint { kDefaultExternalLibraryLoaderConfig; @override - String get codegenVersion => '2.0.0-dev.31'; + String get codegenVersion => '2.0.0'; + + @override + int get rustContentHash => 1452486004; static const kDefaultExternalLibraryLoaderConfig = ExternalLibraryLoaderConfig( @@ -63,197 +74,235 @@ class LdkCore extends BaseEntrypoint { ); } -abstract class LdkCoreApi extends BaseApi { - Future nodeBuilderBuild({required NodeBuilder that, dynamic hint}); - - Future nodeBuilderBuildWithFsStore( - {required NodeBuilder that, dynamic hint}); - - Future nodeBuilderCreateBuilder( - {required Config config, - ChainDataSourceConfig? chainDataSourceConfig, - EntropySourceConfig? entropySourceConfig, - GossipSourceConfig? gossipSourceConfig, - LiquiditySourceConfig? liquiditySourceConfig, - dynamic hint}); - - Future ldkBolt11PaymentReceive( +abstract class coreApi extends BaseApi { + Future crateApiBolt11LdkBolt11PaymentReceive( {required LdkBolt11Payment that, - required int amountMsat, + required BigInt amountMsat, required String description, - required int expirySecs, - dynamic hint}); + required int expirySecs}); - Future ldkBolt11PaymentReceiveVariableAmount( + Future crateApiBolt11LdkBolt11PaymentReceiveVariableAmount( {required LdkBolt11Payment that, required String description, - required int expirySecs, - dynamic hint}); + required int expirySecs}); - Future ldkBolt11PaymentReceiveVariableAmountViaJitChannel( - {required LdkBolt11Payment that, - required String description, - required int expirySecs, - int? maxProportionalLspFeeLimitPpmMsat, - dynamic hint}); + Future + crateApiBolt11LdkBolt11PaymentReceiveVariableAmountViaJitChannel( + {required LdkBolt11Payment that, + required String description, + required int expirySecs, + BigInt? maxProportionalLspFeeLimitPpmMsat}); - Future ldkBolt11PaymentReceiveViaJitChannel( + Future crateApiBolt11LdkBolt11PaymentReceiveViaJitChannel( {required LdkBolt11Payment that, - required int amountMsat, + required BigInt amountMsat, required String description, required int expirySecs, - int? maxTotalLspFeeLimitMsat, - dynamic hint}); + BigInt? maxTotalLspFeeLimitMsat}); - Future ldkBolt11PaymentSend( - {required LdkBolt11Payment that, - required Bolt11Invoice invoice, - dynamic hint}); + Future crateApiBolt11LdkBolt11PaymentSend( + {required LdkBolt11Payment that, required Bolt11Invoice invoice}); - Future ldkBolt11PaymentSendProbes( - {required LdkBolt11Payment that, - required Bolt11Invoice invoice, - dynamic hint}); + Future crateApiBolt11LdkBolt11PaymentSendProbes( + {required LdkBolt11Payment that, required Bolt11Invoice invoice}); - Future ldkBolt11PaymentSendProbesUsingAmount( + Future crateApiBolt11LdkBolt11PaymentSendProbesUsingAmount( {required LdkBolt11Payment that, required Bolt11Invoice invoice, - required int amountMsat, - dynamic hint}); + required BigInt amountMsat}); - Future ldkBolt11PaymentSendUsingAmount( + Future crateApiBolt11LdkBolt11PaymentSendUsingAmount( {required LdkBolt11Payment that, required Bolt11Invoice invoice, - required int amountMsat, - dynamic hint}); + required BigInt amountMsat}); + + Future crateApiBolt12LdkBolt12PaymentInitiateRefund( + {required LdkBolt12Payment that, + required BigInt amountMsat, + required int expirySecs}); + + Future crateApiBolt12LdkBolt12PaymentReceive( + {required LdkBolt12Payment that, + required BigInt amountMsat, + required String description}); + + Future crateApiBolt12LdkBolt12PaymentReceiveVariableAmount( + {required LdkBolt12Payment that, required String description}); + + Future crateApiBolt12LdkBolt12PaymentRequestRefundPayment( + {required LdkBolt12Payment that, required Refund refund}); + + Future crateApiBolt12LdkBolt12PaymentSend( + {required LdkBolt12Payment that, + required Offer offer, + String? payerNote}); + + Future crateApiBolt12LdkBolt12PaymentSendUsingAmount( + {required LdkBolt12Payment that, + required Offer offer, + String? payerNote, + required BigInt amountMsat}); + + Builder crateApiBuilderNodeBuilderAutoAccessorGetBuilder( + {required NodeBuilder that}); + + void crateApiBuilderNodeBuilderAutoAccessorSetBuilder( + {required NodeBuilder that, required Builder builder}); + + Future crateApiBuilderNodeBuilderBuild({required NodeBuilder that}); + + Future crateApiBuilderNodeBuilderBuildWithFsStore( + {required NodeBuilder that}); + + Future crateApiBuilderNodeBuilderCreateBuilder( + {required Config config, + ChainDataSourceConfig? chainDataSourceConfig, + EntropySourceConfig? entropySourceConfig, + GossipSourceConfig? gossipSourceConfig, + LiquiditySourceConfig? liquiditySourceConfig}); + + Future crateApiBuilderLdkMnemonicGenerate(); + + Future crateApiGraphLdkNetworkGraphChannel( + {required LdkNetworkGraph that, required BigInt shortChannelId}); + + Future crateApiGraphLdkNetworkGraphListChannels( + {required LdkNetworkGraph that}); + + Future> crateApiGraphLdkNetworkGraphListNodes( + {required LdkNetworkGraph that}); - Future ldkMnemonicGenerate({dynamic hint}); + Future crateApiNodeLdkNodeBolt11Payment( + {required LdkNode ptr}); - Future ldkNodeBolt11Payment( - {required LdkNode ptr, dynamic hint}); + Future crateApiNodeLdkNodeBolt12Payment( + {required LdkNode ptr}); - Future ldkNodeCloseChannel( + Future crateApiNodeLdkNodeCloseChannel( {required LdkNode that, required UserChannelId userChannelId, - required PublicKey counterpartyNodeId, - dynamic hint}); + required PublicKey counterpartyNodeId}); - Future ldkNodeConfig({required LdkNode that, dynamic hint}); + Future crateApiNodeLdkNodeConfig({required LdkNode that}); - Future ldkNodeConnect( + Future crateApiNodeLdkNodeConnect( {required LdkNode that, required PublicKey nodeId, required SocketAddress address, - required bool persist, - dynamic hint}); + required bool persist}); - Future ldkNodeConnectOpenChannel( + Future crateApiNodeLdkNodeConnectOpenChannel( {required LdkNode that, required SocketAddress socketAddress, required PublicKey nodeId, - required int channelAmountSats, - int? pushToCounterpartyMsat, + required BigInt channelAmountSats, + BigInt? pushToCounterpartyMsat, required bool announceChannel, - ChannelConfig? channelConfig, - dynamic hint}); + ChannelConfig? channelConfig}); + + Future crateApiNodeLdkNodeDisconnect( + {required LdkNode that, required PublicKey counterpartyNodeId}); - Future ldkNodeDisconnect( + Future crateApiNodeLdkNodeEventHandled({required LdkNode that}); + + Future crateApiNodeLdkNodeForceCloseChannel( {required LdkNode that, - required PublicKey counterpartyNodeId, - dynamic hint}); + required UserChannelId userChannelId, + required PublicKey counterpartyNodeId}); - Future ldkNodeEventHandled({required LdkNode that, dynamic hint}); + Future crateApiNodeLdkNodeListBalances( + {required LdkNode that}); - Future ldkNodeListBalances( - {required LdkNode that, dynamic hint}); + Future> crateApiNodeLdkNodeListChannels( + {required LdkNode that}); - Future> ldkNodeListChannels( - {required LdkNode that, dynamic hint}); + Future> crateApiNodeLdkNodeListPayments( + {required LdkNode that}); - Future> ldkNodeListPayments( - {required LdkNode that, dynamic hint}); + Future> crateApiNodeLdkNodeListPaymentsWithFilter( + {required LdkNode that, required PaymentDirection paymentDirection}); - Future> ldkNodeListPaymentsWithFilter( - {required LdkNode that, - required PaymentDirection paymentDirection, - dynamic hint}); + Future> crateApiNodeLdkNodeListPeers( + {required LdkNode that}); - Future> ldkNodeListPeers( - {required LdkNode that, dynamic hint}); + Future?> crateApiNodeLdkNodeListeningAddresses( + {required LdkNode that}); - Future?> ldkNodeListeningAddresses( - {required LdkNode that, dynamic hint}); + Future crateApiNodeLdkNodeNetworkGraph( + {required LdkNode that}); - Future ldkNodeNextEvent({required LdkNode that, dynamic hint}); + Future crateApiNodeLdkNodeNextEvent({required LdkNode that}); - Future ldkNodeNextEventAsync({required LdkNode that, dynamic hint}); + Future crateApiNodeLdkNodeNextEventAsync({required LdkNode that}); - Future ldkNodeNodeId({required LdkNode that, dynamic hint}); + Future crateApiNodeLdkNodeNodeId({required LdkNode that}); - Future ldkNodeOnChainPayment( - {required LdkNode ptr, dynamic hint}); + Future crateApiNodeLdkNodeOnChainPayment( + {required LdkNode ptr}); - Future ldkNodePayment( - {required LdkNode that, required PaymentId paymentId, dynamic hint}); + Future crateApiNodeLdkNodePayment( + {required LdkNode that, required PaymentId paymentId}); - Future ldkNodeRemovePayment( - {required LdkNode that, required PaymentId paymentId, dynamic hint}); + Future crateApiNodeLdkNodeRemovePayment( + {required LdkNode that, required PaymentId paymentId}); - Future ldkNodeSignMessage( - {required LdkNode that, required List msg, dynamic hint}); + Future crateApiNodeLdkNodeSignMessage( + {required LdkNode that, required List msg}); - Future ldkNodeSpontaneousPayment( - {required LdkNode ptr, dynamic hint}); + Future crateApiNodeLdkNodeSpontaneousPayment( + {required LdkNode ptr}); - Future ldkNodeStart({required LdkNode that, dynamic hint}); + Future crateApiNodeLdkNodeStart({required LdkNode that}); - Future ldkNodeStatus({required LdkNode that, dynamic hint}); + Future crateApiNodeLdkNodeStatus({required LdkNode that}); - Future ldkNodeStop({required LdkNode that, dynamic hint}); + Future crateApiNodeLdkNodeStop({required LdkNode that}); - Future ldkNodeSyncWallets({required LdkNode that, dynamic hint}); + Future crateApiNodeLdkNodeSyncWallets({required LdkNode that}); - Future ldkNodeUpdateChannelConfig( + Future crateApiNodeLdkNodeUpdateChannelConfig( {required LdkNode that, required UserChannelId userChannelId, required PublicKey counterpartyNodeId, - required ChannelConfig channelConfig, - dynamic hint}); + required ChannelConfig channelConfig}); - Future ldkNodeVerifySignature( + Future crateApiNodeLdkNodeVerifySignature( {required LdkNode that, required List msg, required String sig, - required PublicKey publicKey, - dynamic hint}); + required PublicKey publicKey}); - Future ldkNodeWaitNextEvent({required LdkNode that, dynamic hint}); + Future crateApiNodeLdkNodeWaitNextEvent({required LdkNode that}); - Future
ldkOnChainPaymentNewAddress( - {required LdkOnChainPayment that, dynamic hint}); + Future
crateApiOnChainLdkOnChainPaymentNewAddress( + {required LdkOnChainPayment that}); - Future ldkOnChainPaymentSendAllToAddress( - {required LdkOnChainPayment that, - required Address address, - dynamic hint}); + Future crateApiOnChainLdkOnChainPaymentSendAllToAddress( + {required LdkOnChainPayment that, required Address address}); - Future ldkOnChainPaymentSendToAddress( + Future crateApiOnChainLdkOnChainPaymentSendToAddress( {required LdkOnChainPayment that, required Address address, - required int amountSats, - dynamic hint}); + required BigInt amountSats}); - Future ldkSpontaneousPaymentSend( + Future crateApiSpontaneousLdkSpontaneousPaymentSend( {required LdkSpontaneousPayment that, - required int amountMsat, - required PublicKey nodeId, - dynamic hint}); + required BigInt amountMsat, + required PublicKey nodeId}); - Future ldkSpontaneousPaymentSendProbes( + Future crateApiSpontaneousLdkSpontaneousPaymentSendProbes( {required LdkSpontaneousPayment that, - required int amountMsat, - required PublicKey nodeId, - dynamic hint}); + required BigInt amountMsat, + required PublicKey nodeId}); + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_ArcBolt12Payment; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_ArcBolt12Payment; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_ArcBolt12PaymentPtr; RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_Node; @@ -269,36 +318,50 @@ abstract class LdkCoreApi extends BaseApi { CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_NodeBuilderPtr; + RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_Builder; + + RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_Builder; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_BuilderPtr; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_NetworkGraph; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_NetworkGraph; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_NetworkGraphPtr; + RustArcIncrementStrongCountFnType - get rust_arc_increment_strong_count_LdkNodePaymentBolt11Payment; + get rust_arc_increment_strong_count_Bolt11Payment; RustArcDecrementStrongCountFnType - get rust_arc_decrement_strong_count_LdkNodePaymentBolt11Payment; + get rust_arc_decrement_strong_count_Bolt11Payment; CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_LdkNodePaymentBolt11PaymentPtr; + get rust_arc_decrement_strong_count_Bolt11PaymentPtr; RustArcIncrementStrongCountFnType - get rust_arc_increment_strong_count_LdkNodePaymentOnchainPayment; + get rust_arc_increment_strong_count_OnchainPayment; RustArcDecrementStrongCountFnType - get rust_arc_decrement_strong_count_LdkNodePaymentOnchainPayment; + get rust_arc_decrement_strong_count_OnchainPayment; CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_LdkNodePaymentOnchainPaymentPtr; + get rust_arc_decrement_strong_count_OnchainPaymentPtr; RustArcIncrementStrongCountFnType - get rust_arc_increment_strong_count_LdkNodePaymentSpontaneousPayment; + get rust_arc_increment_strong_count_SpontaneousPayment; RustArcDecrementStrongCountFnType - get rust_arc_decrement_strong_count_LdkNodePaymentSpontaneousPayment; + get rust_arc_decrement_strong_count_SpontaneousPayment; CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_LdkNodePaymentSpontaneousPaymentPtr; + get rust_arc_decrement_strong_count_SpontaneousPaymentPtr; } -class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { - LdkCoreApiImpl({ +class coreApiImpl extends coreApiImplPlatform implements coreApi { + coreApiImpl({ required super.handler, required super.wire, required super.generalizedFrbRustBinding, @@ -306,178 +369,74 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { }); @override - Future nodeBuilderBuild({required NodeBuilder that, dynamic hint}) { - return handler.executeNormal(NormalTask( - callFfi: (port_) { - var arg0 = - cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( - that); - return wire.wire_NodeBuilder_build(port_, arg0); - }, - codec: DcoCodec( - decodeSuccessData: dco_decode_ldk_node, - decodeErrorData: dco_decode_builder_exception, - ), - constMeta: kNodeBuilderBuildConstMeta, - argValues: [that], - apiImpl: this, - hint: hint, - )); - } - - TaskConstMeta get kNodeBuilderBuildConstMeta => const TaskConstMeta( - debugName: "NodeBuilder_build", - argNames: ["that"], - ); - - @override - Future nodeBuilderBuildWithFsStore( - {required NodeBuilder that, dynamic hint}) { - return handler.executeNormal(NormalTask( - callFfi: (port_) { - var arg0 = - cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( - that); - return wire.wire_NodeBuilder_build_with_fs_store(port_, arg0); - }, - codec: DcoCodec( - decodeSuccessData: dco_decode_ldk_node, - decodeErrorData: dco_decode_builder_exception, - ), - constMeta: kNodeBuilderBuildWithFsStoreConstMeta, - argValues: [that], - apiImpl: this, - hint: hint, - )); - } - - TaskConstMeta get kNodeBuilderBuildWithFsStoreConstMeta => - const TaskConstMeta( - debugName: "NodeBuilder_build_with_fs_store", - argNames: ["that"], - ); - - @override - Future nodeBuilderCreateBuilder( - {required Config config, - ChainDataSourceConfig? chainDataSourceConfig, - EntropySourceConfig? entropySourceConfig, - GossipSourceConfig? gossipSourceConfig, - LiquiditySourceConfig? liquiditySourceConfig, - 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_NodeBuilder_create_builder( - port_, arg0, arg1, arg2, arg3, arg4); - }, - codec: DcoCodec( - decodeSuccessData: - dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder, - decodeErrorData: dco_decode_builder_exception, - ), - constMeta: kNodeBuilderCreateBuilderConstMeta, - argValues: [ - config, - chainDataSourceConfig, - entropySourceConfig, - gossipSourceConfig, - liquiditySourceConfig - ], - apiImpl: this, - hint: hint, - )); - } - - TaskConstMeta get kNodeBuilderCreateBuilderConstMeta => const TaskConstMeta( - debugName: "NodeBuilder_create_builder", - argNames: [ - "config", - "chainDataSourceConfig", - "entropySourceConfig", - "gossipSourceConfig", - "liquiditySourceConfig" - ], - ); - - @override - Future ldkBolt11PaymentReceive( + Future crateApiBolt11LdkBolt11PaymentReceive( {required LdkBolt11Payment that, - required int amountMsat, + required BigInt amountMsat, required String description, - required int expirySecs, - dynamic hint}) { + required int expirySecs}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); var arg1 = cst_encode_u_64(amountMsat); var arg2 = cst_encode_String(description); var arg3 = cst_encode_u_32(expirySecs); - return wire.wire_ldk_bolt_11_payment_receive( + return wire.wire__crate__api__bolt11__ldk_bolt_11_payment_receive( port_, arg0, arg1, arg2, arg3); }, codec: DcoCodec( decodeSuccessData: dco_decode_bolt_11_invoice, - decodeErrorData: dco_decode_node_exception, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkBolt11PaymentReceiveConstMeta, + constMeta: kCrateApiBolt11LdkBolt11PaymentReceiveConstMeta, argValues: [that, amountMsat, description, expirySecs], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkBolt11PaymentReceiveConstMeta => const TaskConstMeta( + TaskConstMeta get kCrateApiBolt11LdkBolt11PaymentReceiveConstMeta => + const TaskConstMeta( debugName: "ldk_bolt_11_payment_receive", argNames: ["that", "amountMsat", "description", "expirySecs"], ); @override - Future ldkBolt11PaymentReceiveVariableAmount( + Future crateApiBolt11LdkBolt11PaymentReceiveVariableAmount( {required LdkBolt11Payment that, required String description, - required int expirySecs, - dynamic hint}) { + required int expirySecs}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); var arg1 = cst_encode_String(description); var arg2 = cst_encode_u_32(expirySecs); - return wire.wire_ldk_bolt_11_payment_receive_variable_amount( - port_, arg0, arg1, arg2); + return wire + .wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount( + port_, arg0, arg1, arg2); }, codec: DcoCodec( decodeSuccessData: dco_decode_bolt_11_invoice, - decodeErrorData: dco_decode_node_exception, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkBolt11PaymentReceiveVariableAmountConstMeta, + constMeta: kCrateApiBolt11LdkBolt11PaymentReceiveVariableAmountConstMeta, argValues: [that, description, expirySecs], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkBolt11PaymentReceiveVariableAmountConstMeta => - const TaskConstMeta( - debugName: "ldk_bolt_11_payment_receive_variable_amount", - argNames: ["that", "description", "expirySecs"], - ); + TaskConstMeta + get kCrateApiBolt11LdkBolt11PaymentReceiveVariableAmountConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_receive_variable_amount", + argNames: ["that", "description", "expirySecs"], + ); @override - Future ldkBolt11PaymentReceiveVariableAmountViaJitChannel( - {required LdkBolt11Payment that, - required String description, - required int expirySecs, - int? maxProportionalLspFeeLimitPpmMsat, - dynamic hint}) { + Future + crateApiBolt11LdkBolt11PaymentReceiveVariableAmountViaJitChannel( + {required LdkBolt11Payment that, + required String description, + required int expirySecs, + BigInt? maxProportionalLspFeeLimitPpmMsat}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); @@ -486,14 +445,15 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { var arg3 = cst_encode_opt_box_autoadd_u_64(maxProportionalLspFeeLimitPpmMsat); return wire - .wire_ldk_bolt_11_payment_receive_variable_amount_via_jit_channel( + .wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel( port_, arg0, arg1, arg2, arg3); }, codec: DcoCodec( decodeSuccessData: dco_decode_bolt_11_invoice, - decodeErrorData: dco_decode_node_exception, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkBolt11PaymentReceiveVariableAmountViaJitChannelConstMeta, + constMeta: + kCrateApiBolt11LdkBolt11PaymentReceiveVariableAmountViaJitChannelConstMeta, argValues: [ that, description, @@ -501,12 +461,11 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { maxProportionalLspFeeLimitPpmMsat ], apiImpl: this, - hint: hint, )); } TaskConstMeta - get kLdkBolt11PaymentReceiveVariableAmountViaJitChannelConstMeta => + get kCrateApiBolt11LdkBolt11PaymentReceiveVariableAmountViaJitChannelConstMeta => const TaskConstMeta( debugName: "ldk_bolt_11_payment_receive_variable_amount_via_jit_channel", @@ -519,13 +478,12 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { ); @override - Future ldkBolt11PaymentReceiveViaJitChannel( + Future crateApiBolt11LdkBolt11PaymentReceiveViaJitChannel( {required LdkBolt11Payment that, - required int amountMsat, + required BigInt amountMsat, required String description, required int expirySecs, - int? maxTotalLspFeeLimitMsat, - dynamic hint}) { + BigInt? maxTotalLspFeeLimitMsat}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); @@ -533,14 +491,15 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { 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_ldk_bolt_11_payment_receive_via_jit_channel( - port_, arg0, arg1, arg2, arg3, arg4); + return wire + .wire__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel( + port_, arg0, arg1, arg2, arg3, arg4); }, codec: DcoCodec( decodeSuccessData: dco_decode_bolt_11_invoice, - decodeErrorData: dco_decode_node_exception, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkBolt11PaymentReceiveViaJitChannelConstMeta, + constMeta: kCrateApiBolt11LdkBolt11PaymentReceiveViaJitChannelConstMeta, argValues: [ that, amountMsat, @@ -549,277 +508,710 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { maxTotalLspFeeLimitMsat ], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkBolt11PaymentReceiveViaJitChannelConstMeta => - const TaskConstMeta( - debugName: "ldk_bolt_11_payment_receive_via_jit_channel", - argNames: [ - "that", - "amountMsat", - "description", - "expirySecs", - "maxTotalLspFeeLimitMsat" - ], - ); + TaskConstMeta + get kCrateApiBolt11LdkBolt11PaymentReceiveViaJitChannelConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_receive_via_jit_channel", + argNames: [ + "that", + "amountMsat", + "description", + "expirySecs", + "maxTotalLspFeeLimitMsat" + ], + ); @override - Future ldkBolt11PaymentSend( - {required LdkBolt11Payment that, - required Bolt11Invoice invoice, - dynamic hint}) { + Future crateApiBolt11LdkBolt11PaymentSend( + {required LdkBolt11Payment that, required Bolt11Invoice invoice}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); var arg1 = cst_encode_box_autoadd_bolt_11_invoice(invoice); - return wire.wire_ldk_bolt_11_payment_send(port_, arg0, arg1); + return wire.wire__crate__api__bolt11__ldk_bolt_11_payment_send( + port_, arg0, arg1); }, codec: DcoCodec( decodeSuccessData: dco_decode_payment_id, - decodeErrorData: dco_decode_node_exception, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkBolt11PaymentSendConstMeta, + constMeta: kCrateApiBolt11LdkBolt11PaymentSendConstMeta, argValues: [that, invoice], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkBolt11PaymentSendConstMeta => const TaskConstMeta( + TaskConstMeta get kCrateApiBolt11LdkBolt11PaymentSendConstMeta => + const TaskConstMeta( debugName: "ldk_bolt_11_payment_send", argNames: ["that", "invoice"], ); @override - Future ldkBolt11PaymentSendProbes( - {required LdkBolt11Payment that, - required Bolt11Invoice invoice, - dynamic hint}) { + Future crateApiBolt11LdkBolt11PaymentSendProbes( + {required LdkBolt11Payment that, required Bolt11Invoice invoice}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); var arg1 = cst_encode_box_autoadd_bolt_11_invoice(invoice); - return wire.wire_ldk_bolt_11_payment_send_probes(port_, arg0, arg1); + return wire.wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes( + port_, arg0, arg1); }, codec: DcoCodec( decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkBolt11PaymentSendProbesConstMeta, + constMeta: kCrateApiBolt11LdkBolt11PaymentSendProbesConstMeta, argValues: [that, invoice], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkBolt11PaymentSendProbesConstMeta => const TaskConstMeta( + TaskConstMeta get kCrateApiBolt11LdkBolt11PaymentSendProbesConstMeta => + const TaskConstMeta( debugName: "ldk_bolt_11_payment_send_probes", argNames: ["that", "invoice"], ); @override - Future ldkBolt11PaymentSendProbesUsingAmount( + Future crateApiBolt11LdkBolt11PaymentSendProbesUsingAmount( {required LdkBolt11Payment that, required Bolt11Invoice invoice, - required int amountMsat, - dynamic hint}) { + required BigInt amountMsat}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); var arg1 = cst_encode_box_autoadd_bolt_11_invoice(invoice); var arg2 = cst_encode_u_64(amountMsat); - return wire.wire_ldk_bolt_11_payment_send_probes_using_amount( - port_, arg0, arg1, arg2); + return wire + .wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount( + port_, arg0, arg1, arg2); }, codec: DcoCodec( decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkBolt11PaymentSendProbesUsingAmountConstMeta, + constMeta: kCrateApiBolt11LdkBolt11PaymentSendProbesUsingAmountConstMeta, argValues: [that, invoice, amountMsat], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkBolt11PaymentSendProbesUsingAmountConstMeta => - const TaskConstMeta( - debugName: "ldk_bolt_11_payment_send_probes_using_amount", - argNames: ["that", "invoice", "amountMsat"], - ); + TaskConstMeta + get kCrateApiBolt11LdkBolt11PaymentSendProbesUsingAmountConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_send_probes_using_amount", + argNames: ["that", "invoice", "amountMsat"], + ); @override - Future ldkBolt11PaymentSendUsingAmount( + Future crateApiBolt11LdkBolt11PaymentSendUsingAmount( {required LdkBolt11Payment that, required Bolt11Invoice invoice, - required int amountMsat, - dynamic hint}) { + required BigInt amountMsat}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); var arg1 = cst_encode_box_autoadd_bolt_11_invoice(invoice); var arg2 = cst_encode_u_64(amountMsat); - return wire.wire_ldk_bolt_11_payment_send_using_amount( - port_, arg0, arg1, arg2); + return wire + .wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount( + port_, arg0, arg1, arg2); }, codec: DcoCodec( decodeSuccessData: dco_decode_payment_id, - decodeErrorData: dco_decode_node_exception, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkBolt11PaymentSendUsingAmountConstMeta, + constMeta: kCrateApiBolt11LdkBolt11PaymentSendUsingAmountConstMeta, argValues: [that, invoice, amountMsat], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkBolt11PaymentSendUsingAmountConstMeta => + TaskConstMeta get kCrateApiBolt11LdkBolt11PaymentSendUsingAmountConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_send_using_amount", + argNames: ["that", "invoice", "amountMsat"], + ); + + @override + Future crateApiBolt12LdkBolt12PaymentInitiateRefund( + {required LdkBolt12Payment that, + required BigInt amountMsat, + required int expirySecs}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_bolt_12_payment(that); + var arg1 = cst_encode_u_64(amountMsat); + var arg2 = cst_encode_u_32(expirySecs); + return wire + .wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refund( + port_, arg0, arg1, arg2); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_refund, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiBolt12LdkBolt12PaymentInitiateRefundConstMeta, + argValues: [that, amountMsat, expirySecs], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiBolt12LdkBolt12PaymentInitiateRefundConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_12_payment_initiate_refund", + argNames: ["that", "amountMsat", "expirySecs"], + ); + + @override + Future crateApiBolt12LdkBolt12PaymentReceive( + {required LdkBolt12Payment that, + required BigInt amountMsat, + required String description}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_bolt_12_payment(that); + var arg1 = cst_encode_u_64(amountMsat); + var arg2 = cst_encode_String(description); + return wire.wire__crate__api__bolt12__ldk_bolt_12_payment_receive( + port_, arg0, arg1, arg2); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_offer, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiBolt12LdkBolt12PaymentReceiveConstMeta, + argValues: [that, amountMsat, description], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiBolt12LdkBolt12PaymentReceiveConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_12_payment_receive", + argNames: ["that", "amountMsat", "description"], + ); + + @override + Future crateApiBolt12LdkBolt12PaymentReceiveVariableAmount( + {required LdkBolt12Payment that, required String description}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_bolt_12_payment(that); + var arg1 = cst_encode_String(description); + return wire + .wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amount( + port_, arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_offer, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiBolt12LdkBolt12PaymentReceiveVariableAmountConstMeta, + argValues: [that, description], + apiImpl: this, + )); + } + + TaskConstMeta + get kCrateApiBolt12LdkBolt12PaymentReceiveVariableAmountConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_12_payment_receive_variable_amount", + argNames: ["that", "description"], + ); + + @override + Future crateApiBolt12LdkBolt12PaymentRequestRefundPayment( + {required LdkBolt12Payment that, required Refund refund}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_bolt_12_payment(that); + var arg1 = cst_encode_box_autoadd_refund(refund); + return wire + .wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_payment( + port_, arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_bolt_12_invoice, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiBolt12LdkBolt12PaymentRequestRefundPaymentConstMeta, + argValues: [that, refund], + apiImpl: this, + )); + } + + TaskConstMeta + get kCrateApiBolt12LdkBolt12PaymentRequestRefundPaymentConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_12_payment_request_refund_payment", + argNames: ["that", "refund"], + ); + + @override + Future crateApiBolt12LdkBolt12PaymentSend( + {required LdkBolt12Payment that, + required Offer offer, + String? payerNote}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_bolt_12_payment(that); + var arg1 = cst_encode_box_autoadd_offer(offer); + var arg2 = cst_encode_opt_String(payerNote); + return wire.wire__crate__api__bolt12__ldk_bolt_12_payment_send( + port_, arg0, arg1, arg2); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_payment_id, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiBolt12LdkBolt12PaymentSendConstMeta, + argValues: [that, offer, payerNote], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiBolt12LdkBolt12PaymentSendConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_12_payment_send", + argNames: ["that", "offer", "payerNote"], + ); + + @override + Future crateApiBolt12LdkBolt12PaymentSendUsingAmount( + {required LdkBolt12Payment that, + required Offer offer, + String? payerNote, + required BigInt amountMsat}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_bolt_12_payment(that); + var arg1 = cst_encode_box_autoadd_offer(offer); + var arg2 = cst_encode_opt_String(payerNote); + var arg3 = cst_encode_u_64(amountMsat); + return wire + .wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amount( + port_, arg0, arg1, arg2, arg3); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_payment_id, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiBolt12LdkBolt12PaymentSendUsingAmountConstMeta, + argValues: [that, offer, payerNote, amountMsat], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiBolt12LdkBolt12PaymentSendUsingAmountConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_12_payment_send_using_amount", + argNames: ["that", "offer", "payerNote", "amountMsat"], + ); + + @override + Builder crateApiBuilderNodeBuilderAutoAccessorGetBuilder( + {required NodeBuilder that}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + that); + return wire + .wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder( + arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_RustOpaque_ldk_nodeBuilder, + decodeErrorData: null, + ), + constMeta: kCrateApiBuilderNodeBuilderAutoAccessorGetBuilderConstMeta, + argValues: [that], + apiImpl: this, + )); + } + + TaskConstMeta + get kCrateApiBuilderNodeBuilderAutoAccessorGetBuilderConstMeta => + const TaskConstMeta( + debugName: "NodeBuilder_auto_accessor_get_builder", + argNames: ["that"], + ); + + @override + void crateApiBuilderNodeBuilderAutoAccessorSetBuilder( + {required NodeBuilder that, required Builder builder}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + that); + var arg1 = cst_encode_RustOpaque_ldk_nodeBuilder(builder); + return wire + .wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder( + arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: null, + ), + constMeta: kCrateApiBuilderNodeBuilderAutoAccessorSetBuilderConstMeta, + argValues: [that, builder], + apiImpl: this, + )); + } + + TaskConstMeta + get kCrateApiBuilderNodeBuilderAutoAccessorSetBuilderConstMeta => + const TaskConstMeta( + debugName: "NodeBuilder_auto_accessor_set_builder", + argNames: ["that", "builder"], + ); + + @override + Future crateApiBuilderNodeBuilderBuild({required NodeBuilder that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + that); + return wire.wire__crate__api__builder__NodeBuilder_build(port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_ldk_node, + decodeErrorData: dco_decode_ldk_builder_error, + ), + constMeta: kCrateApiBuilderNodeBuilderBuildConstMeta, + argValues: [that], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiBuilderNodeBuilderBuildConstMeta => + const TaskConstMeta( + debugName: "NodeBuilder_build", + argNames: ["that"], + ); + + @override + Future crateApiBuilderNodeBuilderBuildWithFsStore( + {required NodeBuilder that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + that); + return wire.wire__crate__api__builder__NodeBuilder_build_with_fs_store( + port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_ldk_node, + decodeErrorData: dco_decode_ldk_builder_error, + ), + constMeta: kCrateApiBuilderNodeBuilderBuildWithFsStoreConstMeta, + argValues: [that], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiBuilderNodeBuilderBuildWithFsStoreConstMeta => + const TaskConstMeta( + debugName: "NodeBuilder_build_with_fs_store", + argNames: ["that"], + ); + + @override + Future crateApiBuilderNodeBuilderCreateBuilder( + {required Config config, + ChainDataSourceConfig? chainDataSourceConfig, + EntropySourceConfig? entropySourceConfig, + GossipSourceConfig? gossipSourceConfig, + LiquiditySourceConfig? liquiditySourceConfig}) { + 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__crate__api__builder__NodeBuilder_create_builder( + port_, arg0, arg1, arg2, arg3, arg4); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder, + decodeErrorData: dco_decode_ldk_builder_error, + ), + constMeta: kCrateApiBuilderNodeBuilderCreateBuilderConstMeta, + argValues: [ + config, + chainDataSourceConfig, + entropySourceConfig, + gossipSourceConfig, + liquiditySourceConfig + ], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiBuilderNodeBuilderCreateBuilderConstMeta => + const TaskConstMeta( + debugName: "NodeBuilder_create_builder", + argNames: [ + "config", + "chainDataSourceConfig", + "entropySourceConfig", + "gossipSourceConfig", + "liquiditySourceConfig" + ], + ); + + @override + Future crateApiBuilderLdkMnemonicGenerate() { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + return wire.wire__crate__api__builder__ldk_mnemonic_generate(port_); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_ldk_mnemonic, + decodeErrorData: null, + ), + constMeta: kCrateApiBuilderLdkMnemonicGenerateConstMeta, + argValues: [], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiBuilderLdkMnemonicGenerateConstMeta => + const TaskConstMeta( + debugName: "ldk_mnemonic_generate", + argNames: [], + ); + + @override + Future crateApiGraphLdkNetworkGraphChannel( + {required LdkNetworkGraph that, required BigInt shortChannelId}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_network_graph(that); + var arg1 = cst_encode_u_64(shortChannelId); + return wire.wire__crate__api__graph__ldk_network_graph_channel( + port_, arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_opt_box_autoadd_channel_info, + decodeErrorData: null, + ), + constMeta: kCrateApiGraphLdkNetworkGraphChannelConstMeta, + argValues: [that, shortChannelId], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiGraphLdkNetworkGraphChannelConstMeta => + const TaskConstMeta( + debugName: "ldk_network_graph_channel", + argNames: ["that", "shortChannelId"], + ); + + @override + Future crateApiGraphLdkNetworkGraphListChannels( + {required LdkNetworkGraph that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_network_graph(that); + return wire.wire__crate__api__graph__ldk_network_graph_list_channels( + port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_list_prim_u_64_strict, + decodeErrorData: null, + ), + constMeta: kCrateApiGraphLdkNetworkGraphListChannelsConstMeta, + argValues: [that], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiGraphLdkNetworkGraphListChannelsConstMeta => + const TaskConstMeta( + debugName: "ldk_network_graph_list_channels", + argNames: ["that"], + ); + + @override + Future> crateApiGraphLdkNetworkGraphListNodes( + {required LdkNetworkGraph that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_network_graph(that); + return wire.wire__crate__api__graph__ldk_network_graph_list_nodes( + port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_list_node_id, + decodeErrorData: null, + ), + constMeta: kCrateApiGraphLdkNetworkGraphListNodesConstMeta, + argValues: [that], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiGraphLdkNetworkGraphListNodesConstMeta => const TaskConstMeta( - debugName: "ldk_bolt_11_payment_send_using_amount", - argNames: ["that", "invoice", "amountMsat"], + debugName: "ldk_network_graph_list_nodes", + argNames: ["that"], ); @override - Future ldkMnemonicGenerate({dynamic hint}) { + Future crateApiNodeLdkNodeBolt11Payment( + {required LdkNode ptr}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - return wire.wire_ldk_mnemonic_generate(port_); + var arg0 = cst_encode_box_autoadd_ldk_node(ptr); + return wire.wire__crate__api__node__ldk_node_bolt11_payment( + port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_ldk_mnemonic, + decodeSuccessData: dco_decode_ldk_bolt_11_payment, decodeErrorData: null, ), - constMeta: kLdkMnemonicGenerateConstMeta, - argValues: [], + constMeta: kCrateApiNodeLdkNodeBolt11PaymentConstMeta, + argValues: [ptr], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkMnemonicGenerateConstMeta => const TaskConstMeta( - debugName: "ldk_mnemonic_generate", - argNames: [], + TaskConstMeta get kCrateApiNodeLdkNodeBolt11PaymentConstMeta => + const TaskConstMeta( + debugName: "ldk_node_bolt11_payment", + argNames: ["ptr"], ); @override - Future ldkNodeBolt11Payment( - {required LdkNode ptr, dynamic hint}) { + Future crateApiNodeLdkNodeBolt12Payment( + {required LdkNode ptr}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(ptr); - return wire.wire_ldk_node_bolt11_payment(port_, arg0); + return wire.wire__crate__api__node__ldk_node_bolt12_payment( + port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_ldk_bolt_11_payment, + decodeSuccessData: dco_decode_ldk_bolt_12_payment, decodeErrorData: null, ), - constMeta: kLdkNodeBolt11PaymentConstMeta, + constMeta: kCrateApiNodeLdkNodeBolt12PaymentConstMeta, argValues: [ptr], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeBolt11PaymentConstMeta => const TaskConstMeta( - debugName: "ldk_node_bolt11_payment", + TaskConstMeta get kCrateApiNodeLdkNodeBolt12PaymentConstMeta => + const TaskConstMeta( + debugName: "ldk_node_bolt12_payment", argNames: ["ptr"], ); @override - Future ldkNodeCloseChannel( + Future crateApiNodeLdkNodeCloseChannel( {required LdkNode that, required UserChannelId userChannelId, - required PublicKey counterpartyNodeId, - dynamic hint}) { + required PublicKey counterpartyNodeId}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); var arg1 = cst_encode_box_autoadd_user_channel_id(userChannelId); var arg2 = cst_encode_box_autoadd_public_key(counterpartyNodeId); - return wire.wire_ldk_node_close_channel(port_, arg0, arg1, arg2); + return wire.wire__crate__api__node__ldk_node_close_channel( + port_, arg0, arg1, arg2); }, codec: DcoCodec( decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeCloseChannelConstMeta, + constMeta: kCrateApiNodeLdkNodeCloseChannelConstMeta, argValues: [that, userChannelId, counterpartyNodeId], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeCloseChannelConstMeta => const TaskConstMeta( + TaskConstMeta get kCrateApiNodeLdkNodeCloseChannelConstMeta => + const TaskConstMeta( debugName: "ldk_node_close_channel", argNames: ["that", "userChannelId", "counterpartyNodeId"], ); @override - Future ldkNodeConfig({required LdkNode that, dynamic hint}) { + Future crateApiNodeLdkNodeConfig({required LdkNode that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_config(port_, arg0); + return wire.wire__crate__api__node__ldk_node_config(port_, arg0); }, codec: DcoCodec( decodeSuccessData: dco_decode_config, decodeErrorData: null, ), - constMeta: kLdkNodeConfigConstMeta, + constMeta: kCrateApiNodeLdkNodeConfigConstMeta, argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeConfigConstMeta => const TaskConstMeta( + TaskConstMeta get kCrateApiNodeLdkNodeConfigConstMeta => const TaskConstMeta( debugName: "ldk_node_config", argNames: ["that"], ); @override - Future ldkNodeConnect( + Future crateApiNodeLdkNodeConnect( {required LdkNode that, required PublicKey nodeId, required SocketAddress address, - required bool persist, - dynamic hint}) { + required bool persist}) { return handler.executeNormal(NormalTask( callFfi: (port_) { 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_ldk_node_connect(port_, arg0, arg1, arg2, arg3); + return wire.wire__crate__api__node__ldk_node_connect( + port_, arg0, arg1, arg2, arg3); }, codec: DcoCodec( decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeConnectConstMeta, + constMeta: kCrateApiNodeLdkNodeConnectConstMeta, argValues: [that, nodeId, address, persist], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeConnectConstMeta => const TaskConstMeta( + TaskConstMeta get kCrateApiNodeLdkNodeConnectConstMeta => const TaskConstMeta( debugName: "ldk_node_connect", argNames: ["that", "nodeId", "address", "persist"], ); @override - Future ldkNodeConnectOpenChannel( + Future crateApiNodeLdkNodeConnectOpenChannel( {required LdkNode that, required SocketAddress socketAddress, required PublicKey nodeId, - required int channelAmountSats, - int? pushToCounterpartyMsat, + required BigInt channelAmountSats, + BigInt? pushToCounterpartyMsat, required bool announceChannel, - ChannelConfig? channelConfig, - dynamic hint}) { + ChannelConfig? channelConfig}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); @@ -829,14 +1221,14 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { 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_ldk_node_connect_open_channel( + return wire.wire__crate__api__node__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_exception, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeConnectOpenChannelConstMeta, + constMeta: kCrateApiNodeLdkNodeConnectOpenChannelConstMeta, argValues: [ that, socketAddress, @@ -847,11 +1239,11 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { channelConfig ], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeConnectOpenChannelConstMeta => const TaskConstMeta( + TaskConstMeta get kCrateApiNodeLdkNodeConnectOpenChannelConstMeta => + const TaskConstMeta( debugName: "ldk_node_connect_open_channel", argNames: [ "that", @@ -865,515 +1257,565 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { ); @override - Future ldkNodeDisconnect( - {required LdkNode that, - required PublicKey counterpartyNodeId, - dynamic hint}) { + Future crateApiNodeLdkNodeDisconnect( + {required LdkNode that, required PublicKey counterpartyNodeId}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); var arg1 = cst_encode_box_autoadd_public_key(counterpartyNodeId); - return wire.wire_ldk_node_disconnect(port_, arg0, arg1); + return wire.wire__crate__api__node__ldk_node_disconnect( + port_, arg0, arg1); }, codec: DcoCodec( decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeDisconnectConstMeta, + constMeta: kCrateApiNodeLdkNodeDisconnectConstMeta, argValues: [that, counterpartyNodeId], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeDisconnectConstMeta => const TaskConstMeta( + TaskConstMeta get kCrateApiNodeLdkNodeDisconnectConstMeta => + const TaskConstMeta( debugName: "ldk_node_disconnect", argNames: ["that", "counterpartyNodeId"], ); @override - Future ldkNodeEventHandled({required LdkNode that, dynamic hint}) { + Future crateApiNodeLdkNodeEventHandled({required LdkNode that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_event_handled(port_, arg0); + return wire.wire__crate__api__node__ldk_node_event_handled(port_, arg0); }, codec: DcoCodec( decodeSuccessData: dco_decode_unit, decodeErrorData: null, ), - constMeta: kLdkNodeEventHandledConstMeta, + constMeta: kCrateApiNodeLdkNodeEventHandledConstMeta, argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeEventHandledConstMeta => const TaskConstMeta( + TaskConstMeta get kCrateApiNodeLdkNodeEventHandledConstMeta => + const TaskConstMeta( debugName: "ldk_node_event_handled", argNames: ["that"], ); @override - Future ldkNodeListBalances( - {required LdkNode that, dynamic hint}) { + Future crateApiNodeLdkNodeForceCloseChannel( + {required LdkNode that, + required UserChannelId userChannelId, + required PublicKey counterpartyNodeId}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + var arg1 = cst_encode_box_autoadd_user_channel_id(userChannelId); + var arg2 = cst_encode_box_autoadd_public_key(counterpartyNodeId); + return wire.wire__crate__api__node__ldk_node_force_close_channel( + port_, arg0, arg1, arg2); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiNodeLdkNodeForceCloseChannelConstMeta, + argValues: [that, userChannelId, counterpartyNodeId], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeForceCloseChannelConstMeta => + const TaskConstMeta( + debugName: "ldk_node_force_close_channel", + argNames: ["that", "userChannelId", "counterpartyNodeId"], + ); + + @override + Future crateApiNodeLdkNodeListBalances( + {required LdkNode that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_list_balances(port_, arg0); + return wire.wire__crate__api__node__ldk_node_list_balances(port_, arg0); }, codec: DcoCodec( decodeSuccessData: dco_decode_balance_details, - decodeErrorData: dco_decode_node_exception, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeListBalancesConstMeta, + constMeta: kCrateApiNodeLdkNodeListBalancesConstMeta, argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeListBalancesConstMeta => const TaskConstMeta( + TaskConstMeta get kCrateApiNodeLdkNodeListBalancesConstMeta => + const TaskConstMeta( debugName: "ldk_node_list_balances", argNames: ["that"], ); @override - Future> ldkNodeListChannels( - {required LdkNode that, dynamic hint}) { + Future> crateApiNodeLdkNodeListChannels( + {required LdkNode that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_list_channels(port_, arg0); + return wire.wire__crate__api__node__ldk_node_list_channels(port_, arg0); }, codec: DcoCodec( decodeSuccessData: dco_decode_list_channel_details, decodeErrorData: null, ), - constMeta: kLdkNodeListChannelsConstMeta, + constMeta: kCrateApiNodeLdkNodeListChannelsConstMeta, argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeListChannelsConstMeta => const TaskConstMeta( + TaskConstMeta get kCrateApiNodeLdkNodeListChannelsConstMeta => + const TaskConstMeta( debugName: "ldk_node_list_channels", argNames: ["that"], ); @override - Future> ldkNodeListPayments( - {required LdkNode that, dynamic hint}) { + Future> crateApiNodeLdkNodeListPayments( + {required LdkNode that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_list_payments(port_, arg0); + return wire.wire__crate__api__node__ldk_node_list_payments(port_, arg0); }, codec: DcoCodec( decodeSuccessData: dco_decode_list_payment_details, decodeErrorData: null, ), - constMeta: kLdkNodeListPaymentsConstMeta, + constMeta: kCrateApiNodeLdkNodeListPaymentsConstMeta, argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeListPaymentsConstMeta => const TaskConstMeta( + TaskConstMeta get kCrateApiNodeLdkNodeListPaymentsConstMeta => + const TaskConstMeta( debugName: "ldk_node_list_payments", argNames: ["that"], ); @override - Future> ldkNodeListPaymentsWithFilter( - {required LdkNode that, - required PaymentDirection paymentDirection, - dynamic hint}) { + Future> crateApiNodeLdkNodeListPaymentsWithFilter( + {required LdkNode that, required PaymentDirection paymentDirection}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); var arg1 = cst_encode_payment_direction(paymentDirection); - return wire.wire_ldk_node_list_payments_with_filter(port_, arg0, arg1); + return wire.wire__crate__api__node__ldk_node_list_payments_with_filter( + port_, arg0, arg1); }, codec: DcoCodec( decodeSuccessData: dco_decode_list_payment_details, decodeErrorData: null, ), - constMeta: kLdkNodeListPaymentsWithFilterConstMeta, + constMeta: kCrateApiNodeLdkNodeListPaymentsWithFilterConstMeta, argValues: [that, paymentDirection], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeListPaymentsWithFilterConstMeta => + TaskConstMeta get kCrateApiNodeLdkNodeListPaymentsWithFilterConstMeta => const TaskConstMeta( debugName: "ldk_node_list_payments_with_filter", argNames: ["that", "paymentDirection"], ); @override - Future> ldkNodeListPeers( - {required LdkNode that, dynamic hint}) { + Future> crateApiNodeLdkNodeListPeers( + {required LdkNode that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_list_peers(port_, arg0); + return wire.wire__crate__api__node__ldk_node_list_peers(port_, arg0); }, codec: DcoCodec( decodeSuccessData: dco_decode_list_peer_details, decodeErrorData: null, ), - constMeta: kLdkNodeListPeersConstMeta, + constMeta: kCrateApiNodeLdkNodeListPeersConstMeta, argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeListPeersConstMeta => const TaskConstMeta( + TaskConstMeta get kCrateApiNodeLdkNodeListPeersConstMeta => + const TaskConstMeta( debugName: "ldk_node_list_peers", argNames: ["that"], ); @override - Future?> ldkNodeListeningAddresses( - {required LdkNode that, dynamic hint}) { + Future?> crateApiNodeLdkNodeListeningAddresses( + {required LdkNode that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_listening_addresses(port_, arg0); + return wire.wire__crate__api__node__ldk_node_listening_addresses( + port_, arg0); }, codec: DcoCodec( decodeSuccessData: dco_decode_opt_list_socket_address, decodeErrorData: null, ), - constMeta: kLdkNodeListeningAddressesConstMeta, + constMeta: kCrateApiNodeLdkNodeListeningAddressesConstMeta, argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeListeningAddressesConstMeta => const TaskConstMeta( + TaskConstMeta get kCrateApiNodeLdkNodeListeningAddressesConstMeta => + const TaskConstMeta( debugName: "ldk_node_listening_addresses", argNames: ["that"], ); @override - Future ldkNodeNextEvent({required LdkNode that, dynamic hint}) { + Future crateApiNodeLdkNodeNetworkGraph( + {required LdkNode that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire__crate__api__node__ldk_node_network_graph(port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_ldk_network_graph, + decodeErrorData: null, + ), + constMeta: kCrateApiNodeLdkNodeNetworkGraphConstMeta, + argValues: [that], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeNetworkGraphConstMeta => + const TaskConstMeta( + debugName: "ldk_node_network_graph", + argNames: ["that"], + ); + + @override + Future crateApiNodeLdkNodeNextEvent({required LdkNode that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_next_event(port_, arg0); + return wire.wire__crate__api__node__ldk_node_next_event(port_, arg0); }, codec: DcoCodec( decodeSuccessData: dco_decode_opt_box_autoadd_event, decodeErrorData: null, ), - constMeta: kLdkNodeNextEventConstMeta, + constMeta: kCrateApiNodeLdkNodeNextEventConstMeta, argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeNextEventConstMeta => const TaskConstMeta( + TaskConstMeta get kCrateApiNodeLdkNodeNextEventConstMeta => + const TaskConstMeta( debugName: "ldk_node_next_event", argNames: ["that"], ); @override - Future ldkNodeNextEventAsync({required LdkNode that, dynamic hint}) { + Future crateApiNodeLdkNodeNextEventAsync({required LdkNode that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_next_event_async(port_, arg0); + return wire.wire__crate__api__node__ldk_node_next_event_async( + port_, arg0); }, codec: DcoCodec( decodeSuccessData: dco_decode_event, decodeErrorData: null, ), - constMeta: kLdkNodeNextEventAsyncConstMeta, + constMeta: kCrateApiNodeLdkNodeNextEventAsyncConstMeta, argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeNextEventAsyncConstMeta => const TaskConstMeta( + TaskConstMeta get kCrateApiNodeLdkNodeNextEventAsyncConstMeta => + const TaskConstMeta( debugName: "ldk_node_next_event_async", argNames: ["that"], ); @override - Future ldkNodeNodeId({required LdkNode that, dynamic hint}) { + Future crateApiNodeLdkNodeNodeId({required LdkNode that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_node_id(port_, arg0); + return wire.wire__crate__api__node__ldk_node_node_id(port_, arg0); }, codec: DcoCodec( decodeSuccessData: dco_decode_public_key, decodeErrorData: null, ), - constMeta: kLdkNodeNodeIdConstMeta, + constMeta: kCrateApiNodeLdkNodeNodeIdConstMeta, argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeNodeIdConstMeta => const TaskConstMeta( + TaskConstMeta get kCrateApiNodeLdkNodeNodeIdConstMeta => const TaskConstMeta( debugName: "ldk_node_node_id", argNames: ["that"], ); @override - Future ldkNodeOnChainPayment( - {required LdkNode ptr, dynamic hint}) { + Future crateApiNodeLdkNodeOnChainPayment( + {required LdkNode ptr}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(ptr); - return wire.wire_ldk_node_on_chain_payment(port_, arg0); + return wire.wire__crate__api__node__ldk_node_on_chain_payment( + port_, arg0); }, codec: DcoCodec( decodeSuccessData: dco_decode_ldk_on_chain_payment, decodeErrorData: null, ), - constMeta: kLdkNodeOnChainPaymentConstMeta, + constMeta: kCrateApiNodeLdkNodeOnChainPaymentConstMeta, argValues: [ptr], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeOnChainPaymentConstMeta => const TaskConstMeta( + TaskConstMeta get kCrateApiNodeLdkNodeOnChainPaymentConstMeta => + const TaskConstMeta( debugName: "ldk_node_on_chain_payment", argNames: ["ptr"], ); @override - Future ldkNodePayment( - {required LdkNode that, required PaymentId paymentId, dynamic hint}) { + Future crateApiNodeLdkNodePayment( + {required LdkNode that, required PaymentId paymentId}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); var arg1 = cst_encode_box_autoadd_payment_id(paymentId); - return wire.wire_ldk_node_payment(port_, arg0, arg1); + return wire.wire__crate__api__node__ldk_node_payment(port_, arg0, arg1); }, codec: DcoCodec( decodeSuccessData: dco_decode_opt_box_autoadd_payment_details, decodeErrorData: null, ), - constMeta: kLdkNodePaymentConstMeta, + constMeta: kCrateApiNodeLdkNodePaymentConstMeta, argValues: [that, paymentId], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodePaymentConstMeta => const TaskConstMeta( + TaskConstMeta get kCrateApiNodeLdkNodePaymentConstMeta => const TaskConstMeta( debugName: "ldk_node_payment", argNames: ["that", "paymentId"], ); @override - Future ldkNodeRemovePayment( - {required LdkNode that, required PaymentId paymentId, dynamic hint}) { + Future crateApiNodeLdkNodeRemovePayment( + {required LdkNode that, required PaymentId paymentId}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); var arg1 = cst_encode_box_autoadd_payment_id(paymentId); - return wire.wire_ldk_node_remove_payment(port_, arg0, arg1); + return wire.wire__crate__api__node__ldk_node_remove_payment( + port_, arg0, arg1); }, codec: DcoCodec( decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeRemovePaymentConstMeta, + constMeta: kCrateApiNodeLdkNodeRemovePaymentConstMeta, argValues: [that, paymentId], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeRemovePaymentConstMeta => const TaskConstMeta( + TaskConstMeta get kCrateApiNodeLdkNodeRemovePaymentConstMeta => + const TaskConstMeta( debugName: "ldk_node_remove_payment", argNames: ["that", "paymentId"], ); @override - Future ldkNodeSignMessage( - {required LdkNode that, required List msg, dynamic hint}) { + Future crateApiNodeLdkNodeSignMessage( + {required LdkNode that, required List msg}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); var arg1 = cst_encode_list_prim_u_8_loose(msg); - return wire.wire_ldk_node_sign_message(port_, arg0, arg1); + return wire.wire__crate__api__node__ldk_node_sign_message( + port_, arg0, arg1); }, codec: DcoCodec( decodeSuccessData: dco_decode_String, - decodeErrorData: dco_decode_node_exception, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeSignMessageConstMeta, + constMeta: kCrateApiNodeLdkNodeSignMessageConstMeta, argValues: [that, msg], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeSignMessageConstMeta => const TaskConstMeta( + TaskConstMeta get kCrateApiNodeLdkNodeSignMessageConstMeta => + const TaskConstMeta( debugName: "ldk_node_sign_message", argNames: ["that", "msg"], ); @override - Future ldkNodeSpontaneousPayment( - {required LdkNode ptr, dynamic hint}) { + Future crateApiNodeLdkNodeSpontaneousPayment( + {required LdkNode ptr}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(ptr); - return wire.wire_ldk_node_spontaneous_payment(port_, arg0); + return wire.wire__crate__api__node__ldk_node_spontaneous_payment( + port_, arg0); }, codec: DcoCodec( decodeSuccessData: dco_decode_ldk_spontaneous_payment, decodeErrorData: null, ), - constMeta: kLdkNodeSpontaneousPaymentConstMeta, + constMeta: kCrateApiNodeLdkNodeSpontaneousPaymentConstMeta, argValues: [ptr], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeSpontaneousPaymentConstMeta => const TaskConstMeta( + TaskConstMeta get kCrateApiNodeLdkNodeSpontaneousPaymentConstMeta => + const TaskConstMeta( debugName: "ldk_node_spontaneous_payment", argNames: ["ptr"], ); @override - Future ldkNodeStart({required LdkNode that, dynamic hint}) { + Future crateApiNodeLdkNodeStart({required LdkNode that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_start(port_, arg0); + return wire.wire__crate__api__node__ldk_node_start(port_, arg0); }, codec: DcoCodec( decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeStartConstMeta, + constMeta: kCrateApiNodeLdkNodeStartConstMeta, argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeStartConstMeta => const TaskConstMeta( + TaskConstMeta get kCrateApiNodeLdkNodeStartConstMeta => const TaskConstMeta( debugName: "ldk_node_start", argNames: ["that"], ); @override - Future ldkNodeStatus({required LdkNode that, dynamic hint}) { + Future crateApiNodeLdkNodeStatus({required LdkNode that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_status(port_, arg0); + return wire.wire__crate__api__node__ldk_node_status(port_, arg0); }, codec: DcoCodec( decodeSuccessData: dco_decode_node_status, decodeErrorData: null, ), - constMeta: kLdkNodeStatusConstMeta, + constMeta: kCrateApiNodeLdkNodeStatusConstMeta, argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeStatusConstMeta => const TaskConstMeta( + TaskConstMeta get kCrateApiNodeLdkNodeStatusConstMeta => const TaskConstMeta( debugName: "ldk_node_status", argNames: ["that"], ); @override - Future ldkNodeStop({required LdkNode that, dynamic hint}) { + Future crateApiNodeLdkNodeStop({required LdkNode that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_stop(port_, arg0); + return wire.wire__crate__api__node__ldk_node_stop(port_, arg0); }, codec: DcoCodec( decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeStopConstMeta, + constMeta: kCrateApiNodeLdkNodeStopConstMeta, argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeStopConstMeta => const TaskConstMeta( + TaskConstMeta get kCrateApiNodeLdkNodeStopConstMeta => const TaskConstMeta( debugName: "ldk_node_stop", argNames: ["that"], ); @override - Future ldkNodeSyncWallets({required LdkNode that, dynamic hint}) { + Future crateApiNodeLdkNodeSyncWallets({required LdkNode that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_sync_wallets(port_, arg0); + return wire.wire__crate__api__node__ldk_node_sync_wallets(port_, arg0); }, codec: DcoCodec( decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeSyncWalletsConstMeta, + constMeta: kCrateApiNodeLdkNodeSyncWalletsConstMeta, argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeSyncWalletsConstMeta => const TaskConstMeta( + TaskConstMeta get kCrateApiNodeLdkNodeSyncWalletsConstMeta => + const TaskConstMeta( debugName: "ldk_node_sync_wallets", argNames: ["that"], ); @override - Future ldkNodeUpdateChannelConfig( + Future crateApiNodeLdkNodeUpdateChannelConfig( {required LdkNode that, required UserChannelId userChannelId, required PublicKey counterpartyNodeId, - required ChannelConfig channelConfig, - dynamic hint}) { + required ChannelConfig channelConfig}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); var arg1 = cst_encode_box_autoadd_user_channel_id(userChannelId); var arg2 = cst_encode_box_autoadd_public_key(counterpartyNodeId); var arg3 = cst_encode_box_autoadd_channel_config(channelConfig); - return wire.wire_ldk_node_update_channel_config( + return wire.wire__crate__api__node__ldk_node_update_channel_config( port_, arg0, arg1, arg2, arg3); }, codec: DcoCodec( decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeUpdateChannelConfigConstMeta, + constMeta: kCrateApiNodeLdkNodeUpdateChannelConfigConstMeta, argValues: [that, userChannelId, counterpartyNodeId, channelConfig], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeUpdateChannelConfigConstMeta => const TaskConstMeta( + TaskConstMeta get kCrateApiNodeLdkNodeUpdateChannelConfigConstMeta => + const TaskConstMeta( debugName: "ldk_node_update_channel_config", argNames: [ "that", @@ -1384,204 +1826,211 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { ); @override - Future ldkNodeVerifySignature( + Future crateApiNodeLdkNodeVerifySignature( {required LdkNode that, required List msg, required String sig, - required PublicKey publicKey, - dynamic hint}) { + required PublicKey publicKey}) { return handler.executeNormal(NormalTask( callFfi: (port_) { 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(publicKey); - return wire.wire_ldk_node_verify_signature( + return wire.wire__crate__api__node__ldk_node_verify_signature( port_, arg0, arg1, arg2, arg3); }, codec: DcoCodec( decodeSuccessData: dco_decode_bool, - decodeErrorData: dco_decode_node_exception, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeVerifySignatureConstMeta, + constMeta: kCrateApiNodeLdkNodeVerifySignatureConstMeta, argValues: [that, msg, sig, publicKey], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeVerifySignatureConstMeta => const TaskConstMeta( + TaskConstMeta get kCrateApiNodeLdkNodeVerifySignatureConstMeta => + const TaskConstMeta( debugName: "ldk_node_verify_signature", argNames: ["that", "msg", "sig", "publicKey"], ); @override - Future ldkNodeWaitNextEvent({required LdkNode that, dynamic hint}) { + Future crateApiNodeLdkNodeWaitNextEvent({required LdkNode that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_wait_next_event(port_, arg0); + return wire.wire__crate__api__node__ldk_node_wait_next_event( + port_, arg0); }, codec: DcoCodec( decodeSuccessData: dco_decode_event, decodeErrorData: null, ), - constMeta: kLdkNodeWaitNextEventConstMeta, + constMeta: kCrateApiNodeLdkNodeWaitNextEventConstMeta, argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeWaitNextEventConstMeta => const TaskConstMeta( + TaskConstMeta get kCrateApiNodeLdkNodeWaitNextEventConstMeta => + const TaskConstMeta( debugName: "ldk_node_wait_next_event", argNames: ["that"], ); @override - Future
ldkOnChainPaymentNewAddress( - {required LdkOnChainPayment that, dynamic hint}) { + Future
crateApiOnChainLdkOnChainPaymentNewAddress( + {required LdkOnChainPayment that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_on_chain_payment(that); - return wire.wire_ldk_on_chain_payment_new_address(port_, arg0); + return wire + .wire__crate__api__on_chain__ldk_on_chain_payment_new_address( + port_, arg0); }, codec: DcoCodec( decodeSuccessData: dco_decode_address, - decodeErrorData: dco_decode_node_exception, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkOnChainPaymentNewAddressConstMeta, + constMeta: kCrateApiOnChainLdkOnChainPaymentNewAddressConstMeta, argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkOnChainPaymentNewAddressConstMeta => + TaskConstMeta get kCrateApiOnChainLdkOnChainPaymentNewAddressConstMeta => const TaskConstMeta( debugName: "ldk_on_chain_payment_new_address", argNames: ["that"], ); @override - Future ldkOnChainPaymentSendAllToAddress( - {required LdkOnChainPayment that, - required Address address, - dynamic hint}) { + Future crateApiOnChainLdkOnChainPaymentSendAllToAddress( + {required LdkOnChainPayment that, required Address address}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_on_chain_payment(that); var arg1 = cst_encode_box_autoadd_address(address); - return wire.wire_ldk_on_chain_payment_send_all_to_address( - port_, arg0, arg1); + return wire + .wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address( + port_, arg0, arg1); }, codec: DcoCodec( decodeSuccessData: dco_decode_txid, - decodeErrorData: dco_decode_node_exception, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkOnChainPaymentSendAllToAddressConstMeta, + constMeta: kCrateApiOnChainLdkOnChainPaymentSendAllToAddressConstMeta, argValues: [that, address], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkOnChainPaymentSendAllToAddressConstMeta => - const TaskConstMeta( - debugName: "ldk_on_chain_payment_send_all_to_address", - argNames: ["that", "address"], - ); + TaskConstMeta + get kCrateApiOnChainLdkOnChainPaymentSendAllToAddressConstMeta => + const TaskConstMeta( + debugName: "ldk_on_chain_payment_send_all_to_address", + argNames: ["that", "address"], + ); @override - Future ldkOnChainPaymentSendToAddress( + Future crateApiOnChainLdkOnChainPaymentSendToAddress( {required LdkOnChainPayment that, required Address address, - required int amountSats, - dynamic hint}) { + required BigInt amountSats}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_on_chain_payment(that); var arg1 = cst_encode_box_autoadd_address(address); var arg2 = cst_encode_u_64(amountSats); - return wire.wire_ldk_on_chain_payment_send_to_address( - port_, arg0, arg1, arg2); + return wire + .wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address( + port_, arg0, arg1, arg2); }, codec: DcoCodec( decodeSuccessData: dco_decode_txid, - decodeErrorData: dco_decode_node_exception, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkOnChainPaymentSendToAddressConstMeta, + constMeta: kCrateApiOnChainLdkOnChainPaymentSendToAddressConstMeta, argValues: [that, address, amountSats], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkOnChainPaymentSendToAddressConstMeta => + TaskConstMeta get kCrateApiOnChainLdkOnChainPaymentSendToAddressConstMeta => const TaskConstMeta( debugName: "ldk_on_chain_payment_send_to_address", argNames: ["that", "address", "amountSats"], ); @override - Future ldkSpontaneousPaymentSend( + Future crateApiSpontaneousLdkSpontaneousPaymentSend( {required LdkSpontaneousPayment that, - required int amountMsat, - required PublicKey nodeId, - dynamic hint}) { + required BigInt amountMsat, + required PublicKey nodeId}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_spontaneous_payment(that); var arg1 = cst_encode_u_64(amountMsat); var arg2 = cst_encode_box_autoadd_public_key(nodeId); - return wire.wire_ldk_spontaneous_payment_send(port_, arg0, arg1, arg2); + return wire.wire__crate__api__spontaneous__ldk_spontaneous_payment_send( + port_, arg0, arg1, arg2); }, codec: DcoCodec( decodeSuccessData: dco_decode_payment_id, - decodeErrorData: dco_decode_node_exception, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkSpontaneousPaymentSendConstMeta, + constMeta: kCrateApiSpontaneousLdkSpontaneousPaymentSendConstMeta, argValues: [that, amountMsat, nodeId], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkSpontaneousPaymentSendConstMeta => const TaskConstMeta( + TaskConstMeta get kCrateApiSpontaneousLdkSpontaneousPaymentSendConstMeta => + const TaskConstMeta( debugName: "ldk_spontaneous_payment_send", argNames: ["that", "amountMsat", "nodeId"], ); @override - Future ldkSpontaneousPaymentSendProbes( + Future crateApiSpontaneousLdkSpontaneousPaymentSendProbes( {required LdkSpontaneousPayment that, - required int amountMsat, - required PublicKey nodeId, - dynamic hint}) { + required BigInt amountMsat, + required PublicKey nodeId}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_spontaneous_payment(that); var arg1 = cst_encode_u_64(amountMsat); var arg2 = cst_encode_box_autoadd_public_key(nodeId); - return wire.wire_ldk_spontaneous_payment_send_probes( - port_, arg0, arg1, arg2); + return wire + .wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes( + port_, arg0, arg1, arg2); }, codec: DcoCodec( decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkSpontaneousPaymentSendProbesConstMeta, + constMeta: kCrateApiSpontaneousLdkSpontaneousPaymentSendProbesConstMeta, argValues: [that, amountMsat, nodeId], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkSpontaneousPaymentSendProbesConstMeta => - const TaskConstMeta( - debugName: "ldk_spontaneous_payment_send_probes", - argNames: ["that", "amountMsat", "nodeId"], - ); + TaskConstMeta + get kCrateApiSpontaneousLdkSpontaneousPaymentSendProbesConstMeta => + const TaskConstMeta( + debugName: "ldk_spontaneous_payment_send_probes", + argNames: ["that", "amountMsat", "nodeId"], + ); + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_ArcBolt12Payment => wire + .rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_ArcBolt12Payment => wire + .rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment; RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_Node => wire.rust_arc_increment_strong_count_RustOpaque_Node; @@ -1591,77 +2040,128 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_NodeBuilder => wire - .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder; + .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder; RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_NodeBuilder => wire - .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder; + .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder; RustArcIncrementStrongCountFnType - get rust_arc_increment_strong_count_LdkNodePaymentBolt11Payment => wire + get rust_arc_increment_strong_count_Builder => + wire.rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilder; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_Builder => + wire.rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilder; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_NetworkGraph => wire + .rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraph; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_NetworkGraph => wire + .rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraph; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_Bolt11Payment => wire .rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment; RustArcDecrementStrongCountFnType - get rust_arc_decrement_strong_count_LdkNodePaymentBolt11Payment => wire + get rust_arc_decrement_strong_count_Bolt11Payment => wire .rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment; RustArcIncrementStrongCountFnType - get rust_arc_increment_strong_count_LdkNodePaymentOnchainPayment => wire + get rust_arc_increment_strong_count_OnchainPayment => wire .rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment; RustArcDecrementStrongCountFnType - get rust_arc_decrement_strong_count_LdkNodePaymentOnchainPayment => wire + get rust_arc_decrement_strong_count_OnchainPayment => wire .rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment; RustArcIncrementStrongCountFnType - get rust_arc_increment_strong_count_LdkNodePaymentSpontaneousPayment => wire + get rust_arc_increment_strong_count_SpontaneousPayment => wire .rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment; RustArcDecrementStrongCountFnType - get rust_arc_decrement_strong_count_LdkNodePaymentSpontaneousPayment => wire + get rust_arc_decrement_strong_count_SpontaneousPayment => wire .rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment; @protected NodeBuilder - dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return NodeBuilderImpl.frbInternalDcoDecode(raw as List); + } + + @protected + NodeBuilder + dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return NodeBuilderImpl.frbInternalDcoDecode(raw as List); + } + + @protected + NodeBuilder + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return NodeBuilder.dcoDecode(raw as List); + return NodeBuilderImpl.frbInternalDcoDecode(raw as List); + } + + @protected + ArcBolt12Payment dco_decode_RustOpaque_Arcldk_nodepaymentBolt12Payment( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return ArcBolt12PaymentImpl.frbInternalDcoDecode(raw as List); } @protected Node dco_decode_RustOpaque_Node(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return Node.dcoDecode(raw as List); + return NodeImpl.frbInternalDcoDecode(raw as List); } @protected NodeBuilder - dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return NodeBuilder.dcoDecode(raw as List); + return NodeBuilderImpl.frbInternalDcoDecode(raw as List); + } + + @protected + Builder dco_decode_RustOpaque_ldk_nodeBuilder(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return BuilderImpl.frbInternalDcoDecode(raw as List); + } + + @protected + NetworkGraph dco_decode_RustOpaque_ldk_nodegraphNetworkGraph(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return NetworkGraphImpl.frbInternalDcoDecode(raw as List); } @protected - LdkNodePaymentBolt11Payment - dco_decode_RustOpaque_ldk_nodepaymentBolt11Payment(dynamic raw) { + Bolt11Payment dco_decode_RustOpaque_ldk_nodepaymentBolt11Payment( + dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return LdkNodePaymentBolt11Payment.dcoDecode(raw as List); + return Bolt11PaymentImpl.frbInternalDcoDecode(raw as List); } @protected - LdkNodePaymentOnchainPayment - dco_decode_RustOpaque_ldk_nodepaymentOnchainPayment(dynamic raw) { + OnchainPayment dco_decode_RustOpaque_ldk_nodepaymentOnchainPayment( + dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return LdkNodePaymentOnchainPayment.dcoDecode(raw as List); + return OnchainPaymentImpl.frbInternalDcoDecode(raw as List); } @protected - LdkNodePaymentSpontaneousPayment - dco_decode_RustOpaque_ldk_nodepaymentSpontaneousPayment(dynamic raw) { + SpontaneousPayment dco_decode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return LdkNodePaymentSpontaneousPayment.dcoDecode(raw as List); + return SpontaneousPaymentImpl.frbInternalDcoDecode(raw as List); } @protected @@ -1681,6 +2181,18 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { ); } + @protected + AnchorChannelsConfig dco_decode_anchor_channels_config(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 AnchorChannelsConfig( + trustedPeersNoReserve: dco_decode_list_public_key(arr[0]), + perChannelReserveSats: dco_decode_u_64(arr[1]), + ); + } + @protected BalanceDetails dco_decode_balance_details(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1720,6 +2232,46 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { ); } + @protected + Bolt12Invoice dco_decode_bolt_12_invoice(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 Bolt12Invoice( + data: dco_decode_list_prim_u_8_strict(arr[0]), + ); + } + + @protected + Bolt12ParseError dco_decode_bolt_12_parse_error(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + switch (raw[0]) { + case 0: + return Bolt12ParseError_InvalidContinuation(); + case 1: + return Bolt12ParseError_InvalidBech32Hrp(); + case 2: + return Bolt12ParseError_Bech32( + dco_decode_String(raw[1]), + ); + case 3: + return Bolt12ParseError_Decode( + dco_decode_box_autoadd_decode_error(raw[1]), + ); + case 4: + return Bolt12ParseError_InvalidSemantics( + dco_decode_String(raw[1]), + ); + case 5: + return Bolt12ParseError_InvalidSignature( + dco_decode_String(raw[1]), + ); + default: + throw Exception("unreachable"); + } + } + @protected bool dco_decode_bool(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1732,12 +2284,25 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return dco_decode_address(raw); } + @protected + AnchorChannelsConfig dco_decode_box_autoadd_anchor_channels_config( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_anchor_channels_config(raw); + } + @protected Bolt11Invoice dco_decode_box_autoadd_bolt_11_invoice(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs return dco_decode_bolt_11_invoice(raw); } + @protected + Bolt12ParseError dco_decode_box_autoadd_bolt_12_parse_error(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_bolt_12_parse_error(raw); + } + @protected ChainDataSourceConfig dco_decode_box_autoadd_chain_data_source_config( dynamic raw) { @@ -1757,6 +2322,18 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return dco_decode_channel_id(raw); } + @protected + ChannelInfo dco_decode_box_autoadd_channel_info(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_channel_info(raw); + } + + @protected + ChannelUpdateInfo dco_decode_box_autoadd_channel_update_info(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_channel_update_info(raw); + } + @protected ClosureReason dco_decode_box_autoadd_closure_reason(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1769,6 +2346,12 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return dco_decode_config(raw); } + @protected + DecodeError dco_decode_box_autoadd_decode_error(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_decode_error(raw); + } + @protected EntropySourceConfig dco_decode_box_autoadd_entropy_source_config( dynamic raw) { @@ -1794,12 +2377,24 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return dco_decode_ldk_bolt_11_payment(raw); } + @protected + LdkBolt12Payment dco_decode_box_autoadd_ldk_bolt_12_payment(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_ldk_bolt_12_payment(raw); + } + @protected LdkMnemonic dco_decode_box_autoadd_ldk_mnemonic(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs return dco_decode_ldk_mnemonic(raw); } + @protected + LdkNetworkGraph dco_decode_box_autoadd_ldk_network_graph(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_ldk_network_graph(raw); + } + @protected LdkNode dco_decode_box_autoadd_ldk_node(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1839,6 +2434,18 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return dco_decode_max_dust_htlc_exposure(raw); } + @protected + Offer dco_decode_box_autoadd_offer(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_offer(raw); + } + + @protected + OfferId dco_decode_box_autoadd_offer_id(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_offer_id(raw); + } + @protected OutPoint dco_decode_box_autoadd_out_point(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1888,6 +2495,12 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return dco_decode_public_key(raw); } + @protected + Refund dco_decode_box_autoadd_refund(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_refund(raw); + } + @protected SocketAddress dco_decode_box_autoadd_socket_address(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1913,7 +2526,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - int dco_decode_box_autoadd_u_64(dynamic raw) { + BigInt dco_decode_box_autoadd_u_64(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs return dco_decode_u_64(raw); } @@ -1924,12 +2537,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return dco_decode_user_channel_id(raw); } - @protected - BuilderException dco_decode_builder_exception(dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - return BuilderException.values[raw as int]; - } - @protected ChainDataSourceConfig dco_decode_chain_data_source_config(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -2014,6 +2621,37 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { ); } + @protected + ChannelInfo dco_decode_channel_info(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 ChannelInfo( + nodeOne: dco_decode_node_id(arr[0]), + oneToTwo: dco_decode_opt_box_autoadd_channel_update_info(arr[1]), + nodeTwo: dco_decode_node_id(arr[2]), + twoToOne: dco_decode_opt_box_autoadd_channel_update_info(arr[3]), + capacitySats: dco_decode_opt_box_autoadd_u_64(arr[4]), + ); + } + + @protected + ChannelUpdateInfo dco_decode_channel_update_info(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + final arr = raw as List; + if (arr.length != 6) + throw Exception('unexpected arr length: expect 6 but see ${arr.length}'); + return ChannelUpdateInfo( + lastUpdate: dco_decode_u_32(arr[0]), + enabled: dco_decode_bool(arr[1]), + cltvExpiryDelta: dco_decode_u_16(arr[2]), + htlcMinimumMsat: dco_decode_u_64(arr[3]), + htlcMaximumMsat: dco_decode_u_64(arr[4]), + fees: dco_decode_routing_fees(arr[5]), + ); + } + @protected ClosureReason dco_decode_closure_reason(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -2057,8 +2695,8 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { 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) - throw Exception('unexpected arr length: expect 11 but see ${arr.length}'); + if (arr.length != 12) + throw Exception('unexpected arr length: expect 12 but see ${arr.length}'); return Config( storageDirPath: dco_decode_String(arr[0]), logDirPath: dco_decode_opt_String(arr[1]), @@ -2071,9 +2709,38 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { trustedPeers0Conf: dco_decode_list_public_key(arr[8]), probingLiquidityLimitMultiplier: dco_decode_u_64(arr[9]), logLevel: dco_decode_log_level(arr[10]), + anchorChannelsConfig: + dco_decode_opt_box_autoadd_anchor_channels_config(arr[11]), ); } + @protected + DecodeError dco_decode_decode_error(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + switch (raw[0]) { + case 0: + return DecodeError_UnknownVersion(); + case 1: + return DecodeError_UnknownRequiredFeature(); + case 2: + return DecodeError_InvalidValue(); + case 3: + return DecodeError_ShortRead(); + case 4: + return DecodeError_BadLengthDescriptor(); + case 5: + return DecodeError_Io( + dco_decode_String(raw[1]), + ); + case 6: + return DecodeError_UnsupportedCompression(); + case 7: + return DecodeError_DangerousValue(); + default: + throw Exception("unreachable"); + } + } + @protected EntropySourceConfig dco_decode_entropy_source_config(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -2101,24 +2768,31 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { // Codec=Dco (DartCObject based), see doc to use other codecs switch (raw[0]) { case 0: + return Event_PaymentClaimable( + paymentId: dco_decode_box_autoadd_payment_id(raw[1]), + paymentHash: dco_decode_box_autoadd_payment_hash(raw[2]), + claimableAmountMsat: dco_decode_u_64(raw[3]), + claimDeadline: dco_decode_opt_box_autoadd_u_32(raw[4]), + ); + case 1: return Event_PaymentSuccessful( paymentId: dco_decode_opt_box_autoadd_payment_id(raw[1]), paymentHash: dco_decode_box_autoadd_payment_hash(raw[2]), feePaidMsat: dco_decode_opt_box_autoadd_u_64(raw[3]), ); - case 1: + case 2: return Event_PaymentFailed( paymentId: dco_decode_opt_box_autoadd_payment_id(raw[1]), paymentHash: dco_decode_box_autoadd_payment_hash(raw[2]), reason: dco_decode_opt_box_autoadd_payment_failure_reason(raw[3]), ); - case 2: + case 3: return Event_PaymentReceived( paymentId: dco_decode_opt_box_autoadd_payment_id(raw[1]), paymentHash: dco_decode_box_autoadd_payment_hash(raw[2]), amountMsat: dco_decode_u_64(raw[3]), ); - case 3: + case 4: return Event_ChannelPending( channelId: dco_decode_box_autoadd_channel_id(raw[1]), userChannelId: dco_decode_box_autoadd_user_channel_id(raw[2]), @@ -2126,13 +2800,13 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { counterpartyNodeId: dco_decode_box_autoadd_public_key(raw[4]), fundingTxo: dco_decode_box_autoadd_out_point(raw[5]), ); - case 4: + case 5: return Event_ChannelReady( 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: + case 6: return Event_ChannelClosed( channelId: dco_decode_box_autoadd_channel_id(raw[1]), userChannelId: dco_decode_box_autoadd_user_channel_id(raw[2]), @@ -2176,6 +2850,23 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { ); } + @protected + LdkBolt12Payment dco_decode_ldk_bolt_12_payment(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 LdkBolt12Payment( + ptr: dco_decode_RustOpaque_Arcldk_nodepaymentBolt12Payment(arr[0]), + ); + } + + @protected + LdkBuilderError dco_decode_ldk_builder_error(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return LdkBuilderError.values[raw as int]; + } + @protected LdkMnemonic dco_decode_ldk_mnemonic(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -2187,6 +2878,17 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { ); } + @protected + LdkNetworkGraph dco_decode_ldk_network_graph(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 LdkNetworkGraph( + inner: dco_decode_RustOpaque_ldk_nodegraphNetworkGraph(arr[0]), + ); + } + @protected LdkNode dco_decode_ldk_node(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -2198,6 +2900,117 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { ); } + @protected + LdkNodeError dco_decode_ldk_node_error(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + switch (raw[0]) { + case 0: + return LdkNodeError_InvalidTxid(); + case 1: + return LdkNodeError_AlreadyRunning(); + case 2: + return LdkNodeError_NotRunning(); + case 3: + return LdkNodeError_OnchainTxCreationFailed(); + case 4: + return LdkNodeError_ConnectionFailed(); + case 5: + return LdkNodeError_InvoiceCreationFailed(); + case 6: + return LdkNodeError_PaymentSendingFailed(); + case 7: + return LdkNodeError_ProbeSendingFailed(); + case 8: + return LdkNodeError_ChannelCreationFailed(); + case 9: + return LdkNodeError_ChannelClosingFailed(); + case 10: + return LdkNodeError_ChannelConfigUpdateFailed(); + case 11: + return LdkNodeError_PersistenceFailed(); + case 12: + return LdkNodeError_WalletOperationFailed(); + case 13: + return LdkNodeError_OnchainTxSigningFailed(); + case 14: + return LdkNodeError_MessageSigningFailed(); + case 15: + return LdkNodeError_TxSyncFailed(); + case 16: + return LdkNodeError_GossipUpdateFailed(); + case 17: + return LdkNodeError_InvalidAddress(); + case 18: + return LdkNodeError_InvalidSocketAddress(); + case 19: + return LdkNodeError_InvalidPublicKey(); + case 20: + return LdkNodeError_InvalidSecretKey(); + case 21: + return LdkNodeError_InvalidPaymentHash(); + case 22: + return LdkNodeError_InvalidPaymentPreimage(); + case 23: + return LdkNodeError_InvalidPaymentSecret(); + case 24: + return LdkNodeError_InvalidAmount(); + case 25: + return LdkNodeError_InvalidInvoice(); + case 26: + return LdkNodeError_InvalidChannelId(); + case 27: + return LdkNodeError_InvalidNetwork(); + case 28: + return LdkNodeError_DuplicatePayment(); + case 29: + return LdkNodeError_InsufficientFunds(); + case 30: + return LdkNodeError_FeerateEstimationUpdateFailed(); + case 31: + return LdkNodeError_LiquidityRequestFailed(); + case 32: + return LdkNodeError_LiquiditySourceUnavailable(); + case 33: + return LdkNodeError_LiquidityFeeTooHigh(); + case 34: + return LdkNodeError_InvalidPaymentId(); + case 35: + return LdkNodeError_Decode( + dco_decode_box_autoadd_decode_error(raw[1]), + ); + case 36: + return LdkNodeError_Bolt12Parse( + dco_decode_box_autoadd_bolt_12_parse_error(raw[1]), + ); + case 37: + return LdkNodeError_InvoiceRequestCreationFailed(); + case 38: + return LdkNodeError_OfferCreationFailed(); + case 39: + return LdkNodeError_RefundCreationFailed(); + case 40: + return LdkNodeError_FeerateEstimationUpdateTimeout(); + case 41: + return LdkNodeError_WalletOperationTimeout(); + case 42: + return LdkNodeError_TxSyncTimeout(); + case 43: + return LdkNodeError_GossipUpdateTimeout(); + case 44: + return LdkNodeError_InvalidOfferId(); + case 45: + return LdkNodeError_InvalidNodeId(); + case 46: + return LdkNodeError_InvalidOffer(); + case 47: + return LdkNodeError_InvalidRefund(); + case 48: + return LdkNodeError_UnsupportedCurrency(); + default: + throw Exception("unreachable"); + } + } + @protected LdkOnChainPayment dco_decode_ldk_on_chain_payment(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -2297,6 +3110,12 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return (raw as List).map(dco_decode_lightning_balance).toList(); } + @protected + List dco_decode_list_node_id(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return (raw as List).map(dco_decode_node_id).toList(); + } + @protected List dco_decode_list_payment_details(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -2317,6 +3136,12 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { .toList(); } + @protected + Uint64List dco_decode_list_prim_u_64_strict(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dcoDecodeUint64List(raw); + } + @protected List dco_decode_list_prim_u_8_loose(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -2383,9 +3208,14 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - NodeException dco_decode_node_exception(dynamic raw) { + NodeId dco_decode_node_id(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return NodeException.values[raw as int]; + final arr = raw as List; + if (arr.length != 1) + throw Exception('unexpected arr length: expect 1 but see ${arr.length}'); + return NodeId( + compressed: dco_decode_list_prim_u_8_strict(arr[0]), + ); } @protected @@ -2408,12 +3238,43 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { ); } + @protected + Offer dco_decode_offer(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 Offer( + s: dco_decode_String(arr[0]), + ); + } + + @protected + OfferId dco_decode_offer_id(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 OfferId( + field0: dco_decode_u_8_array_32(arr[0]), + ); + } + @protected String? dco_decode_opt_String(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs return raw == null ? null : dco_decode_String(raw); } + @protected + AnchorChannelsConfig? dco_decode_opt_box_autoadd_anchor_channels_config( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw == null + ? null + : dco_decode_box_autoadd_anchor_channels_config(raw); + } + @protected ChainDataSourceConfig? dco_decode_opt_box_autoadd_chain_data_source_config( dynamic raw) { @@ -2435,6 +3296,19 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return raw == null ? null : dco_decode_box_autoadd_channel_id(raw); } + @protected + ChannelInfo? dco_decode_opt_box_autoadd_channel_info(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw == null ? null : dco_decode_box_autoadd_channel_info(raw); + } + + @protected + ChannelUpdateInfo? dco_decode_opt_box_autoadd_channel_update_info( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw == null ? null : dco_decode_box_autoadd_channel_update_info(raw); + } + @protected ClosureReason? dco_decode_opt_box_autoadd_closure_reason(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -2504,6 +3378,12 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { : dco_decode_box_autoadd_payment_failure_reason(raw); } + @protected + PaymentHash? dco_decode_opt_box_autoadd_payment_hash(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw == null ? null : dco_decode_box_autoadd_payment_hash(raw); + } + @protected PaymentId? dco_decode_opt_box_autoadd_payment_id(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -2541,7 +3421,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - int? dco_decode_opt_box_autoadd_u_64(dynamic raw) { + BigInt? dco_decode_opt_box_autoadd_u_64(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs return raw == null ? null : dco_decode_box_autoadd_u_64(raw); } @@ -2637,6 +3517,19 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { hash: dco_decode_box_autoadd_payment_hash(raw[1]), preimage: dco_decode_opt_box_autoadd_payment_preimage(raw[2]), ); + case 4: + return PaymentKind_Bolt12Offer( + hash: dco_decode_opt_box_autoadd_payment_hash(raw[1]), + preimage: dco_decode_opt_box_autoadd_payment_preimage(raw[2]), + secret: dco_decode_opt_box_autoadd_payment_secret(raw[3]), + offerId: dco_decode_box_autoadd_offer_id(raw[4]), + ); + case 5: + return PaymentKind_Bolt12Refund( + hash: dco_decode_opt_box_autoadd_payment_hash(raw[1]), + preimage: dco_decode_opt_box_autoadd_payment_preimage(raw[2]), + secret: dco_decode_opt_box_autoadd_payment_secret(raw[3]), + ); default: throw Exception("unreachable"); } @@ -2738,6 +3631,29 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { ); } + @protected + Refund dco_decode_refund(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 Refund( + s: dco_decode_String(arr[0]), + ); + } + + @protected + RoutingFees dco_decode_routing_fees(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 RoutingFees( + baseMsat: dco_decode_u_32(arr[0]), + proportionalMillionths: dco_decode_u_32(arr[1]), + ); + } + @protected SocketAddress dco_decode_socket_address(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -2797,9 +3713,9 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - int dco_decode_u_64(dynamic raw) { + BigInt dco_decode_u_64(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dcoDecodeI64OrU64(raw); + return dcoDecodeU64(raw); } @protected @@ -2856,60 +3772,98 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - int dco_decode_usize(dynamic raw) { + BigInt dco_decode_usize(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dcoDecodeI64OrU64(raw); + return dcoDecodeU64(raw); } @protected NodeBuilder - sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return NodeBuilder.sseDecode( + return NodeBuilderImpl.frbInternalSseDecode( sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); } @protected - Node sse_decode_RustOpaque_Node(SseDeserializer deserializer) { + NodeBuilder + sse_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return Node.sseDecode( + return NodeBuilderImpl.frbInternalSseDecode( sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); } @protected NodeBuilder - sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return NodeBuilder.sseDecode( + return NodeBuilderImpl.frbInternalSseDecode( sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); } @protected - LdkNodePaymentBolt11Payment - sse_decode_RustOpaque_ldk_nodepaymentBolt11Payment( - SseDeserializer deserializer) { + ArcBolt12Payment sse_decode_RustOpaque_Arcldk_nodepaymentBolt12Payment( + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return LdkNodePaymentBolt11Payment.sseDecode( + return ArcBolt12PaymentImpl.frbInternalSseDecode( sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); } @protected - LdkNodePaymentOnchainPayment - sse_decode_RustOpaque_ldk_nodepaymentOnchainPayment( - SseDeserializer deserializer) { + Node sse_decode_RustOpaque_Node(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return LdkNodePaymentOnchainPayment.sseDecode( + return NodeImpl.frbInternalSseDecode( sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); } @protected - LdkNodePaymentSpontaneousPayment - sse_decode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + NodeBuilder + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return LdkNodePaymentSpontaneousPayment.sseDecode( + return NodeBuilderImpl.frbInternalSseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Builder sse_decode_RustOpaque_ldk_nodeBuilder(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return BuilderImpl.frbInternalSseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + NetworkGraph sse_decode_RustOpaque_ldk_nodegraphNetworkGraph( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return NetworkGraphImpl.frbInternalSseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Bolt11Payment sse_decode_RustOpaque_ldk_nodepaymentBolt11Payment( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return Bolt11PaymentImpl.frbInternalSseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + OnchainPayment sse_decode_RustOpaque_ldk_nodepaymentOnchainPayment( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return OnchainPaymentImpl.frbInternalSseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + SpontaneousPayment sse_decode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return SpontaneousPaymentImpl.frbInternalSseDecode( sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); } @@ -2927,6 +3881,17 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return Address(s: var_s); } + @protected + AnchorChannelsConfig sse_decode_anchor_channels_config( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_trustedPeersNoReserve = sse_decode_list_public_key(deserializer); + var var_perChannelReserveSats = sse_decode_u_64(deserializer); + return AnchorChannelsConfig( + trustedPeersNoReserve: var_trustedPeersNoReserve, + perChannelReserveSats: var_perChannelReserveSats); + } + @protected BalanceDetails sse_decode_balance_details(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -2960,6 +3925,41 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return Bolt11Invoice(signedRawInvoice: var_signedRawInvoice); } + @protected + Bolt12Invoice sse_decode_bolt_12_invoice(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_data = sse_decode_list_prim_u_8_strict(deserializer); + return Bolt12Invoice(data: var_data); + } + + @protected + Bolt12ParseError sse_decode_bolt_12_parse_error( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + var tag_ = sse_decode_i_32(deserializer); + switch (tag_) { + case 0: + return Bolt12ParseError_InvalidContinuation(); + case 1: + return Bolt12ParseError_InvalidBech32Hrp(); + case 2: + var var_field0 = sse_decode_String(deserializer); + return Bolt12ParseError_Bech32(var_field0); + case 3: + var var_field0 = sse_decode_box_autoadd_decode_error(deserializer); + return Bolt12ParseError_Decode(var_field0); + case 4: + var var_field0 = sse_decode_String(deserializer); + return Bolt12ParseError_InvalidSemantics(var_field0); + case 5: + var var_field0 = sse_decode_String(deserializer); + return Bolt12ParseError_InvalidSignature(var_field0); + default: + throw UnimplementedError(''); + } + } + @protected bool sse_decode_bool(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -2972,6 +3972,13 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return (sse_decode_address(deserializer)); } + @protected + AnchorChannelsConfig sse_decode_box_autoadd_anchor_channels_config( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_anchor_channels_config(deserializer)); + } + @protected Bolt11Invoice sse_decode_box_autoadd_bolt_11_invoice( SseDeserializer deserializer) { @@ -2979,6 +3986,13 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return (sse_decode_bolt_11_invoice(deserializer)); } + @protected + Bolt12ParseError sse_decode_box_autoadd_bolt_12_parse_error( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_bolt_12_parse_error(deserializer)); + } + @protected ChainDataSourceConfig sse_decode_box_autoadd_chain_data_source_config( SseDeserializer deserializer) { @@ -2999,6 +4013,20 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return (sse_decode_channel_id(deserializer)); } + @protected + ChannelInfo sse_decode_box_autoadd_channel_info( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_channel_info(deserializer)); + } + + @protected + ChannelUpdateInfo sse_decode_box_autoadd_channel_update_info( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_channel_update_info(deserializer)); + } + @protected ClosureReason sse_decode_box_autoadd_closure_reason( SseDeserializer deserializer) { @@ -3012,6 +4040,13 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return (sse_decode_config(deserializer)); } + @protected + DecodeError sse_decode_box_autoadd_decode_error( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_decode_error(deserializer)); + } + @protected EntropySourceConfig sse_decode_box_autoadd_entropy_source_config( SseDeserializer deserializer) { @@ -3039,6 +4074,13 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return (sse_decode_ldk_bolt_11_payment(deserializer)); } + @protected + LdkBolt12Payment sse_decode_box_autoadd_ldk_bolt_12_payment( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_ldk_bolt_12_payment(deserializer)); + } + @protected LdkMnemonic sse_decode_box_autoadd_ldk_mnemonic( SseDeserializer deserializer) { @@ -3046,6 +4088,13 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return (sse_decode_ldk_mnemonic(deserializer)); } + @protected + LdkNetworkGraph sse_decode_box_autoadd_ldk_network_graph( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_ldk_network_graph(deserializer)); + } + @protected LdkNode sse_decode_box_autoadd_ldk_node(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -3087,6 +4136,18 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return (sse_decode_max_dust_htlc_exposure(deserializer)); } + @protected + Offer sse_decode_box_autoadd_offer(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_offer(deserializer)); + } + + @protected + OfferId sse_decode_box_autoadd_offer_id(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_offer_id(deserializer)); + } + @protected OutPoint sse_decode_box_autoadd_out_point(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -3135,9 +4196,15 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - PublicKey sse_decode_box_autoadd_public_key(SseDeserializer deserializer) { + PublicKey sse_decode_box_autoadd_public_key(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_public_key(deserializer)); + } + + @protected + Refund sse_decode_box_autoadd_refund(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_public_key(deserializer)); + return (sse_decode_refund(deserializer)); } @protected @@ -3166,7 +4233,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - int sse_decode_box_autoadd_u_64(SseDeserializer deserializer) { + BigInt sse_decode_box_autoadd_u_64(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs return (sse_decode_u_64(deserializer)); } @@ -3178,13 +4245,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return (sse_decode_user_channel_id(deserializer)); } - @protected - 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 BuilderException.values[inner]; - } - @protected ChainDataSourceConfig sse_decode_chain_data_source_config( SseDeserializer deserializer) { @@ -3306,6 +4366,43 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return ChannelId(data: var_data); } + @protected + ChannelInfo sse_decode_channel_info(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_nodeOne = sse_decode_node_id(deserializer); + var var_oneToTwo = + sse_decode_opt_box_autoadd_channel_update_info(deserializer); + var var_nodeTwo = sse_decode_node_id(deserializer); + var var_twoToOne = + sse_decode_opt_box_autoadd_channel_update_info(deserializer); + var var_capacitySats = sse_decode_opt_box_autoadd_u_64(deserializer); + return ChannelInfo( + nodeOne: var_nodeOne, + oneToTwo: var_oneToTwo, + nodeTwo: var_nodeTwo, + twoToOne: var_twoToOne, + capacitySats: var_capacitySats); + } + + @protected + ChannelUpdateInfo sse_decode_channel_update_info( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_lastUpdate = sse_decode_u_32(deserializer); + var var_enabled = sse_decode_bool(deserializer); + var var_cltvExpiryDelta = sse_decode_u_16(deserializer); + var var_htlcMinimumMsat = sse_decode_u_64(deserializer); + var var_htlcMaximumMsat = sse_decode_u_64(deserializer); + var var_fees = sse_decode_routing_fees(deserializer); + return ChannelUpdateInfo( + lastUpdate: var_lastUpdate, + enabled: var_enabled, + cltvExpiryDelta: var_cltvExpiryDelta, + htlcMinimumMsat: var_htlcMinimumMsat, + htlcMaximumMsat: var_htlcMaximumMsat, + fees: var_fees); + } + @protected ClosureReason sse_decode_closure_reason(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -3360,6 +4457,8 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { var var_trustedPeers0Conf = sse_decode_list_public_key(deserializer); var var_probingLiquidityLimitMultiplier = sse_decode_u_64(deserializer); var var_logLevel = sse_decode_log_level(deserializer); + var var_anchorChannelsConfig = + sse_decode_opt_box_autoadd_anchor_channels_config(deserializer); return Config( storageDirPath: var_storageDirPath, logDirPath: var_logDirPath, @@ -3371,7 +4470,36 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { feeRateCacheUpdateIntervalSecs: var_feeRateCacheUpdateIntervalSecs, trustedPeers0Conf: var_trustedPeers0Conf, probingLiquidityLimitMultiplier: var_probingLiquidityLimitMultiplier, - logLevel: var_logLevel); + logLevel: var_logLevel, + anchorChannelsConfig: var_anchorChannelsConfig); + } + + @protected + DecodeError sse_decode_decode_error(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + var tag_ = sse_decode_i_32(deserializer); + switch (tag_) { + case 0: + return DecodeError_UnknownVersion(); + case 1: + return DecodeError_UnknownRequiredFeature(); + case 2: + return DecodeError_InvalidValue(); + case 3: + return DecodeError_ShortRead(); + case 4: + return DecodeError_BadLengthDescriptor(); + case 5: + var var_field0 = sse_decode_String(deserializer); + return DecodeError_Io(var_field0); + case 6: + return DecodeError_UnsupportedCompression(); + case 7: + return DecodeError_DangerousValue(); + default: + throw UnimplementedError(''); + } } @protected @@ -3404,6 +4532,16 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { var tag_ = sse_decode_i_32(deserializer); switch (tag_) { case 0: + var var_paymentId = sse_decode_box_autoadd_payment_id(deserializer); + var var_paymentHash = sse_decode_box_autoadd_payment_hash(deserializer); + var var_claimableAmountMsat = sse_decode_u_64(deserializer); + var var_claimDeadline = sse_decode_opt_box_autoadd_u_32(deserializer); + return Event_PaymentClaimable( + paymentId: var_paymentId, + paymentHash: var_paymentHash, + claimableAmountMsat: var_claimableAmountMsat, + claimDeadline: var_claimDeadline); + case 1: var var_paymentId = sse_decode_opt_box_autoadd_payment_id(deserializer); var var_paymentHash = sse_decode_box_autoadd_payment_hash(deserializer); var var_feePaidMsat = sse_decode_opt_box_autoadd_u_64(deserializer); @@ -3411,7 +4549,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { paymentId: var_paymentId, paymentHash: var_paymentHash, feePaidMsat: var_feePaidMsat); - case 1: + case 2: var var_paymentId = sse_decode_opt_box_autoadd_payment_id(deserializer); var var_paymentHash = sse_decode_box_autoadd_payment_hash(deserializer); var var_reason = @@ -3420,7 +4558,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { paymentId: var_paymentId, paymentHash: var_paymentHash, reason: var_reason); - case 2: + case 3: var var_paymentId = sse_decode_opt_box_autoadd_payment_id(deserializer); var var_paymentHash = sse_decode_box_autoadd_payment_hash(deserializer); var var_amountMsat = sse_decode_u_64(deserializer); @@ -3428,7 +4566,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { paymentId: var_paymentId, paymentHash: var_paymentHash, amountMsat: var_amountMsat); - case 3: + case 4: var var_channelId = sse_decode_box_autoadd_channel_id(deserializer); var var_userChannelId = sse_decode_box_autoadd_user_channel_id(deserializer); @@ -3443,7 +4581,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { formerTemporaryChannelId: var_formerTemporaryChannelId, counterpartyNodeId: var_counterpartyNodeId, fundingTxo: var_fundingTxo); - case 4: + case 5: var var_channelId = sse_decode_box_autoadd_channel_id(deserializer); var var_userChannelId = sse_decode_box_autoadd_user_channel_id(deserializer); @@ -3453,7 +4591,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { channelId: var_channelId, userChannelId: var_userChannelId, counterpartyNodeId: var_counterpartyNodeId); - case 5: + case 6: var var_channelId = sse_decode_box_autoadd_channel_id(deserializer); var var_userChannelId = sse_decode_box_autoadd_user_channel_id(deserializer); @@ -3503,6 +4641,22 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return LdkBolt11Payment(ptr: var_ptr); } + @protected + LdkBolt12Payment sse_decode_ldk_bolt_12_payment( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_ptr = + sse_decode_RustOpaque_Arcldk_nodepaymentBolt12Payment(deserializer); + return LdkBolt12Payment(ptr: var_ptr); + } + + @protected + LdkBuilderError sse_decode_ldk_builder_error(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var inner = sse_decode_i_32(deserializer); + return LdkBuilderError.values[inner]; + } + @protected LdkMnemonic sse_decode_ldk_mnemonic(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -3510,6 +4664,14 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return LdkMnemonic(seedPhrase: var_seedPhrase); } + @protected + LdkNetworkGraph sse_decode_ldk_network_graph(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_inner = + sse_decode_RustOpaque_ldk_nodegraphNetworkGraph(deserializer); + return LdkNetworkGraph(inner: var_inner); + } + @protected LdkNode sse_decode_ldk_node(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -3517,6 +4679,118 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return LdkNode(ptr: var_ptr); } + @protected + LdkNodeError sse_decode_ldk_node_error(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + var tag_ = sse_decode_i_32(deserializer); + switch (tag_) { + case 0: + return LdkNodeError_InvalidTxid(); + case 1: + return LdkNodeError_AlreadyRunning(); + case 2: + return LdkNodeError_NotRunning(); + case 3: + return LdkNodeError_OnchainTxCreationFailed(); + case 4: + return LdkNodeError_ConnectionFailed(); + case 5: + return LdkNodeError_InvoiceCreationFailed(); + case 6: + return LdkNodeError_PaymentSendingFailed(); + case 7: + return LdkNodeError_ProbeSendingFailed(); + case 8: + return LdkNodeError_ChannelCreationFailed(); + case 9: + return LdkNodeError_ChannelClosingFailed(); + case 10: + return LdkNodeError_ChannelConfigUpdateFailed(); + case 11: + return LdkNodeError_PersistenceFailed(); + case 12: + return LdkNodeError_WalletOperationFailed(); + case 13: + return LdkNodeError_OnchainTxSigningFailed(); + case 14: + return LdkNodeError_MessageSigningFailed(); + case 15: + return LdkNodeError_TxSyncFailed(); + case 16: + return LdkNodeError_GossipUpdateFailed(); + case 17: + return LdkNodeError_InvalidAddress(); + case 18: + return LdkNodeError_InvalidSocketAddress(); + case 19: + return LdkNodeError_InvalidPublicKey(); + case 20: + return LdkNodeError_InvalidSecretKey(); + case 21: + return LdkNodeError_InvalidPaymentHash(); + case 22: + return LdkNodeError_InvalidPaymentPreimage(); + case 23: + return LdkNodeError_InvalidPaymentSecret(); + case 24: + return LdkNodeError_InvalidAmount(); + case 25: + return LdkNodeError_InvalidInvoice(); + case 26: + return LdkNodeError_InvalidChannelId(); + case 27: + return LdkNodeError_InvalidNetwork(); + case 28: + return LdkNodeError_DuplicatePayment(); + case 29: + return LdkNodeError_InsufficientFunds(); + case 30: + return LdkNodeError_FeerateEstimationUpdateFailed(); + case 31: + return LdkNodeError_LiquidityRequestFailed(); + case 32: + return LdkNodeError_LiquiditySourceUnavailable(); + case 33: + return LdkNodeError_LiquidityFeeTooHigh(); + case 34: + return LdkNodeError_InvalidPaymentId(); + case 35: + var var_field0 = sse_decode_box_autoadd_decode_error(deserializer); + return LdkNodeError_Decode(var_field0); + case 36: + var var_field0 = + sse_decode_box_autoadd_bolt_12_parse_error(deserializer); + return LdkNodeError_Bolt12Parse(var_field0); + case 37: + return LdkNodeError_InvoiceRequestCreationFailed(); + case 38: + return LdkNodeError_OfferCreationFailed(); + case 39: + return LdkNodeError_RefundCreationFailed(); + case 40: + return LdkNodeError_FeerateEstimationUpdateTimeout(); + case 41: + return LdkNodeError_WalletOperationTimeout(); + case 42: + return LdkNodeError_TxSyncTimeout(); + case 43: + return LdkNodeError_GossipUpdateTimeout(); + case 44: + return LdkNodeError_InvalidOfferId(); + case 45: + return LdkNodeError_InvalidNodeId(); + case 46: + return LdkNodeError_InvalidOffer(); + case 47: + return LdkNodeError_InvalidRefund(); + case 48: + return LdkNodeError_UnsupportedCurrency(); + default: + throw UnimplementedError(''); + } + } + @protected LdkOnChainPayment sse_decode_ldk_on_chain_payment( SseDeserializer deserializer) { @@ -3652,6 +4926,18 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return ans_; } + @protected + List sse_decode_list_node_id(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_node_id(deserializer)); + } + return ans_; + } + @protected List sse_decode_list_payment_details( SseDeserializer deserializer) { @@ -3690,6 +4976,13 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return ans_; } + @protected + Uint64List sse_decode_list_prim_u_64_strict(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var len_ = sse_decode_i_32(deserializer); + return deserializer.buffer.getUint64List(len_); + } + @protected List sse_decode_list_prim_u_8_loose(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -3774,10 +5067,10 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - NodeException sse_decode_node_exception(SseDeserializer deserializer) { + NodeId sse_decode_node_id(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - var inner = sse_decode_i_32(deserializer); - return NodeException.values[inner]; + var var_compressed = sse_decode_list_prim_u_8_strict(deserializer); + return NodeId(compressed: var_compressed); } @protected @@ -3809,6 +5102,20 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { var_latestNodeAnnouncementBroadcastTimestamp); } + @protected + Offer sse_decode_offer(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_s = sse_decode_String(deserializer); + return Offer(s: var_s); + } + + @protected + OfferId sse_decode_offer_id(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_field0 = sse_decode_u_8_array_32(deserializer); + return OfferId(field0: var_field0); + } + @protected String? sse_decode_opt_String(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -3820,6 +5127,18 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } } + @protected + AnchorChannelsConfig? sse_decode_opt_box_autoadd_anchor_channels_config( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + if (sse_decode_bool(deserializer)) { + return (sse_decode_box_autoadd_anchor_channels_config(deserializer)); + } else { + return null; + } + } + @protected ChainDataSourceConfig? sse_decode_opt_box_autoadd_chain_data_source_config( SseDeserializer deserializer) { @@ -3856,6 +5175,30 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } } + @protected + ChannelInfo? sse_decode_opt_box_autoadd_channel_info( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + if (sse_decode_bool(deserializer)) { + return (sse_decode_box_autoadd_channel_info(deserializer)); + } else { + return null; + } + } + + @protected + ChannelUpdateInfo? sse_decode_opt_box_autoadd_channel_update_info( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + if (sse_decode_bool(deserializer)) { + return (sse_decode_box_autoadd_channel_update_info(deserializer)); + } else { + return null; + } + } + @protected ClosureReason? sse_decode_opt_box_autoadd_closure_reason( SseDeserializer deserializer) { @@ -3962,6 +5305,18 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } } + @protected + PaymentHash? sse_decode_opt_box_autoadd_payment_hash( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + if (sse_decode_bool(deserializer)) { + return (sse_decode_box_autoadd_payment_hash(deserializer)); + } else { + return null; + } + } + @protected PaymentId? sse_decode_opt_box_autoadd_payment_id( SseDeserializer deserializer) { @@ -4033,7 +5388,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - int? sse_decode_opt_box_autoadd_u_64(SseDeserializer deserializer) { + BigInt? sse_decode_opt_box_autoadd_u_64(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs if (sse_decode_bool(deserializer)) { @@ -4142,6 +5497,26 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { var var_preimage = sse_decode_opt_box_autoadd_payment_preimage(deserializer); return PaymentKind_Spontaneous(hash: var_hash, preimage: var_preimage); + case 4: + var var_hash = sse_decode_opt_box_autoadd_payment_hash(deserializer); + var var_preimage = + sse_decode_opt_box_autoadd_payment_preimage(deserializer); + var var_secret = + sse_decode_opt_box_autoadd_payment_secret(deserializer); + var var_offerId = sse_decode_box_autoadd_offer_id(deserializer); + return PaymentKind_Bolt12Offer( + hash: var_hash, + preimage: var_preimage, + secret: var_secret, + offerId: var_offerId); + case 5: + var var_hash = sse_decode_opt_box_autoadd_payment_hash(deserializer); + var var_preimage = + sse_decode_opt_box_autoadd_payment_preimage(deserializer); + var var_secret = + sse_decode_opt_box_autoadd_payment_secret(deserializer); + return PaymentKind_Bolt12Refund( + hash: var_hash, preimage: var_preimage, secret: var_secret); default: throw UnimplementedError(''); } @@ -4235,6 +5610,23 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return (var_field0, var_field1, var_field2); } + @protected + Refund sse_decode_refund(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_s = sse_decode_String(deserializer); + return Refund(s: var_s); + } + + @protected + RoutingFees sse_decode_routing_fees(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_baseMsat = sse_decode_u_32(deserializer); + var var_proportionalMillionths = sse_decode_u_32(deserializer); + return RoutingFees( + baseMsat: var_baseMsat, + proportionalMillionths: var_proportionalMillionths); + } + @protected SocketAddress sse_decode_socket_address(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -4291,9 +5683,9 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - int sse_decode_u_64(SseDeserializer deserializer) { + BigInt sse_decode_u_64(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return deserializer.buffer.getUint64(); + return deserializer.buffer.getBigUint64(); } @protected @@ -4350,68 +5742,98 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - int sse_decode_usize(SseDeserializer deserializer) { + BigInt sse_decode_usize(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return deserializer.buffer.getUint64(); + return deserializer.buffer.getBigUint64(); + } + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return (raw as NodeBuilderImpl).frbInternalCstEncode(move: true); } @protected - int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + int cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( NodeBuilder raw) { // Codec=Cst (C-struct based), see doc to use other codecs // ignore: invalid_use_of_internal_member - return raw.cstEncode(move: true); + return (raw as NodeBuilderImpl).frbInternalCstEncode(move: false); + } + + @protected + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return (raw as NodeBuilderImpl).frbInternalCstEncode(move: false); + } + + @protected + int cst_encode_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ArcBolt12Payment raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return (raw as ArcBolt12PaymentImpl).frbInternalCstEncode(); } @protected int cst_encode_RustOpaque_Node(Node raw) { // Codec=Cst (C-struct based), see doc to use other codecs // ignore: invalid_use_of_internal_member - return raw.cstEncode(); + return (raw as NodeImpl).frbInternalCstEncode(); } @protected - int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( NodeBuilder raw) { // Codec=Cst (C-struct based), see doc to use other codecs // ignore: invalid_use_of_internal_member - return raw.cstEncode(); + return (raw as NodeBuilderImpl).frbInternalCstEncode(); } @protected - int cst_encode_RustOpaque_ldk_nodepaymentBolt11Payment( - LdkNodePaymentBolt11Payment raw) { + int cst_encode_RustOpaque_ldk_nodeBuilder(Builder raw) { // Codec=Cst (C-struct based), see doc to use other codecs // ignore: invalid_use_of_internal_member - return raw.cstEncode(); + return (raw as BuilderImpl).frbInternalCstEncode(); } @protected - int cst_encode_RustOpaque_ldk_nodepaymentOnchainPayment( - LdkNodePaymentOnchainPayment raw) { + int cst_encode_RustOpaque_ldk_nodegraphNetworkGraph(NetworkGraph raw) { // Codec=Cst (C-struct based), see doc to use other codecs // ignore: invalid_use_of_internal_member - return raw.cstEncode(); + return (raw as NetworkGraphImpl).frbInternalCstEncode(); } @protected - int cst_encode_RustOpaque_ldk_nodepaymentSpontaneousPayment( - LdkNodePaymentSpontaneousPayment raw) { + int cst_encode_RustOpaque_ldk_nodepaymentBolt11Payment(Bolt11Payment raw) { // Codec=Cst (C-struct based), see doc to use other codecs // ignore: invalid_use_of_internal_member - return raw.cstEncode(); + return (raw as Bolt11PaymentImpl).frbInternalCstEncode(); } @protected - bool cst_encode_bool(bool raw) { + int cst_encode_RustOpaque_ldk_nodepaymentOnchainPayment(OnchainPayment raw) { // Codec=Cst (C-struct based), see doc to use other codecs - return raw; +// ignore: invalid_use_of_internal_member + return (raw as OnchainPaymentImpl).frbInternalCstEncode(); + } + + @protected + int cst_encode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + SpontaneousPayment raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return (raw as SpontaneousPaymentImpl).frbInternalCstEncode(); } @protected - int cst_encode_builder_exception(BuilderException raw) { + bool cst_encode_bool(bool raw) { // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_i_32(raw.index); + return raw; } @protected @@ -4421,19 +5843,19 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - int cst_encode_log_level(LogLevel raw) { + int cst_encode_ldk_builder_error(LdkBuilderError raw) { // Codec=Cst (C-struct based), see doc to use other codecs return cst_encode_i_32(raw.index); } @protected - int cst_encode_network(Network raw) { + int cst_encode_log_level(LogLevel raw) { // Codec=Cst (C-struct based), see doc to use other codecs return cst_encode_i_32(raw.index); } @protected - int cst_encode_node_exception(NodeException raw) { + int cst_encode_network(Network raw) { // Codec=Cst (C-struct based), see doc to use other codecs return cst_encode_i_32(raw.index); } @@ -4481,52 +5903,101 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - int cst_encode_usize(int raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw; + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize( + (self as NodeBuilderImpl).frbInternalSseEncode(move: true), serializer); + } + + @protected + void + sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize( + (self as NodeBuilderImpl).frbInternalSseEncode(move: false), + serializer); } @protected void - sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( NodeBuilder self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_usize(self.sseEncode(move: true), serializer); + sse_encode_usize( + (self as NodeBuilderImpl).frbInternalSseEncode(move: false), + serializer); + } + + @protected + void sse_encode_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ArcBolt12Payment self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize( + (self as ArcBolt12PaymentImpl).frbInternalSseEncode(move: null), + serializer); } @protected void sse_encode_RustOpaque_Node(Node self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_usize(self.sseEncode(move: null), serializer); + sse_encode_usize( + (self as NodeImpl).frbInternalSseEncode(move: null), serializer); } @protected void - sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( NodeBuilder self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_usize(self.sseEncode(move: null), serializer); + sse_encode_usize( + (self as NodeBuilderImpl).frbInternalSseEncode(move: null), serializer); + } + + @protected + void sse_encode_RustOpaque_ldk_nodeBuilder( + Builder self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize( + (self as BuilderImpl).frbInternalSseEncode(move: null), serializer); + } + + @protected + void sse_encode_RustOpaque_ldk_nodegraphNetworkGraph( + NetworkGraph self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize( + (self as NetworkGraphImpl).frbInternalSseEncode(move: null), + serializer); } @protected void sse_encode_RustOpaque_ldk_nodepaymentBolt11Payment( - LdkNodePaymentBolt11Payment self, SseSerializer serializer) { + Bolt11Payment self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_usize(self.sseEncode(move: null), serializer); + sse_encode_usize( + (self as Bolt11PaymentImpl).frbInternalSseEncode(move: null), + serializer); } @protected void sse_encode_RustOpaque_ldk_nodepaymentOnchainPayment( - LdkNodePaymentOnchainPayment self, SseSerializer serializer) { + OnchainPayment self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_usize(self.sseEncode(move: null), serializer); + sse_encode_usize( + (self as OnchainPaymentImpl).frbInternalSseEncode(move: null), + serializer); } @protected void sse_encode_RustOpaque_ldk_nodepaymentSpontaneousPayment( - LdkNodePaymentSpontaneousPayment self, SseSerializer serializer) { + SpontaneousPayment self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_usize(self.sseEncode(move: null), serializer); + sse_encode_usize( + (self as SpontaneousPaymentImpl).frbInternalSseEncode(move: null), + serializer); } @protected @@ -4541,6 +6012,14 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_String(self.s, serializer); } + @protected + void sse_encode_anchor_channels_config( + AnchorChannelsConfig self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_list_public_key(self.trustedPeersNoReserve, serializer); + sse_encode_u_64(self.perChannelReserveSats, serializer); + } + @protected void sse_encode_balance_details( BalanceDetails self, SseSerializer serializer) { @@ -4567,6 +6046,39 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_String(self.signedRawInvoice, serializer); } + @protected + void sse_encode_bolt_12_invoice( + Bolt12Invoice self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_list_prim_u_8_strict(self.data, serializer); + } + + @protected + void sse_encode_bolt_12_parse_error( + Bolt12ParseError self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + switch (self) { + case Bolt12ParseError_InvalidContinuation(): + sse_encode_i_32(0, serializer); + case Bolt12ParseError_InvalidBech32Hrp(): + sse_encode_i_32(1, serializer); + case Bolt12ParseError_Bech32(field0: final field0): + sse_encode_i_32(2, serializer); + sse_encode_String(field0, serializer); + case Bolt12ParseError_Decode(field0: final field0): + sse_encode_i_32(3, serializer); + sse_encode_box_autoadd_decode_error(field0, serializer); + case Bolt12ParseError_InvalidSemantics(field0: final field0): + sse_encode_i_32(4, serializer); + sse_encode_String(field0, serializer); + case Bolt12ParseError_InvalidSignature(field0: final field0): + sse_encode_i_32(5, serializer); + sse_encode_String(field0, serializer); + default: + throw UnimplementedError(''); + } + } + @protected void sse_encode_bool(bool self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -4579,6 +6091,13 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_address(self, serializer); } + @protected + void sse_encode_box_autoadd_anchor_channels_config( + AnchorChannelsConfig self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_anchor_channels_config(self, serializer); + } + @protected void sse_encode_box_autoadd_bolt_11_invoice( Bolt11Invoice self, SseSerializer serializer) { @@ -4586,6 +6105,13 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_bolt_11_invoice(self, serializer); } + @protected + void sse_encode_box_autoadd_bolt_12_parse_error( + Bolt12ParseError self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_bolt_12_parse_error(self, serializer); + } + @protected void sse_encode_box_autoadd_chain_data_source_config( ChainDataSourceConfig self, SseSerializer serializer) { @@ -4607,6 +6133,20 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_channel_id(self, serializer); } + @protected + void sse_encode_box_autoadd_channel_info( + ChannelInfo self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_channel_info(self, serializer); + } + + @protected + void sse_encode_box_autoadd_channel_update_info( + ChannelUpdateInfo self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_channel_update_info(self, serializer); + } + @protected void sse_encode_box_autoadd_closure_reason( ClosureReason self, SseSerializer serializer) { @@ -4620,6 +6160,13 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_config(self, serializer); } + @protected + void sse_encode_box_autoadd_decode_error( + DecodeError self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_decode_error(self, serializer); + } + @protected void sse_encode_box_autoadd_entropy_source_config( EntropySourceConfig self, SseSerializer serializer) { @@ -4647,6 +6194,13 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_ldk_bolt_11_payment(self, serializer); } + @protected + void sse_encode_box_autoadd_ldk_bolt_12_payment( + LdkBolt12Payment self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_ldk_bolt_12_payment(self, serializer); + } + @protected void sse_encode_box_autoadd_ldk_mnemonic( LdkMnemonic self, SseSerializer serializer) { @@ -4654,6 +6208,13 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_ldk_mnemonic(self, serializer); } + @protected + void sse_encode_box_autoadd_ldk_network_graph( + LdkNetworkGraph self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_ldk_network_graph(self, serializer); + } + @protected void sse_encode_box_autoadd_ldk_node(LdkNode self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -4695,6 +6256,18 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_max_dust_htlc_exposure(self, serializer); } + @protected + void sse_encode_box_autoadd_offer(Offer self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_offer(self, serializer); + } + + @protected + void sse_encode_box_autoadd_offer_id(OfferId self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_offer_id(self, serializer); + } + @protected void sse_encode_box_autoadd_out_point( OutPoint self, SseSerializer serializer) { @@ -4751,6 +6324,12 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_public_key(self, serializer); } + @protected + void sse_encode_box_autoadd_refund(Refund self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_refund(self, serializer); + } + @protected void sse_encode_box_autoadd_socket_address( SocketAddress self, SseSerializer serializer) { @@ -4777,7 +6356,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - void sse_encode_box_autoadd_u_64(int self, SseSerializer serializer) { + void sse_encode_box_autoadd_u_64(BigInt self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_u_64(self, serializer); } @@ -4789,13 +6368,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_user_channel_id(self, serializer); } - @protected - 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); - } - @protected void sse_encode_chain_data_source_config( ChainDataSourceConfig self, SseSerializer serializer) { @@ -4804,6 +6376,8 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { case ChainDataSourceConfig_Esplora(field0: final field0): sse_encode_i_32(0, serializer); sse_encode_String(field0, serializer); + default: + throw UnimplementedError(''); } } @@ -4865,6 +6439,28 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_u_8_array_32(self.data, serializer); } + @protected + void sse_encode_channel_info(ChannelInfo self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_node_id(self.nodeOne, serializer); + sse_encode_opt_box_autoadd_channel_update_info(self.oneToTwo, serializer); + sse_encode_node_id(self.nodeTwo, serializer); + sse_encode_opt_box_autoadd_channel_update_info(self.twoToOne, serializer); + sse_encode_opt_box_autoadd_u_64(self.capacitySats, serializer); + } + + @protected + void sse_encode_channel_update_info( + ChannelUpdateInfo self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_u_32(self.lastUpdate, serializer); + sse_encode_bool(self.enabled, serializer); + sse_encode_u_16(self.cltvExpiryDelta, serializer); + sse_encode_u_64(self.htlcMinimumMsat, serializer); + sse_encode_u_64(self.htlcMaximumMsat, serializer); + sse_encode_routing_fees(self.fees, serializer); + } + @protected void sse_encode_closure_reason(ClosureReason self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -4897,6 +6493,8 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_i_32(11, serializer); case ClosureReason_HTLCsTimedOut(): sse_encode_i_32(12, serializer); + default: + throw UnimplementedError(''); } } @@ -4914,6 +6512,34 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_list_public_key(self.trustedPeers0Conf, serializer); sse_encode_u_64(self.probingLiquidityLimitMultiplier, serializer); sse_encode_log_level(self.logLevel, serializer); + sse_encode_opt_box_autoadd_anchor_channels_config( + self.anchorChannelsConfig, serializer); + } + + @protected + void sse_encode_decode_error(DecodeError self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + switch (self) { + case DecodeError_UnknownVersion(): + sse_encode_i_32(0, serializer); + case DecodeError_UnknownRequiredFeature(): + sse_encode_i_32(1, serializer); + case DecodeError_InvalidValue(): + sse_encode_i_32(2, serializer); + case DecodeError_ShortRead(): + sse_encode_i_32(3, serializer); + case DecodeError_BadLengthDescriptor(): + sse_encode_i_32(4, serializer); + case DecodeError_Io(field0: final field0): + sse_encode_i_32(5, serializer); + sse_encode_String(field0, serializer); + case DecodeError_UnsupportedCompression(): + sse_encode_i_32(6, serializer); + case DecodeError_DangerousValue(): + sse_encode_i_32(7, serializer); + default: + throw UnimplementedError(''); + } } @protected @@ -4934,6 +6560,8 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_i_32(2, serializer); sse_encode_box_autoadd_ldk_mnemonic(mnemonic, serializer); sse_encode_opt_String(passphrase, serializer); + default: + throw UnimplementedError(''); } } @@ -4941,12 +6569,23 @@ 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_PaymentClaimable( + paymentId: final paymentId, + paymentHash: final paymentHash, + claimableAmountMsat: final claimableAmountMsat, + claimDeadline: final claimDeadline + ): + sse_encode_i_32(0, serializer); + sse_encode_box_autoadd_payment_id(paymentId, serializer); + sse_encode_box_autoadd_payment_hash(paymentHash, serializer); + sse_encode_u_64(claimableAmountMsat, serializer); + sse_encode_opt_box_autoadd_u_32(claimDeadline, serializer); case Event_PaymentSuccessful( paymentId: final paymentId, paymentHash: final paymentHash, feePaidMsat: final feePaidMsat ): - sse_encode_i_32(0, serializer); + sse_encode_i_32(1, serializer); sse_encode_opt_box_autoadd_payment_id(paymentId, serializer); sse_encode_box_autoadd_payment_hash(paymentHash, serializer); sse_encode_opt_box_autoadd_u_64(feePaidMsat, serializer); @@ -4955,7 +6594,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { paymentHash: final paymentHash, reason: final reason ): - sse_encode_i_32(1, serializer); + sse_encode_i_32(2, serializer); sse_encode_opt_box_autoadd_payment_id(paymentId, serializer); sse_encode_box_autoadd_payment_hash(paymentHash, serializer); sse_encode_opt_box_autoadd_payment_failure_reason(reason, serializer); @@ -4964,7 +6603,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { paymentHash: final paymentHash, amountMsat: final amountMsat ): - sse_encode_i_32(2, serializer); + sse_encode_i_32(3, serializer); sse_encode_opt_box_autoadd_payment_id(paymentId, serializer); sse_encode_box_autoadd_payment_hash(paymentHash, serializer); sse_encode_u_64(amountMsat, serializer); @@ -4975,7 +6614,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { counterpartyNodeId: final counterpartyNodeId, fundingTxo: final fundingTxo ): - sse_encode_i_32(3, serializer); + sse_encode_i_32(4, 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); @@ -4986,7 +6625,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { userChannelId: final userChannelId, counterpartyNodeId: final counterpartyNodeId ): - sse_encode_i_32(4, serializer); + 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); @@ -4996,11 +6635,13 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { counterpartyNodeId: final counterpartyNodeId, reason: final reason ): - sse_encode_i_32(5, serializer); + sse_encode_i_32(6, 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); + default: + throw UnimplementedError(''); } } @@ -5014,6 +6655,8 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { case GossipSourceConfig_RapidGossipSync(field0: final field0): sse_encode_i_32(1, serializer); sse_encode_String(field0, serializer); + default: + throw UnimplementedError(''); } } @@ -5030,18 +6673,148 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_RustOpaque_ldk_nodepaymentBolt11Payment(self.ptr, serializer); } + @protected + void sse_encode_ldk_bolt_12_payment( + LdkBolt12Payment self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_RustOpaque_Arcldk_nodepaymentBolt12Payment(self.ptr, serializer); + } + + @protected + void sse_encode_ldk_builder_error( + LdkBuilderError self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_i_32(self.index, serializer); + } + @protected void sse_encode_ldk_mnemonic(LdkMnemonic self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_String(self.seedPhrase, serializer); } + @protected + void sse_encode_ldk_network_graph( + LdkNetworkGraph self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_RustOpaque_ldk_nodegraphNetworkGraph(self.inner, serializer); + } + @protected void sse_encode_ldk_node(LdkNode self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_RustOpaque_Node(self.ptr, serializer); } + @protected + void sse_encode_ldk_node_error(LdkNodeError self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + switch (self) { + case LdkNodeError_InvalidTxid(): + sse_encode_i_32(0, serializer); + case LdkNodeError_AlreadyRunning(): + sse_encode_i_32(1, serializer); + case LdkNodeError_NotRunning(): + sse_encode_i_32(2, serializer); + case LdkNodeError_OnchainTxCreationFailed(): + sse_encode_i_32(3, serializer); + case LdkNodeError_ConnectionFailed(): + sse_encode_i_32(4, serializer); + case LdkNodeError_InvoiceCreationFailed(): + sse_encode_i_32(5, serializer); + case LdkNodeError_PaymentSendingFailed(): + sse_encode_i_32(6, serializer); + case LdkNodeError_ProbeSendingFailed(): + sse_encode_i_32(7, serializer); + case LdkNodeError_ChannelCreationFailed(): + sse_encode_i_32(8, serializer); + case LdkNodeError_ChannelClosingFailed(): + sse_encode_i_32(9, serializer); + case LdkNodeError_ChannelConfigUpdateFailed(): + sse_encode_i_32(10, serializer); + case LdkNodeError_PersistenceFailed(): + sse_encode_i_32(11, serializer); + case LdkNodeError_WalletOperationFailed(): + sse_encode_i_32(12, serializer); + case LdkNodeError_OnchainTxSigningFailed(): + sse_encode_i_32(13, serializer); + case LdkNodeError_MessageSigningFailed(): + sse_encode_i_32(14, serializer); + case LdkNodeError_TxSyncFailed(): + sse_encode_i_32(15, serializer); + case LdkNodeError_GossipUpdateFailed(): + sse_encode_i_32(16, serializer); + case LdkNodeError_InvalidAddress(): + sse_encode_i_32(17, serializer); + case LdkNodeError_InvalidSocketAddress(): + sse_encode_i_32(18, serializer); + case LdkNodeError_InvalidPublicKey(): + sse_encode_i_32(19, serializer); + case LdkNodeError_InvalidSecretKey(): + sse_encode_i_32(20, serializer); + case LdkNodeError_InvalidPaymentHash(): + sse_encode_i_32(21, serializer); + case LdkNodeError_InvalidPaymentPreimage(): + sse_encode_i_32(22, serializer); + case LdkNodeError_InvalidPaymentSecret(): + sse_encode_i_32(23, serializer); + case LdkNodeError_InvalidAmount(): + sse_encode_i_32(24, serializer); + case LdkNodeError_InvalidInvoice(): + sse_encode_i_32(25, serializer); + case LdkNodeError_InvalidChannelId(): + sse_encode_i_32(26, serializer); + case LdkNodeError_InvalidNetwork(): + sse_encode_i_32(27, serializer); + case LdkNodeError_DuplicatePayment(): + sse_encode_i_32(28, serializer); + case LdkNodeError_InsufficientFunds(): + sse_encode_i_32(29, serializer); + case LdkNodeError_FeerateEstimationUpdateFailed(): + sse_encode_i_32(30, serializer); + case LdkNodeError_LiquidityRequestFailed(): + sse_encode_i_32(31, serializer); + case LdkNodeError_LiquiditySourceUnavailable(): + sse_encode_i_32(32, serializer); + case LdkNodeError_LiquidityFeeTooHigh(): + sse_encode_i_32(33, serializer); + case LdkNodeError_InvalidPaymentId(): + sse_encode_i_32(34, serializer); + case LdkNodeError_Decode(field0: final field0): + sse_encode_i_32(35, serializer); + sse_encode_box_autoadd_decode_error(field0, serializer); + case LdkNodeError_Bolt12Parse(field0: final field0): + sse_encode_i_32(36, serializer); + sse_encode_box_autoadd_bolt_12_parse_error(field0, serializer); + case LdkNodeError_InvoiceRequestCreationFailed(): + sse_encode_i_32(37, serializer); + case LdkNodeError_OfferCreationFailed(): + sse_encode_i_32(38, serializer); + case LdkNodeError_RefundCreationFailed(): + sse_encode_i_32(39, serializer); + case LdkNodeError_FeerateEstimationUpdateTimeout(): + sse_encode_i_32(40, serializer); + case LdkNodeError_WalletOperationTimeout(): + sse_encode_i_32(41, serializer); + case LdkNodeError_TxSyncTimeout(): + sse_encode_i_32(42, serializer); + case LdkNodeError_GossipUpdateTimeout(): + sse_encode_i_32(43, serializer); + case LdkNodeError_InvalidOfferId(): + sse_encode_i_32(44, serializer); + case LdkNodeError_InvalidNodeId(): + sse_encode_i_32(45, serializer); + case LdkNodeError_InvalidOffer(): + sse_encode_i_32(46, serializer); + case LdkNodeError_InvalidRefund(): + sse_encode_i_32(47, serializer); + case LdkNodeError_UnsupportedCurrency(): + sse_encode_i_32(48, serializer); + default: + throw UnimplementedError(''); + } + } + @protected void sse_encode_ldk_on_chain_payment( LdkOnChainPayment self, SseSerializer serializer) { @@ -5132,6 +6905,8 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_box_autoadd_channel_id(channelId, serializer); sse_encode_box_autoadd_public_key(counterpartyNodeId, serializer); sse_encode_u_64(amountSatoshis, serializer); + default: + throw UnimplementedError(''); } } @@ -5163,6 +6938,15 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } } + @protected + void sse_encode_list_node_id(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_node_id(item, serializer); + } + } + @protected void sse_encode_list_payment_details( List self, SseSerializer serializer) { @@ -5193,6 +6977,14 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } } + @protected + void sse_encode_list_prim_u_64_strict( + Uint64List self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_i_32(self.length, serializer); + serializer.buffer.putUint64List(self); + } + @protected void sse_encode_list_prim_u_8_loose( List self, SseSerializer serializer) { @@ -5255,6 +7047,8 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { case MaxDustHTLCExposure_FeeRateMultiplier(field0: final field0): sse_encode_i_32(1, serializer); sse_encode_u_64(field0, serializer); + default: + throw UnimplementedError(''); } } @@ -5265,9 +7059,9 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - void sse_encode_node_exception(NodeException self, SseSerializer serializer) { + void sse_encode_node_id(NodeId self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_i_32(self.index, serializer); + sse_encode_list_prim_u_8_strict(self.compressed, serializer); } @protected @@ -5287,6 +7081,18 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { self.latestNodeAnnouncementBroadcastTimestamp, serializer); } + @protected + void sse_encode_offer(Offer self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_String(self.s, serializer); + } + + @protected + void sse_encode_offer_id(OfferId self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_u_8_array_32(self.field0, serializer); + } + @protected void sse_encode_opt_String(String? self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -5297,6 +7103,17 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } } + @protected + void sse_encode_opt_box_autoadd_anchor_channels_config( + AnchorChannelsConfig? 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_anchor_channels_config(self, serializer); + } + } + @protected void sse_encode_opt_box_autoadd_chain_data_source_config( ChainDataSourceConfig? self, SseSerializer serializer) { @@ -5330,6 +7147,28 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } } + @protected + void sse_encode_opt_box_autoadd_channel_info( + ChannelInfo? 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_info(self, serializer); + } + } + + @protected + void sse_encode_opt_box_autoadd_channel_update_info( + ChannelUpdateInfo? 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_update_info(self, serializer); + } + } + @protected void sse_encode_opt_box_autoadd_closure_reason( ClosureReason? self, SseSerializer serializer) { @@ -5428,6 +7267,17 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } } + @protected + void sse_encode_opt_box_autoadd_payment_hash( + PaymentHash? 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_hash(self, serializer); + } + } + @protected void sse_encode_opt_box_autoadd_payment_id( PaymentId? self, SseSerializer serializer) { @@ -5493,7 +7343,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - void sse_encode_opt_box_autoadd_u_64(int? self, SseSerializer serializer) { + void sse_encode_opt_box_autoadd_u_64(BigInt? self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_bool(self != null, serializer); @@ -5587,6 +7437,28 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_i_32(3, serializer); sse_encode_box_autoadd_payment_hash(hash, serializer); sse_encode_opt_box_autoadd_payment_preimage(preimage, serializer); + case PaymentKind_Bolt12Offer( + hash: final hash, + preimage: final preimage, + secret: final secret, + offerId: final offerId + ): + sse_encode_i_32(4, serializer); + sse_encode_opt_box_autoadd_payment_hash(hash, serializer); + sse_encode_opt_box_autoadd_payment_preimage(preimage, serializer); + sse_encode_opt_box_autoadd_payment_secret(secret, serializer); + sse_encode_box_autoadd_offer_id(offerId, serializer); + case PaymentKind_Bolt12Refund( + hash: final hash, + preimage: final preimage, + secret: final secret + ): + sse_encode_i_32(5, serializer); + sse_encode_opt_box_autoadd_payment_hash(hash, serializer); + sse_encode_opt_box_autoadd_payment_preimage(preimage, serializer); + sse_encode_opt_box_autoadd_payment_secret(secret, serializer); + default: + throw UnimplementedError(''); } } @@ -5653,6 +7525,8 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_String(confirmationHash, serializer); sse_encode_u_32(confirmationHeight, serializer); sse_encode_u_64(amountSatoshis, serializer); + default: + throw UnimplementedError(''); } } @@ -5671,6 +7545,19 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_opt_String(self.$3, serializer); } + @protected + void sse_encode_refund(Refund self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_String(self.s, serializer); + } + + @protected + void sse_encode_routing_fees(RoutingFees self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_u_32(self.baseMsat, serializer); + sse_encode_u_32(self.proportionalMillionths, serializer); + } + @protected void sse_encode_socket_address(SocketAddress self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -5701,6 +7588,8 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_i_32(4, serializer); sse_encode_String(addr, serializer); sse_encode_u_16(port, serializer); + default: + throw UnimplementedError(''); } } @@ -5723,9 +7612,9 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - void sse_encode_u_64(int self, SseSerializer serializer) { + void sse_encode_u_64(BigInt self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - serializer.buffer.putUint64(self); + serializer.buffer.putBigUint64(self); } @protected @@ -5777,8 +7666,188 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - void sse_encode_usize(int self, SseSerializer serializer) { + void sse_encode_usize(BigInt self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - serializer.buffer.putUint64(self); + serializer.buffer.putBigUint64(self); } } + +@sealed +class ArcBolt12PaymentImpl extends RustOpaque implements ArcBolt12Payment { + // Not to be used by end users + ArcBolt12PaymentImpl.frbInternalDcoDecode(List wire) + : super.frbInternalDcoDecode(wire, _kStaticData); + + // Not to be used by end users + ArcBolt12PaymentImpl.frbInternalSseDecode( + BigInt ptr, int externalSizeOnNative) + : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + core.instance.api.rust_arc_increment_strong_count_ArcBolt12Payment, + rustArcDecrementStrongCount: + core.instance.api.rust_arc_decrement_strong_count_ArcBolt12Payment, + rustArcDecrementStrongCountPtr: + core.instance.api.rust_arc_decrement_strong_count_ArcBolt12PaymentPtr, + ); +} + +@sealed +class Bolt11PaymentImpl extends RustOpaque implements Bolt11Payment { + // Not to be used by end users + Bolt11PaymentImpl.frbInternalDcoDecode(List wire) + : super.frbInternalDcoDecode(wire, _kStaticData); + + // Not to be used by end users + Bolt11PaymentImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative) + : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + core.instance.api.rust_arc_increment_strong_count_Bolt11Payment, + rustArcDecrementStrongCount: + core.instance.api.rust_arc_decrement_strong_count_Bolt11Payment, + rustArcDecrementStrongCountPtr: + core.instance.api.rust_arc_decrement_strong_count_Bolt11PaymentPtr, + ); +} + +@sealed +class BuilderImpl extends RustOpaque implements Builder { + // Not to be used by end users + BuilderImpl.frbInternalDcoDecode(List wire) + : super.frbInternalDcoDecode(wire, _kStaticData); + + // Not to be used by end users + BuilderImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative) + : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + core.instance.api.rust_arc_increment_strong_count_Builder, + rustArcDecrementStrongCount: + core.instance.api.rust_arc_decrement_strong_count_Builder, + rustArcDecrementStrongCountPtr: + core.instance.api.rust_arc_decrement_strong_count_BuilderPtr, + ); +} + +@sealed +class NetworkGraphImpl extends RustOpaque implements NetworkGraph { + // Not to be used by end users + NetworkGraphImpl.frbInternalDcoDecode(List wire) + : super.frbInternalDcoDecode(wire, _kStaticData); + + // Not to be used by end users + NetworkGraphImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative) + : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + core.instance.api.rust_arc_increment_strong_count_NetworkGraph, + rustArcDecrementStrongCount: + core.instance.api.rust_arc_decrement_strong_count_NetworkGraph, + rustArcDecrementStrongCountPtr: + core.instance.api.rust_arc_decrement_strong_count_NetworkGraphPtr, + ); +} + +@sealed +class NodeBuilderImpl extends RustOpaque implements NodeBuilder { + // Not to be used by end users + NodeBuilderImpl.frbInternalDcoDecode(List wire) + : super.frbInternalDcoDecode(wire, _kStaticData); + + // Not to be used by end users + NodeBuilderImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative) + : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + core.instance.api.rust_arc_increment_strong_count_NodeBuilder, + rustArcDecrementStrongCount: + core.instance.api.rust_arc_decrement_strong_count_NodeBuilder, + rustArcDecrementStrongCountPtr: + core.instance.api.rust_arc_decrement_strong_count_NodeBuilderPtr, + ); + + Builder get builder => + core.instance.api.crateApiBuilderNodeBuilderAutoAccessorGetBuilder( + that: this, + ); + + void set builder(Builder builder) => + core.instance.api.crateApiBuilderNodeBuilderAutoAccessorSetBuilder( + that: this, builder: builder); + + Future build() => core.instance.api.crateApiBuilderNodeBuilderBuild( + that: this, + ); + + Future buildWithFsStore() => + core.instance.api.crateApiBuilderNodeBuilderBuildWithFsStore( + that: this, + ); +} + +@sealed +class NodeImpl extends RustOpaque implements Node { + // Not to be used by end users + NodeImpl.frbInternalDcoDecode(List wire) + : super.frbInternalDcoDecode(wire, _kStaticData); + + // Not to be used by end users + NodeImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative) + : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + core.instance.api.rust_arc_increment_strong_count_Node, + rustArcDecrementStrongCount: + core.instance.api.rust_arc_decrement_strong_count_Node, + rustArcDecrementStrongCountPtr: + core.instance.api.rust_arc_decrement_strong_count_NodePtr, + ); +} + +@sealed +class OnchainPaymentImpl extends RustOpaque implements OnchainPayment { + // Not to be used by end users + OnchainPaymentImpl.frbInternalDcoDecode(List wire) + : super.frbInternalDcoDecode(wire, _kStaticData); + + // Not to be used by end users + OnchainPaymentImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative) + : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + core.instance.api.rust_arc_increment_strong_count_OnchainPayment, + rustArcDecrementStrongCount: + core.instance.api.rust_arc_decrement_strong_count_OnchainPayment, + rustArcDecrementStrongCountPtr: + core.instance.api.rust_arc_decrement_strong_count_OnchainPaymentPtr, + ); +} + +@sealed +class SpontaneousPaymentImpl extends RustOpaque implements SpontaneousPayment { + // Not to be used by end users + SpontaneousPaymentImpl.frbInternalDcoDecode(List wire) + : super.frbInternalDcoDecode(wire, _kStaticData); + + // Not to be used by end users + SpontaneousPaymentImpl.frbInternalSseDecode( + BigInt ptr, int externalSizeOnNative) + : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + core.instance.api.rust_arc_increment_strong_count_SpontaneousPayment, + rustArcDecrementStrongCount: + core.instance.api.rust_arc_decrement_strong_count_SpontaneousPayment, + rustArcDecrementStrongCountPtr: + core.instance.api.rust_arc_decrement_strong_count_SpontaneousPaymentPtr, + ); +} diff --git a/lib/src/generated/frb_generated.io.dart b/lib/src/generated/frb_generated.io.dart index f16e549..2e30b3b 100644 --- a/lib/src/generated/frb_generated.io.dart +++ b/lib/src/generated/frb_generated.io.dart @@ -1,68 +1,105 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. +// Generated by `flutter_rust_bridge`@ 2.0.0. // 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 -import 'api/error.dart'; +import 'api/bolt11.dart'; +import 'api/bolt12.dart'; +import 'api/builder.dart'; +import 'api/graph.dart'; import 'api/node.dart'; +import 'api/on_chain.dart'; +import 'api/spontaneous.dart'; import 'api/types.dart'; import 'dart:async'; import 'dart:convert'; import 'dart:ffi' as ffi; import 'frb_generated.dart'; +import 'lib.dart'; import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated_io.dart'; +import 'utils/error.dart'; -abstract class LdkCoreApiImplPlatform extends BaseApiImpl { - LdkCoreApiImplPlatform({ +abstract class coreApiImplPlatform extends BaseApiImpl { + coreApiImplPlatform({ required super.handler, required super.wire, required super.generalizedFrbRustBinding, required super.portManager, }); + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_ArcBolt12PaymentPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12PaymentPtr; + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_NodePtr => wire._rust_arc_decrement_strong_count_RustOpaque_NodePtr; CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_NodeBuilderPtr => wire - ._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilderPtr; + ._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilderPtr; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_BuilderPtr => + wire._rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilderPtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_NetworkGraphPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraphPtr; CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_LdkNodePaymentBolt11PaymentPtr => wire + get rust_arc_decrement_strong_count_Bolt11PaymentPtr => wire ._rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11PaymentPtr; CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_LdkNodePaymentOnchainPaymentPtr => wire + get rust_arc_decrement_strong_count_OnchainPaymentPtr => wire ._rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPaymentPtr; CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_LdkNodePaymentSpontaneousPaymentPtr => - wire._rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPaymentPtr; + get rust_arc_decrement_strong_count_SpontaneousPaymentPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPaymentPtr; + + @protected + NodeBuilder + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + dynamic raw); + + @protected + NodeBuilder + dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + dynamic raw); @protected NodeBuilder - dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( dynamic raw); + @protected + ArcBolt12Payment dco_decode_RustOpaque_Arcldk_nodepaymentBolt12Payment( + dynamic raw); + @protected Node dco_decode_RustOpaque_Node(dynamic raw); @protected NodeBuilder - dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( dynamic raw); @protected - LdkNodePaymentBolt11Payment - dco_decode_RustOpaque_ldk_nodepaymentBolt11Payment(dynamic raw); + Builder dco_decode_RustOpaque_ldk_nodeBuilder(dynamic raw); @protected - LdkNodePaymentOnchainPayment - dco_decode_RustOpaque_ldk_nodepaymentOnchainPayment(dynamic raw); + NetworkGraph dco_decode_RustOpaque_ldk_nodegraphNetworkGraph(dynamic raw); @protected - LdkNodePaymentSpontaneousPayment - dco_decode_RustOpaque_ldk_nodepaymentSpontaneousPayment(dynamic raw); + Bolt11Payment dco_decode_RustOpaque_ldk_nodepaymentBolt11Payment(dynamic raw); + + @protected + OnchainPayment dco_decode_RustOpaque_ldk_nodepaymentOnchainPayment( + dynamic raw); + + @protected + SpontaneousPayment dco_decode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + dynamic raw); @protected String dco_decode_String(dynamic raw); @@ -70,6 +107,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected Address dco_decode_address(dynamic raw); + @protected + AnchorChannelsConfig dco_decode_anchor_channels_config(dynamic raw); + @protected BalanceDetails dco_decode_balance_details(dynamic raw); @@ -79,15 +119,28 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected Bolt11Invoice dco_decode_bolt_11_invoice(dynamic raw); + @protected + Bolt12Invoice dco_decode_bolt_12_invoice(dynamic raw); + + @protected + Bolt12ParseError dco_decode_bolt_12_parse_error(dynamic raw); + @protected bool dco_decode_bool(dynamic raw); @protected Address dco_decode_box_autoadd_address(dynamic raw); + @protected + AnchorChannelsConfig dco_decode_box_autoadd_anchor_channels_config( + dynamic raw); + @protected Bolt11Invoice dco_decode_box_autoadd_bolt_11_invoice(dynamic raw); + @protected + Bolt12ParseError dco_decode_box_autoadd_bolt_12_parse_error(dynamic raw); + @protected ChainDataSourceConfig dco_decode_box_autoadd_chain_data_source_config( dynamic raw); @@ -98,12 +151,21 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected ChannelId dco_decode_box_autoadd_channel_id(dynamic raw); + @protected + ChannelInfo dco_decode_box_autoadd_channel_info(dynamic raw); + + @protected + ChannelUpdateInfo dco_decode_box_autoadd_channel_update_info(dynamic raw); + @protected ClosureReason dco_decode_box_autoadd_closure_reason(dynamic raw); @protected Config dco_decode_box_autoadd_config(dynamic raw); + @protected + DecodeError dco_decode_box_autoadd_decode_error(dynamic raw); + @protected EntropySourceConfig dco_decode_box_autoadd_entropy_source_config(dynamic raw); @@ -116,9 +178,15 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected LdkBolt11Payment dco_decode_box_autoadd_ldk_bolt_11_payment(dynamic raw); + @protected + LdkBolt12Payment dco_decode_box_autoadd_ldk_bolt_12_payment(dynamic raw); + @protected LdkMnemonic dco_decode_box_autoadd_ldk_mnemonic(dynamic raw); + @protected + LdkNetworkGraph dco_decode_box_autoadd_ldk_network_graph(dynamic raw); + @protected LdkNode dco_decode_box_autoadd_ldk_node(dynamic raw); @@ -140,6 +208,12 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { MaxDustHTLCExposure dco_decode_box_autoadd_max_dust_htlc_exposure( dynamic raw); + @protected + Offer dco_decode_box_autoadd_offer(dynamic raw); + + @protected + OfferId dco_decode_box_autoadd_offer_id(dynamic raw); + @protected OutPoint dco_decode_box_autoadd_out_point(dynamic raw); @@ -165,6 +239,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected PublicKey dco_decode_box_autoadd_public_key(dynamic raw); + @protected + Refund dco_decode_box_autoadd_refund(dynamic raw); + @protected SocketAddress dco_decode_box_autoadd_socket_address(dynamic raw); @@ -178,14 +255,11 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { int dco_decode_box_autoadd_u_32(dynamic raw); @protected - int dco_decode_box_autoadd_u_64(dynamic raw); + BigInt dco_decode_box_autoadd_u_64(dynamic raw); @protected UserChannelId dco_decode_box_autoadd_user_channel_id(dynamic raw); - @protected - BuilderException dco_decode_builder_exception(dynamic raw); - @protected ChainDataSourceConfig dco_decode_chain_data_source_config(dynamic raw); @@ -198,12 +272,21 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected ChannelId dco_decode_channel_id(dynamic raw); + @protected + ChannelInfo dco_decode_channel_info(dynamic raw); + + @protected + ChannelUpdateInfo dco_decode_channel_update_info(dynamic raw); + @protected ClosureReason dco_decode_closure_reason(dynamic raw); @protected Config dco_decode_config(dynamic raw); + @protected + DecodeError dco_decode_decode_error(dynamic raw); + @protected EntropySourceConfig dco_decode_entropy_source_config(dynamic raw); @@ -219,12 +302,24 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected LdkBolt11Payment dco_decode_ldk_bolt_11_payment(dynamic raw); + @protected + LdkBolt12Payment dco_decode_ldk_bolt_12_payment(dynamic raw); + + @protected + LdkBuilderError dco_decode_ldk_builder_error(dynamic raw); + @protected LdkMnemonic dco_decode_ldk_mnemonic(dynamic raw); + @protected + LdkNetworkGraph dco_decode_ldk_network_graph(dynamic raw); + @protected LdkNode dco_decode_ldk_node(dynamic raw); + @protected + LdkNodeError dco_decode_ldk_node_error(dynamic raw); + @protected LdkOnChainPayment dco_decode_ldk_on_chain_payment(dynamic raw); @@ -243,6 +338,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected List dco_decode_list_lightning_balance(dynamic raw); + @protected + List dco_decode_list_node_id(dynamic raw); + @protected List dco_decode_list_payment_details(dynamic raw); @@ -252,6 +350,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected List dco_decode_list_pending_sweep_balance(dynamic raw); + @protected + Uint64List dco_decode_list_prim_u_64_strict(dynamic raw); + @protected List dco_decode_list_prim_u_8_loose(dynamic raw); @@ -277,14 +378,24 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { Network dco_decode_network(dynamic raw); @protected - NodeException dco_decode_node_exception(dynamic raw); + NodeId dco_decode_node_id(dynamic raw); @protected NodeStatus dco_decode_node_status(dynamic raw); + @protected + Offer dco_decode_offer(dynamic raw); + + @protected + OfferId dco_decode_offer_id(dynamic raw); + @protected String? dco_decode_opt_String(dynamic raw); + @protected + AnchorChannelsConfig? dco_decode_opt_box_autoadd_anchor_channels_config( + dynamic raw); + @protected ChainDataSourceConfig? dco_decode_opt_box_autoadd_chain_data_source_config( dynamic raw); @@ -295,6 +406,13 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected ChannelId? dco_decode_opt_box_autoadd_channel_id(dynamic raw); + @protected + ChannelInfo? dco_decode_opt_box_autoadd_channel_info(dynamic raw); + + @protected + ChannelUpdateInfo? dco_decode_opt_box_autoadd_channel_update_info( + dynamic raw); + @protected ClosureReason? dco_decode_opt_box_autoadd_closure_reason(dynamic raw); @@ -327,6 +445,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { PaymentFailureReason? dco_decode_opt_box_autoadd_payment_failure_reason( dynamic raw); + @protected + PaymentHash? dco_decode_opt_box_autoadd_payment_hash(dynamic raw); + @protected PaymentId? dco_decode_opt_box_autoadd_payment_id(dynamic raw); @@ -346,7 +467,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { int? dco_decode_opt_box_autoadd_u_32(dynamic raw); @protected - int? dco_decode_opt_box_autoadd_u_64(dynamic raw); + BigInt? dco_decode_opt_box_autoadd_u_64(dynamic raw); @protected List? dco_decode_opt_list_socket_address(dynamic raw); @@ -394,6 +515,12 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { (SocketAddress, PublicKey, String?) dco_decode_record_socket_address_public_key_opt_string(dynamic raw); + @protected + Refund dco_decode_refund(dynamic raw); + + @protected + RoutingFees dco_decode_routing_fees(dynamic raw); + @protected SocketAddress dco_decode_socket_address(dynamic raw); @@ -407,7 +534,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { int dco_decode_u_32(dynamic raw); @protected - int dco_decode_u_64(dynamic raw); + BigInt dco_decode_u_64(dynamic raw); @protected int dco_decode_u_8(dynamic raw); @@ -434,42 +561,64 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { UserChannelId dco_decode_user_channel_id(dynamic raw); @protected - int dco_decode_usize(dynamic raw); + BigInt dco_decode_usize(dynamic raw); @protected NodeBuilder - sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( SseDeserializer deserializer); @protected - Node sse_decode_RustOpaque_Node(SseDeserializer deserializer); + NodeBuilder + sse_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + SseDeserializer deserializer); @protected NodeBuilder - sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( SseDeserializer deserializer); @protected - LdkNodePaymentBolt11Payment - sse_decode_RustOpaque_ldk_nodepaymentBolt11Payment( - SseDeserializer deserializer); + ArcBolt12Payment sse_decode_RustOpaque_Arcldk_nodepaymentBolt12Payment( + SseDeserializer deserializer); @protected - LdkNodePaymentOnchainPayment - sse_decode_RustOpaque_ldk_nodepaymentOnchainPayment( - SseDeserializer deserializer); + Node sse_decode_RustOpaque_Node(SseDeserializer deserializer); @protected - LdkNodePaymentSpontaneousPayment - sse_decode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + NodeBuilder + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( SseDeserializer deserializer); + @protected + Builder sse_decode_RustOpaque_ldk_nodeBuilder(SseDeserializer deserializer); + + @protected + NetworkGraph sse_decode_RustOpaque_ldk_nodegraphNetworkGraph( + SseDeserializer deserializer); + + @protected + Bolt11Payment sse_decode_RustOpaque_ldk_nodepaymentBolt11Payment( + SseDeserializer deserializer); + + @protected + OnchainPayment sse_decode_RustOpaque_ldk_nodepaymentOnchainPayment( + SseDeserializer deserializer); + + @protected + SpontaneousPayment sse_decode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + SseDeserializer deserializer); + @protected String sse_decode_String(SseDeserializer deserializer); @protected Address sse_decode_address(SseDeserializer deserializer); + @protected + AnchorChannelsConfig sse_decode_anchor_channels_config( + SseDeserializer deserializer); + @protected BalanceDetails sse_decode_balance_details(SseDeserializer deserializer); @@ -479,16 +628,30 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected Bolt11Invoice sse_decode_bolt_11_invoice(SseDeserializer deserializer); + @protected + Bolt12Invoice sse_decode_bolt_12_invoice(SseDeserializer deserializer); + + @protected + Bolt12ParseError sse_decode_bolt_12_parse_error(SseDeserializer deserializer); + @protected bool sse_decode_bool(SseDeserializer deserializer); @protected Address sse_decode_box_autoadd_address(SseDeserializer deserializer); + @protected + AnchorChannelsConfig sse_decode_box_autoadd_anchor_channels_config( + SseDeserializer deserializer); + @protected Bolt11Invoice sse_decode_box_autoadd_bolt_11_invoice( SseDeserializer deserializer); + @protected + Bolt12ParseError sse_decode_box_autoadd_bolt_12_parse_error( + SseDeserializer deserializer); + @protected ChainDataSourceConfig sse_decode_box_autoadd_chain_data_source_config( SseDeserializer deserializer); @@ -500,6 +663,13 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected ChannelId sse_decode_box_autoadd_channel_id(SseDeserializer deserializer); + @protected + ChannelInfo sse_decode_box_autoadd_channel_info(SseDeserializer deserializer); + + @protected + ChannelUpdateInfo sse_decode_box_autoadd_channel_update_info( + SseDeserializer deserializer); + @protected ClosureReason sse_decode_box_autoadd_closure_reason( SseDeserializer deserializer); @@ -507,6 +677,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected Config sse_decode_box_autoadd_config(SseDeserializer deserializer); + @protected + DecodeError sse_decode_box_autoadd_decode_error(SseDeserializer deserializer); + @protected EntropySourceConfig sse_decode_box_autoadd_entropy_source_config( SseDeserializer deserializer); @@ -522,9 +695,17 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { LdkBolt11Payment sse_decode_box_autoadd_ldk_bolt_11_payment( SseDeserializer deserializer); + @protected + LdkBolt12Payment sse_decode_box_autoadd_ldk_bolt_12_payment( + SseDeserializer deserializer); + @protected LdkMnemonic sse_decode_box_autoadd_ldk_mnemonic(SseDeserializer deserializer); + @protected + LdkNetworkGraph sse_decode_box_autoadd_ldk_network_graph( + SseDeserializer deserializer); + @protected LdkNode sse_decode_box_autoadd_ldk_node(SseDeserializer deserializer); @@ -548,6 +729,12 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { MaxDustHTLCExposure sse_decode_box_autoadd_max_dust_htlc_exposure( SseDeserializer deserializer); + @protected + Offer sse_decode_box_autoadd_offer(SseDeserializer deserializer); + + @protected + OfferId sse_decode_box_autoadd_offer_id(SseDeserializer deserializer); + @protected OutPoint sse_decode_box_autoadd_out_point(SseDeserializer deserializer); @@ -576,6 +763,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected PublicKey sse_decode_box_autoadd_public_key(SseDeserializer deserializer); + @protected + Refund sse_decode_box_autoadd_refund(SseDeserializer deserializer); + @protected SocketAddress sse_decode_box_autoadd_socket_address( SseDeserializer deserializer); @@ -590,15 +780,12 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { int sse_decode_box_autoadd_u_32(SseDeserializer deserializer); @protected - int sse_decode_box_autoadd_u_64(SseDeserializer deserializer); + BigInt sse_decode_box_autoadd_u_64(SseDeserializer deserializer); @protected UserChannelId sse_decode_box_autoadd_user_channel_id( SseDeserializer deserializer); - @protected - BuilderException sse_decode_builder_exception(SseDeserializer deserializer); - @protected ChainDataSourceConfig sse_decode_chain_data_source_config( SseDeserializer deserializer); @@ -612,12 +799,22 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected ChannelId sse_decode_channel_id(SseDeserializer deserializer); + @protected + ChannelInfo sse_decode_channel_info(SseDeserializer deserializer); + + @protected + ChannelUpdateInfo sse_decode_channel_update_info( + SseDeserializer deserializer); + @protected ClosureReason sse_decode_closure_reason(SseDeserializer deserializer); @protected Config sse_decode_config(SseDeserializer deserializer); + @protected + DecodeError sse_decode_decode_error(SseDeserializer deserializer); + @protected EntropySourceConfig sse_decode_entropy_source_config( SseDeserializer deserializer); @@ -635,12 +832,24 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected LdkBolt11Payment sse_decode_ldk_bolt_11_payment(SseDeserializer deserializer); + @protected + LdkBolt12Payment sse_decode_ldk_bolt_12_payment(SseDeserializer deserializer); + + @protected + LdkBuilderError sse_decode_ldk_builder_error(SseDeserializer deserializer); + @protected LdkMnemonic sse_decode_ldk_mnemonic(SseDeserializer deserializer); + @protected + LdkNetworkGraph sse_decode_ldk_network_graph(SseDeserializer deserializer); + @protected LdkNode sse_decode_ldk_node(SseDeserializer deserializer); + @protected + LdkNodeError sse_decode_ldk_node_error(SseDeserializer deserializer); + @protected LdkOnChainPayment sse_decode_ldk_on_chain_payment( SseDeserializer deserializer); @@ -664,6 +873,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { List sse_decode_list_lightning_balance( SseDeserializer deserializer); + @protected + List sse_decode_list_node_id(SseDeserializer deserializer); + @protected List sse_decode_list_payment_details( SseDeserializer deserializer); @@ -675,6 +887,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { List sse_decode_list_pending_sweep_balance( SseDeserializer deserializer); + @protected + Uint64List sse_decode_list_prim_u_64_strict(SseDeserializer deserializer); + @protected List sse_decode_list_prim_u_8_loose(SseDeserializer deserializer); @@ -702,14 +917,24 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { Network sse_decode_network(SseDeserializer deserializer); @protected - NodeException sse_decode_node_exception(SseDeserializer deserializer); + NodeId sse_decode_node_id(SseDeserializer deserializer); @protected NodeStatus sse_decode_node_status(SseDeserializer deserializer); + @protected + Offer sse_decode_offer(SseDeserializer deserializer); + + @protected + OfferId sse_decode_offer_id(SseDeserializer deserializer); + @protected String? sse_decode_opt_String(SseDeserializer deserializer); + @protected + AnchorChannelsConfig? sse_decode_opt_box_autoadd_anchor_channels_config( + SseDeserializer deserializer); + @protected ChainDataSourceConfig? sse_decode_opt_box_autoadd_chain_data_source_config( SseDeserializer deserializer); @@ -722,6 +947,14 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { ChannelId? sse_decode_opt_box_autoadd_channel_id( SseDeserializer deserializer); + @protected + ChannelInfo? sse_decode_opt_box_autoadd_channel_info( + SseDeserializer deserializer); + + @protected + ChannelUpdateInfo? sse_decode_opt_box_autoadd_channel_update_info( + SseDeserializer deserializer); + @protected ClosureReason? sse_decode_opt_box_autoadd_closure_reason( SseDeserializer deserializer); @@ -756,6 +989,10 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { PaymentFailureReason? sse_decode_opt_box_autoadd_payment_failure_reason( SseDeserializer deserializer); + @protected + PaymentHash? sse_decode_opt_box_autoadd_payment_hash( + SseDeserializer deserializer); + @protected PaymentId? sse_decode_opt_box_autoadd_payment_id( SseDeserializer deserializer); @@ -779,7 +1016,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { int? sse_decode_opt_box_autoadd_u_32(SseDeserializer deserializer); @protected - int? sse_decode_opt_box_autoadd_u_64(SseDeserializer deserializer); + BigInt? sse_decode_opt_box_autoadd_u_64(SseDeserializer deserializer); @protected List? sse_decode_opt_list_socket_address( @@ -831,6 +1068,12 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { sse_decode_record_socket_address_public_key_opt_string( SseDeserializer deserializer); + @protected + Refund sse_decode_refund(SseDeserializer deserializer); + + @protected + RoutingFees sse_decode_routing_fees(SseDeserializer deserializer); + @protected SocketAddress sse_decode_socket_address(SseDeserializer deserializer); @@ -844,7 +1087,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { int sse_decode_u_32(SseDeserializer deserializer); @protected - int sse_decode_u_64(SseDeserializer deserializer); + BigInt sse_decode_u_64(SseDeserializer deserializer); @protected int sse_decode_u_8(SseDeserializer deserializer); @@ -871,7 +1114,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { UserChannelId sse_decode_user_channel_id(SseDeserializer deserializer); @protected - int sse_decode_usize(SseDeserializer deserializer); + BigInt sse_decode_usize(SseDeserializer deserializer); @protected ffi.Pointer cst_encode_String(String raw) { @@ -887,6 +1130,15 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ptr; } + @protected + ffi.Pointer + cst_encode_box_autoadd_anchor_channels_config(AnchorChannelsConfig raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_anchor_channels_config(); + cst_api_fill_to_wire_anchor_channels_config(raw, ptr.ref); + return ptr; + } + @protected ffi.Pointer cst_encode_box_autoadd_bolt_11_invoice( Bolt11Invoice raw) { @@ -896,6 +1148,15 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ptr; } + @protected + ffi.Pointer + cst_encode_box_autoadd_bolt_12_parse_error(Bolt12ParseError raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_bolt_12_parse_error(); + cst_api_fill_to_wire_bolt_12_parse_error(raw, ptr.ref); + return ptr; + } + @protected ffi.Pointer cst_encode_box_autoadd_chain_data_source_config( @@ -924,6 +1185,24 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ptr; } + @protected + ffi.Pointer cst_encode_box_autoadd_channel_info( + ChannelInfo raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_channel_info(); + cst_api_fill_to_wire_channel_info(raw, ptr.ref); + return ptr; + } + + @protected + ffi.Pointer + cst_encode_box_autoadd_channel_update_info(ChannelUpdateInfo raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_channel_update_info(); + cst_api_fill_to_wire_channel_update_info(raw, ptr.ref); + return ptr; + } + @protected ffi.Pointer cst_encode_box_autoadd_closure_reason( ClosureReason raw) { @@ -941,6 +1220,15 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ptr; } + @protected + ffi.Pointer cst_encode_box_autoadd_decode_error( + DecodeError raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_decode_error(); + cst_api_fill_to_wire_decode_error(raw, ptr.ref); + return ptr; + } + @protected ffi.Pointer cst_encode_box_autoadd_entropy_source_config(EntropySourceConfig raw) { @@ -976,6 +1264,15 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ptr; } + @protected + ffi.Pointer + cst_encode_box_autoadd_ldk_bolt_12_payment(LdkBolt12Payment raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_ldk_bolt_12_payment(); + cst_api_fill_to_wire_ldk_bolt_12_payment(raw, ptr.ref); + return ptr; + } + @protected ffi.Pointer cst_encode_box_autoadd_ldk_mnemonic( LdkMnemonic raw) { @@ -985,6 +1282,15 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ptr; } + @protected + ffi.Pointer + cst_encode_box_autoadd_ldk_network_graph(LdkNetworkGraph raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_ldk_network_graph(); + cst_api_fill_to_wire_ldk_network_graph(raw, ptr.ref); + return ptr; + } + @protected ffi.Pointer cst_encode_box_autoadd_ldk_node(LdkNode raw) { // Codec=Cst (C-struct based), see doc to use other codecs @@ -1040,6 +1346,22 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ptr; } + @protected + ffi.Pointer cst_encode_box_autoadd_offer(Offer raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_offer(); + cst_api_fill_to_wire_offer(raw, ptr.ref); + return ptr; + } + + @protected + ffi.Pointer cst_encode_box_autoadd_offer_id(OfferId raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_offer_id(); + cst_api_fill_to_wire_offer_id(raw, ptr.ref); + return ptr; + } + @protected ffi.Pointer cst_encode_box_autoadd_out_point( OutPoint raw) { @@ -1111,6 +1433,14 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ptr; } + @protected + ffi.Pointer cst_encode_box_autoadd_refund(Refund raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_refund(); + cst_api_fill_to_wire_refund(raw, ptr.ref); + return ptr; + } + @protected ffi.Pointer cst_encode_box_autoadd_socket_address( SocketAddress raw) { @@ -1141,7 +1471,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { } @protected - ffi.Pointer cst_encode_box_autoadd_u_64(int raw) { + ffi.Pointer cst_encode_box_autoadd_u_64(BigInt raw) { // Codec=Cst (C-struct based), see doc to use other codecs return wire.cst_new_box_autoadd_u_64(cst_encode_u_64(raw)); } @@ -1177,6 +1507,16 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ans; } + @protected + ffi.Pointer cst_encode_list_node_id(List raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ans = wire.cst_new_list_node_id(raw.length); + for (var i = 0; i < raw.length; ++i) { + cst_api_fill_to_wire_node_id(raw[i], ans.ref.ptr[i]); + } + return ans; + } + @protected ffi.Pointer cst_encode_list_payment_details( List raw) { @@ -1210,6 +1550,15 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ans; } + @protected + ffi.Pointer cst_encode_list_prim_u_64_strict( + Uint64List raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ans = wire.cst_new_list_prim_u_64_strict(raw.length); + ans.ref.ptr.asTypedList(raw.length).setAll(0, raw.inner); + return ans; + } + @protected ffi.Pointer cst_encode_list_prim_u_8_loose( List raw) { @@ -1257,6 +1606,16 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return raw == null ? ffi.nullptr : cst_encode_String(raw); } + @protected + ffi.Pointer + cst_encode_opt_box_autoadd_anchor_channels_config( + AnchorChannelsConfig? raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw == null + ? ffi.nullptr + : cst_encode_box_autoadd_anchor_channels_config(raw); + } + @protected ffi.Pointer cst_encode_opt_box_autoadd_chain_data_source_config( @@ -1284,16 +1643,32 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { } @protected - ffi.Pointer - cst_encode_opt_box_autoadd_closure_reason(ClosureReason? raw) { + ffi.Pointer cst_encode_opt_box_autoadd_channel_info( + ChannelInfo? raw) { // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null - ? ffi.nullptr - : cst_encode_box_autoadd_closure_reason(raw); + return raw == null ? ffi.nullptr : cst_encode_box_autoadd_channel_info(raw); } @protected - ffi.Pointer + ffi.Pointer + cst_encode_opt_box_autoadd_channel_update_info(ChannelUpdateInfo? raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw == null + ? ffi.nullptr + : cst_encode_box_autoadd_channel_update_info(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( EntropySourceConfig? raw) { // Codec=Cst (C-struct based), see doc to use other codecs @@ -1362,6 +1737,13 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { : cst_encode_box_autoadd_payment_failure_reason(raw); } + @protected + ffi.Pointer cst_encode_opt_box_autoadd_payment_hash( + PaymentHash? raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw == null ? ffi.nullptr : cst_encode_box_autoadd_payment_hash(raw); + } + @protected ffi.Pointer cst_encode_opt_box_autoadd_payment_id( PaymentId? raw) { @@ -1407,7 +1789,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { } @protected - ffi.Pointer cst_encode_opt_box_autoadd_u_64(int? raw) { + ffi.Pointer cst_encode_opt_box_autoadd_u_64(BigInt? raw) { // Codec=Cst (C-struct based), see doc to use other codecs return raw == null ? ffi.nullptr : cst_encode_box_autoadd_u_64(raw); } @@ -1420,9 +1802,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { } @protected - int cst_encode_u_64(int raw) { + int cst_encode_u_64(BigInt raw) { // Codec=Cst (C-struct based), see doc to use other codecs - return raw.toInt(); + return raw.toSigned(64).toInt(); } @protected @@ -1470,11 +1852,26 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ans; } + @protected + int cst_encode_usize(BigInt raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw.toSigned(64).toInt(); + } + @protected void cst_api_fill_to_wire_address(Address apiObj, wire_cst_address wireObj) { wireObj.s = cst_encode_String(apiObj.s); } + @protected + void cst_api_fill_to_wire_anchor_channels_config( + AnchorChannelsConfig apiObj, wire_cst_anchor_channels_config wireObj) { + wireObj.trusted_peers_no_reserve = + cst_encode_list_public_key(apiObj.trustedPeersNoReserve); + wireObj.per_channel_reserve_sats = + cst_encode_u_64(apiObj.perChannelReserveSats); + } + @protected void cst_api_fill_to_wire_balance_details( BalanceDetails apiObj, wire_cst_balance_details wireObj) { @@ -1504,18 +1901,75 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { wireObj.signed_raw_invoice = cst_encode_String(apiObj.signedRawInvoice); } + @protected + void cst_api_fill_to_wire_bolt_12_invoice( + Bolt12Invoice apiObj, wire_cst_bolt_12_invoice wireObj) { + wireObj.data = cst_encode_list_prim_u_8_strict(apiObj.data); + } + + @protected + void cst_api_fill_to_wire_bolt_12_parse_error( + Bolt12ParseError apiObj, wire_cst_bolt_12_parse_error wireObj) { + if (apiObj is Bolt12ParseError_InvalidContinuation) { + wireObj.tag = 0; + return; + } + if (apiObj is Bolt12ParseError_InvalidBech32Hrp) { + wireObj.tag = 1; + return; + } + if (apiObj is Bolt12ParseError_Bech32) { + var pre_field0 = cst_encode_String(apiObj.field0); + wireObj.tag = 2; + wireObj.kind.Bech32.field0 = pre_field0; + return; + } + if (apiObj is Bolt12ParseError_Decode) { + var pre_field0 = cst_encode_box_autoadd_decode_error(apiObj.field0); + wireObj.tag = 3; + wireObj.kind.Decode.field0 = pre_field0; + return; + } + if (apiObj is Bolt12ParseError_InvalidSemantics) { + var pre_field0 = cst_encode_String(apiObj.field0); + wireObj.tag = 4; + wireObj.kind.InvalidSemantics.field0 = pre_field0; + return; + } + if (apiObj is Bolt12ParseError_InvalidSignature) { + var pre_field0 = cst_encode_String(apiObj.field0); + wireObj.tag = 5; + wireObj.kind.InvalidSignature.field0 = pre_field0; + return; + } + } + @protected void cst_api_fill_to_wire_box_autoadd_address( Address apiObj, ffi.Pointer wireObj) { cst_api_fill_to_wire_address(apiObj, wireObj.ref); } + @protected + void cst_api_fill_to_wire_box_autoadd_anchor_channels_config( + AnchorChannelsConfig apiObj, + ffi.Pointer wireObj) { + cst_api_fill_to_wire_anchor_channels_config(apiObj, wireObj.ref); + } + @protected void cst_api_fill_to_wire_box_autoadd_bolt_11_invoice( Bolt11Invoice apiObj, ffi.Pointer wireObj) { cst_api_fill_to_wire_bolt_11_invoice(apiObj, wireObj.ref); } + @protected + void cst_api_fill_to_wire_box_autoadd_bolt_12_parse_error( + Bolt12ParseError apiObj, + ffi.Pointer wireObj) { + cst_api_fill_to_wire_bolt_12_parse_error(apiObj, wireObj.ref); + } + @protected void cst_api_fill_to_wire_box_autoadd_chain_data_source_config( ChainDataSourceConfig apiObj, @@ -1535,6 +1989,19 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { cst_api_fill_to_wire_channel_id(apiObj, wireObj.ref); } + @protected + void cst_api_fill_to_wire_box_autoadd_channel_info( + ChannelInfo apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_channel_info(apiObj, wireObj.ref); + } + + @protected + void cst_api_fill_to_wire_box_autoadd_channel_update_info( + ChannelUpdateInfo apiObj, + ffi.Pointer wireObj) { + cst_api_fill_to_wire_channel_update_info(apiObj, wireObj.ref); + } + @protected void cst_api_fill_to_wire_box_autoadd_closure_reason( ClosureReason apiObj, ffi.Pointer wireObj) { @@ -1547,6 +2014,12 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { cst_api_fill_to_wire_config(apiObj, wireObj.ref); } + @protected + void cst_api_fill_to_wire_box_autoadd_decode_error( + DecodeError apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_decode_error(apiObj, wireObj.ref); + } + @protected void cst_api_fill_to_wire_box_autoadd_entropy_source_config( EntropySourceConfig apiObj, @@ -1574,12 +2047,25 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { cst_api_fill_to_wire_ldk_bolt_11_payment(apiObj, wireObj.ref); } + @protected + void cst_api_fill_to_wire_box_autoadd_ldk_bolt_12_payment( + LdkBolt12Payment apiObj, + ffi.Pointer wireObj) { + cst_api_fill_to_wire_ldk_bolt_12_payment(apiObj, wireObj.ref); + } + @protected 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_ldk_network_graph( + LdkNetworkGraph apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_ldk_network_graph(apiObj, wireObj.ref); + } + @protected void cst_api_fill_to_wire_box_autoadd_ldk_node( LdkNode apiObj, ffi.Pointer wireObj) { @@ -1620,6 +2106,18 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { cst_api_fill_to_wire_max_dust_htlc_exposure(apiObj, wireObj.ref); } + @protected + void cst_api_fill_to_wire_box_autoadd_offer( + Offer apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_offer(apiObj, wireObj.ref); + } + + @protected + void cst_api_fill_to_wire_box_autoadd_offer_id( + OfferId apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_offer_id(apiObj, wireObj.ref); + } + @protected void cst_api_fill_to_wire_box_autoadd_out_point( OutPoint apiObj, ffi.Pointer wireObj) { @@ -1662,6 +2160,12 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { cst_api_fill_to_wire_public_key(apiObj, wireObj.ref); } + @protected + void cst_api_fill_to_wire_box_autoadd_refund( + Refund apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_refund(apiObj, wireObj.ref); + } + @protected void cst_api_fill_to_wire_box_autoadd_socket_address( SocketAddress apiObj, ffi.Pointer wireObj) { @@ -1772,6 +2276,30 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { wireObj.data = cst_encode_u_8_array_32(apiObj.data); } + @protected + void cst_api_fill_to_wire_channel_info( + ChannelInfo apiObj, wire_cst_channel_info wireObj) { + cst_api_fill_to_wire_node_id(apiObj.nodeOne, wireObj.node_one); + wireObj.one_to_two = + cst_encode_opt_box_autoadd_channel_update_info(apiObj.oneToTwo); + cst_api_fill_to_wire_node_id(apiObj.nodeTwo, wireObj.node_two); + wireObj.two_to_one = + cst_encode_opt_box_autoadd_channel_update_info(apiObj.twoToOne); + wireObj.capacity_sats = + cst_encode_opt_box_autoadd_u_64(apiObj.capacitySats); + } + + @protected + void cst_api_fill_to_wire_channel_update_info( + ChannelUpdateInfo apiObj, wire_cst_channel_update_info wireObj) { + wireObj.last_update = cst_encode_u_32(apiObj.lastUpdate); + wireObj.enabled = cst_encode_bool(apiObj.enabled); + wireObj.cltv_expiry_delta = cst_encode_u_16(apiObj.cltvExpiryDelta); + wireObj.htlc_minimum_msat = cst_encode_u_64(apiObj.htlcMinimumMsat); + wireObj.htlc_maximum_msat = cst_encode_u_64(apiObj.htlcMaximumMsat); + cst_api_fill_to_wire_routing_fees(apiObj.fees, wireObj.fees); + } + @protected void cst_api_fill_to_wire_closure_reason( ClosureReason apiObj, wire_cst_closure_reason wireObj) { @@ -1853,6 +2381,48 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { wireObj.probing_liquidity_limit_multiplier = cst_encode_u_64(apiObj.probingLiquidityLimitMultiplier); wireObj.log_level = cst_encode_log_level(apiObj.logLevel); + wireObj.anchor_channels_config = + cst_encode_opt_box_autoadd_anchor_channels_config( + apiObj.anchorChannelsConfig); + } + + @protected + void cst_api_fill_to_wire_decode_error( + DecodeError apiObj, wire_cst_decode_error wireObj) { + if (apiObj is DecodeError_UnknownVersion) { + wireObj.tag = 0; + return; + } + if (apiObj is DecodeError_UnknownRequiredFeature) { + wireObj.tag = 1; + return; + } + if (apiObj is DecodeError_InvalidValue) { + wireObj.tag = 2; + return; + } + if (apiObj is DecodeError_ShortRead) { + wireObj.tag = 3; + return; + } + if (apiObj is DecodeError_BadLengthDescriptor) { + wireObj.tag = 4; + return; + } + if (apiObj is DecodeError_Io) { + var pre_field0 = cst_encode_String(apiObj.field0); + wireObj.tag = 5; + wireObj.kind.Io.field0 = pre_field0; + return; + } + if (apiObj is DecodeError_UnsupportedCompression) { + wireObj.tag = 6; + return; + } + if (apiObj is DecodeError_DangerousValue) { + wireObj.tag = 7; + return; + } } @protected @@ -1882,6 +2452,22 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected void cst_api_fill_to_wire_event(Event apiObj, wire_cst_event wireObj) { + if (apiObj is Event_PaymentClaimable) { + var pre_payment_id = cst_encode_box_autoadd_payment_id(apiObj.paymentId); + var pre_payment_hash = + cst_encode_box_autoadd_payment_hash(apiObj.paymentHash); + var pre_claimable_amount_msat = + cst_encode_u_64(apiObj.claimableAmountMsat); + var pre_claim_deadline = + cst_encode_opt_box_autoadd_u_32(apiObj.claimDeadline); + wireObj.tag = 0; + wireObj.kind.PaymentClaimable.payment_id = pre_payment_id; + wireObj.kind.PaymentClaimable.payment_hash = pre_payment_hash; + wireObj.kind.PaymentClaimable.claimable_amount_msat = + pre_claimable_amount_msat; + wireObj.kind.PaymentClaimable.claim_deadline = pre_claim_deadline; + return; + } if (apiObj is Event_PaymentSuccessful) { var pre_payment_id = cst_encode_opt_box_autoadd_payment_id(apiObj.paymentId); @@ -1889,7 +2475,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { 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.tag = 1; wireObj.kind.PaymentSuccessful.payment_id = pre_payment_id; wireObj.kind.PaymentSuccessful.payment_hash = pre_payment_hash; wireObj.kind.PaymentSuccessful.fee_paid_msat = pre_fee_paid_msat; @@ -1902,7 +2488,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { 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.tag = 2; wireObj.kind.PaymentFailed.payment_id = pre_payment_id; wireObj.kind.PaymentFailed.payment_hash = pre_payment_hash; wireObj.kind.PaymentFailed.reason = pre_reason; @@ -1914,7 +2500,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { var pre_payment_hash = cst_encode_box_autoadd_payment_hash(apiObj.paymentHash); var pre_amount_msat = cst_encode_u_64(apiObj.amountMsat); - wireObj.tag = 2; + wireObj.tag = 3; wireObj.kind.PaymentReceived.payment_id = pre_payment_id; wireObj.kind.PaymentReceived.payment_hash = pre_payment_hash; wireObj.kind.PaymentReceived.amount_msat = pre_amount_msat; @@ -1929,7 +2515,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { 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); - wireObj.tag = 3; + wireObj.tag = 4; 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 = @@ -1945,7 +2531,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { 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.tag = 5; 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; @@ -1958,7 +2544,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { 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); - wireObj.tag = 5; + wireObj.tag = 6; wireObj.kind.ChannelClosed.channel_id = pre_channel_id; wireObj.kind.ChannelClosed.user_channel_id = pre_user_channel_id; wireObj.kind.ChannelClosed.counterparty_node_id = @@ -1991,148 +2577,368 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { } @protected - void cst_api_fill_to_wire_ldk_mnemonic( - LdkMnemonic apiObj, wire_cst_ldk_mnemonic wireObj) { - wireObj.seed_phrase = cst_encode_String(apiObj.seedPhrase); + void cst_api_fill_to_wire_ldk_bolt_12_payment( + LdkBolt12Payment apiObj, wire_cst_ldk_bolt_12_payment wireObj) { + wireObj.ptr = + cst_encode_RustOpaque_Arcldk_nodepaymentBolt12Payment(apiObj.ptr); } @protected - void cst_api_fill_to_wire_ldk_node( - LdkNode apiObj, wire_cst_ldk_node wireObj) { - wireObj.ptr = cst_encode_RustOpaque_Node(apiObj.ptr); + 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_ldk_on_chain_payment( - LdkOnChainPayment apiObj, wire_cst_ldk_on_chain_payment wireObj) { - wireObj.ptr = - cst_encode_RustOpaque_ldk_nodepaymentOnchainPayment(apiObj.ptr); + void cst_api_fill_to_wire_ldk_network_graph( + LdkNetworkGraph apiObj, wire_cst_ldk_network_graph wireObj) { + wireObj.inner = + cst_encode_RustOpaque_ldk_nodegraphNetworkGraph(apiObj.inner); } @protected - void cst_api_fill_to_wire_ldk_spontaneous_payment( - LdkSpontaneousPayment apiObj, wire_cst_ldk_spontaneous_payment wireObj) { - wireObj.ptr = - cst_encode_RustOpaque_ldk_nodepaymentSpontaneousPayment(apiObj.ptr); + void cst_api_fill_to_wire_ldk_node( + LdkNode apiObj, wire_cst_ldk_node wireObj) { + wireObj.ptr = cst_encode_RustOpaque_Node(apiObj.ptr); } @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); + void cst_api_fill_to_wire_ldk_node_error( + LdkNodeError apiObj, wire_cst_ldk_node_error wireObj) { + if (apiObj is LdkNodeError_InvalidTxid) { 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); + if (apiObj is LdkNodeError_AlreadyRunning) { 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); + if (apiObj is LdkNodeError_NotRunning) { 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); + if (apiObj is LdkNodeError_OnchainTxCreationFailed) { 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); + if (apiObj is LdkNodeError_ConnectionFailed) { 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); + if (apiObj is LdkNodeError_InvoiceCreationFailed) { 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; } - } - - @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); - } - - @protected - void cst_api_fill_to_wire_lsp_fee_limits( - LSPFeeLimits apiObj, wire_cst_lsp_fee_limits wireObj) { - wireObj.max_total_opening_fee_msat = - cst_encode_opt_box_autoadd_u_64(apiObj.maxTotalOpeningFeeMsat); + if (apiObj is LdkNodeError_PaymentSendingFailed) { + wireObj.tag = 6; + return; + } + if (apiObj is LdkNodeError_ProbeSendingFailed) { + wireObj.tag = 7; + return; + } + if (apiObj is LdkNodeError_ChannelCreationFailed) { + wireObj.tag = 8; + return; + } + if (apiObj is LdkNodeError_ChannelClosingFailed) { + wireObj.tag = 9; + return; + } + if (apiObj is LdkNodeError_ChannelConfigUpdateFailed) { + wireObj.tag = 10; + return; + } + if (apiObj is LdkNodeError_PersistenceFailed) { + wireObj.tag = 11; + return; + } + if (apiObj is LdkNodeError_WalletOperationFailed) { + wireObj.tag = 12; + return; + } + if (apiObj is LdkNodeError_OnchainTxSigningFailed) { + wireObj.tag = 13; + return; + } + if (apiObj is LdkNodeError_MessageSigningFailed) { + wireObj.tag = 14; + return; + } + if (apiObj is LdkNodeError_TxSyncFailed) { + wireObj.tag = 15; + return; + } + if (apiObj is LdkNodeError_GossipUpdateFailed) { + wireObj.tag = 16; + return; + } + if (apiObj is LdkNodeError_InvalidAddress) { + wireObj.tag = 17; + return; + } + if (apiObj is LdkNodeError_InvalidSocketAddress) { + wireObj.tag = 18; + return; + } + if (apiObj is LdkNodeError_InvalidPublicKey) { + wireObj.tag = 19; + return; + } + if (apiObj is LdkNodeError_InvalidSecretKey) { + wireObj.tag = 20; + return; + } + if (apiObj is LdkNodeError_InvalidPaymentHash) { + wireObj.tag = 21; + return; + } + if (apiObj is LdkNodeError_InvalidPaymentPreimage) { + wireObj.tag = 22; + return; + } + if (apiObj is LdkNodeError_InvalidPaymentSecret) { + wireObj.tag = 23; + return; + } + if (apiObj is LdkNodeError_InvalidAmount) { + wireObj.tag = 24; + return; + } + if (apiObj is LdkNodeError_InvalidInvoice) { + wireObj.tag = 25; + return; + } + if (apiObj is LdkNodeError_InvalidChannelId) { + wireObj.tag = 26; + return; + } + if (apiObj is LdkNodeError_InvalidNetwork) { + wireObj.tag = 27; + return; + } + if (apiObj is LdkNodeError_DuplicatePayment) { + wireObj.tag = 28; + return; + } + if (apiObj is LdkNodeError_InsufficientFunds) { + wireObj.tag = 29; + return; + } + if (apiObj is LdkNodeError_FeerateEstimationUpdateFailed) { + wireObj.tag = 30; + return; + } + if (apiObj is LdkNodeError_LiquidityRequestFailed) { + wireObj.tag = 31; + return; + } + if (apiObj is LdkNodeError_LiquiditySourceUnavailable) { + wireObj.tag = 32; + return; + } + if (apiObj is LdkNodeError_LiquidityFeeTooHigh) { + wireObj.tag = 33; + return; + } + if (apiObj is LdkNodeError_InvalidPaymentId) { + wireObj.tag = 34; + return; + } + if (apiObj is LdkNodeError_Decode) { + var pre_field0 = cst_encode_box_autoadd_decode_error(apiObj.field0); + wireObj.tag = 35; + wireObj.kind.Decode.field0 = pre_field0; + return; + } + if (apiObj is LdkNodeError_Bolt12Parse) { + var pre_field0 = + cst_encode_box_autoadd_bolt_12_parse_error(apiObj.field0); + wireObj.tag = 36; + wireObj.kind.Bolt12Parse.field0 = pre_field0; + return; + } + if (apiObj is LdkNodeError_InvoiceRequestCreationFailed) { + wireObj.tag = 37; + return; + } + if (apiObj is LdkNodeError_OfferCreationFailed) { + wireObj.tag = 38; + return; + } + if (apiObj is LdkNodeError_RefundCreationFailed) { + wireObj.tag = 39; + return; + } + if (apiObj is LdkNodeError_FeerateEstimationUpdateTimeout) { + wireObj.tag = 40; + return; + } + if (apiObj is LdkNodeError_WalletOperationTimeout) { + wireObj.tag = 41; + return; + } + if (apiObj is LdkNodeError_TxSyncTimeout) { + wireObj.tag = 42; + return; + } + if (apiObj is LdkNodeError_GossipUpdateTimeout) { + wireObj.tag = 43; + return; + } + if (apiObj is LdkNodeError_InvalidOfferId) { + wireObj.tag = 44; + return; + } + if (apiObj is LdkNodeError_InvalidNodeId) { + wireObj.tag = 45; + return; + } + if (apiObj is LdkNodeError_InvalidOffer) { + wireObj.tag = 46; + return; + } + if (apiObj is LdkNodeError_InvalidRefund) { + wireObj.tag = 47; + return; + } + if (apiObj is LdkNodeError_UnsupportedCurrency) { + wireObj.tag = 48; + return; + } + } + + @protected + void cst_api_fill_to_wire_ldk_on_chain_payment( + LdkOnChainPayment apiObj, wire_cst_ldk_on_chain_payment wireObj) { + wireObj.ptr = + cst_encode_RustOpaque_ldk_nodepaymentOnchainPayment(apiObj.ptr); + } + + @protected + void cst_api_fill_to_wire_ldk_spontaneous_payment( + LdkSpontaneousPayment apiObj, wire_cst_ldk_spontaneous_payment wireObj) { + wireObj.ptr = + cst_encode_RustOpaque_ldk_nodepaymentSpontaneousPayment(apiObj.ptr); + } + + @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; + } + } + + @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); + } + + @protected + void cst_api_fill_to_wire_lsp_fee_limits( + LSPFeeLimits apiObj, wire_cst_lsp_fee_limits wireObj) { + wireObj.max_total_opening_fee_msat = + cst_encode_opt_box_autoadd_u_64(apiObj.maxTotalOpeningFeeMsat); wireObj.max_proportional_opening_fee_ppm_msat = cst_encode_opt_box_autoadd_u_64( apiObj.maxProportionalOpeningFeePpmMsat); @@ -2155,6 +2961,11 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { } } + @protected + void cst_api_fill_to_wire_node_id(NodeId apiObj, wire_cst_node_id wireObj) { + wireObj.compressed = cst_encode_list_prim_u_8_strict(apiObj.compressed); + } + @protected void cst_api_fill_to_wire_node_status( NodeStatus apiObj, wire_cst_node_status wireObj) { @@ -2177,6 +2988,17 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { apiObj.latestNodeAnnouncementBroadcastTimestamp); } + @protected + void cst_api_fill_to_wire_offer(Offer apiObj, wire_cst_offer wireObj) { + wireObj.s = cst_encode_String(apiObj.s); + } + + @protected + void cst_api_fill_to_wire_offer_id( + OfferId apiObj, wire_cst_offer_id wireObj) { + wireObj.field0 = cst_encode_u_8_array_32(apiObj.field0); + } + @protected void cst_api_fill_to_wire_out_point( OutPoint apiObj, wire_cst_out_point wireObj) { @@ -2247,6 +3069,30 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { wireObj.kind.Spontaneous.preimage = pre_preimage; return; } + if (apiObj is PaymentKind_Bolt12Offer) { + var pre_hash = cst_encode_opt_box_autoadd_payment_hash(apiObj.hash); + var pre_preimage = + cst_encode_opt_box_autoadd_payment_preimage(apiObj.preimage); + var pre_secret = cst_encode_opt_box_autoadd_payment_secret(apiObj.secret); + var pre_offer_id = cst_encode_box_autoadd_offer_id(apiObj.offerId); + wireObj.tag = 4; + wireObj.kind.Bolt12Offer.hash = pre_hash; + wireObj.kind.Bolt12Offer.preimage = pre_preimage; + wireObj.kind.Bolt12Offer.secret = pre_secret; + wireObj.kind.Bolt12Offer.offer_id = pre_offer_id; + return; + } + if (apiObj is PaymentKind_Bolt12Refund) { + var pre_hash = cst_encode_opt_box_autoadd_payment_hash(apiObj.hash); + var pre_preimage = + cst_encode_opt_box_autoadd_payment_preimage(apiObj.preimage); + var pre_secret = cst_encode_opt_box_autoadd_payment_secret(apiObj.secret); + wireObj.tag = 5; + wireObj.kind.Bolt12Refund.hash = pre_hash; + wireObj.kind.Bolt12Refund.preimage = pre_preimage; + wireObj.kind.Bolt12Refund.secret = pre_secret; + return; + } } @protected @@ -2336,6 +3182,19 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { wireObj.field2 = cst_encode_opt_String(apiObj.$3); } + @protected + void cst_api_fill_to_wire_refund(Refund apiObj, wire_cst_refund wireObj) { + wireObj.s = cst_encode_String(apiObj.s); + } + + @protected + void cst_api_fill_to_wire_routing_fees( + RoutingFees apiObj, wire_cst_routing_fees wireObj) { + wireObj.base_msat = cst_encode_u_32(apiObj.baseMsat); + wireObj.proportional_millionths = + cst_encode_u_32(apiObj.proportionalMillionths); + } + @protected void cst_api_fill_to_wire_socket_address( SocketAddress apiObj, wire_cst_socket_address wireObj) { @@ -2395,36 +3254,52 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { } @protected - int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( NodeBuilder raw); + @protected + int cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder raw); + + @protected + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder raw); + + @protected + int cst_encode_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ArcBolt12Payment raw); + @protected int cst_encode_RustOpaque_Node(Node raw); @protected - int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( NodeBuilder raw); @protected - int cst_encode_RustOpaque_ldk_nodepaymentBolt11Payment( - LdkNodePaymentBolt11Payment raw); + int cst_encode_RustOpaque_ldk_nodeBuilder(Builder raw); + + @protected + int cst_encode_RustOpaque_ldk_nodegraphNetworkGraph(NetworkGraph raw); + + @protected + int cst_encode_RustOpaque_ldk_nodepaymentBolt11Payment(Bolt11Payment raw); @protected - int cst_encode_RustOpaque_ldk_nodepaymentOnchainPayment( - LdkNodePaymentOnchainPayment raw); + int cst_encode_RustOpaque_ldk_nodepaymentOnchainPayment(OnchainPayment raw); @protected int cst_encode_RustOpaque_ldk_nodepaymentSpontaneousPayment( - LdkNodePaymentSpontaneousPayment raw); + SpontaneousPayment raw); @protected bool cst_encode_bool(bool raw); @protected - int cst_encode_builder_exception(BuilderException raw); + int cst_encode_i_32(int raw); @protected - int cst_encode_i_32(int raw); + int cst_encode_ldk_builder_error(LdkBuilderError raw); @protected int cst_encode_log_level(LogLevel raw); @@ -2432,9 +3307,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected int cst_encode_network(Network raw); - @protected - int cst_encode_node_exception(NodeException raw); - @protected int cst_encode_payment_direction(PaymentDirection raw); @@ -2457,32 +3329,51 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void cst_encode_unit(void raw); @protected - int cst_encode_usize(int raw); + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder self, SseSerializer serializer); @protected void - sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( NodeBuilder self, SseSerializer serializer); + @protected + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder self, SseSerializer serializer); + + @protected + void sse_encode_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ArcBolt12Payment self, SseSerializer serializer); + @protected void sse_encode_RustOpaque_Node(Node self, SseSerializer serializer); @protected void - sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( NodeBuilder self, SseSerializer serializer); + @protected + void sse_encode_RustOpaque_ldk_nodeBuilder( + Builder self, SseSerializer serializer); + + @protected + void sse_encode_RustOpaque_ldk_nodegraphNetworkGraph( + NetworkGraph self, SseSerializer serializer); + @protected void sse_encode_RustOpaque_ldk_nodepaymentBolt11Payment( - LdkNodePaymentBolt11Payment self, SseSerializer serializer); + Bolt11Payment self, SseSerializer serializer); @protected void sse_encode_RustOpaque_ldk_nodepaymentOnchainPayment( - LdkNodePaymentOnchainPayment self, SseSerializer serializer); + OnchainPayment self, SseSerializer serializer); @protected void sse_encode_RustOpaque_ldk_nodepaymentSpontaneousPayment( - LdkNodePaymentSpontaneousPayment self, SseSerializer serializer); + SpontaneousPayment self, SseSerializer serializer); @protected void sse_encode_String(String self, SseSerializer serializer); @@ -2490,6 +3381,10 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected void sse_encode_address(Address self, SseSerializer serializer); + @protected + void sse_encode_anchor_channels_config( + AnchorChannelsConfig self, SseSerializer serializer); + @protected void sse_encode_balance_details( BalanceDetails self, SseSerializer serializer); @@ -2500,16 +3395,31 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected void sse_encode_bolt_11_invoice(Bolt11Invoice self, SseSerializer serializer); + @protected + void sse_encode_bolt_12_invoice(Bolt12Invoice self, SseSerializer serializer); + + @protected + void sse_encode_bolt_12_parse_error( + Bolt12ParseError self, SseSerializer serializer); + @protected void sse_encode_bool(bool self, SseSerializer serializer); @protected void sse_encode_box_autoadd_address(Address self, SseSerializer serializer); + @protected + void sse_encode_box_autoadd_anchor_channels_config( + AnchorChannelsConfig self, SseSerializer serializer); + @protected void sse_encode_box_autoadd_bolt_11_invoice( Bolt11Invoice self, SseSerializer serializer); + @protected + void sse_encode_box_autoadd_bolt_12_parse_error( + Bolt12ParseError self, SseSerializer serializer); + @protected void sse_encode_box_autoadd_chain_data_source_config( ChainDataSourceConfig self, SseSerializer serializer); @@ -2522,6 +3432,14 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_box_autoadd_channel_id( ChannelId self, SseSerializer serializer); + @protected + void sse_encode_box_autoadd_channel_info( + ChannelInfo self, SseSerializer serializer); + + @protected + void sse_encode_box_autoadd_channel_update_info( + ChannelUpdateInfo self, SseSerializer serializer); + @protected void sse_encode_box_autoadd_closure_reason( ClosureReason self, SseSerializer serializer); @@ -2529,6 +3447,10 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected void sse_encode_box_autoadd_config(Config self, SseSerializer serializer); + @protected + void sse_encode_box_autoadd_decode_error( + DecodeError self, SseSerializer serializer); + @protected void sse_encode_box_autoadd_entropy_source_config( EntropySourceConfig self, SseSerializer serializer); @@ -2544,10 +3466,18 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_box_autoadd_ldk_bolt_11_payment( LdkBolt11Payment self, SseSerializer serializer); + @protected + void sse_encode_box_autoadd_ldk_bolt_12_payment( + LdkBolt12Payment self, SseSerializer serializer); + @protected void sse_encode_box_autoadd_ldk_mnemonic( LdkMnemonic self, SseSerializer serializer); + @protected + void sse_encode_box_autoadd_ldk_network_graph( + LdkNetworkGraph self, SseSerializer serializer); + @protected void sse_encode_box_autoadd_ldk_node(LdkNode self, SseSerializer serializer); @@ -2571,6 +3501,12 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_box_autoadd_max_dust_htlc_exposure( MaxDustHTLCExposure self, SseSerializer serializer); + @protected + void sse_encode_box_autoadd_offer(Offer self, SseSerializer serializer); + + @protected + void sse_encode_box_autoadd_offer_id(OfferId self, SseSerializer serializer); + @protected void sse_encode_box_autoadd_out_point( OutPoint self, SseSerializer serializer); @@ -2603,6 +3539,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_box_autoadd_public_key( PublicKey self, SseSerializer serializer); + @protected + void sse_encode_box_autoadd_refund(Refund self, SseSerializer serializer); + @protected void sse_encode_box_autoadd_socket_address( SocketAddress self, SseSerializer serializer); @@ -2617,16 +3556,12 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_box_autoadd_u_32(int self, SseSerializer serializer); @protected - void sse_encode_box_autoadd_u_64(int self, SseSerializer serializer); + void sse_encode_box_autoadd_u_64(BigInt self, SseSerializer serializer); @protected void sse_encode_box_autoadd_user_channel_id( UserChannelId self, SseSerializer serializer); - @protected - void sse_encode_builder_exception( - BuilderException self, SseSerializer serializer); - @protected void sse_encode_chain_data_source_config( ChainDataSourceConfig self, SseSerializer serializer); @@ -2641,12 +3576,22 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected void sse_encode_channel_id(ChannelId self, SseSerializer serializer); + @protected + void sse_encode_channel_info(ChannelInfo self, SseSerializer serializer); + + @protected + void sse_encode_channel_update_info( + ChannelUpdateInfo self, SseSerializer serializer); + @protected void sse_encode_closure_reason(ClosureReason self, SseSerializer serializer); @protected void sse_encode_config(Config self, SseSerializer serializer); + @protected + void sse_encode_decode_error(DecodeError self, SseSerializer serializer); + @protected void sse_encode_entropy_source_config( EntropySourceConfig self, SseSerializer serializer); @@ -2665,12 +3610,27 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_ldk_bolt_11_payment( LdkBolt11Payment self, SseSerializer serializer); + @protected + void sse_encode_ldk_bolt_12_payment( + LdkBolt12Payment self, SseSerializer serializer); + + @protected + void sse_encode_ldk_builder_error( + LdkBuilderError self, SseSerializer serializer); + @protected void sse_encode_ldk_mnemonic(LdkMnemonic self, SseSerializer serializer); + @protected + void sse_encode_ldk_network_graph( + LdkNetworkGraph self, SseSerializer serializer); + @protected void sse_encode_ldk_node(LdkNode self, SseSerializer serializer); + @protected + void sse_encode_ldk_node_error(LdkNodeError self, SseSerializer serializer); + @protected void sse_encode_ldk_on_chain_payment( LdkOnChainPayment self, SseSerializer serializer); @@ -2695,6 +3655,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_list_lightning_balance( List self, SseSerializer serializer); + @protected + void sse_encode_list_node_id(List self, SseSerializer serializer); + @protected void sse_encode_list_payment_details( List self, SseSerializer serializer); @@ -2707,6 +3670,10 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_list_pending_sweep_balance( List self, SseSerializer serializer); + @protected + void sse_encode_list_prim_u_64_strict( + Uint64List self, SseSerializer serializer); + @protected void sse_encode_list_prim_u_8_loose(List self, SseSerializer serializer); @@ -2736,14 +3703,24 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_network(Network self, SseSerializer serializer); @protected - void sse_encode_node_exception(NodeException self, SseSerializer serializer); + void sse_encode_node_id(NodeId self, SseSerializer serializer); @protected void sse_encode_node_status(NodeStatus self, SseSerializer serializer); + @protected + void sse_encode_offer(Offer self, SseSerializer serializer); + + @protected + void sse_encode_offer_id(OfferId self, SseSerializer serializer); + @protected void sse_encode_opt_String(String? self, SseSerializer serializer); + @protected + void sse_encode_opt_box_autoadd_anchor_channels_config( + AnchorChannelsConfig? self, SseSerializer serializer); + @protected void sse_encode_opt_box_autoadd_chain_data_source_config( ChainDataSourceConfig? self, SseSerializer serializer); @@ -2756,6 +3733,14 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_opt_box_autoadd_channel_id( ChannelId? self, SseSerializer serializer); + @protected + void sse_encode_opt_box_autoadd_channel_info( + ChannelInfo? self, SseSerializer serializer); + + @protected + void sse_encode_opt_box_autoadd_channel_update_info( + ChannelUpdateInfo? self, SseSerializer serializer); + @protected void sse_encode_opt_box_autoadd_closure_reason( ClosureReason? self, SseSerializer serializer); @@ -2791,6 +3776,10 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_opt_box_autoadd_payment_failure_reason( PaymentFailureReason? self, SseSerializer serializer); + @protected + void sse_encode_opt_box_autoadd_payment_hash( + PaymentHash? self, SseSerializer serializer); + @protected void sse_encode_opt_box_autoadd_payment_id( PaymentId? self, SseSerializer serializer); @@ -2814,7 +3803,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_opt_box_autoadd_u_32(int? self, SseSerializer serializer); @protected - void sse_encode_opt_box_autoadd_u_64(int? self, SseSerializer serializer); + void sse_encode_opt_box_autoadd_u_64(BigInt? self, SseSerializer serializer); @protected void sse_encode_opt_list_socket_address( @@ -2868,6 +3857,12 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_record_socket_address_public_key_opt_string( (SocketAddress, PublicKey, String?) self, SseSerializer serializer); + @protected + void sse_encode_refund(Refund self, SseSerializer serializer); + + @protected + void sse_encode_routing_fees(RoutingFees self, SseSerializer serializer); + @protected void sse_encode_socket_address(SocketAddress self, SseSerializer serializer); @@ -2881,7 +3876,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_u_32(int self, SseSerializer serializer); @protected - void sse_encode_u_64(int self, SseSerializer serializer); + void sse_encode_u_64(BigInt self, SseSerializer serializer); @protected void sse_encode_u_8(int self, SseSerializer serializer); @@ -2908,7 +3903,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_user_channel_id(UserChannelId self, SseSerializer serializer); @protected - void sse_encode_usize(int self, SseSerializer serializer); + void sse_encode_usize(BigInt self, SseSerializer serializer); } // Section: wire_class @@ -2920,20 +3915,19 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { // ignore_for_file: type=lint /// generated by flutter_rust_bridge -class LdkCoreWire implements BaseWire { - factory LdkCoreWire.fromExternalLibrary(ExternalLibrary lib) => - LdkCoreWire(lib.ffiDynamicLibrary); +class coreWire implements BaseWire { + factory coreWire.fromExternalLibrary(ExternalLibrary lib) => + coreWire(lib.ffiDynamicLibrary); /// Holds the symbol lookup function. final ffi.Pointer Function(String symbolName) _lookup; /// The symbols are looked up in [dynamicLibrary]. - LdkCoreWire(ffi.DynamicLibrary dynamicLibrary) - : _lookup = dynamicLibrary.lookup; + coreWire(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup; /// The symbols are looked up with [lookup]. - LdkCoreWire.fromLookup( + coreWire.fromLookup( ffi.Pointer Function(String symbolName) lookup) : _lookup = lookup; @@ -2952,347 +3946,648 @@ class LdkCoreWire implements BaseWire { late final _store_dart_post_cobject = _store_dart_post_cobjectPtr .asFunction(); - void wire_NodeBuilder_build( + void wire__crate__api__bolt11__ldk_bolt_11_payment_receive( int port_, - int that, + ffi.Pointer that, + int amount_msat, + ffi.Pointer description, + int expiry_secs, ) { - return _wire_NodeBuilder_build( + return _wire__crate__api__bolt11__ldk_bolt_11_payment_receive( port_, that, + amount_msat, + description, + expiry_secs, ); } - late final _wire_NodeBuilder_buildPtr = - _lookup>( - 'frbgen_ldk_node_wire_NodeBuilder_build'); - late final _wire_NodeBuilder_build = - _wire_NodeBuilder_buildPtr.asFunction(); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receivePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Uint64, + ffi.Pointer, + ffi.Uint32)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive = + _wire__crate__api__bolt11__ldk_bolt_11_payment_receivePtr.asFunction< + void Function(int, ffi.Pointer, int, + ffi.Pointer, int)>(); - void wire_NodeBuilder_build_with_fs_store( + void wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount( int port_, - int that, + ffi.Pointer that, + ffi.Pointer description, + int expiry_secs, ) { - return _wire_NodeBuilder_build_with_fs_store( + return _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount( port_, that, + description, + expiry_secs, ); } - late final _wire_NodeBuilder_build_with_fs_storePtr = - _lookup>( - 'frbgen_ldk_node_wire_NodeBuilder_build_with_fs_store'); - late final _wire_NodeBuilder_build_with_fs_store = - _wire_NodeBuilder_build_with_fs_storePtr - .asFunction(); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amountPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Uint32)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount = + _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amountPtr + .asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer, int)>(); - void wire_NodeBuilder_create_builder( + void + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel( 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, + ffi.Pointer description, + int expiry_secs, + ffi.Pointer max_proportional_lsp_fee_limit_ppm_msat, ) { - return _wire_NodeBuilder_create_builder( + return _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel( port_, - config, - chain_data_source_config, - entropy_source_config, - gossip_source_config, - liquidity_source_config, + that, + description, + expiry_secs, + max_proportional_lsp_fee_limit_ppm_msat, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channelPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Uint32, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel = + _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channelPtr + .asFunction< + void Function( + int, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + + void wire__crate__api__bolt11__ldk_bolt_11_payment_receive_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__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel( + port_, + that, + amount_msat, + description, + expiry_secs, + max_total_lsp_fee_limit_msat, ); } - late final _wire_NodeBuilder_create_builderPtr = _lookup< + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_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__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel = + _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channelPtr + .asFunction< + void Function( + int, + ffi.Pointer, + int, + ffi.Pointer, + int, + ffi.Pointer)>(); + + void wire__crate__api__bolt11__ldk_bolt_11_payment_send( + int port_, + ffi.Pointer that, + ffi.Pointer invoice, + ) { + return _wire__crate__api__bolt11__ldk_bolt_11_payment_send( + port_, + that, + invoice, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_sendPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Int64, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>( - 'frbgen_ldk_node_wire_NodeBuilder_create_builder'); - late final _wire_NodeBuilder_create_builder = - _wire_NodeBuilder_create_builderPtr.asFunction< - void Function( - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_send = + _wire__crate__api__bolt11__ldk_bolt_11_payment_sendPtr.asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer)>(); + + void wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes( + int port_, + ffi.Pointer that, + ffi.Pointer invoice, + ) { + return _wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes( + port_, + that, + invoice, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_send_probesPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes = + _wire__crate__api__bolt11__ldk_bolt_11_payment_send_probesPtr.asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer)>(); - void wire_ldk_bolt_11_payment_receive( + void wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount( int port_, ffi.Pointer that, + ffi.Pointer invoice, + int amount_msat, + ) { + return _wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount( + port_, + that, + invoice, + amount_msat, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amountPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Uint64)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount = + _wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amountPtr + .asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer, int)>(); + + void wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount( + int port_, + ffi.Pointer that, + ffi.Pointer invoice, + int amount_msat, + ) { + return _wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount( + port_, + that, + invoice, + amount_msat, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amountPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Uint64)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount = + _wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amountPtr + .asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer, int)>(); + + void wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refund( + int port_, + ffi.Pointer that, int amount_msat, - ffi.Pointer description, int expiry_secs, ) { - return _wire_ldk_bolt_11_payment_receive( - port_, + return _wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refund( + port_, + that, + amount_msat, + expiry_secs, + ); + } + + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refundPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Uint64, + ffi.Uint32)>>( + 'frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refund'); + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refund = + _wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refundPtr + .asFunction< + void Function( + int, ffi.Pointer, int, int)>(); + + void wire__crate__api__bolt12__ldk_bolt_12_payment_receive( + int port_, + ffi.Pointer that, + int amount_msat, + ffi.Pointer description, + ) { + return _wire__crate__api__bolt12__ldk_bolt_12_payment_receive( + port_, + that, + amount_msat, + description, + ); + } + + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_receivePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Uint64, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_receive'); + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_receive = + _wire__crate__api__bolt12__ldk_bolt_12_payment_receivePtr.asFunction< + void Function(int, ffi.Pointer, int, + ffi.Pointer)>(); + + void wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amount( + int port_, + ffi.Pointer that, + ffi.Pointer description, + ) { + return _wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amount( + port_, + that, + description, + ); + } + + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amountPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amount'); + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amount = + _wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amountPtr + .asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer)>(); + + void wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_payment( + int port_, + ffi.Pointer that, + ffi.Pointer refund, + ) { + return _wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_payment( + port_, + that, + refund, + ); + } + + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_paymentPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_payment'); + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_payment = + _wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_paymentPtr + .asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer)>(); + + void wire__crate__api__bolt12__ldk_bolt_12_payment_send( + int port_, + ffi.Pointer that, + ffi.Pointer offer, + ffi.Pointer payer_note, + ) { + return _wire__crate__api__bolt12__ldk_bolt_12_payment_send( + port_, + that, + offer, + payer_note, + ); + } + + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_sendPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_send'); + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_send = + _wire__crate__api__bolt12__ldk_bolt_12_payment_sendPtr.asFunction< + void Function( + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + void wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amount( + int port_, + ffi.Pointer that, + ffi.Pointer offer, + ffi.Pointer payer_note, + int amount_msat, + ) { + return _wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amount( + port_, + that, + offer, + payer_note, + amount_msat, + ); + } + + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amountPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Uint64)>>( + 'frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amount'); + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amount = + _wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amountPtr + .asFunction< + void Function( + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); + + WireSyncRust2DartDco + wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder( + int that, + ) { + return _wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder( + that, + ); + } + + late final _wire__crate__api__builder__NodeBuilder_auto_accessor_get_builderPtr = + _lookup>( + 'frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder'); + late final _wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder = + _wire__crate__api__builder__NodeBuilder_auto_accessor_get_builderPtr + .asFunction(); + + WireSyncRust2DartDco + wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder( + int that, + int builder, + ) { + return _wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder( that, - amount_msat, - description, - expiry_secs, + builder, ); } - late final _wire_ldk_bolt_11_payment_receivePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Int64, - ffi.Pointer, - ffi.Uint64, - ffi.Pointer, - ffi.Uint32)>>('frbgen_ldk_node_wire_ldk_bolt_11_payment_receive'); - late final _wire_ldk_bolt_11_payment_receive = - _wire_ldk_bolt_11_payment_receivePtr.asFunction< - void Function(int, ffi.Pointer, int, - ffi.Pointer, int)>(); + late final _wire__crate__api__builder__NodeBuilder_auto_accessor_set_builderPtr = + _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function(ffi.UintPtr, ffi.UintPtr)>>( + 'frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder'); + late final _wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder = + _wire__crate__api__builder__NodeBuilder_auto_accessor_set_builderPtr + .asFunction(); - void wire_ldk_bolt_11_payment_receive_variable_amount( + void wire__crate__api__builder__NodeBuilder_build( int port_, - ffi.Pointer that, - ffi.Pointer description, - int expiry_secs, + int that, ) { - return _wire_ldk_bolt_11_payment_receive_variable_amount( + return _wire__crate__api__builder__NodeBuilder_build( port_, that, - description, - expiry_secs, ); } - late final _wire_ldk_bolt_11_payment_receive_variable_amountPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Int64, - ffi.Pointer, - ffi.Pointer, - ffi.Uint32)>>( - 'frbgen_ldk_node_wire_ldk_bolt_11_payment_receive_variable_amount'); - late final _wire_ldk_bolt_11_payment_receive_variable_amount = - _wire_ldk_bolt_11_payment_receive_variable_amountPtr.asFunction< - void Function(int, ffi.Pointer, - ffi.Pointer, int)>(); + late final _wire__crate__api__builder__NodeBuilder_buildPtr = + _lookup>( + 'frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_build'); + late final _wire__crate__api__builder__NodeBuilder_build = + _wire__crate__api__builder__NodeBuilder_buildPtr + .asFunction(); - void wire_ldk_bolt_11_payment_receive_variable_amount_via_jit_channel( + void wire__crate__api__builder__NodeBuilder_build_with_fs_store( int port_, - ffi.Pointer that, - ffi.Pointer description, - int expiry_secs, - ffi.Pointer max_proportional_lsp_fee_limit_ppm_msat, + int that, ) { - return _wire_ldk_bolt_11_payment_receive_variable_amount_via_jit_channel( + return _wire__crate__api__builder__NodeBuilder_build_with_fs_store( port_, that, - description, - expiry_secs, - max_proportional_lsp_fee_limit_ppm_msat, ); } - late final _wire_ldk_bolt_11_payment_receive_variable_amount_via_jit_channelPtr = - _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Int64, - ffi.Pointer, - ffi.Pointer, - ffi.Uint32, - ffi.Pointer)>>( - 'frbgen_ldk_node_wire_ldk_bolt_11_payment_receive_variable_amount_via_jit_channel'); - late final _wire_ldk_bolt_11_payment_receive_variable_amount_via_jit_channel = - _wire_ldk_bolt_11_payment_receive_variable_amount_via_jit_channelPtr - .asFunction< - void Function( - int, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); + late final _wire__crate__api__builder__NodeBuilder_build_with_fs_storePtr = + _lookup>( + 'frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_build_with_fs_store'); + late final _wire__crate__api__builder__NodeBuilder_build_with_fs_store = + _wire__crate__api__builder__NodeBuilder_build_with_fs_storePtr + .asFunction(); - void wire_ldk_bolt_11_payment_receive_via_jit_channel( + void wire__crate__api__builder__NodeBuilder_create_builder( int port_, - ffi.Pointer that, - int amount_msat, - ffi.Pointer description, - int expiry_secs, - ffi.Pointer max_total_lsp_fee_limit_msat, + ffi.Pointer config, + ffi.Pointer chain_data_source_config, + ffi.Pointer entropy_source_config, + ffi.Pointer gossip_source_config, + ffi.Pointer liquidity_source_config, ) { - return _wire_ldk_bolt_11_payment_receive_via_jit_channel( + return _wire__crate__api__builder__NodeBuilder_create_builder( port_, - that, - amount_msat, - description, - expiry_secs, - max_total_lsp_fee_limit_msat, + config, + chain_data_source_config, + entropy_source_config, + gossip_source_config, + liquidity_source_config, ); } - late final _wire_ldk_bolt_11_payment_receive_via_jit_channelPtr = _lookup< + late final _wire__crate__api__builder__NodeBuilder_create_builderPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Int64, - ffi.Pointer, - ffi.Uint64, - ffi.Pointer, - ffi.Uint32, - ffi.Pointer)>>( - 'frbgen_ldk_node_wire_ldk_bolt_11_payment_receive_via_jit_channel'); - late final _wire_ldk_bolt_11_payment_receive_via_jit_channel = - _wire_ldk_bolt_11_payment_receive_via_jit_channelPtr.asFunction< + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_create_builder'); + late final _wire__crate__api__builder__NodeBuilder_create_builder = + _wire__crate__api__builder__NodeBuilder_create_builderPtr.asFunction< void Function( int, - ffi.Pointer, - int, - ffi.Pointer, - int, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); - void wire_ldk_bolt_11_payment_send( + void wire__crate__api__builder__ldk_mnemonic_generate( int port_, - ffi.Pointer that, - ffi.Pointer invoice, ) { - return _wire_ldk_bolt_11_payment_send( + return _wire__crate__api__builder__ldk_mnemonic_generate( port_, - that, - invoice, ); } - late final _wire_ldk_bolt_11_payment_sendPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Int64, - ffi.Pointer, - ffi.Pointer)>>( - 'frbgen_ldk_node_wire_ldk_bolt_11_payment_send'); - late final _wire_ldk_bolt_11_payment_send = - _wire_ldk_bolt_11_payment_sendPtr.asFunction< - void Function(int, ffi.Pointer, - ffi.Pointer)>(); + late final _wire__crate__api__builder__ldk_mnemonic_generatePtr = + _lookup>( + 'frbgen_ldk_node_wire__crate__api__builder__ldk_mnemonic_generate'); + late final _wire__crate__api__builder__ldk_mnemonic_generate = + _wire__crate__api__builder__ldk_mnemonic_generatePtr + .asFunction(); - void wire_ldk_bolt_11_payment_send_probes( + void wire__crate__api__graph__ldk_network_graph_channel( int port_, - ffi.Pointer that, - ffi.Pointer invoice, + ffi.Pointer that, + int short_channel_id, ) { - return _wire_ldk_bolt_11_payment_send_probes( + return _wire__crate__api__graph__ldk_network_graph_channel( port_, that, - invoice, + short_channel_id, ); } - late final _wire_ldk_bolt_11_payment_send_probesPtr = _lookup< + late final _wire__crate__api__graph__ldk_network_graph_channelPtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - ffi.Int64, - ffi.Pointer, - ffi.Pointer)>>( - 'frbgen_ldk_node_wire_ldk_bolt_11_payment_send_probes'); - late final _wire_ldk_bolt_11_payment_send_probes = - _wire_ldk_bolt_11_payment_send_probesPtr.asFunction< - void Function(int, ffi.Pointer, - ffi.Pointer)>(); - - void wire_ldk_bolt_11_payment_send_probes_using_amount( + ffi.Void Function(ffi.Int64, + ffi.Pointer, ffi.Uint64)>>( + 'frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_channel'); + late final _wire__crate__api__graph__ldk_network_graph_channel = + _wire__crate__api__graph__ldk_network_graph_channelPtr.asFunction< + void Function(int, ffi.Pointer, int)>(); + + void wire__crate__api__graph__ldk_network_graph_list_channels( int port_, - ffi.Pointer that, - ffi.Pointer invoice, - int amount_msat, + ffi.Pointer that, ) { - return _wire_ldk_bolt_11_payment_send_probes_using_amount( + return _wire__crate__api__graph__ldk_network_graph_list_channels( port_, that, - invoice, - amount_msat, ); } - late final _wire_ldk_bolt_11_payment_send_probes_using_amountPtr = _lookup< + late final _wire__crate__api__graph__ldk_network_graph_list_channelsPtr = _lookup< ffi.NativeFunction< ffi.Void Function( - ffi.Int64, - ffi.Pointer, - ffi.Pointer, - ffi.Uint64)>>( - 'frbgen_ldk_node_wire_ldk_bolt_11_payment_send_probes_using_amount'); - late final _wire_ldk_bolt_11_payment_send_probes_using_amount = - _wire_ldk_bolt_11_payment_send_probes_using_amountPtr.asFunction< - void Function(int, ffi.Pointer, - ffi.Pointer, int)>(); + ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_list_channels'); + late final _wire__crate__api__graph__ldk_network_graph_list_channels = + _wire__crate__api__graph__ldk_network_graph_list_channelsPtr.asFunction< + void Function(int, ffi.Pointer)>(); - void wire_ldk_bolt_11_payment_send_using_amount( + void wire__crate__api__graph__ldk_network_graph_list_nodes( int port_, - ffi.Pointer that, - ffi.Pointer invoice, - int amount_msat, + ffi.Pointer that, ) { - return _wire_ldk_bolt_11_payment_send_using_amount( + return _wire__crate__api__graph__ldk_network_graph_list_nodes( port_, that, - invoice, - amount_msat, ); } - late final _wire_ldk_bolt_11_payment_send_using_amountPtr = _lookup< + late final _wire__crate__api__graph__ldk_network_graph_list_nodesPtr = _lookup< ffi.NativeFunction< ffi.Void Function( - ffi.Int64, - ffi.Pointer, - ffi.Pointer, - ffi.Uint64)>>( - 'frbgen_ldk_node_wire_ldk_bolt_11_payment_send_using_amount'); - late final _wire_ldk_bolt_11_payment_send_using_amount = - _wire_ldk_bolt_11_payment_send_using_amountPtr.asFunction< - void Function(int, ffi.Pointer, - ffi.Pointer, int)>(); + ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_list_nodes'); + late final _wire__crate__api__graph__ldk_network_graph_list_nodes = + _wire__crate__api__graph__ldk_network_graph_list_nodesPtr.asFunction< + void Function(int, ffi.Pointer)>(); - void wire_ldk_mnemonic_generate( + void wire__crate__api__node__ldk_node_bolt11_payment( int port_, + ffi.Pointer ptr, ) { - return _wire_ldk_mnemonic_generate( + return _wire__crate__api__node__ldk_node_bolt11_payment( port_, + ptr, ); } - late final _wire_ldk_mnemonic_generatePtr = - _lookup>( - 'frbgen_ldk_node_wire_ldk_mnemonic_generate'); - late final _wire_ldk_mnemonic_generate = - _wire_ldk_mnemonic_generatePtr.asFunction(); + late final _wire__crate__api__node__ldk_node_bolt11_paymentPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_bolt11_payment'); + late final _wire__crate__api__node__ldk_node_bolt11_payment = + _wire__crate__api__node__ldk_node_bolt11_paymentPtr + .asFunction)>(); - void wire_ldk_node_bolt11_payment( + void wire__crate__api__node__ldk_node_bolt12_payment( int port_, ffi.Pointer ptr, ) { - return _wire_ldk_node_bolt11_payment( + return _wire__crate__api__node__ldk_node_bolt12_payment( port_, ptr, ); } - late final _wire_ldk_node_bolt11_paymentPtr = _lookup< + late final _wire__crate__api__node__ldk_node_bolt12_paymentPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Int64, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_ldk_node_bolt11_payment'); - late final _wire_ldk_node_bolt11_payment = _wire_ldk_node_bolt11_paymentPtr - .asFunction)>(); + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_bolt12_payment'); + late final _wire__crate__api__node__ldk_node_bolt12_payment = + _wire__crate__api__node__ldk_node_bolt12_paymentPtr + .asFunction)>(); - void wire_ldk_node_close_channel( + void wire__crate__api__node__ldk_node_close_channel( int port_, ffi.Pointer that, ffi.Pointer user_channel_id, ffi.Pointer counterparty_node_id, ) { - return _wire_ldk_node_close_channel( + return _wire__crate__api__node__ldk_node_close_channel( port_, that, user_channel_id, @@ -3300,47 +4595,48 @@ class LdkCoreWire implements BaseWire { ); } - late final _wire_ldk_node_close_channelPtr = _lookup< + late final _wire__crate__api__node__ldk_node_close_channelPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Int64, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_ldk_node_close_channel'); - late final _wire_ldk_node_close_channel = - _wire_ldk_node_close_channelPtr.asFunction< + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_close_channel'); + late final _wire__crate__api__node__ldk_node_close_channel = + _wire__crate__api__node__ldk_node_close_channelPtr.asFunction< void Function( int, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - void wire_ldk_node_config( + void wire__crate__api__node__ldk_node_config( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_config( + return _wire__crate__api__node__ldk_node_config( port_, that, ); } - late final _wire_ldk_node_configPtr = _lookup< + late final _wire__crate__api__node__ldk_node_configPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Int64, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_ldk_node_config'); - late final _wire_ldk_node_config = _wire_ldk_node_configPtr - .asFunction)>(); + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_config'); + late final _wire__crate__api__node__ldk_node_config = + _wire__crate__api__node__ldk_node_configPtr + .asFunction)>(); - void wire_ldk_node_connect( + void wire__crate__api__node__ldk_node_connect( int port_, ffi.Pointer that, ffi.Pointer node_id, ffi.Pointer address, bool persist, ) { - return _wire_ldk_node_connect( + return _wire__crate__api__node__ldk_node_connect( port_, that, node_id, @@ -3349,23 +4645,25 @@ class LdkCoreWire implements BaseWire { ); } - late final _wire_ldk_node_connectPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Int64, + late final _wire__crate__api__node__ldk_node_connectPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_connect'); + late final _wire__crate__api__node__ldk_node_connect = + _wire__crate__api__node__ldk_node_connectPtr.asFunction< + void Function( + int, ffi.Pointer, ffi.Pointer, ffi.Pointer, - 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, - bool)>(); - - void wire_ldk_node_connect_open_channel( + bool)>(); + + void wire__crate__api__node__ldk_node_connect_open_channel( int port_, ffi.Pointer that, ffi.Pointer socket_address, @@ -3375,7 +4673,7 @@ class LdkCoreWire implements BaseWire { bool announce_channel, ffi.Pointer channel_config, ) { - return _wire_ldk_node_connect_open_channel( + return _wire__crate__api__node__ldk_node_connect_open_channel( port_, that, socket_address, @@ -3387,7 +4685,7 @@ class LdkCoreWire implements BaseWire { ); } - late final _wire_ldk_node_connect_open_channelPtr = _lookup< + late final _wire__crate__api__node__ldk_node_connect_open_channelPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Int64, @@ -3398,9 +4696,9 @@ class LdkCoreWire implements BaseWire { ffi.Pointer, ffi.Bool, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_ldk_node_connect_open_channel'); - late final _wire_ldk_node_connect_open_channel = - _wire_ldk_node_connect_open_channelPtr.asFunction< + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_connect_open_channel'); + late final _wire__crate__api__node__ldk_node_connect_open_channel = + _wire__crate__api__node__ldk_node_connect_open_channelPtr.asFunction< void Function( int, ffi.Pointer, @@ -3411,381 +4709,442 @@ class LdkCoreWire implements BaseWire { bool, ffi.Pointer)>(); - void wire_ldk_node_disconnect( + void wire__crate__api__node__ldk_node_disconnect( int port_, ffi.Pointer that, ffi.Pointer counterparty_node_id, ) { - return _wire_ldk_node_disconnect( + return _wire__crate__api__node__ldk_node_disconnect( port_, that, counterparty_node_id, ); } - late final _wire_ldk_node_disconnectPtr = _lookup< + late final _wire__crate__api__node__ldk_node_disconnectPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Int64, ffi.Pointer, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_ldk_node_disconnect'); - late final _wire_ldk_node_disconnect = - _wire_ldk_node_disconnectPtr.asFunction< + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_disconnect'); + late final _wire__crate__api__node__ldk_node_disconnect = + _wire__crate__api__node__ldk_node_disconnectPtr.asFunction< void Function(int, ffi.Pointer, ffi.Pointer)>(); - void wire_ldk_node_event_handled( + void wire__crate__api__node__ldk_node_event_handled( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_event_handled( + return _wire__crate__api__node__ldk_node_event_handled( port_, that, ); } - late final _wire_ldk_node_event_handledPtr = _lookup< + late final _wire__crate__api__node__ldk_node_event_handledPtr = _lookup< ffi.NativeFunction< 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)>(); + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_event_handled'); + late final _wire__crate__api__node__ldk_node_event_handled = + _wire__crate__api__node__ldk_node_event_handledPtr + .asFunction)>(); + + void wire__crate__api__node__ldk_node_force_close_channel( + int port_, + ffi.Pointer that, + ffi.Pointer user_channel_id, + ffi.Pointer counterparty_node_id, + ) { + return _wire__crate__api__node__ldk_node_force_close_channel( + port_, + that, + user_channel_id, + counterparty_node_id, + ); + } - void wire_ldk_node_list_balances( + late final _wire__crate__api__node__ldk_node_force_close_channelPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_force_close_channel'); + late final _wire__crate__api__node__ldk_node_force_close_channel = + _wire__crate__api__node__ldk_node_force_close_channelPtr.asFunction< + void Function( + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + void wire__crate__api__node__ldk_node_list_balances( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_list_balances( + return _wire__crate__api__node__ldk_node_list_balances( port_, that, ); } - late final _wire_ldk_node_list_balancesPtr = _lookup< + late final _wire__crate__api__node__ldk_node_list_balancesPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Int64, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_ldk_node_list_balances'); - late final _wire_ldk_node_list_balances = _wire_ldk_node_list_balancesPtr - .asFunction)>(); + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_list_balances'); + late final _wire__crate__api__node__ldk_node_list_balances = + _wire__crate__api__node__ldk_node_list_balancesPtr + .asFunction)>(); - void wire_ldk_node_list_channels( + void wire__crate__api__node__ldk_node_list_channels( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_list_channels( + return _wire__crate__api__node__ldk_node_list_channels( port_, that, ); } - late final _wire_ldk_node_list_channelsPtr = _lookup< + late final _wire__crate__api__node__ldk_node_list_channelsPtr = _lookup< ffi.NativeFunction< 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)>(); + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_list_channels'); + late final _wire__crate__api__node__ldk_node_list_channels = + _wire__crate__api__node__ldk_node_list_channelsPtr + .asFunction)>(); - void wire_ldk_node_list_payments( + void wire__crate__api__node__ldk_node_list_payments( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_list_payments( + return _wire__crate__api__node__ldk_node_list_payments( port_, that, ); } - late final _wire_ldk_node_list_paymentsPtr = _lookup< + late final _wire__crate__api__node__ldk_node_list_paymentsPtr = _lookup< ffi.NativeFunction< 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)>(); + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_list_payments'); + late final _wire__crate__api__node__ldk_node_list_payments = + _wire__crate__api__node__ldk_node_list_paymentsPtr + .asFunction)>(); - void wire_ldk_node_list_payments_with_filter( + void wire__crate__api__node__ldk_node_list_payments_with_filter( int port_, ffi.Pointer that, int payment_direction, ) { - return _wire_ldk_node_list_payments_with_filter( + return _wire__crate__api__node__ldk_node_list_payments_with_filter( port_, that, payment_direction, ); } - 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_ldk_node_list_payments_with_filter'); - late final _wire_ldk_node_list_payments_with_filter = - _wire_ldk_node_list_payments_with_filterPtr.asFunction< + late final _wire__crate__api__node__ldk_node_list_payments_with_filterPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, ffi.Pointer, ffi.Int32)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_list_payments_with_filter'); + late final _wire__crate__api__node__ldk_node_list_payments_with_filter = + _wire__crate__api__node__ldk_node_list_payments_with_filterPtr.asFunction< void Function(int, ffi.Pointer, int)>(); - void wire_ldk_node_list_peers( + void wire__crate__api__node__ldk_node_list_peers( + int port_, + ffi.Pointer that, + ) { + return _wire__crate__api__node__ldk_node_list_peers( + port_, + that, + ); + } + + late final _wire__crate__api__node__ldk_node_list_peersPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_list_peers'); + late final _wire__crate__api__node__ldk_node_list_peers = + _wire__crate__api__node__ldk_node_list_peersPtr + .asFunction)>(); + + void wire__crate__api__node__ldk_node_listening_addresses( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_list_peers( + return _wire__crate__api__node__ldk_node_listening_addresses( port_, that, ); } - late final _wire_ldk_node_list_peersPtr = _lookup< + late final _wire__crate__api__node__ldk_node_listening_addressesPtr = _lookup< ffi.NativeFunction< 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)>(); + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_listening_addresses'); + late final _wire__crate__api__node__ldk_node_listening_addresses = + _wire__crate__api__node__ldk_node_listening_addressesPtr + .asFunction)>(); - void wire_ldk_node_listening_addresses( + void wire__crate__api__node__ldk_node_network_graph( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_listening_addresses( + return _wire__crate__api__node__ldk_node_network_graph( port_, that, ); } - late final _wire_ldk_node_listening_addressesPtr = _lookup< + late final _wire__crate__api__node__ldk_node_network_graphPtr = _lookup< ffi.NativeFunction< 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 + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_network_graph'); + late final _wire__crate__api__node__ldk_node_network_graph = + _wire__crate__api__node__ldk_node_network_graphPtr .asFunction)>(); - void wire_ldk_node_next_event( + void wire__crate__api__node__ldk_node_next_event( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_next_event( + return _wire__crate__api__node__ldk_node_next_event( port_, that, ); } - late final _wire_ldk_node_next_eventPtr = _lookup< + late final _wire__crate__api__node__ldk_node_next_eventPtr = _lookup< ffi.NativeFunction< 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)>(); + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_next_event'); + late final _wire__crate__api__node__ldk_node_next_event = + _wire__crate__api__node__ldk_node_next_eventPtr + .asFunction)>(); - void wire_ldk_node_next_event_async( + void wire__crate__api__node__ldk_node_next_event_async( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_next_event_async( + return _wire__crate__api__node__ldk_node_next_event_async( port_, that, ); } - late final _wire_ldk_node_next_event_asyncPtr = _lookup< + late final _wire__crate__api__node__ldk_node_next_event_asyncPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Int64, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_ldk_node_next_event_async'); - late final _wire_ldk_node_next_event_async = - _wire_ldk_node_next_event_asyncPtr + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_next_event_async'); + late final _wire__crate__api__node__ldk_node_next_event_async = + _wire__crate__api__node__ldk_node_next_event_asyncPtr .asFunction)>(); - void wire_ldk_node_node_id( + void wire__crate__api__node__ldk_node_node_id( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_node_id( + return _wire__crate__api__node__ldk_node_node_id( port_, that, ); } - late final _wire_ldk_node_node_idPtr = _lookup< + late final _wire__crate__api__node__ldk_node_node_idPtr = _lookup< ffi.NativeFunction< 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)>(); + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_node_id'); + late final _wire__crate__api__node__ldk_node_node_id = + _wire__crate__api__node__ldk_node_node_idPtr + .asFunction)>(); - void wire_ldk_node_on_chain_payment( + void wire__crate__api__node__ldk_node_on_chain_payment( int port_, ffi.Pointer ptr, ) { - return _wire_ldk_node_on_chain_payment( + return _wire__crate__api__node__ldk_node_on_chain_payment( port_, ptr, ); } - late final _wire_ldk_node_on_chain_paymentPtr = _lookup< + late final _wire__crate__api__node__ldk_node_on_chain_paymentPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Int64, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_ldk_node_on_chain_payment'); - late final _wire_ldk_node_on_chain_payment = - _wire_ldk_node_on_chain_paymentPtr + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_on_chain_payment'); + late final _wire__crate__api__node__ldk_node_on_chain_payment = + _wire__crate__api__node__ldk_node_on_chain_paymentPtr .asFunction)>(); - void wire_ldk_node_payment( + void wire__crate__api__node__ldk_node_payment( int port_, ffi.Pointer that, ffi.Pointer payment_id, ) { - return _wire_ldk_node_payment( + return _wire__crate__api__node__ldk_node_payment( port_, that, payment_id, ); } - late final _wire_ldk_node_paymentPtr = _lookup< + late final _wire__crate__api__node__ldk_node_paymentPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Int64, ffi.Pointer, 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)>(); + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_payment'); + late final _wire__crate__api__node__ldk_node_payment = + _wire__crate__api__node__ldk_node_paymentPtr.asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer)>(); - void wire_ldk_node_remove_payment( + void wire__crate__api__node__ldk_node_remove_payment( int port_, ffi.Pointer that, ffi.Pointer payment_id, ) { - return _wire_ldk_node_remove_payment( + return _wire__crate__api__node__ldk_node_remove_payment( port_, that, payment_id, ); } - late final _wire_ldk_node_remove_paymentPtr = _lookup< + late final _wire__crate__api__node__ldk_node_remove_paymentPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Int64, ffi.Pointer, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_ldk_node_remove_payment'); - late final _wire_ldk_node_remove_payment = - _wire_ldk_node_remove_paymentPtr.asFunction< + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_remove_payment'); + late final _wire__crate__api__node__ldk_node_remove_payment = + _wire__crate__api__node__ldk_node_remove_paymentPtr.asFunction< void Function(int, ffi.Pointer, ffi.Pointer)>(); - void wire_ldk_node_sign_message( + void wire__crate__api__node__ldk_node_sign_message( int port_, ffi.Pointer that, ffi.Pointer msg, ) { - return _wire_ldk_node_sign_message( + return _wire__crate__api__node__ldk_node_sign_message( port_, that, msg, ); } - late final _wire_ldk_node_sign_messagePtr = _lookup< + late final _wire__crate__api__node__ldk_node_sign_messagePtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Int64, ffi.Pointer, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_ldk_node_sign_message'); - late final _wire_ldk_node_sign_message = - _wire_ldk_node_sign_messagePtr.asFunction< + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_sign_message'); + late final _wire__crate__api__node__ldk_node_sign_message = + _wire__crate__api__node__ldk_node_sign_messagePtr.asFunction< void Function(int, ffi.Pointer, ffi.Pointer)>(); - void wire_ldk_node_spontaneous_payment( + void wire__crate__api__node__ldk_node_spontaneous_payment( int port_, ffi.Pointer ptr, ) { - return _wire_ldk_node_spontaneous_payment( + return _wire__crate__api__node__ldk_node_spontaneous_payment( port_, ptr, ); } - late final _wire_ldk_node_spontaneous_paymentPtr = _lookup< + late final _wire__crate__api__node__ldk_node_spontaneous_paymentPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Int64, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_ldk_node_spontaneous_payment'); - late final _wire_ldk_node_spontaneous_payment = - _wire_ldk_node_spontaneous_paymentPtr + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_spontaneous_payment'); + late final _wire__crate__api__node__ldk_node_spontaneous_payment = + _wire__crate__api__node__ldk_node_spontaneous_paymentPtr .asFunction)>(); - void wire_ldk_node_start( + void wire__crate__api__node__ldk_node_start( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_start( + return _wire__crate__api__node__ldk_node_start( port_, that, ); } - late final _wire_ldk_node_startPtr = _lookup< + late final _wire__crate__api__node__ldk_node_startPtr = _lookup< ffi.NativeFunction< 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)>(); + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_start'); + late final _wire__crate__api__node__ldk_node_start = + _wire__crate__api__node__ldk_node_startPtr + .asFunction)>(); - void wire_ldk_node_status( + void wire__crate__api__node__ldk_node_status( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_status( + return _wire__crate__api__node__ldk_node_status( port_, that, ); } - late final _wire_ldk_node_statusPtr = _lookup< + late final _wire__crate__api__node__ldk_node_statusPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Int64, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_ldk_node_status'); - late final _wire_ldk_node_status = _wire_ldk_node_statusPtr - .asFunction)>(); + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_status'); + late final _wire__crate__api__node__ldk_node_status = + _wire__crate__api__node__ldk_node_statusPtr + .asFunction)>(); - void wire_ldk_node_stop( + void wire__crate__api__node__ldk_node_stop( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_stop( + return _wire__crate__api__node__ldk_node_stop( port_, that, ); } - late final _wire_ldk_node_stopPtr = _lookup< + late final _wire__crate__api__node__ldk_node_stopPtr = _lookup< ffi.NativeFunction< 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)>(); + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_stop'); + late final _wire__crate__api__node__ldk_node_stop = + _wire__crate__api__node__ldk_node_stopPtr + .asFunction)>(); - void wire_ldk_node_sync_wallets( + void wire__crate__api__node__ldk_node_sync_wallets( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_sync_wallets( + return _wire__crate__api__node__ldk_node_sync_wallets( port_, that, ); } - late final _wire_ldk_node_sync_walletsPtr = _lookup< + late final _wire__crate__api__node__ldk_node_sync_walletsPtr = _lookup< ffi.NativeFunction< 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)>(); + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_sync_wallets'); + late final _wire__crate__api__node__ldk_node_sync_wallets = + _wire__crate__api__node__ldk_node_sync_walletsPtr + .asFunction)>(); - void wire_ldk_node_update_channel_config( + void wire__crate__api__node__ldk_node_update_channel_config( int port_, ffi.Pointer that, ffi.Pointer user_channel_id, ffi.Pointer counterparty_node_id, ffi.Pointer channel_config, ) { - return _wire_ldk_node_update_channel_config( + return _wire__crate__api__node__ldk_node_update_channel_config( port_, that, user_channel_id, @@ -3794,7 +5153,7 @@ class LdkCoreWire implements BaseWire { ); } - late final _wire_ldk_node_update_channel_configPtr = _lookup< + late final _wire__crate__api__node__ldk_node_update_channel_configPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Int64, @@ -3802,9 +5161,9 @@ class LdkCoreWire implements BaseWire { ffi.Pointer, ffi.Pointer, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_ldk_node_update_channel_config'); - late final _wire_ldk_node_update_channel_config = - _wire_ldk_node_update_channel_configPtr.asFunction< + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_update_channel_config'); + late final _wire__crate__api__node__ldk_node_update_channel_config = + _wire__crate__api__node__ldk_node_update_channel_configPtr.asFunction< void Function( int, ffi.Pointer, @@ -3812,14 +5171,14 @@ class LdkCoreWire implements BaseWire { ffi.Pointer, ffi.Pointer)>(); - void wire_ldk_node_verify_signature( + void wire__crate__api__node__ldk_node_verify_signature( int port_, ffi.Pointer that, ffi.Pointer msg, ffi.Pointer sig, ffi.Pointer public_key, ) { - return _wire_ldk_node_verify_signature( + return _wire__crate__api__node__ldk_node_verify_signature( port_, that, msg, @@ -3828,7 +5187,7 @@ class LdkCoreWire implements BaseWire { ); } - late final _wire_ldk_node_verify_signaturePtr = _lookup< + late final _wire__crate__api__node__ldk_node_verify_signaturePtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Int64, @@ -3836,9 +5195,9 @@ class LdkCoreWire implements BaseWire { ffi.Pointer, ffi.Pointer, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_ldk_node_verify_signature'); - late final _wire_ldk_node_verify_signature = - _wire_ldk_node_verify_signaturePtr.asFunction< + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_verify_signature'); + late final _wire__crate__api__node__ldk_node_verify_signature = + _wire__crate__api__node__ldk_node_verify_signaturePtr.asFunction< void Function( int, ffi.Pointer, @@ -3846,73 +5205,78 @@ class LdkCoreWire implements BaseWire { ffi.Pointer, ffi.Pointer)>(); - void wire_ldk_node_wait_next_event( + void wire__crate__api__node__ldk_node_wait_next_event( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_wait_next_event( + return _wire__crate__api__node__ldk_node_wait_next_event( port_, that, ); } - late final _wire_ldk_node_wait_next_eventPtr = _lookup< + late final _wire__crate__api__node__ldk_node_wait_next_eventPtr = _lookup< ffi.NativeFunction< 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)>(); + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_wait_next_event'); + late final _wire__crate__api__node__ldk_node_wait_next_event = + _wire__crate__api__node__ldk_node_wait_next_eventPtr + .asFunction)>(); - void wire_ldk_on_chain_payment_new_address( + void wire__crate__api__on_chain__ldk_on_chain_payment_new_address( int port_, ffi.Pointer that, ) { - return _wire_ldk_on_chain_payment_new_address( + return _wire__crate__api__on_chain__ldk_on_chain_payment_new_address( port_, that, ); } - late final _wire_ldk_on_chain_payment_new_addressPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Int64, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_ldk_on_chain_payment_new_address'); - late final _wire_ldk_on_chain_payment_new_address = - _wire_ldk_on_chain_payment_new_addressPtr.asFunction< - void Function(int, ffi.Pointer)>(); + late final _wire__crate__api__on_chain__ldk_on_chain_payment_new_addressPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_new_address'); + late final _wire__crate__api__on_chain__ldk_on_chain_payment_new_address = + _wire__crate__api__on_chain__ldk_on_chain_payment_new_addressPtr + .asFunction< + void Function(int, ffi.Pointer)>(); - void wire_ldk_on_chain_payment_send_all_to_address( + void wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address( int port_, ffi.Pointer that, ffi.Pointer address, ) { - return _wire_ldk_on_chain_payment_send_all_to_address( + return _wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address( port_, that, address, ); } - late final _wire_ldk_on_chain_payment_send_all_to_addressPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Int64, - ffi.Pointer, - ffi.Pointer)>>( - 'frbgen_ldk_node_wire_ldk_on_chain_payment_send_all_to_address'); - late final _wire_ldk_on_chain_payment_send_all_to_address = - _wire_ldk_on_chain_payment_send_all_to_addressPtr.asFunction< - void Function(int, ffi.Pointer, - ffi.Pointer)>(); - - void wire_ldk_on_chain_payment_send_to_address( + late final _wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_addressPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address'); + late final _wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address = + _wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_addressPtr + .asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer)>(); + + void wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address( int port_, ffi.Pointer that, ffi.Pointer address, int amount_sats, ) { - return _wire_ldk_on_chain_payment_send_to_address( + return _wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address( port_, that, address, @@ -3920,26 +5284,57 @@ class LdkCoreWire implements BaseWire { ); } - late final _wire_ldk_on_chain_payment_send_to_addressPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Int64, - ffi.Pointer, - ffi.Pointer, - ffi.Uint64)>>( - 'frbgen_ldk_node_wire_ldk_on_chain_payment_send_to_address'); - late final _wire_ldk_on_chain_payment_send_to_address = - _wire_ldk_on_chain_payment_send_to_addressPtr.asFunction< - void Function(int, ffi.Pointer, - ffi.Pointer, int)>(); - - void wire_ldk_spontaneous_payment_send( + late final _wire__crate__api__on_chain__ldk_on_chain_payment_send_to_addressPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Uint64)>>( + 'frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address'); + late final _wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address = + _wire__crate__api__on_chain__ldk_on_chain_payment_send_to_addressPtr + .asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer, int)>(); + + void wire__crate__api__spontaneous__ldk_spontaneous_payment_send( + int port_, + ffi.Pointer that, + int amount_msat, + ffi.Pointer node_id, + ) { + return _wire__crate__api__spontaneous__ldk_spontaneous_payment_send( + port_, + that, + amount_msat, + node_id, + ); + } + + late final _wire__crate__api__spontaneous__ldk_spontaneous_payment_sendPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Uint64, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__spontaneous__ldk_spontaneous_payment_send'); + late final _wire__crate__api__spontaneous__ldk_spontaneous_payment_send = + _wire__crate__api__spontaneous__ldk_spontaneous_payment_sendPtr + .asFunction< + void Function(int, ffi.Pointer, + int, ffi.Pointer)>(); + + void wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes( int port_, ffi.Pointer that, int amount_msat, ffi.Pointer node_id, ) { - return _wire_ldk_spontaneous_payment_send( + return _wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes( port_, that, amount_msat, @@ -3947,45 +5342,52 @@ class LdkCoreWire implements BaseWire { ); } - late final _wire_ldk_spontaneous_payment_sendPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Int64, - ffi.Pointer, - ffi.Uint64, - ffi.Pointer)>>( - 'frbgen_ldk_node_wire_ldk_spontaneous_payment_send'); - late final _wire_ldk_spontaneous_payment_send = - _wire_ldk_spontaneous_payment_sendPtr.asFunction< - void Function(int, ffi.Pointer, int, - ffi.Pointer)>(); + late final _wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probesPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Uint64, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes'); + late final _wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes = + _wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probesPtr + .asFunction< + void Function(int, ffi.Pointer, + int, ffi.Pointer)>(); + + void + rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12PaymentPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment'); + late final _rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment = + _rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12PaymentPtr + .asFunction)>(); - void wire_ldk_spontaneous_payment_send_probes( - int port_, - ffi.Pointer that, - int amount_msat, - ffi.Pointer node_id, + void + rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ffi.Pointer ptr, ) { - return _wire_ldk_spontaneous_payment_send_probes( - port_, - that, - amount_msat, - node_id, + return _rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ptr, ); } - late final _wire_ldk_spontaneous_payment_send_probesPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Int64, - ffi.Pointer, - ffi.Uint64, - ffi.Pointer)>>( - 'frbgen_ldk_node_wire_ldk_spontaneous_payment_send_probes'); - late final _wire_ldk_spontaneous_payment_send_probes = - _wire_ldk_spontaneous_payment_send_probesPtr.asFunction< - void Function(int, ffi.Pointer, int, - ffi.Pointer)>(); + late final _rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12PaymentPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment'); + late final _rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment = + _rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12PaymentPtr + .asFunction)>(); void rust_arc_increment_strong_count_RustOpaque_Node( ffi.Pointer ptr, @@ -4018,35 +5420,95 @@ class LdkCoreWire implements BaseWire { .asFunction)>(); void - rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( ffi.Pointer ptr, ) { - return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( ptr, ); } - late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilderPtr = + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilderPtr = _lookup)>>( - 'frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder'); - late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder = - _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilderPtr + 'frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder'); + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder = + _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilderPtr .asFunction)>(); void - rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilderPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder'); + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder = + _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilderPtr + .asFunction)>(); + + void rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilder( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilder( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilderPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilder'); + late final _rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilder = + _rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilderPtr + .asFunction)>(); + + void rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilder( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilder( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilderPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilder'); + late final _rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilder = + _rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilderPtr + .asFunction)>(); + + void rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraph( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraph( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraphPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraph'); + late final _rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraph = + _rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraphPtr + .asFunction)>(); + + void rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraph( ffi.Pointer ptr, ) { - return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( + return _rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraph( ptr, ); } - late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilderPtr = + late final _rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraphPtr = _lookup)>>( - 'frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder'); - late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder = - _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilderPtr + 'frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraph'); + late final _rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraph = + _rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraphPtr .asFunction)>(); void rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( @@ -4151,6 +5613,19 @@ class LdkCoreWire implements BaseWire { late final _cst_new_box_autoadd_address = _cst_new_box_autoadd_addressPtr .asFunction Function()>(); + ffi.Pointer + cst_new_box_autoadd_anchor_channels_config() { + return _cst_new_box_autoadd_anchor_channels_config(); + } + + late final _cst_new_box_autoadd_anchor_channels_configPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_anchor_channels_config'); + late final _cst_new_box_autoadd_anchor_channels_config = + _cst_new_box_autoadd_anchor_channels_configPtr.asFunction< + ffi.Pointer Function()>(); + ffi.Pointer cst_new_box_autoadd_bolt_11_invoice() { return _cst_new_box_autoadd_bolt_11_invoice(); } @@ -4162,6 +5637,19 @@ class LdkCoreWire implements BaseWire { _cst_new_box_autoadd_bolt_11_invoicePtr .asFunction Function()>(); + ffi.Pointer + cst_new_box_autoadd_bolt_12_parse_error() { + return _cst_new_box_autoadd_bolt_12_parse_error(); + } + + late final _cst_new_box_autoadd_bolt_12_parse_errorPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_bolt_12_parse_error'); + late final _cst_new_box_autoadd_bolt_12_parse_error = + _cst_new_box_autoadd_bolt_12_parse_errorPtr + .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_chain_data_source_config() { return _cst_new_box_autoadd_chain_data_source_config(); @@ -4197,6 +5685,30 @@ class LdkCoreWire implements BaseWire { _cst_new_box_autoadd_channel_idPtr .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_channel_info() { + return _cst_new_box_autoadd_channel_info(); + } + + late final _cst_new_box_autoadd_channel_infoPtr = _lookup< + ffi.NativeFunction Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_channel_info'); + late final _cst_new_box_autoadd_channel_info = + _cst_new_box_autoadd_channel_infoPtr + .asFunction Function()>(); + + ffi.Pointer + cst_new_box_autoadd_channel_update_info() { + return _cst_new_box_autoadd_channel_update_info(); + } + + late final _cst_new_box_autoadd_channel_update_infoPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_channel_update_info'); + late final _cst_new_box_autoadd_channel_update_info = + _cst_new_box_autoadd_channel_update_infoPtr + .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_closure_reason() { return _cst_new_box_autoadd_closure_reason(); } @@ -4218,6 +5730,17 @@ class LdkCoreWire implements BaseWire { late final _cst_new_box_autoadd_config = _cst_new_box_autoadd_configPtr .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_decode_error() { + return _cst_new_box_autoadd_decode_error(); + } + + late final _cst_new_box_autoadd_decode_errorPtr = _lookup< + ffi.NativeFunction Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_decode_error'); + late final _cst_new_box_autoadd_decode_error = + _cst_new_box_autoadd_decode_errorPtr + .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_entropy_source_config() { return _cst_new_box_autoadd_entropy_source_config(); @@ -4267,6 +5790,19 @@ class LdkCoreWire implements BaseWire { _cst_new_box_autoadd_ldk_bolt_11_paymentPtr .asFunction Function()>(); + ffi.Pointer + cst_new_box_autoadd_ldk_bolt_12_payment() { + return _cst_new_box_autoadd_ldk_bolt_12_payment(); + } + + late final _cst_new_box_autoadd_ldk_bolt_12_paymentPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_ldk_bolt_12_payment'); + late final _cst_new_box_autoadd_ldk_bolt_12_payment = + _cst_new_box_autoadd_ldk_bolt_12_paymentPtr + .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_ldk_mnemonic() { return _cst_new_box_autoadd_ldk_mnemonic(); } @@ -4278,6 +5814,19 @@ class LdkCoreWire implements BaseWire { _cst_new_box_autoadd_ldk_mnemonicPtr .asFunction Function()>(); + ffi.Pointer + cst_new_box_autoadd_ldk_network_graph() { + return _cst_new_box_autoadd_ldk_network_graph(); + } + + late final _cst_new_box_autoadd_ldk_network_graphPtr = _lookup< + ffi + .NativeFunction Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_ldk_network_graph'); + late final _cst_new_box_autoadd_ldk_network_graph = + _cst_new_box_autoadd_ldk_network_graphPtr + .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_ldk_node() { return _cst_new_box_autoadd_ldk_node(); } @@ -4351,6 +5900,26 @@ class LdkCoreWire implements BaseWire { _cst_new_box_autoadd_max_dust_htlc_exposurePtr.asFunction< ffi.Pointer Function()>(); + ffi.Pointer cst_new_box_autoadd_offer() { + return _cst_new_box_autoadd_offer(); + } + + late final _cst_new_box_autoadd_offerPtr = + _lookup Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_offer'); + late final _cst_new_box_autoadd_offer = _cst_new_box_autoadd_offerPtr + .asFunction Function()>(); + + ffi.Pointer cst_new_box_autoadd_offer_id() { + return _cst_new_box_autoadd_offer_id(); + } + + late final _cst_new_box_autoadd_offer_idPtr = + _lookup Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_offer_id'); + late final _cst_new_box_autoadd_offer_id = _cst_new_box_autoadd_offer_idPtr + .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_out_point() { return _cst_new_box_autoadd_out_point(); } @@ -4444,6 +6013,16 @@ class LdkCoreWire implements BaseWire { _cst_new_box_autoadd_public_keyPtr .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_refund() { + return _cst_new_box_autoadd_refund(); + } + + late final _cst_new_box_autoadd_refundPtr = + _lookup Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_refund'); + late final _cst_new_box_autoadd_refund = _cst_new_box_autoadd_refundPtr + .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_socket_address() { return _cst_new_box_autoadd_socket_address(); } @@ -4549,6 +6128,21 @@ class LdkCoreWire implements BaseWire { _cst_new_list_lightning_balancePtr.asFunction< ffi.Pointer Function(int)>(); + ffi.Pointer cst_new_list_node_id( + int len, + ) { + return _cst_new_list_node_id( + len, + ); + } + + late final _cst_new_list_node_idPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Int32)>>('frbgen_ldk_node_cst_new_list_node_id'); + late final _cst_new_list_node_id = _cst_new_list_node_idPtr + .asFunction Function(int)>(); + ffi.Pointer cst_new_list_payment_details( int len, ) { @@ -4597,6 +6191,21 @@ class LdkCoreWire implements BaseWire { _cst_new_list_pending_sweep_balancePtr.asFunction< ffi.Pointer Function(int)>(); + ffi.Pointer cst_new_list_prim_u_64_strict( + int len, + ) { + return _cst_new_list_prim_u_64_strict( + len, + ); + } + + late final _cst_new_list_prim_u_64_strictPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Int32)>>('frbgen_ldk_node_cst_new_list_prim_u_64_strict'); + late final _cst_new_list_prim_u_64_strict = _cst_new_list_prim_u_64_strictPtr + .asFunction Function(int)>(); + ffi.Pointer cst_new_list_prim_u_8_loose( int len, ) { @@ -4668,10 +6277,19 @@ class LdkCoreWire implements BaseWire { _dummy_method_to_enforce_bundlingPtr.asFunction(); } -typedef DartPostCObjectFnType = ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function(DartPort port_id, ffi.Pointer message)>>; +typedef DartPostCObjectFnType + = ffi.Pointer>; +typedef DartPostCObjectFnTypeFunction = ffi.Bool Function( + DartPort port_id, ffi.Pointer message); +typedef DartDartPostCObjectFnTypeFunction = bool Function( + DartDartPort port_id, ffi.Pointer message); typedef DartPort = ffi.Int64; +typedef DartDartPort = int; + +final class wire_cst_ldk_bolt_11_payment extends ffi.Struct { + @ffi.UintPtr() + external int ptr; +} final class wire_cst_list_prim_u_8_strict extends ffi.Struct { external ffi.Pointer ptr; @@ -4680,6 +6298,23 @@ final class wire_cst_list_prim_u_8_strict extends ffi.Struct { external int len; } +final class wire_cst_bolt_11_invoice extends ffi.Struct { + external ffi.Pointer signed_raw_invoice; +} + +final class wire_cst_ldk_bolt_12_payment extends ffi.Struct { + @ffi.UintPtr() + external int ptr; +} + +final class wire_cst_refund extends ffi.Struct { + external ffi.Pointer s; +} + +final class wire_cst_offer extends ffi.Struct { + external ffi.Pointer s; +} + final class wire_cst_SocketAddress_TcpIpV4 extends ffi.Struct { external ffi.Pointer addr; @@ -4755,6 +6390,13 @@ final class wire_cst_list_public_key extends ffi.Struct { external int len; } +final class wire_cst_anchor_channels_config extends ffi.Struct { + external ffi.Pointer trusted_peers_no_reserve; + + @ffi.Uint64() + external int per_channel_reserve_sats; +} + final class wire_cst_config extends ffi.Struct { external ffi.Pointer storage_dir_path; @@ -4784,6 +6426,8 @@ final class wire_cst_config extends ffi.Struct { @ffi.Int32() external int log_level; + + external ffi.Pointer anchor_channels_config; } final class wire_cst_ChainDataSourceConfig_Esplora extends ffi.Struct { @@ -4862,13 +6506,9 @@ 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_bolt_11_payment extends ffi.Struct { +final class wire_cst_ldk_network_graph extends ffi.Struct { @ffi.UintPtr() - external int ptr; -} - -final class wire_cst_bolt_11_invoice extends ffi.Struct { - external ffi.Pointer signed_raw_invoice; + external int inner; } final class wire_cst_ldk_node extends ffi.Struct { @@ -4947,10 +6587,101 @@ final class wire_cst_ldk_spontaneous_payment extends ffi.Struct { external int ptr; } +final class wire_cst_Bolt12ParseError_Bech32 extends ffi.Struct { + external ffi.Pointer field0; +} + +final class wire_cst_DecodeError_Io extends ffi.Struct { + external ffi.Pointer field0; +} + +final class DecodeErrorKind extends ffi.Union { + external wire_cst_DecodeError_Io Io; +} + +final class wire_cst_decode_error extends ffi.Struct { + @ffi.Int32() + external int tag; + + external DecodeErrorKind kind; +} + +final class wire_cst_Bolt12ParseError_Decode extends ffi.Struct { + external ffi.Pointer field0; +} + +final class wire_cst_Bolt12ParseError_InvalidSemantics extends ffi.Struct { + external ffi.Pointer field0; +} + +final class wire_cst_Bolt12ParseError_InvalidSignature extends ffi.Struct { + external ffi.Pointer field0; +} + +final class Bolt12ParseErrorKind extends ffi.Union { + external wire_cst_Bolt12ParseError_Bech32 Bech32; + + external wire_cst_Bolt12ParseError_Decode Decode; + + external wire_cst_Bolt12ParseError_InvalidSemantics InvalidSemantics; + + external wire_cst_Bolt12ParseError_InvalidSignature InvalidSignature; +} + +final class wire_cst_bolt_12_parse_error extends ffi.Struct { + @ffi.Int32() + external int tag; + + external Bolt12ParseErrorKind kind; +} + final class wire_cst_channel_id extends ffi.Struct { external ffi.Pointer data; } +final class wire_cst_node_id extends ffi.Struct { + external ffi.Pointer compressed; +} + +final class wire_cst_routing_fees extends ffi.Struct { + @ffi.Uint32() + external int base_msat; + + @ffi.Uint32() + external int proportional_millionths; +} + +final class wire_cst_channel_update_info extends ffi.Struct { + @ffi.Uint32() + external int last_update; + + @ffi.Bool() + external bool enabled; + + @ffi.Uint16() + external int cltv_expiry_delta; + + @ffi.Uint64() + external int htlc_minimum_msat; + + @ffi.Uint64() + external int htlc_maximum_msat; + + external wire_cst_routing_fees fees; +} + +final class wire_cst_channel_info extends ffi.Struct { + external wire_cst_node_id node_one; + + external ffi.Pointer one_to_two; + + external wire_cst_node_id node_two; + + external ffi.Pointer two_to_one; + + external ffi.Pointer capacity_sats; +} + final class wire_cst_ClosureReason_CounterpartyForceClosed extends ffi.Struct { external ffi.Pointer peer_msg; } @@ -4977,6 +6708,17 @@ final class wire_cst_payment_hash extends ffi.Struct { external ffi.Pointer data; } +final class wire_cst_Event_PaymentClaimable extends ffi.Struct { + external ffi.Pointer payment_id; + + external ffi.Pointer payment_hash; + + @ffi.Uint64() + external int claimable_amount_msat; + + external ffi.Pointer claim_deadline; +} + final class wire_cst_Event_PaymentSuccessful extends ffi.Struct { external ffi.Pointer payment_id; @@ -5044,6 +6786,8 @@ final class wire_cst_Event_ChannelClosed extends ffi.Struct { } final class EventKind extends ffi.Union { + external wire_cst_Event_PaymentClaimable PaymentClaimable; + external wire_cst_Event_PaymentSuccessful PaymentSuccessful; external wire_cst_Event_PaymentFailed PaymentFailed; @@ -5070,6 +6814,10 @@ final class wire_cst_lsp_fee_limits extends ffi.Struct { external ffi.Pointer max_proportional_opening_fee_ppm_msat; } +final class wire_cst_offer_id extends ffi.Struct { + external ffi.Pointer field0; +} + final class wire_cst_payment_preimage extends ffi.Struct { external ffi.Pointer data; } @@ -5102,12 +6850,34 @@ final class wire_cst_PaymentKind_Spontaneous extends ffi.Struct { external ffi.Pointer preimage; } +final class wire_cst_PaymentKind_Bolt12Offer extends ffi.Struct { + external ffi.Pointer hash; + + external ffi.Pointer preimage; + + external ffi.Pointer secret; + + external ffi.Pointer offer_id; +} + +final class wire_cst_PaymentKind_Bolt12Refund extends ffi.Struct { + external ffi.Pointer hash; + + external ffi.Pointer preimage; + + external ffi.Pointer secret; +} + final class PaymentKindKind extends ffi.Union { external wire_cst_PaymentKind_Bolt11 Bolt11; external wire_cst_PaymentKind_Bolt11Jit Bolt11Jit; external wire_cst_PaymentKind_Spontaneous Spontaneous; + + external wire_cst_PaymentKind_Bolt12Offer Bolt12Offer; + + external wire_cst_PaymentKind_Bolt12Refund Bolt12Refund; } final class wire_cst_payment_kind extends ffi.Struct { @@ -5322,6 +7092,13 @@ final class wire_cst_list_lightning_balance extends ffi.Struct { external int len; } +final class wire_cst_list_node_id 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; @@ -5404,6 +7181,13 @@ final class wire_cst_list_pending_sweep_balance extends ffi.Struct { external int len; } +final class wire_cst_list_prim_u_64_strict 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; @@ -5427,6 +7211,31 @@ final class wire_cst_best_block extends ffi.Struct { external int height; } +final class wire_cst_bolt_12_invoice extends ffi.Struct { + external ffi.Pointer data; +} + +final class wire_cst_LdkNodeError_Decode extends ffi.Struct { + external ffi.Pointer field0; +} + +final class wire_cst_LdkNodeError_Bolt12Parse extends ffi.Struct { + external ffi.Pointer field0; +} + +final class LdkNodeErrorKind extends ffi.Union { + external wire_cst_LdkNodeError_Decode Decode; + + external wire_cst_LdkNodeError_Bolt12Parse Bolt12Parse; +} + +final class wire_cst_ldk_node_error extends ffi.Struct { + @ffi.Int32() + external int tag; + + external LdkNodeErrorKind kind; +} + final class wire_cst_node_status extends ffi.Struct { @ffi.Bool() external bool is_running; diff --git a/lib/src/generated/frb_generated.web.dart b/lib/src/generated/frb_generated.web.dart deleted file mode 100644 index 8d37fc4..0000000 --- a/lib/src/generated/frb_generated.web.dart +++ /dev/null @@ -1,2905 +0,0 @@ -// This file is automatically generated, so please do not edit it. -// 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 - -import 'api/error.dart'; -import 'api/node.dart'; -import 'api/types.dart'; -import 'dart:async'; -import 'dart:convert'; -import 'frb_generated.dart'; -import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated_web.dart'; - -abstract class LdkCoreApiImplPlatform extends BaseApiImpl { - LdkCoreApiImplPlatform({ - required super.handler, - required super.wire, - required super.generalizedFrbRustBinding, - required super.portManager, - }); - - CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_NodePtr => - wire.rust_arc_decrement_strong_count_RustOpaque_Node; - - CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_NodeBuilderPtr => wire - .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder; - - CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_LdkNodePaymentBolt11PaymentPtr => wire - .rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment; - - CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_LdkNodePaymentOnchainPaymentPtr => wire - .rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment; - - CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_LdkNodePaymentSpontaneousPaymentPtr => - wire.rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment; - - @protected - NodeBuilder - dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( - dynamic raw); - - @protected - Node dco_decode_RustOpaque_Node(dynamic raw); - - @protected - NodeBuilder - dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( - dynamic raw); - - @protected - LdkNodePaymentBolt11Payment - dco_decode_RustOpaque_ldk_nodepaymentBolt11Payment(dynamic raw); - - @protected - LdkNodePaymentOnchainPayment - dco_decode_RustOpaque_ldk_nodepaymentOnchainPayment(dynamic raw); - - @protected - LdkNodePaymentSpontaneousPayment - dco_decode_RustOpaque_ldk_nodepaymentSpontaneousPayment(dynamic raw); - - @protected - String dco_decode_String(dynamic raw); - - @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); - - @protected - bool dco_decode_bool(dynamic raw); - - @protected - Address dco_decode_box_autoadd_address(dynamic raw); - - @protected - Bolt11Invoice dco_decode_box_autoadd_bolt_11_invoice(dynamic raw); - - @protected - ChainDataSourceConfig dco_decode_box_autoadd_chain_data_source_config( - dynamic raw); - - @protected - ChannelConfig dco_decode_box_autoadd_channel_config(dynamic raw); - - @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); - - @protected - EntropySourceConfig dco_decode_box_autoadd_entropy_source_config(dynamic raw); - - @protected - Event dco_decode_box_autoadd_event(dynamic raw); - - @protected - GossipSourceConfig dco_decode_box_autoadd_gossip_source_config(dynamic raw); - - @protected - LdkBolt11Payment dco_decode_box_autoadd_ldk_bolt_11_payment(dynamic raw); - - @protected - LdkMnemonic dco_decode_box_autoadd_ldk_mnemonic(dynamic raw); - - @protected - LdkNode dco_decode_box_autoadd_ldk_node(dynamic raw); - - @protected - LdkOnChainPayment dco_decode_box_autoadd_ldk_on_chain_payment(dynamic raw); - - @protected - LdkSpontaneousPayment dco_decode_box_autoadd_ldk_spontaneous_payment( - dynamic raw); - - @protected - LiquiditySourceConfig dco_decode_box_autoadd_liquidity_source_config( - dynamic raw); - - @protected - LSPFeeLimits dco_decode_box_autoadd_lsp_fee_limits(dynamic raw); - - @protected - MaxDustHTLCExposure dco_decode_box_autoadd_max_dust_htlc_exposure( - dynamic raw); - - @protected - OutPoint dco_decode_box_autoadd_out_point(dynamic raw); - - @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); - - @protected - PaymentId dco_decode_box_autoadd_payment_id(dynamic raw); - - @protected - PaymentPreimage dco_decode_box_autoadd_payment_preimage(dynamic raw); - - @protected - PaymentSecret dco_decode_box_autoadd_payment_secret(dynamic raw); - - @protected - PublicKey dco_decode_box_autoadd_public_key(dynamic raw); - - @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); - - @protected - int dco_decode_box_autoadd_u_64(dynamic raw); - - @protected - UserChannelId dco_decode_box_autoadd_user_channel_id(dynamic raw); - - @protected - BuilderException dco_decode_builder_exception(dynamic raw); - - @protected - ChainDataSourceConfig dco_decode_chain_data_source_config(dynamic raw); - - @protected - ChannelConfig dco_decode_channel_config(dynamic raw); - - @protected - ChannelDetails dco_decode_channel_details(dynamic raw); - - @protected - ChannelId dco_decode_channel_id(dynamic raw); - - @protected - ClosureReason dco_decode_closure_reason(dynamic raw); - - @protected - Config dco_decode_config(dynamic raw); - - @protected - EntropySourceConfig dco_decode_entropy_source_config(dynamic raw); - - @protected - Event dco_decode_event(dynamic raw); - - @protected - GossipSourceConfig dco_decode_gossip_source_config(dynamic raw); - - @protected - int dco_decode_i_32(dynamic raw); - - @protected - LdkBolt11Payment dco_decode_ldk_bolt_11_payment(dynamic raw); - - @protected - LdkMnemonic dco_decode_ldk_mnemonic(dynamic raw); - - @protected - LdkNode dco_decode_ldk_node(dynamic raw); - - @protected - LdkOnChainPayment dco_decode_ldk_on_chain_payment(dynamic raw); - - @protected - LdkSpontaneousPayment dco_decode_ldk_spontaneous_payment(dynamic raw); - - @protected - LightningBalance dco_decode_lightning_balance(dynamic raw); - - @protected - LiquiditySourceConfig dco_decode_liquidity_source_config(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); - - @protected - Uint8List dco_decode_list_prim_u_8_strict(dynamic raw); - - @protected - List dco_decode_list_public_key(dynamic raw); - - @protected - List dco_decode_list_socket_address(dynamic raw); - - @protected - LogLevel dco_decode_log_level(dynamic raw); - - @protected - LSPFeeLimits dco_decode_lsp_fee_limits(dynamic raw); - - @protected - MaxDustHTLCExposure dco_decode_max_dust_htlc_exposure(dynamic raw); - - @protected - Network dco_decode_network(dynamic raw); - - @protected - NodeException dco_decode_node_exception(dynamic raw); - - @protected - NodeStatus dco_decode_node_status(dynamic raw); - - @protected - String? dco_decode_opt_String(dynamic raw); - - @protected - ChainDataSourceConfig? dco_decode_opt_box_autoadd_chain_data_source_config( - dynamic raw); - - @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); - - @protected - Event? dco_decode_opt_box_autoadd_event(dynamic raw); - - @protected - 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 - PaymentId? dco_decode_opt_box_autoadd_payment_id(dynamic raw); - - @protected - PaymentPreimage? dco_decode_opt_box_autoadd_payment_preimage(dynamic raw); - - @protected - PaymentSecret? dco_decode_opt_box_autoadd_payment_secret(dynamic raw); - - @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); - - @protected - int? dco_decode_opt_box_autoadd_u_64(dynamic raw); - - @protected - List? dco_decode_opt_list_socket_address(dynamic raw); - - @protected - OutPoint dco_decode_out_point(dynamic raw); - - @protected - PaymentDetails dco_decode_payment_details(dynamic raw); - - @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); - - @protected - PaymentId dco_decode_payment_id(dynamic raw); - - @protected - PaymentKind dco_decode_payment_kind(dynamic raw); - - @protected - PaymentPreimage dco_decode_payment_preimage(dynamic raw); - - @protected - PaymentSecret dco_decode_payment_secret(dynamic raw); - - @protected - PaymentStatus dco_decode_payment_status(dynamic raw); - - @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); - - @protected - Txid dco_decode_txid(dynamic raw); - - @protected - int dco_decode_u_16(dynamic raw); - - @protected - int dco_decode_u_32(dynamic raw); - - @protected - int dco_decode_u_64(dynamic raw); - - @protected - int dco_decode_u_8(dynamic raw); - - @protected - U8Array12 dco_decode_u_8_array_12(dynamic raw); - - @protected - U8Array16 dco_decode_u_8_array_16(dynamic raw); - - @protected - U8Array32 dco_decode_u_8_array_32(dynamic raw); - - @protected - U8Array4 dco_decode_u_8_array_4(dynamic raw); - - @protected - U8Array64 dco_decode_u_8_array_64(dynamic raw); - - @protected - void dco_decode_unit(dynamic raw); - - @protected - UserChannelId dco_decode_user_channel_id(dynamic raw); - - @protected - int dco_decode_usize(dynamic raw); - - @protected - NodeBuilder - sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( - SseDeserializer deserializer); - - @protected - Node sse_decode_RustOpaque_Node(SseDeserializer deserializer); - - @protected - NodeBuilder - sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( - SseDeserializer deserializer); - - @protected - LdkNodePaymentBolt11Payment - sse_decode_RustOpaque_ldk_nodepaymentBolt11Payment( - SseDeserializer deserializer); - - @protected - LdkNodePaymentOnchainPayment - sse_decode_RustOpaque_ldk_nodepaymentOnchainPayment( - SseDeserializer deserializer); - - @protected - LdkNodePaymentSpontaneousPayment - sse_decode_RustOpaque_ldk_nodepaymentSpontaneousPayment( - SseDeserializer deserializer); - - @protected - String sse_decode_String(SseDeserializer deserializer); - - @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); - - @protected - bool sse_decode_bool(SseDeserializer deserializer); - - @protected - Address sse_decode_box_autoadd_address(SseDeserializer deserializer); - - @protected - Bolt11Invoice sse_decode_box_autoadd_bolt_11_invoice( - SseDeserializer deserializer); - - @protected - ChainDataSourceConfig sse_decode_box_autoadd_chain_data_source_config( - SseDeserializer deserializer); - - @protected - ChannelConfig sse_decode_box_autoadd_channel_config( - SseDeserializer deserializer); - - @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); - - @protected - EntropySourceConfig sse_decode_box_autoadd_entropy_source_config( - SseDeserializer deserializer); - - @protected - Event sse_decode_box_autoadd_event(SseDeserializer deserializer); - - @protected - GossipSourceConfig sse_decode_box_autoadd_gossip_source_config( - SseDeserializer deserializer); - - @protected - LdkBolt11Payment sse_decode_box_autoadd_ldk_bolt_11_payment( - SseDeserializer deserializer); - - @protected - LdkMnemonic sse_decode_box_autoadd_ldk_mnemonic(SseDeserializer deserializer); - - @protected - LdkNode sse_decode_box_autoadd_ldk_node(SseDeserializer deserializer); - - @protected - LdkOnChainPayment sse_decode_box_autoadd_ldk_on_chain_payment( - SseDeserializer deserializer); - - @protected - LdkSpontaneousPayment sse_decode_box_autoadd_ldk_spontaneous_payment( - SseDeserializer deserializer); - - @protected - LiquiditySourceConfig sse_decode_box_autoadd_liquidity_source_config( - SseDeserializer deserializer); - - @protected - LSPFeeLimits sse_decode_box_autoadd_lsp_fee_limits( - SseDeserializer deserializer); - - @protected - MaxDustHTLCExposure sse_decode_box_autoadd_max_dust_htlc_exposure( - SseDeserializer deserializer); - - @protected - OutPoint sse_decode_box_autoadd_out_point(SseDeserializer deserializer); - - @protected - 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); - - @protected - PaymentId sse_decode_box_autoadd_payment_id(SseDeserializer deserializer); - - @protected - PaymentPreimage sse_decode_box_autoadd_payment_preimage( - SseDeserializer deserializer); - - @protected - PaymentSecret sse_decode_box_autoadd_payment_secret( - SseDeserializer deserializer); - - @protected - PublicKey sse_decode_box_autoadd_public_key(SseDeserializer deserializer); - - @protected - 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); - - @protected - int sse_decode_box_autoadd_u_64(SseDeserializer deserializer); - - @protected - UserChannelId sse_decode_box_autoadd_user_channel_id( - SseDeserializer deserializer); - - @protected - BuilderException sse_decode_builder_exception(SseDeserializer deserializer); - - @protected - ChainDataSourceConfig sse_decode_chain_data_source_config( - SseDeserializer deserializer); - - @protected - ChannelConfig sse_decode_channel_config(SseDeserializer deserializer); - - @protected - ChannelDetails sse_decode_channel_details(SseDeserializer deserializer); - - @protected - ChannelId sse_decode_channel_id(SseDeserializer deserializer); - - @protected - ClosureReason sse_decode_closure_reason(SseDeserializer deserializer); - - @protected - Config sse_decode_config(SseDeserializer deserializer); - - @protected - EntropySourceConfig sse_decode_entropy_source_config( - SseDeserializer deserializer); - - @protected - Event sse_decode_event(SseDeserializer deserializer); - - @protected - GossipSourceConfig sse_decode_gossip_source_config( - SseDeserializer deserializer); - - @protected - int sse_decode_i_32(SseDeserializer deserializer); - - @protected - LdkBolt11Payment sse_decode_ldk_bolt_11_payment(SseDeserializer deserializer); - - @protected - LdkMnemonic sse_decode_ldk_mnemonic(SseDeserializer deserializer); - - @protected - LdkNode sse_decode_ldk_node(SseDeserializer deserializer); - - @protected - LdkOnChainPayment sse_decode_ldk_on_chain_payment( - SseDeserializer deserializer); - - @protected - LdkSpontaneousPayment sse_decode_ldk_spontaneous_payment( - SseDeserializer deserializer); - - @protected - LightningBalance sse_decode_lightning_balance(SseDeserializer deserializer); - - @protected - LiquiditySourceConfig sse_decode_liquidity_source_config( - 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); - - @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); - - @protected - Uint8List sse_decode_list_prim_u_8_strict(SseDeserializer deserializer); - - @protected - List sse_decode_list_public_key(SseDeserializer deserializer); - - @protected - List sse_decode_list_socket_address( - SseDeserializer deserializer); - - @protected - LogLevel sse_decode_log_level(SseDeserializer deserializer); - - @protected - LSPFeeLimits sse_decode_lsp_fee_limits(SseDeserializer deserializer); - - @protected - MaxDustHTLCExposure sse_decode_max_dust_htlc_exposure( - SseDeserializer deserializer); - - @protected - Network sse_decode_network(SseDeserializer deserializer); - - @protected - NodeException sse_decode_node_exception(SseDeserializer deserializer); - - @protected - NodeStatus sse_decode_node_status(SseDeserializer deserializer); - - @protected - String? sse_decode_opt_String(SseDeserializer deserializer); - - @protected - ChainDataSourceConfig? sse_decode_opt_box_autoadd_chain_data_source_config( - SseDeserializer deserializer); - - @protected - 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); - - @protected - Event? sse_decode_opt_box_autoadd_event(SseDeserializer deserializer); - - @protected - 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 - PaymentId? sse_decode_opt_box_autoadd_payment_id( - SseDeserializer deserializer); - - @protected - PaymentPreimage? sse_decode_opt_box_autoadd_payment_preimage( - SseDeserializer deserializer); - - @protected - PaymentSecret? sse_decode_opt_box_autoadd_payment_secret( - SseDeserializer deserializer); - - @protected - 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); - - @protected - int? sse_decode_opt_box_autoadd_u_64(SseDeserializer deserializer); - - @protected - List? sse_decode_opt_list_socket_address( - SseDeserializer deserializer); - - @protected - OutPoint sse_decode_out_point(SseDeserializer deserializer); - - @protected - PaymentDetails sse_decode_payment_details(SseDeserializer deserializer); - - @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); - - @protected - PaymentId sse_decode_payment_id(SseDeserializer deserializer); - - @protected - PaymentKind sse_decode_payment_kind(SseDeserializer deserializer); - - @protected - PaymentPreimage sse_decode_payment_preimage(SseDeserializer deserializer); - - @protected - PaymentSecret sse_decode_payment_secret(SseDeserializer deserializer); - - @protected - PaymentStatus sse_decode_payment_status(SseDeserializer deserializer); - - @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); - - @protected - Txid sse_decode_txid(SseDeserializer deserializer); - - @protected - int sse_decode_u_16(SseDeserializer deserializer); - - @protected - int sse_decode_u_32(SseDeserializer deserializer); - - @protected - int sse_decode_u_64(SseDeserializer deserializer); - - @protected - int sse_decode_u_8(SseDeserializer deserializer); - - @protected - U8Array12 sse_decode_u_8_array_12(SseDeserializer deserializer); - - @protected - U8Array16 sse_decode_u_8_array_16(SseDeserializer deserializer); - - @protected - U8Array32 sse_decode_u_8_array_32(SseDeserializer deserializer); - - @protected - U8Array4 sse_decode_u_8_array_4(SseDeserializer deserializer); - - @protected - U8Array64 sse_decode_u_8_array_64(SseDeserializer deserializer); - - @protected - void sse_decode_unit(SseDeserializer deserializer); - - @protected - UserChannelId sse_decode_user_channel_id(SseDeserializer deserializer); - - @protected - int sse_decode_usize(SseDeserializer deserializer); - - @protected - String cst_encode_String(String raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw; - } - - @protected - List cst_encode_address(Address raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - 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 - return [cst_encode_String(raw.signedRawInvoice)]; - } - - @protected - List cst_encode_box_autoadd_address(Address raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_address(raw); - } - - @protected - List cst_encode_box_autoadd_bolt_11_invoice(Bolt11Invoice raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_bolt_11_invoice(raw); - } - - @protected - List cst_encode_box_autoadd_chain_data_source_config( - ChainDataSourceConfig raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_chain_data_source_config(raw); - } - - @protected - List cst_encode_box_autoadd_channel_config(ChannelConfig raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_channel_config(raw); - } - - @protected - List cst_encode_box_autoadd_channel_id(ChannelId raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - 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 - return cst_encode_config(raw); - } - - @protected - List cst_encode_box_autoadd_entropy_source_config( - EntropySourceConfig raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_entropy_source_config(raw); - } - - @protected - List cst_encode_box_autoadd_event(Event raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_event(raw); - } - - @protected - List cst_encode_box_autoadd_gossip_source_config( - GossipSourceConfig raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_gossip_source_config(raw); - } - - @protected - List cst_encode_box_autoadd_ldk_bolt_11_payment( - LdkBolt11Payment raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_ldk_bolt_11_payment(raw); - } - - @protected - List cst_encode_box_autoadd_ldk_mnemonic(LdkMnemonic raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_ldk_mnemonic(raw); - } - - @protected - List cst_encode_box_autoadd_ldk_node(LdkNode raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_ldk_node(raw); - } - - @protected - List cst_encode_box_autoadd_ldk_on_chain_payment( - LdkOnChainPayment raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_ldk_on_chain_payment(raw); - } - - @protected - List cst_encode_box_autoadd_ldk_spontaneous_payment( - LdkSpontaneousPayment raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_ldk_spontaneous_payment(raw); - } - - @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_lsp_fee_limits(LSPFeeLimits raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_lsp_fee_limits(raw); - } - - @protected - List cst_encode_box_autoadd_max_dust_htlc_exposure( - MaxDustHTLCExposure raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_max_dust_htlc_exposure(raw); - } - - @protected - List cst_encode_box_autoadd_out_point(OutPoint raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_out_point(raw); - } - - @protected - List cst_encode_box_autoadd_payment_details(PaymentDetails raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - 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 - return cst_encode_payment_hash(raw); - } - - @protected - List cst_encode_box_autoadd_payment_id(PaymentId raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_payment_id(raw); - } - - @protected - List cst_encode_box_autoadd_payment_preimage(PaymentPreimage raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_payment_preimage(raw); - } - - @protected - List cst_encode_box_autoadd_payment_secret(PaymentSecret raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_payment_secret(raw); - } - - @protected - List cst_encode_box_autoadd_public_key(PublicKey raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_public_key(raw); - } - - @protected - List cst_encode_box_autoadd_socket_address(SocketAddress raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - 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 - return cst_encode_u_32(raw); - } - - @protected - Object cst_encode_box_autoadd_u_64(int raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_u_64(raw); - } - - @protected - List cst_encode_box_autoadd_user_channel_id(UserChannelId raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_user_channel_id(raw); - } - - @protected - List cst_encode_chain_data_source_config(ChainDataSourceConfig raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - if (raw is ChainDataSourceConfig_Esplora) { - return [0, cst_encode_String(raw.field0)]; - } - - throw Exception('unreachable'); - } - - @protected - List cst_encode_channel_config(ChannelConfig raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [ - 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_u_64(raw.forceCloseAvoidanceMaxFeeSatoshis), - cst_encode_bool(raw.acceptUnderpayingHtlcs) - ]; - } - - @protected - List cst_encode_channel_details(ChannelDetails raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [ - cst_encode_channel_id(raw.channelId), - cst_encode_public_key(raw.counterpartyNodeId), - cst_encode_opt_box_autoadd_out_point(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.outboundCapacityMsat), - cst_encode_u_64(raw.inboundCapacityMsat), - cst_encode_opt_box_autoadd_u_32(raw.confirmationsRequired), - cst_encode_opt_box_autoadd_u_32(raw.confirmations), - 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) - ]; - } - - @protected - List cst_encode_channel_id(ChannelId raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - 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_LegacyCooperativeClosure) { - return [2]; - } - if (raw is ClosureReason_CounterpartyInitiatedCooperativeClosure) { - return [3]; - } - if (raw is ClosureReason_LocallyInitiatedCooperativeClosure) { - return [4]; - } - if (raw is ClosureReason_CommitmentTxConfirmed) { - return [5]; - } - if (raw is ClosureReason_FundingTimedOut) { - return [6]; - } - if (raw is ClosureReason_ProcessingError) { - return [7, cst_encode_String(raw.err)]; - } - if (raw is ClosureReason_DisconnectedPeer) { - return [8]; - } - if (raw is ClosureReason_OutdatedChannelManager) { - return [9]; - } - if (raw is ClosureReason_CounterpartyCoopClosedUnfundedChannel) { - return [10]; - } - if (raw is ClosureReason_FundingBatchClosure) { - return [11]; - } - if (raw is ClosureReason_HTLCsTimedOut) { - return [12]; - } - - throw Exception('unreachable'); - } - - @protected - List cst_encode_config(Config raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [ - cst_encode_String(raw.storageDirPath), - cst_encode_opt_String(raw.logDirPath), - cst_encode_network(raw.network), - cst_encode_opt_list_socket_address(raw.listeningAddresses), - cst_encode_u_32(raw.defaultCltvExpiryDelta), - cst_encode_u_64(raw.onchainWalletSyncIntervalSecs), - cst_encode_u_64(raw.walletSyncIntervalSecs), - cst_encode_u_64(raw.feeRateCacheUpdateIntervalSecs), - cst_encode_list_public_key(raw.trustedPeers0Conf), - cst_encode_u_64(raw.probingLiquidityLimitMultiplier), - cst_encode_log_level(raw.logLevel) - ]; - } - - @protected - List cst_encode_entropy_source_config(EntropySourceConfig raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - if (raw is EntropySourceConfig_SeedFile) { - return [0, cst_encode_String(raw.field0)]; - } - if (raw is EntropySourceConfig_SeedBytes) { - return [1, cst_encode_u_8_array_64(raw.field0)]; - } - if (raw is EntropySourceConfig_Bip39Mnemonic) { - return [ - 2, - cst_encode_box_autoadd_ldk_mnemonic(raw.mnemonic), - cst_encode_opt_String(raw.passphrase) - ]; - } - - throw Exception('unreachable'); - } - - @protected - 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_opt_box_autoadd_payment_id(raw.paymentId), - cst_encode_box_autoadd_payment_hash(raw.paymentHash), - cst_encode_opt_box_autoadd_u_64(raw.feePaidMsat) - ]; - } - if (raw is Event_PaymentFailed) { - return [ - 1, - cst_encode_opt_box_autoadd_payment_id(raw.paymentId), - cst_encode_box_autoadd_payment_hash(raw.paymentHash), - cst_encode_opt_box_autoadd_payment_failure_reason(raw.reason) - ]; - } - if (raw is Event_PaymentReceived) { - return [ - 2, - cst_encode_opt_box_autoadd_payment_id(raw.paymentId), - cst_encode_box_autoadd_payment_hash(raw.paymentHash), - cst_encode_u_64(raw.amountMsat) - ]; - } - if (raw is Event_ChannelPending) { - 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) - ]; - } - if (raw is Event_ChannelReady) { - return [ - 4, - 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) - ]; - } - if (raw is Event_ChannelClosed) { - 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) - ]; - } - - throw Exception('unreachable'); - } - - @protected - List cst_encode_gossip_source_config(GossipSourceConfig raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - if (raw is GossipSourceConfig_P2PNetwork) { - return [0]; - } - if (raw is GossipSourceConfig_RapidGossipSync) { - return [1, cst_encode_String(raw.field0)]; - } - - throw Exception('unreachable'); - } - - @protected - List cst_encode_ldk_bolt_11_payment(LdkBolt11Payment raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_RustOpaque_ldk_nodepaymentBolt11Payment(raw.ptr)]; - } - - @protected - List cst_encode_ldk_mnemonic(LdkMnemonic raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_String(raw.seedPhrase)]; - } - - @protected - List cst_encode_ldk_node(LdkNode raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_RustOpaque_Node(raw.ptr)]; - } - - @protected - List cst_encode_ldk_on_chain_payment(LdkOnChainPayment raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_RustOpaque_ldk_nodepaymentOnchainPayment(raw.ptr)]; - } - - @protected - List cst_encode_ldk_spontaneous_payment(LdkSpontaneousPayment raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_RustOpaque_ldk_nodepaymentSpontaneousPayment(raw.ptr)]; - } - - @protected - List cst_encode_lightning_balance(LightningBalance 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'); - } - - @protected - List cst_encode_liquidity_source_config(LiquiditySourceConfig raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [ - cst_encode_record_socket_address_public_key_opt_string(raw.lsps2Service) - ]; - } - - @protected - List cst_encode_list_channel_details(List raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - 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 - return raw.map(cst_encode_payment_details).toList(); - } - - @protected - List cst_encode_list_peer_details(List raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - 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 - return raw; - } - - @protected - Uint8List cst_encode_list_prim_u_8_strict(Uint8List raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw; - } - - @protected - List cst_encode_list_public_key(List raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw.map(cst_encode_public_key).toList(); - } - - @protected - List cst_encode_list_socket_address(List raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw.map(cst_encode_socket_address).toList(); - } - - @protected - List cst_encode_lsp_fee_limits(LSPFeeLimits raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [ - cst_encode_opt_box_autoadd_u_64(raw.maxTotalOpeningFeeMsat), - cst_encode_opt_box_autoadd_u_64(raw.maxProportionalOpeningFeePpmMsat) - ]; - } - - @protected - List cst_encode_max_dust_htlc_exposure(MaxDustHTLCExposure raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - if (raw is MaxDustHTLCExposure_FixedLimitMsat) { - return [0, cst_encode_u_64(raw.field0)]; - } - if (raw is MaxDustHTLCExposure_FeeRateMultiplier) { - return [1, cst_encode_u_64(raw.field0)]; - } - - throw Exception('unreachable'); - } - - @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 - return raw == null ? null : cst_encode_String(raw); - } - - @protected - List? cst_encode_opt_box_autoadd_chain_data_source_config( - ChainDataSourceConfig? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null - ? null - : cst_encode_box_autoadd_chain_data_source_config(raw); - } - - @protected - List? cst_encode_opt_box_autoadd_channel_config(ChannelConfig? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - 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) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null - ? null - : cst_encode_box_autoadd_entropy_source_config(raw); - } - - @protected - List? cst_encode_opt_box_autoadd_event(Event? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? null : cst_encode_box_autoadd_event(raw); - } - - @protected - List? cst_encode_opt_box_autoadd_gossip_source_config( - GossipSourceConfig? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null - ? null - : 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) { - // Codec=Cst (C-struct based), see doc to use other codecs - 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_id(PaymentId? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? null : cst_encode_box_autoadd_payment_id(raw); - } - - @protected - List? cst_encode_opt_box_autoadd_payment_preimage( - PaymentPreimage? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? null : cst_encode_box_autoadd_payment_preimage(raw); - } - - @protected - List? cst_encode_opt_box_autoadd_payment_secret(PaymentSecret? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? null : cst_encode_box_autoadd_payment_secret(raw); - } - - @protected - List? cst_encode_opt_box_autoadd_public_key(PublicKey? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - 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 - return raw == null ? null : cst_encode_box_autoadd_u_32(raw); - } - - @protected - Object? cst_encode_opt_box_autoadd_u_64(int? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? null : cst_encode_box_autoadd_u_64(raw); - } - - @protected - List? cst_encode_opt_list_socket_address(List? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? null : cst_encode_list_socket_address(raw); - } - - @protected - List cst_encode_out_point(OutPoint raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_txid(raw.txid), cst_encode_u_32(raw.vout)]; - } - - @protected - List cst_encode_payment_details(PaymentDetails raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [ - cst_encode_payment_id(raw.id), - cst_encode_payment_kind(raw.kind), - cst_encode_opt_box_autoadd_u_64(raw.amountMsat), - cst_encode_payment_direction(raw.direction), - cst_encode_payment_status(raw.status) - ]; - } - - @protected - List cst_encode_payment_hash(PaymentHash raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_u_8_array_32(raw.data)]; - } - - @protected - List cst_encode_payment_id(PaymentId raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_u_8_array_32(raw.field0)]; - } - - @protected - List cst_encode_payment_kind(PaymentKind raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - if (raw is PaymentKind_Onchain) { - return [0]; - } - if (raw is PaymentKind_Bolt11) { - return [ - 1, - cst_encode_box_autoadd_payment_hash(raw.hash), - cst_encode_opt_box_autoadd_payment_preimage(raw.preimage), - cst_encode_opt_box_autoadd_payment_secret(raw.secret) - ]; - } - if (raw is PaymentKind_Bolt11Jit) { - return [ - 2, - cst_encode_box_autoadd_payment_hash(raw.hash), - cst_encode_opt_box_autoadd_payment_preimage(raw.preimage), - cst_encode_opt_box_autoadd_payment_secret(raw.secret), - cst_encode_box_autoadd_lsp_fee_limits(raw.lspFeeLimits) - ]; - } - if (raw is PaymentKind_Spontaneous) { - return [ - 3, - cst_encode_box_autoadd_payment_hash(raw.hash), - cst_encode_opt_box_autoadd_payment_preimage(raw.preimage) - ]; - } - - throw Exception('unreachable'); - } - - @protected - List cst_encode_payment_preimage(PaymentPreimage raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_u_8_array_32(raw.data)]; - } - - @protected - List cst_encode_payment_secret(PaymentSecret raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_u_8_array_32(raw.data)]; - } - - @protected - List cst_encode_peer_details(PeerDetails raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [ - cst_encode_public_key(raw.nodeId), - cst_encode_socket_address(raw.address), - cst_encode_bool(raw.isConnected) - ]; - } - - @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.hex)]; - } - - @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) - ]; - } - - @protected - List cst_encode_socket_address(SocketAddress raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - if (raw is SocketAddress_TcpIpV4) { - return [0, cst_encode_u_8_array_4(raw.addr), cst_encode_u_16(raw.port)]; - } - if (raw is SocketAddress_TcpIpV6) { - return [1, cst_encode_u_8_array_16(raw.addr), cst_encode_u_16(raw.port)]; - } - if (raw is SocketAddress_OnionV2) { - return [2, cst_encode_u_8_array_12(raw.field0)]; - } - if (raw is SocketAddress_OnionV3) { - return [ - 3, - cst_encode_u_8_array_32(raw.ed25519Pubkey), - cst_encode_u_16(raw.checksum), - cst_encode_u_8(raw.version), - cst_encode_u_16(raw.port) - ]; - } - if (raw is SocketAddress_Hostname) { - return [4, cst_encode_String(raw.addr), cst_encode_u_16(raw.port)]; - } - - throw Exception('unreachable'); - } - - @protected - List cst_encode_txid(Txid raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_String(raw.hash)]; - } - - @protected - Object cst_encode_u_64(int raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return castNativeBigInt(raw); - } - - @protected - Uint8List cst_encode_u_8_array_12(U8Array12 raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return Uint8List.fromList(raw); - } - - @protected - Uint8List cst_encode_u_8_array_16(U8Array16 raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return Uint8List.fromList(raw); - } - - @protected - Uint8List cst_encode_u_8_array_32(U8Array32 raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return Uint8List.fromList(raw); - } - - @protected - Uint8List cst_encode_u_8_array_4(U8Array4 raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return Uint8List.fromList(raw); - } - - @protected - Uint8List cst_encode_u_8_array_64(U8Array64 raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return Uint8List.fromList(raw); - } - - @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)]; - } - - @protected - int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( - NodeBuilder raw); - - @protected - int cst_encode_RustOpaque_Node(Node raw); - - @protected - int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( - NodeBuilder raw); - - @protected - int cst_encode_RustOpaque_ldk_nodepaymentBolt11Payment( - LdkNodePaymentBolt11Payment raw); - - @protected - int cst_encode_RustOpaque_ldk_nodepaymentOnchainPayment( - LdkNodePaymentOnchainPayment raw); - - @protected - int cst_encode_RustOpaque_ldk_nodepaymentSpontaneousPayment( - LdkNodePaymentSpontaneousPayment raw); - - @protected - bool cst_encode_bool(bool raw); - - @protected - int cst_encode_builder_exception(BuilderException raw); - - @protected - int cst_encode_i_32(int raw); - - @protected - int cst_encode_log_level(LogLevel raw); - - @protected - int cst_encode_network(Network raw); - - @protected - 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); - - @protected - int cst_encode_u_16(int raw); - - @protected - int cst_encode_u_32(int raw); - - @protected - int cst_encode_u_8(int raw); - - @protected - void cst_encode_unit(void raw); - - @protected - int cst_encode_usize(int raw); - - @protected - void - sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( - NodeBuilder self, SseSerializer serializer); - - @protected - void sse_encode_RustOpaque_Node(Node self, SseSerializer serializer); - - @protected - void - sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( - NodeBuilder self, SseSerializer serializer); - - @protected - void sse_encode_RustOpaque_ldk_nodepaymentBolt11Payment( - LdkNodePaymentBolt11Payment self, SseSerializer serializer); - - @protected - void sse_encode_RustOpaque_ldk_nodepaymentOnchainPayment( - LdkNodePaymentOnchainPayment self, SseSerializer serializer); - - @protected - void sse_encode_RustOpaque_ldk_nodepaymentSpontaneousPayment( - LdkNodePaymentSpontaneousPayment self, SseSerializer serializer); - - @protected - void sse_encode_String(String self, SseSerializer serializer); - - @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); - - @protected - void sse_encode_bool(bool self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_address(Address self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_bolt_11_invoice( - Bolt11Invoice self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_chain_data_source_config( - ChainDataSourceConfig self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_channel_config( - ChannelConfig self, SseSerializer serializer); - - @protected - 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); - - @protected - void sse_encode_box_autoadd_entropy_source_config( - EntropySourceConfig self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_event(Event self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_gossip_source_config( - GossipSourceConfig self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_ldk_bolt_11_payment( - LdkBolt11Payment self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_ldk_mnemonic( - LdkMnemonic self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_ldk_node(LdkNode self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_ldk_on_chain_payment( - LdkOnChainPayment self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_ldk_spontaneous_payment( - LdkSpontaneousPayment self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_liquidity_source_config( - LiquiditySourceConfig self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_lsp_fee_limits( - LSPFeeLimits self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_max_dust_htlc_exposure( - MaxDustHTLCExposure self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_out_point( - OutPoint self, SseSerializer serializer); - - @protected - 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); - - @protected - void sse_encode_box_autoadd_payment_id( - PaymentId self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_payment_preimage( - PaymentPreimage self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_payment_secret( - PaymentSecret self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_public_key( - PublicKey self, SseSerializer serializer); - - @protected - 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); - - @protected - void sse_encode_box_autoadd_u_64(int self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_user_channel_id( - UserChannelId self, SseSerializer serializer); - - @protected - void sse_encode_builder_exception( - BuilderException self, SseSerializer serializer); - - @protected - void sse_encode_chain_data_source_config( - ChainDataSourceConfig self, SseSerializer serializer); - - @protected - void sse_encode_channel_config(ChannelConfig self, SseSerializer serializer); - - @protected - void sse_encode_channel_details( - ChannelDetails self, SseSerializer serializer); - - @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); - - @protected - void sse_encode_entropy_source_config( - EntropySourceConfig self, SseSerializer serializer); - - @protected - void sse_encode_event(Event self, SseSerializer serializer); - - @protected - void sse_encode_gossip_source_config( - GossipSourceConfig self, SseSerializer serializer); - - @protected - void sse_encode_i_32(int self, SseSerializer serializer); - - @protected - void sse_encode_ldk_bolt_11_payment( - LdkBolt11Payment self, SseSerializer serializer); - - @protected - void sse_encode_ldk_mnemonic(LdkMnemonic self, SseSerializer serializer); - - @protected - void sse_encode_ldk_node(LdkNode self, SseSerializer serializer); - - @protected - void sse_encode_ldk_on_chain_payment( - LdkOnChainPayment self, SseSerializer serializer); - - @protected - void sse_encode_ldk_spontaneous_payment( - LdkSpontaneousPayment self, SseSerializer serializer); - - @protected - void sse_encode_lightning_balance( - LightningBalance self, SseSerializer serializer); - - @protected - void sse_encode_liquidity_source_config( - LiquiditySourceConfig 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); - - @protected - 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); - - @protected - void sse_encode_list_prim_u_8_strict( - Uint8List self, SseSerializer serializer); - - @protected - void sse_encode_list_public_key( - List self, SseSerializer serializer); - - @protected - void sse_encode_list_socket_address( - List self, SseSerializer serializer); - - @protected - void sse_encode_log_level(LogLevel self, SseSerializer serializer); - - @protected - void sse_encode_lsp_fee_limits(LSPFeeLimits self, SseSerializer serializer); - - @protected - void sse_encode_max_dust_htlc_exposure( - MaxDustHTLCExposure self, SseSerializer serializer); - - @protected - void sse_encode_network(Network self, SseSerializer serializer); - - @protected - void sse_encode_node_exception(NodeException self, SseSerializer serializer); - - @protected - void sse_encode_node_status(NodeStatus self, SseSerializer serializer); - - @protected - void sse_encode_opt_String(String? self, SseSerializer serializer); - - @protected - void sse_encode_opt_box_autoadd_chain_data_source_config( - ChainDataSourceConfig? self, SseSerializer serializer); - - @protected - 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); - - @protected - void sse_encode_opt_box_autoadd_event(Event? self, SseSerializer serializer); - - @protected - 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_id( - PaymentId? self, SseSerializer serializer); - - @protected - void sse_encode_opt_box_autoadd_payment_preimage( - PaymentPreimage? self, SseSerializer serializer); - - @protected - void sse_encode_opt_box_autoadd_payment_secret( - PaymentSecret? self, SseSerializer serializer); - - @protected - 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); - - @protected - void sse_encode_opt_box_autoadd_u_64(int? self, SseSerializer serializer); - - @protected - void sse_encode_opt_list_socket_address( - List? self, SseSerializer serializer); - - @protected - void sse_encode_out_point(OutPoint self, SseSerializer serializer); - - @protected - void sse_encode_payment_details( - PaymentDetails self, SseSerializer serializer); - - @protected - 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); - - @protected - void sse_encode_payment_id(PaymentId self, SseSerializer serializer); - - @protected - void sse_encode_payment_kind(PaymentKind self, SseSerializer serializer); - - @protected - void sse_encode_payment_preimage( - PaymentPreimage self, SseSerializer serializer); - - @protected - void sse_encode_payment_secret(PaymentSecret self, SseSerializer serializer); - - @protected - void sse_encode_payment_status(PaymentStatus self, SseSerializer serializer); - - @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); - - @protected - void sse_encode_txid(Txid self, SseSerializer serializer); - - @protected - void sse_encode_u_16(int self, SseSerializer serializer); - - @protected - void sse_encode_u_32(int self, SseSerializer serializer); - - @protected - void sse_encode_u_64(int self, SseSerializer serializer); - - @protected - void sse_encode_u_8(int self, SseSerializer serializer); - - @protected - void sse_encode_u_8_array_12(U8Array12 self, SseSerializer serializer); - - @protected - void sse_encode_u_8_array_16(U8Array16 self, SseSerializer serializer); - - @protected - void sse_encode_u_8_array_32(U8Array32 self, SseSerializer serializer); - - @protected - void sse_encode_u_8_array_4(U8Array4 self, SseSerializer serializer); - - @protected - void sse_encode_u_8_array_64(U8Array64 self, SseSerializer serializer); - - @protected - void sse_encode_unit(void self, SseSerializer serializer); - - @protected - void sse_encode_user_channel_id(UserChannelId self, SseSerializer serializer); - - @protected - void sse_encode_usize(int self, SseSerializer serializer); -} - -// Section: wire_class - -class LdkCoreWire implements BaseWire { - LdkCoreWire.fromExternalLibrary(ExternalLibrary lib); - - void wire_NodeBuilder_build(NativePortType port_, Object that) => - wasmModule.wire_NodeBuilder_build(port_, that); - - void wire_NodeBuilder_build_with_fs_store( - NativePortType port_, Object that) => - wasmModule.wire_NodeBuilder_build_with_fs_store(port_, that); - - void wire_NodeBuilder_create_builder( - NativePortType port_, - List config, - List? chain_data_source_config, - List? entropy_source_config, - List? gossip_source_config, - List? liquidity_source_config) => - wasmModule.wire_NodeBuilder_create_builder( - port_, - config, - chain_data_source_config, - entropy_source_config, - gossip_source_config, - liquidity_source_config); - - void wire_ldk_bolt_11_payment_receive( - NativePortType port_, - List that, - Object amount_msat, - String description, - int expiry_secs) => - wasmModule.wire_ldk_bolt_11_payment_receive( - port_, that, amount_msat, description, expiry_secs); - - void wire_ldk_bolt_11_payment_receive_variable_amount(NativePortType port_, - List that, String description, int expiry_secs) => - wasmModule.wire_ldk_bolt_11_payment_receive_variable_amount( - port_, that, description, expiry_secs); - - void wire_ldk_bolt_11_payment_receive_variable_amount_via_jit_channel( - NativePortType port_, - List that, - String description, - int expiry_secs, - Object? max_proportional_lsp_fee_limit_ppm_msat) => - wasmModule - .wire_ldk_bolt_11_payment_receive_variable_amount_via_jit_channel( - port_, - that, - description, - expiry_secs, - max_proportional_lsp_fee_limit_ppm_msat); - - void wire_ldk_bolt_11_payment_receive_via_jit_channel( - NativePortType port_, - List that, - Object amount_msat, - String description, - int expiry_secs, - Object? max_total_lsp_fee_limit_msat) => - wasmModule.wire_ldk_bolt_11_payment_receive_via_jit_channel(port_, that, - amount_msat, description, expiry_secs, max_total_lsp_fee_limit_msat); - - void wire_ldk_bolt_11_payment_send( - NativePortType port_, List that, List invoice) => - wasmModule.wire_ldk_bolt_11_payment_send(port_, that, invoice); - - void wire_ldk_bolt_11_payment_send_probes( - NativePortType port_, List that, List invoice) => - wasmModule.wire_ldk_bolt_11_payment_send_probes(port_, that, invoice); - - void wire_ldk_bolt_11_payment_send_probes_using_amount(NativePortType port_, - List that, List invoice, Object amount_msat) => - wasmModule.wire_ldk_bolt_11_payment_send_probes_using_amount( - port_, that, invoice, amount_msat); - - void wire_ldk_bolt_11_payment_send_using_amount(NativePortType port_, - List that, List invoice, Object amount_msat) => - wasmModule.wire_ldk_bolt_11_payment_send_using_amount( - port_, that, invoice, amount_msat); - - void wire_ldk_mnemonic_generate(NativePortType port_) => - wasmModule.wire_ldk_mnemonic_generate(port_); - - void wire_ldk_node_bolt11_payment(NativePortType port_, List ptr) => - wasmModule.wire_ldk_node_bolt11_payment(port_, ptr); - - void wire_ldk_node_close_channel(NativePortType port_, List that, - List user_channel_id, List counterparty_node_id) => - wasmModule.wire_ldk_node_close_channel( - port_, that, user_channel_id, counterparty_node_id); - - void wire_ldk_node_config(NativePortType port_, List that) => - wasmModule.wire_ldk_node_config(port_, that); - - void wire_ldk_node_connect(NativePortType port_, List that, - List node_id, List address, bool persist) => - wasmModule.wire_ldk_node_connect(port_, that, node_id, address, persist); - - void wire_ldk_node_connect_open_channel( - NativePortType port_, - List that, - List socket_address, - List node_id, - Object channel_amount_sats, - Object? push_to_counterparty_msat, - bool announce_channel, - List? channel_config) => - wasmModule.wire_ldk_node_connect_open_channel( - port_, - that, - socket_address, - node_id, - channel_amount_sats, - push_to_counterparty_msat, - announce_channel, - channel_config); - - void wire_ldk_node_disconnect(NativePortType port_, List that, - List counterparty_node_id) => - wasmModule.wire_ldk_node_disconnect(port_, that, counterparty_node_id); - - void wire_ldk_node_event_handled(NativePortType port_, List that) => - wasmModule.wire_ldk_node_event_handled(port_, that); - - void wire_ldk_node_list_balances(NativePortType port_, List that) => - wasmModule.wire_ldk_node_list_balances(port_, that); - - void wire_ldk_node_list_channels(NativePortType port_, List that) => - wasmModule.wire_ldk_node_list_channels(port_, that); - - void wire_ldk_node_list_payments(NativePortType port_, List that) => - wasmModule.wire_ldk_node_list_payments(port_, that); - - void wire_ldk_node_list_payments_with_filter( - NativePortType port_, List that, int payment_direction) => - wasmModule.wire_ldk_node_list_payments_with_filter( - port_, that, payment_direction); - - void wire_ldk_node_list_peers(NativePortType port_, List that) => - wasmModule.wire_ldk_node_list_peers(port_, that); - - void wire_ldk_node_listening_addresses( - NativePortType port_, List that) => - wasmModule.wire_ldk_node_listening_addresses(port_, that); - - void wire_ldk_node_next_event(NativePortType port_, List that) => - wasmModule.wire_ldk_node_next_event(port_, that); - - void wire_ldk_node_next_event_async( - NativePortType port_, List that) => - wasmModule.wire_ldk_node_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_ldk_node_on_chain_payment( - NativePortType port_, List ptr) => - wasmModule.wire_ldk_node_on_chain_payment(port_, ptr); - - void wire_ldk_node_payment( - NativePortType port_, List that, List payment_id) => - wasmModule.wire_ldk_node_payment(port_, that, payment_id); - - void wire_ldk_node_remove_payment( - NativePortType port_, List that, List payment_id) => - wasmModule.wire_ldk_node_remove_payment(port_, that, payment_id); - - void wire_ldk_node_sign_message( - NativePortType port_, List that, List msg) => - wasmModule.wire_ldk_node_sign_message(port_, that, msg); - - void wire_ldk_node_spontaneous_payment( - NativePortType port_, List ptr) => - wasmModule.wire_ldk_node_spontaneous_payment(port_, ptr); - - void wire_ldk_node_start(NativePortType port_, List that) => - wasmModule.wire_ldk_node_start(port_, that); - - void wire_ldk_node_status(NativePortType port_, List that) => - wasmModule.wire_ldk_node_status(port_, that); - - void wire_ldk_node_stop(NativePortType port_, List that) => - wasmModule.wire_ldk_node_stop(port_, that); - - void wire_ldk_node_sync_wallets(NativePortType port_, List that) => - wasmModule.wire_ldk_node_sync_wallets(port_, that); - - void wire_ldk_node_update_channel_config( - NativePortType port_, - List that, - List user_channel_id, - List counterparty_node_id, - List channel_config) => - wasmModule.wire_ldk_node_update_channel_config( - port_, that, user_channel_id, counterparty_node_id, channel_config); - - void wire_ldk_node_verify_signature(NativePortType port_, List that, - List msg, String sig, List public_key) => - wasmModule.wire_ldk_node_verify_signature( - port_, that, msg, sig, public_key); - - void wire_ldk_node_wait_next_event( - NativePortType port_, List that) => - wasmModule.wire_ldk_node_wait_next_event(port_, that); - - void wire_ldk_on_chain_payment_new_address( - NativePortType port_, List that) => - wasmModule.wire_ldk_on_chain_payment_new_address(port_, that); - - void wire_ldk_on_chain_payment_send_all_to_address( - NativePortType port_, List that, List address) => - wasmModule.wire_ldk_on_chain_payment_send_all_to_address( - port_, that, address); - - void wire_ldk_on_chain_payment_send_to_address(NativePortType port_, - List that, List address, Object amount_sats) => - wasmModule.wire_ldk_on_chain_payment_send_to_address( - port_, that, address, amount_sats); - - void wire_ldk_spontaneous_payment_send(NativePortType port_, - List that, Object amount_msat, List node_id) => - wasmModule.wire_ldk_spontaneous_payment_send( - port_, that, amount_msat, node_id); - - void wire_ldk_spontaneous_payment_send_probes(NativePortType port_, - List that, Object amount_msat, List node_id) => - wasmModule.wire_ldk_spontaneous_payment_send_probes( - port_, that, amount_msat, node_id); - - void rust_arc_increment_strong_count_RustOpaque_Node(dynamic ptr) => - wasmModule.rust_arc_increment_strong_count_RustOpaque_Node(ptr); - - void rust_arc_decrement_strong_count_RustOpaque_Node(dynamic ptr) => - wasmModule.rust_arc_decrement_strong_count_RustOpaque_Node(ptr); - - void rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( - dynamic ptr) => - wasmModule - .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( - ptr); - - void rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( - dynamic ptr) => - wasmModule - .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( - ptr); - - void rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( - dynamic ptr) => - wasmModule - .rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( - ptr); - - void rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( - dynamic ptr) => - wasmModule - .rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( - ptr); - - void rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( - dynamic ptr) => - wasmModule - .rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( - ptr); - - void rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( - dynamic ptr) => - wasmModule - .rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( - ptr); - - void rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( - dynamic ptr) => - wasmModule - .rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( - ptr); - - void rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( - dynamic ptr) => - wasmModule - .rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( - ptr); -} - -@JS('wasm_bindgen') -external LdkCoreWasmModule get wasmModule; - -@JS() -@anonymous -class LdkCoreWasmModule implements WasmModule { - @override - external Object /* Promise */ call([String? moduleName]); - - @override - external LdkCoreWasmModule bind(dynamic thisArg, String moduleName); - - external void wire_NodeBuilder_build(NativePortType port_, Object that); - - external void wire_NodeBuilder_build_with_fs_store( - NativePortType port_, Object that); - - external void wire_NodeBuilder_create_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_ldk_bolt_11_payment_receive( - NativePortType port_, - List that, - Object amount_msat, - String description, - int expiry_secs); - - external void wire_ldk_bolt_11_payment_receive_variable_amount( - NativePortType port_, - List that, - String description, - int expiry_secs); - - external void - wire_ldk_bolt_11_payment_receive_variable_amount_via_jit_channel( - NativePortType port_, - List that, - String description, - int expiry_secs, - Object? max_proportional_lsp_fee_limit_ppm_msat); - - external void wire_ldk_bolt_11_payment_receive_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_ldk_bolt_11_payment_send( - NativePortType port_, List that, List invoice); - - external void wire_ldk_bolt_11_payment_send_probes( - NativePortType port_, List that, List invoice); - - external void wire_ldk_bolt_11_payment_send_probes_using_amount( - NativePortType port_, - List that, - List invoice, - Object amount_msat); - - external void wire_ldk_bolt_11_payment_send_using_amount(NativePortType port_, - List that, List invoice, Object amount_msat); - - external void wire_ldk_mnemonic_generate(NativePortType port_); - - external void wire_ldk_node_bolt11_payment( - NativePortType port_, List ptr); - - external void wire_ldk_node_close_channel( - NativePortType port_, - List that, - List user_channel_id, - List counterparty_node_id); - - external void wire_ldk_node_config(NativePortType port_, List that); - - external void wire_ldk_node_connect(NativePortType port_, List that, - List node_id, List address, bool persist); - - external void wire_ldk_node_connect_open_channel( - NativePortType port_, - List that, - List socket_address, - List node_id, - Object channel_amount_sats, - Object? push_to_counterparty_msat, - bool announce_channel, - List? channel_config); - - external void wire_ldk_node_disconnect(NativePortType port_, - List that, List counterparty_node_id); - - external void wire_ldk_node_event_handled( - NativePortType port_, List that); - - external void wire_ldk_node_list_balances( - NativePortType port_, List that); - - external void wire_ldk_node_list_channels( - NativePortType port_, List that); - - external void wire_ldk_node_list_payments( - NativePortType port_, List that); - - external void wire_ldk_node_list_payments_with_filter( - NativePortType port_, List that, int payment_direction); - - external void wire_ldk_node_list_peers( - NativePortType port_, List that); - - external void wire_ldk_node_listening_addresses( - NativePortType port_, List that); - - external void wire_ldk_node_next_event( - NativePortType port_, List that); - - external void wire_ldk_node_next_event_async( - NativePortType port_, List that); - - external void wire_ldk_node_node_id(NativePortType port_, List that); - - external void wire_ldk_node_on_chain_payment( - NativePortType port_, List ptr); - - external void wire_ldk_node_payment( - NativePortType port_, List that, List payment_id); - - external void wire_ldk_node_remove_payment( - NativePortType port_, List that, List payment_id); - - external void wire_ldk_node_sign_message( - NativePortType port_, List that, List msg); - - external void wire_ldk_node_spontaneous_payment( - NativePortType port_, List ptr); - - external void wire_ldk_node_start(NativePortType port_, List that); - - external void wire_ldk_node_status(NativePortType port_, List that); - - external void wire_ldk_node_stop(NativePortType port_, List that); - - external void wire_ldk_node_sync_wallets( - NativePortType port_, List that); - - external void wire_ldk_node_update_channel_config( - NativePortType port_, - List that, - List user_channel_id, - List counterparty_node_id, - List channel_config); - - external void wire_ldk_node_verify_signature(NativePortType port_, - List that, List msg, String sig, List public_key); - - external void wire_ldk_node_wait_next_event( - NativePortType port_, List that); - - external void wire_ldk_on_chain_payment_new_address( - NativePortType port_, List that); - - external void wire_ldk_on_chain_payment_send_all_to_address( - NativePortType port_, List that, List address); - - external void wire_ldk_on_chain_payment_send_to_address(NativePortType port_, - List that, List address, Object amount_sats); - - external void wire_ldk_spontaneous_payment_send(NativePortType port_, - List that, Object amount_msat, List node_id); - - external void wire_ldk_spontaneous_payment_send_probes(NativePortType port_, - List that, Object amount_msat, List node_id); - - external void rust_arc_increment_strong_count_RustOpaque_Node(dynamic ptr); - - external void rust_arc_decrement_strong_count_RustOpaque_Node(dynamic ptr); - - external void - rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( - dynamic ptr); - - external void - rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( - dynamic ptr); - - external void - rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( - dynamic ptr); - - external void - rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( - dynamic ptr); - - external void - rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( - dynamic ptr); - - external void - rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( - dynamic ptr); - - external void - rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( - dynamic ptr); - - external void - rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( - dynamic ptr); -} diff --git a/rust/src/frb_generated.io.rs b/rust/src/frb_generated.io.rs index 451e5c9..9bc6adf 100644 --- a/rust/src/frb_generated.io.rs +++ b/rust/src/frb_generated.io.rs @@ -1,12 +1,15 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. +// Generated by `flutter_rust_bridge`@ 2.0.0. // Section: imports use super::*; +use crate::api::bolt12::*; +use crate::api::builder::*; use crate::api::node::*; +use crate::*; use flutter_rust_bridge::for_generated::byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt}; -use flutter_rust_bridge::for_generated::transform_result_dco; +use flutter_rust_bridge::for_generated::{transform_result_dco, Lifetimeable, Lockable}; use flutter_rust_bridge::{Handler, IntoIntoDart}; // Section: boilerplate @@ -18,10 +21,17 @@ flutter_rust_bridge::frb_generated_boilerplate_io!(); impl CstDecode for usize { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> NodeBuilder { - CstDecode::< - RustOpaqueNom>, - >::cst_decode(self) - .rust_auto_opaque_decode_owned() + flutter_rust_bridge::for_generated::rust_auto_opaque_decode_owned(CstDecode::< + RustOpaqueNom>, + >::cst_decode( + self + )) + } +} +impl CstDecode>> for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> RustOpaqueNom> { + unsafe { decode_rust_opaque_nom(self as _) } } } impl CstDecode> for usize { @@ -30,13 +40,25 @@ impl CstDecode> for usize { unsafe { decode_rust_opaque_nom(self as _) } } } -impl CstDecode>> +impl CstDecode>> for usize { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode( self, - ) -> RustOpaqueNom> { + ) -> RustOpaqueNom> { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode> for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> RustOpaqueNom { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode> for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> RustOpaqueNom { unsafe { decode_rust_opaque_nom(self as _) } } } @@ -73,6 +95,15 @@ impl CstDecode for wire_cst_address { } } } +impl CstDecode for wire_cst_anchor_channels_config { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::AnchorChannelsConfig { + crate::api::types::AnchorChannelsConfig { + trusted_peers_no_reserve: self.trusted_peers_no_reserve.cst_decode(), + per_channel_reserve_sats: self.per_channel_reserve_sats.cst_decode(), + } + } +} 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 { @@ -96,14 +127,48 @@ impl CstDecode for wire_cst_best_block { } } } -impl CstDecode for wire_cst_bolt_11_invoice { +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 { - crate::api::types::Bolt11Invoice { + fn cst_decode(self) -> crate::api::bolt11::Bolt11Invoice { + crate::api::bolt11::Bolt11Invoice { signed_raw_invoice: self.signed_raw_invoice.cst_decode(), } } } +impl CstDecode for wire_cst_bolt_12_invoice { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::bolt12::Bolt12Invoice { + crate::api::bolt12::Bolt12Invoice { + data: self.data.cst_decode(), + } + } +} +impl CstDecode for wire_cst_bolt_12_parse_error { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::utils::error::Bolt12ParseError { + match self.tag { + 0 => crate::utils::error::Bolt12ParseError::InvalidContinuation, + 1 => crate::utils::error::Bolt12ParseError::InvalidBech32Hrp, + 2 => { + let ans = unsafe { self.kind.Bech32 }; + crate::utils::error::Bolt12ParseError::Bech32(ans.field0.cst_decode()) + } + 3 => { + let ans = unsafe { self.kind.Decode }; + crate::utils::error::Bolt12ParseError::Decode(ans.field0.cst_decode()) + } + 4 => { + let ans = unsafe { self.kind.InvalidSemantics }; + crate::utils::error::Bolt12ParseError::InvalidSemantics(ans.field0.cst_decode()) + } + 5 => { + let ans = unsafe { self.kind.InvalidSignature }; + crate::utils::error::Bolt12ParseError::InvalidSignature(ans.field0.cst_decode()) + } + _ => unreachable!(), + } + } +} impl CstDecode for *mut wire_cst_address { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::Address { @@ -111,11 +176,25 @@ impl CstDecode for *mut wire_cst_address { CstDecode::::cst_decode(*wrap).into() } } -impl CstDecode for *mut wire_cst_bolt_11_invoice { +impl CstDecode for *mut wire_cst_anchor_channels_config { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::AnchorChannelsConfig { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} +impl CstDecode for *mut wire_cst_bolt_11_invoice { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::bolt11::Bolt11Invoice { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} +impl CstDecode for *mut wire_cst_bolt_12_parse_error { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::Bolt11Invoice { + fn cst_decode(self) -> crate::utils::error::Bolt12ParseError { 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 @@ -141,6 +220,20 @@ impl CstDecode for *mut wire_cst_channel_id { CstDecode::::cst_decode(*wrap).into() } } +impl CstDecode for *mut wire_cst_channel_info { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::ChannelInfo { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} +impl CstDecode for *mut wire_cst_channel_update_info { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::ChannelUpdateInfo { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + 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 { @@ -155,6 +248,13 @@ impl CstDecode for *mut wire_cst_config { CstDecode::::cst_decode(*wrap).into() } } +impl CstDecode for *mut wire_cst_decode_error { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::utils::error::DecodeError { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} impl CstDecode for *mut wire_cst_entropy_source_config { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::EntropySourceConfig { @@ -176,18 +276,32 @@ impl CstDecode for *mut wire_cst_gossip_s CstDecode::::cst_decode(*wrap).into() } } -impl CstDecode for *mut wire_cst_ldk_bolt_11_payment { +impl CstDecode for *mut wire_cst_ldk_bolt_11_payment { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::bolt11::LdkBolt11Payment { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} +impl CstDecode for *mut wire_cst_ldk_bolt_12_payment { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::bolt12::LdkBolt12Payment { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} +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::LdkBolt11Payment { + fn cst_decode(self) -> crate::api::builder::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_ldk_mnemonic { +impl CstDecode for *mut wire_cst_ldk_network_graph { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::node::LdkMnemonic { + fn cst_decode(self) -> crate::api::graph::LdkNetworkGraph { 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_ldk_node { @@ -197,18 +311,20 @@ impl CstDecode for *mut wire_cst_ldk_node { CstDecode::::cst_decode(*wrap).into() } } -impl CstDecode for *mut wire_cst_ldk_on_chain_payment { +impl CstDecode for *mut wire_cst_ldk_on_chain_payment { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::node::LdkOnChainPayment { + fn cst_decode(self) -> crate::api::on_chain::LdkOnChainPayment { 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_ldk_spontaneous_payment { +impl CstDecode + for *mut wire_cst_ldk_spontaneous_payment +{ // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::node::LdkSpontaneousPayment { + fn cst_decode(self) -> crate::api::spontaneous::LdkSpontaneousPayment { 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_liquidity_source_config { @@ -232,6 +348,20 @@ impl CstDecode for *mut wire_cst_max_dus CstDecode::::cst_decode(*wrap).into() } } +impl CstDecode for *mut wire_cst_offer { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::bolt12::Offer { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} +impl CstDecode for *mut wire_cst_offer_id { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::OfferId { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} impl CstDecode for *mut wire_cst_out_point { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::OutPoint { @@ -288,6 +418,13 @@ impl CstDecode for *mut wire_cst_public_key { CstDecode::::cst_decode(*wrap).into() } } +impl CstDecode for *mut wire_cst_refund { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::bolt12::Refund { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} impl CstDecode for *mut wire_cst_socket_address { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::SocketAddress { @@ -411,6 +548,31 @@ impl CstDecode for wire_cst_channel_id { } } } +impl CstDecode for wire_cst_channel_info { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::ChannelInfo { + crate::api::graph::ChannelInfo { + node_one: self.node_one.cst_decode(), + one_to_two: self.one_to_two.cst_decode(), + node_two: self.node_two.cst_decode(), + two_to_one: self.two_to_one.cst_decode(), + capacity_sats: self.capacity_sats.cst_decode(), + } + } +} +impl CstDecode for wire_cst_channel_update_info { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::ChannelUpdateInfo { + crate::api::graph::ChannelUpdateInfo { + last_update: self.last_update.cst_decode(), + enabled: self.enabled.cst_decode(), + cltv_expiry_delta: self.cltv_expiry_delta.cst_decode(), + htlc_minimum_msat: self.htlc_minimum_msat.cst_decode(), + htlc_maximum_msat: self.htlc_maximum_msat.cst_decode(), + fees: self.fees.cst_decode(), + } + } +} 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 { @@ -461,6 +623,26 @@ impl CstDecode for wire_cst_config { .probing_liquidity_limit_multiplier .cst_decode(), log_level: self.log_level.cst_decode(), + anchor_channels_config: self.anchor_channels_config.cst_decode(), + } + } +} +impl CstDecode for wire_cst_decode_error { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::utils::error::DecodeError { + match self.tag { + 0 => crate::utils::error::DecodeError::UnknownVersion, + 1 => crate::utils::error::DecodeError::UnknownRequiredFeature, + 2 => crate::utils::error::DecodeError::InvalidValue, + 3 => crate::utils::error::DecodeError::ShortRead, + 4 => crate::utils::error::DecodeError::BadLengthDescriptor, + 5 => { + let ans = unsafe { self.kind.Io }; + crate::utils::error::DecodeError::Io(ans.field0.cst_decode()) + } + 6 => crate::utils::error::DecodeError::UnsupportedCompression, + 7 => crate::utils::error::DecodeError::DangerousValue, + _ => unreachable!(), } } } @@ -492,6 +674,15 @@ impl CstDecode for wire_cst_event { fn cst_decode(self) -> crate::api::types::Event { match self.tag { 0 => { + let ans = unsafe { self.kind.PaymentClaimable }; + crate::api::types::Event::PaymentClaimable { + payment_id: ans.payment_id.cst_decode(), + payment_hash: ans.payment_hash.cst_decode(), + claimable_amount_msat: ans.claimable_amount_msat.cst_decode(), + claim_deadline: ans.claim_deadline.cst_decode(), + } + } + 1 => { let ans = unsafe { self.kind.PaymentSuccessful }; crate::api::types::Event::PaymentSuccessful { payment_id: ans.payment_id.cst_decode(), @@ -499,7 +690,7 @@ impl CstDecode for wire_cst_event { fee_paid_msat: ans.fee_paid_msat.cst_decode(), } } - 1 => { + 2 => { let ans = unsafe { self.kind.PaymentFailed }; crate::api::types::Event::PaymentFailed { payment_id: ans.payment_id.cst_decode(), @@ -507,7 +698,7 @@ impl CstDecode for wire_cst_event { reason: ans.reason.cst_decode(), } } - 2 => { + 3 => { let ans = unsafe { self.kind.PaymentReceived }; crate::api::types::Event::PaymentReceived { payment_id: ans.payment_id.cst_decode(), @@ -515,7 +706,7 @@ impl CstDecode for wire_cst_event { amount_msat: ans.amount_msat.cst_decode(), } } - 3 => { + 4 => { let ans = unsafe { self.kind.ChannelPending }; crate::api::types::Event::ChannelPending { channel_id: ans.channel_id.cst_decode(), @@ -525,7 +716,7 @@ impl CstDecode for wire_cst_event { funding_txo: ans.funding_txo.cst_decode(), } } - 4 => { + 5 => { let ans = unsafe { self.kind.ChannelReady }; crate::api::types::Event::ChannelReady { channel_id: ans.channel_id.cst_decode(), @@ -533,7 +724,7 @@ impl CstDecode for wire_cst_event { counterparty_node_id: ans.counterparty_node_id.cst_decode(), } } - 5 => { + 6 => { let ans = unsafe { self.kind.ChannelClosed }; crate::api::types::Event::ChannelClosed { channel_id: ans.channel_id.cst_decode(), @@ -559,22 +750,38 @@ impl CstDecode for wire_cst_gossip_source } } } -impl CstDecode for wire_cst_ldk_bolt_11_payment { +impl CstDecode for wire_cst_ldk_bolt_11_payment { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::bolt11::LdkBolt11Payment { + crate::api::bolt11::LdkBolt11Payment { + ptr: self.ptr.cst_decode(), + } + } +} +impl CstDecode for wire_cst_ldk_bolt_12_payment { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::node::LdkBolt11Payment { - crate::api::node::LdkBolt11Payment { + fn cst_decode(self) -> crate::api::bolt12::LdkBolt12Payment { + crate::api::bolt12::LdkBolt12Payment { ptr: self.ptr.cst_decode(), } } } -impl CstDecode for wire_cst_ldk_mnemonic { +impl CstDecode for wire_cst_ldk_mnemonic { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::node::LdkMnemonic { - crate::api::node::LdkMnemonic { + fn cst_decode(self) -> crate::api::builder::LdkMnemonic { + crate::api::builder::LdkMnemonic { seed_phrase: self.seed_phrase.cst_decode(), } } } +impl CstDecode for wire_cst_ldk_network_graph { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::LdkNetworkGraph { + crate::api::graph::LdkNetworkGraph { + inner: self.inner.cst_decode(), + } + } +} impl CstDecode for wire_cst_ldk_node { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::node::LdkNode { @@ -583,18 +790,83 @@ impl CstDecode for wire_cst_ldk_node { } } } -impl CstDecode for wire_cst_ldk_on_chain_payment { +impl CstDecode for wire_cst_ldk_node_error { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::utils::error::LdkNodeError { + match self.tag { + 0 => crate::utils::error::LdkNodeError::InvalidTxid, + 1 => crate::utils::error::LdkNodeError::AlreadyRunning, + 2 => crate::utils::error::LdkNodeError::NotRunning, + 3 => crate::utils::error::LdkNodeError::OnchainTxCreationFailed, + 4 => crate::utils::error::LdkNodeError::ConnectionFailed, + 5 => crate::utils::error::LdkNodeError::InvoiceCreationFailed, + 6 => crate::utils::error::LdkNodeError::PaymentSendingFailed, + 7 => crate::utils::error::LdkNodeError::ProbeSendingFailed, + 8 => crate::utils::error::LdkNodeError::ChannelCreationFailed, + 9 => crate::utils::error::LdkNodeError::ChannelClosingFailed, + 10 => crate::utils::error::LdkNodeError::ChannelConfigUpdateFailed, + 11 => crate::utils::error::LdkNodeError::PersistenceFailed, + 12 => crate::utils::error::LdkNodeError::WalletOperationFailed, + 13 => crate::utils::error::LdkNodeError::OnchainTxSigningFailed, + 14 => crate::utils::error::LdkNodeError::MessageSigningFailed, + 15 => crate::utils::error::LdkNodeError::TxSyncFailed, + 16 => crate::utils::error::LdkNodeError::GossipUpdateFailed, + 17 => crate::utils::error::LdkNodeError::InvalidAddress, + 18 => crate::utils::error::LdkNodeError::InvalidSocketAddress, + 19 => crate::utils::error::LdkNodeError::InvalidPublicKey, + 20 => crate::utils::error::LdkNodeError::InvalidSecretKey, + 21 => crate::utils::error::LdkNodeError::InvalidPaymentHash, + 22 => crate::utils::error::LdkNodeError::InvalidPaymentPreimage, + 23 => crate::utils::error::LdkNodeError::InvalidPaymentSecret, + 24 => crate::utils::error::LdkNodeError::InvalidAmount, + 25 => crate::utils::error::LdkNodeError::InvalidInvoice, + 26 => crate::utils::error::LdkNodeError::InvalidChannelId, + 27 => crate::utils::error::LdkNodeError::InvalidNetwork, + 28 => crate::utils::error::LdkNodeError::DuplicatePayment, + 29 => crate::utils::error::LdkNodeError::InsufficientFunds, + 30 => crate::utils::error::LdkNodeError::FeerateEstimationUpdateFailed, + 31 => crate::utils::error::LdkNodeError::LiquidityRequestFailed, + 32 => crate::utils::error::LdkNodeError::LiquiditySourceUnavailable, + 33 => crate::utils::error::LdkNodeError::LiquidityFeeTooHigh, + 34 => crate::utils::error::LdkNodeError::InvalidPaymentId, + 35 => { + let ans = unsafe { self.kind.Decode }; + crate::utils::error::LdkNodeError::Decode(ans.field0.cst_decode()) + } + 36 => { + let ans = unsafe { self.kind.Bolt12Parse }; + crate::utils::error::LdkNodeError::Bolt12Parse(ans.field0.cst_decode()) + } + 37 => crate::utils::error::LdkNodeError::InvoiceRequestCreationFailed, + 38 => crate::utils::error::LdkNodeError::OfferCreationFailed, + 39 => crate::utils::error::LdkNodeError::RefundCreationFailed, + 40 => crate::utils::error::LdkNodeError::FeerateEstimationUpdateTimeout, + 41 => crate::utils::error::LdkNodeError::WalletOperationTimeout, + 42 => crate::utils::error::LdkNodeError::TxSyncTimeout, + 43 => crate::utils::error::LdkNodeError::GossipUpdateTimeout, + 44 => crate::utils::error::LdkNodeError::InvalidOfferId, + 45 => crate::utils::error::LdkNodeError::InvalidNodeId, + 46 => crate::utils::error::LdkNodeError::InvalidOffer, + 47 => crate::utils::error::LdkNodeError::InvalidRefund, + 48 => crate::utils::error::LdkNodeError::UnsupportedCurrency, + _ => unreachable!(), + } + } +} +impl CstDecode for wire_cst_ldk_on_chain_payment { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::node::LdkOnChainPayment { - crate::api::node::LdkOnChainPayment { + fn cst_decode(self) -> crate::api::on_chain::LdkOnChainPayment { + crate::api::on_chain::LdkOnChainPayment { ptr: self.ptr.cst_decode(), } } } -impl CstDecode for wire_cst_ldk_spontaneous_payment { +impl CstDecode + for wire_cst_ldk_spontaneous_payment +{ // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::node::LdkSpontaneousPayment { - crate::api::node::LdkSpontaneousPayment { + fn cst_decode(self) -> crate::api::spontaneous::LdkSpontaneousPayment { + crate::api::spontaneous::LdkSpontaneousPayment { ptr: self.ptr.cst_decode(), } } @@ -691,6 +963,16 @@ impl CstDecode> for *mut wire_cst_list_ vec.into_iter().map(CstDecode::cst_decode).collect() } } +impl CstDecode> for *mut wire_cst_list_node_id { + // 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 { @@ -723,6 +1005,15 @@ impl CstDecode> vec.into_iter().map(CstDecode::cst_decode).collect() } } +impl CstDecode> for *mut wire_cst_list_prim_u_64_strict { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> 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) + } + } +} 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 { @@ -788,6 +1079,14 @@ impl CstDecode for wire_cst_max_dust_htl } } } +impl CstDecode for wire_cst_node_id { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::NodeId { + crate::api::graph::NodeId { + compressed: self.compressed.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 { @@ -809,6 +1108,20 @@ impl CstDecode for wire_cst_node_status { } } } +impl CstDecode for wire_cst_offer { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::bolt12::Offer { + crate::api::bolt12::Offer { + s: self.s.cst_decode(), + } + } +} +impl CstDecode for wire_cst_offer_id { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::OfferId { + crate::api::types::OfferId(self.field0.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 { @@ -873,6 +1186,23 @@ impl CstDecode for wire_cst_payment_kind { preimage: ans.preimage.cst_decode(), } } + 4 => { + let ans = unsafe { self.kind.Bolt12Offer }; + crate::api::types::PaymentKind::Bolt12Offer { + hash: ans.hash.cst_decode(), + preimage: ans.preimage.cst_decode(), + secret: ans.secret.cst_decode(), + offer_id: ans.offer_id.cst_decode(), + } + } + 5 => { + let ans = unsafe { self.kind.Bolt12Refund }; + crate::api::types::PaymentKind::Bolt12Refund { + hash: ans.hash.cst_decode(), + preimage: ans.preimage.cst_decode(), + secret: ans.secret.cst_decode(), + } + } _ => unreachable!(), } } @@ -967,6 +1297,23 @@ impl ) } } +impl CstDecode for wire_cst_refund { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::bolt12::Refund { + crate::api::bolt12::Refund { + s: self.s.cst_decode(), + } + } +} +impl CstDecode for wire_cst_routing_fees { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::RoutingFees { + crate::api::graph::RoutingFees { + base_msat: self.base_msat.cst_decode(), + proportional_millionths: self.proportional_millionths.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 { @@ -1072,6 +1419,19 @@ impl Default for wire_cst_address { Self::new_with_null_ptr() } } +impl NewWithNullPtr for wire_cst_anchor_channels_config { + fn new_with_null_ptr() -> Self { + Self { + trusted_peers_no_reserve: core::ptr::null_mut(), + per_channel_reserve_sats: Default::default(), + } + } +} +impl Default for wire_cst_anchor_channels_config { + fn default() -> Self { + Self::new_with_null_ptr() + } +} impl NewWithNullPtr for wire_cst_balance_details { fn new_with_null_ptr() -> Self { Self { @@ -1113,6 +1473,31 @@ impl Default for wire_cst_bolt_11_invoice { Self::new_with_null_ptr() } } +impl NewWithNullPtr for wire_cst_bolt_12_invoice { + fn new_with_null_ptr() -> Self { + Self { + data: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_bolt_12_invoice { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_bolt_12_parse_error { + fn new_with_null_ptr() -> Self { + Self { + tag: -1, + kind: Bolt12ParseErrorKind { nil__: () }, + } + } +} +impl Default for wire_cst_bolt_12_parse_error { + fn default() -> Self { + Self::new_with_null_ptr() + } +} impl NewWithNullPtr for wire_cst_chain_data_source_config { fn new_with_null_ptr() -> Self { Self { @@ -1194,6 +1579,39 @@ impl Default for wire_cst_channel_id { Self::new_with_null_ptr() } } +impl NewWithNullPtr for wire_cst_channel_info { + fn new_with_null_ptr() -> Self { + Self { + node_one: Default::default(), + one_to_two: core::ptr::null_mut(), + node_two: Default::default(), + two_to_one: core::ptr::null_mut(), + capacity_sats: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_channel_info { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_channel_update_info { + fn new_with_null_ptr() -> Self { + Self { + last_update: Default::default(), + enabled: Default::default(), + cltv_expiry_delta: Default::default(), + htlc_minimum_msat: Default::default(), + htlc_maximum_msat: Default::default(), + fees: Default::default(), + } + } +} +impl Default for wire_cst_channel_update_info { + fn default() -> Self { + Self::new_with_null_ptr() + } +} impl NewWithNullPtr for wire_cst_closure_reason { fn new_with_null_ptr() -> Self { Self { @@ -1221,6 +1639,7 @@ impl NewWithNullPtr for wire_cst_config { trusted_peers_0conf: core::ptr::null_mut(), probing_liquidity_limit_multiplier: Default::default(), log_level: Default::default(), + anchor_channels_config: core::ptr::null_mut(), } } } @@ -1229,6 +1648,19 @@ impl Default for wire_cst_config { Self::new_with_null_ptr() } } +impl NewWithNullPtr for wire_cst_decode_error { + fn new_with_null_ptr() -> Self { + Self { + tag: -1, + kind: DecodeErrorKind { nil__: () }, + } + } +} +impl Default for wire_cst_decode_error { + fn default() -> Self { + Self::new_with_null_ptr() + } +} impl NewWithNullPtr for wire_cst_entropy_source_config { fn new_with_null_ptr() -> Self { Self { @@ -1280,75 +1712,112 @@ impl Default for wire_cst_ldk_bolt_11_payment { Self::new_with_null_ptr() } } -impl NewWithNullPtr for wire_cst_ldk_mnemonic { +impl NewWithNullPtr for wire_cst_ldk_bolt_12_payment { fn new_with_null_ptr() -> Self { Self { - seed_phrase: core::ptr::null_mut(), + ptr: Default::default(), } } } -impl Default for wire_cst_ldk_mnemonic { +impl Default for wire_cst_ldk_bolt_12_payment { fn default() -> Self { Self::new_with_null_ptr() } } -impl NewWithNullPtr for wire_cst_ldk_node { +impl NewWithNullPtr for wire_cst_ldk_mnemonic { fn new_with_null_ptr() -> Self { Self { - ptr: Default::default(), + seed_phrase: core::ptr::null_mut(), } } } -impl Default for wire_cst_ldk_node { +impl Default for wire_cst_ldk_mnemonic { fn default() -> Self { Self::new_with_null_ptr() } } -impl NewWithNullPtr for wire_cst_ldk_on_chain_payment { +impl NewWithNullPtr for wire_cst_ldk_network_graph { fn new_with_null_ptr() -> Self { Self { - ptr: Default::default(), + inner: Default::default(), } } } -impl Default for wire_cst_ldk_on_chain_payment { +impl Default for wire_cst_ldk_network_graph { fn default() -> Self { Self::new_with_null_ptr() } } -impl NewWithNullPtr for wire_cst_ldk_spontaneous_payment { +impl NewWithNullPtr for wire_cst_ldk_node { fn new_with_null_ptr() -> Self { Self { ptr: Default::default(), } } } -impl Default for wire_cst_ldk_spontaneous_payment { +impl Default for wire_cst_ldk_node { fn default() -> Self { Self::new_with_null_ptr() } } -impl NewWithNullPtr for wire_cst_lightning_balance { +impl NewWithNullPtr for wire_cst_ldk_node_error { fn new_with_null_ptr() -> Self { Self { tag: -1, - kind: LightningBalanceKind { nil__: () }, + kind: LdkNodeErrorKind { nil__: () }, } } } -impl Default for wire_cst_lightning_balance { +impl Default for wire_cst_ldk_node_error { fn default() -> Self { Self::new_with_null_ptr() } } -impl NewWithNullPtr for wire_cst_liquidity_source_config { +impl NewWithNullPtr for wire_cst_ldk_on_chain_payment { 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_on_chain_payment { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_ldk_spontaneous_payment { + fn new_with_null_ptr() -> Self { + Self { + ptr: Default::default(), + } + } +} +impl Default for wire_cst_ldk_spontaneous_payment { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_lightning_balance { + fn new_with_null_ptr() -> Self { + Self { + tag: -1, + kind: LightningBalanceKind { nil__: () }, + } + } +} +impl Default for wire_cst_lightning_balance { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_liquidity_source_config { + fn new_with_null_ptr() -> Self { + Self { + lsps2_service: Default::default(), + } + } +} +impl Default for wire_cst_liquidity_source_config { fn default() -> Self { Self::new_with_null_ptr() } @@ -1379,6 +1848,18 @@ impl Default for wire_cst_max_dust_htlc_exposure { Self::new_with_null_ptr() } } +impl NewWithNullPtr for wire_cst_node_id { + fn new_with_null_ptr() -> Self { + Self { + compressed: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_node_id { + fn default() -> Self { + Self::new_with_null_ptr() + } +} impl NewWithNullPtr for wire_cst_node_status { fn new_with_null_ptr() -> Self { Self { @@ -1398,6 +1879,30 @@ impl Default for wire_cst_node_status { Self::new_with_null_ptr() } } +impl NewWithNullPtr for wire_cst_offer { + fn new_with_null_ptr() -> Self { + Self { + s: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_offer { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_offer_id { + fn new_with_null_ptr() -> Self { + Self { + field0: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_offer_id { + fn default() -> Self { + Self::new_with_null_ptr() + } +} impl NewWithNullPtr for wire_cst_out_point { fn new_with_null_ptr() -> Self { Self { @@ -1541,6 +2046,31 @@ impl Default for wire_cst_record_socket_address_public_key_opt_string { Self::new_with_null_ptr() } } +impl NewWithNullPtr for wire_cst_refund { + fn new_with_null_ptr() -> Self { + Self { + s: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_refund { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_routing_fees { + fn new_with_null_ptr() -> Self { + Self { + base_msat: Default::default(), + proportional_millionths: Default::default(), + } + } +} +impl Default for wire_cst_routing_fees { + fn default() -> Self { + Self::new_with_null_ptr() + } +} impl NewWithNullPtr for wire_cst_socket_address { fn new_with_null_ptr() -> Self { Self { @@ -1580,64 +2110,46 @@ impl Default for wire_cst_user_channel_id { } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBuilder_build(port_: i64, that: usize) { - wire_NodeBuilder_build_impl(port_, that) -} - -#[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBuilder_build_with_fs_store(port_: i64, that: usize) { - wire_NodeBuilder_build_with_fs_store_impl(port_, that) -} - -#[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBuilder_create_builder( - 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, -) { - wire_NodeBuilder_create_builder_impl( - port_, - config, - chain_data_source_config, - entropy_source_config, - gossip_source_config, - liquidity_source_config, - ) -} - -#[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_bolt_11_payment_receive( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive( port_: i64, that: *mut wire_cst_ldk_bolt_11_payment, amount_msat: u64, description: *mut wire_cst_list_prim_u_8_strict, expiry_secs: u32, ) { - wire_ldk_bolt_11_payment_receive_impl(port_, that, amount_msat, description, expiry_secs) + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_impl( + port_, + that, + amount_msat, + description, + expiry_secs, + ) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_bolt_11_payment_receive_variable_amount( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount( port_: i64, that: *mut wire_cst_ldk_bolt_11_payment, description: *mut wire_cst_list_prim_u_8_strict, expiry_secs: u32, ) { - wire_ldk_bolt_11_payment_receive_variable_amount_impl(port_, that, description, expiry_secs) + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_impl( + port_, + that, + description, + expiry_secs, + ) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_bolt_11_payment_receive_variable_amount_via_jit_channel( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel( port_: i64, that: *mut wire_cst_ldk_bolt_11_payment, description: *mut wire_cst_list_prim_u_8_strict, expiry_secs: u32, max_proportional_lsp_fee_limit_ppm_msat: *mut u64, ) { - wire_ldk_bolt_11_payment_receive_variable_amount_via_jit_channel_impl( + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel_impl( port_, that, description, @@ -1647,7 +2159,7 @@ pub extern "C" fn frbgen_ldk_node_wire_ldk_bolt_11_payment_receive_variable_amou } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_bolt_11_payment_receive_via_jit_channel( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel( port_: i64, that: *mut wire_cst_ldk_bolt_11_payment, amount_msat: u64, @@ -1655,7 +2167,7 @@ pub extern "C" fn frbgen_ldk_node_wire_ldk_bolt_11_payment_receive_via_jit_chann expiry_secs: u32, max_total_lsp_fee_limit_msat: *mut u64, ) { - wire_ldk_bolt_11_payment_receive_via_jit_channel_impl( + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel_impl( port_, that, amount_msat, @@ -1666,84 +2178,264 @@ pub extern "C" fn frbgen_ldk_node_wire_ldk_bolt_11_payment_receive_via_jit_chann } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_bolt_11_payment_send( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send( port_: i64, that: *mut wire_cst_ldk_bolt_11_payment, invoice: *mut wire_cst_bolt_11_invoice, ) { - wire_ldk_bolt_11_payment_send_impl(port_, that, invoice) + wire__crate__api__bolt11__ldk_bolt_11_payment_send_impl(port_, that, invoice) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_bolt_11_payment_send_probes( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes( port_: i64, that: *mut wire_cst_ldk_bolt_11_payment, invoice: *mut wire_cst_bolt_11_invoice, ) { - wire_ldk_bolt_11_payment_send_probes_impl(port_, that, invoice) + wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_impl(port_, that, invoice) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_bolt_11_payment_send_probes_using_amount( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount( port_: i64, that: *mut wire_cst_ldk_bolt_11_payment, invoice: *mut wire_cst_bolt_11_invoice, amount_msat: u64, ) { - wire_ldk_bolt_11_payment_send_probes_using_amount_impl(port_, that, invoice, amount_msat) + wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount_impl( + port_, + that, + invoice, + amount_msat, + ) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_bolt_11_payment_send_using_amount( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount( port_: i64, that: *mut wire_cst_ldk_bolt_11_payment, invoice: *mut wire_cst_bolt_11_invoice, amount_msat: u64, ) { - wire_ldk_bolt_11_payment_send_using_amount_impl(port_, that, invoice, amount_msat) + wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount_impl( + port_, + that, + invoice, + amount_msat, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refund( + port_: i64, + that: *mut wire_cst_ldk_bolt_12_payment, + amount_msat: u64, + expiry_secs: u32, +) { + wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refund_impl( + port_, + that, + amount_msat, + expiry_secs, + ) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_mnemonic_generate(port_: i64) { - wire_ldk_mnemonic_generate_impl(port_) +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_receive( + port_: i64, + that: *mut wire_cst_ldk_bolt_12_payment, + amount_msat: u64, + description: *mut wire_cst_list_prim_u_8_strict, +) { + wire__crate__api__bolt12__ldk_bolt_12_payment_receive_impl( + port_, + that, + amount_msat, + description, + ) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_bolt11_payment( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amount( + port_: i64, + that: *mut wire_cst_ldk_bolt_12_payment, + description: *mut wire_cst_list_prim_u_8_strict, +) { + wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amount_impl( + port_, + that, + description, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_payment( + port_: i64, + that: *mut wire_cst_ldk_bolt_12_payment, + refund: *mut wire_cst_refund, +) { + wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_payment_impl(port_, that, refund) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_send( + port_: i64, + that: *mut wire_cst_ldk_bolt_12_payment, + offer: *mut wire_cst_offer, + payer_note: *mut wire_cst_list_prim_u_8_strict, +) { + wire__crate__api__bolt12__ldk_bolt_12_payment_send_impl(port_, that, offer, payer_note) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amount( + port_: i64, + that: *mut wire_cst_ldk_bolt_12_payment, + offer: *mut wire_cst_offer, + payer_note: *mut wire_cst_list_prim_u_8_strict, + amount_msat: u64, +) { + wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amount_impl( + port_, + that, + offer, + payer_note, + amount_msat, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder( + that: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder_impl(that) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder( + that: usize, + builder: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder_impl(that, builder) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_build( + port_: i64, + that: usize, +) { + wire__crate__api__builder__NodeBuilder_build_impl(port_, that) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_build_with_fs_store( + port_: i64, + that: usize, +) { + wire__crate__api__builder__NodeBuilder_build_with_fs_store_impl(port_, that) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_create_builder( + 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, +) { + wire__crate__api__builder__NodeBuilder_create_builder_impl( + port_, + config, + chain_data_source_config, + entropy_source_config, + gossip_source_config, + liquidity_source_config, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__builder__ldk_mnemonic_generate(port_: i64) { + wire__crate__api__builder__ldk_mnemonic_generate_impl(port_) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_channel( + port_: i64, + that: *mut wire_cst_ldk_network_graph, + short_channel_id: u64, +) { + wire__crate__api__graph__ldk_network_graph_channel_impl(port_, that, short_channel_id) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_list_channels( + port_: i64, + that: *mut wire_cst_ldk_network_graph, +) { + wire__crate__api__graph__ldk_network_graph_list_channels_impl(port_, that) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_list_nodes( + port_: i64, + that: *mut wire_cst_ldk_network_graph, +) { + wire__crate__api__graph__ldk_network_graph_list_nodes_impl(port_, that) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_bolt11_payment( port_: i64, ptr: *mut wire_cst_ldk_node, ) { - wire_ldk_node_bolt11_payment_impl(port_, ptr) + wire__crate__api__node__ldk_node_bolt11_payment_impl(port_, ptr) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_close_channel( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_bolt12_payment( + port_: i64, + ptr: *mut wire_cst_ldk_node, +) { + wire__crate__api__node__ldk_node_bolt12_payment_impl(port_, ptr) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_close_channel( port_: i64, that: *mut wire_cst_ldk_node, user_channel_id: *mut wire_cst_user_channel_id, counterparty_node_id: *mut wire_cst_public_key, ) { - wire_ldk_node_close_channel_impl(port_, that, user_channel_id, counterparty_node_id) + wire__crate__api__node__ldk_node_close_channel_impl( + port_, + that, + user_channel_id, + counterparty_node_id, + ) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_config(port_: i64, that: *mut wire_cst_ldk_node) { - wire_ldk_node_config_impl(port_, that) +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_config( + port_: i64, + that: *mut wire_cst_ldk_node, +) { + wire__crate__api__node__ldk_node_config_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_connect( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_connect( port_: i64, that: *mut wire_cst_ldk_node, node_id: *mut wire_cst_public_key, address: *mut wire_cst_socket_address, persist: bool, ) { - wire_ldk_node_connect_impl(port_, that, node_id, address, persist) + wire__crate__api__node__ldk_node_connect_impl(port_, that, node_id, address, persist) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_connect_open_channel( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_connect_open_channel( port_: i64, that: *mut wire_cst_ldk_node, socket_address: *mut wire_cst_socket_address, @@ -1753,7 +2445,7 @@ pub extern "C" fn frbgen_ldk_node_wire_ldk_node_connect_open_channel( announce_channel: bool, channel_config: *mut wire_cst_channel_config, ) { - wire_ldk_node_connect_open_channel_impl( + wire__crate__api__node__ldk_node_connect_open_channel_impl( port_, that, socket_address, @@ -1766,167 +2458,202 @@ pub extern "C" fn frbgen_ldk_node_wire_ldk_node_connect_open_channel( } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_disconnect( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_disconnect( port_: i64, that: *mut wire_cst_ldk_node, counterparty_node_id: *mut wire_cst_public_key, ) { - wire_ldk_node_disconnect_impl(port_, that, counterparty_node_id) + wire__crate__api__node__ldk_node_disconnect_impl(port_, that, counterparty_node_id) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_event_handled( + port_: i64, + that: *mut wire_cst_ldk_node, +) { + wire__crate__api__node__ldk_node_event_handled_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_event_handled( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_force_close_channel( port_: i64, that: *mut wire_cst_ldk_node, + user_channel_id: *mut wire_cst_user_channel_id, + counterparty_node_id: *mut wire_cst_public_key, ) { - wire_ldk_node_event_handled_impl(port_, that) + wire__crate__api__node__ldk_node_force_close_channel_impl( + port_, + that, + user_channel_id, + counterparty_node_id, + ) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_list_balances( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_list_balances( port_: i64, that: *mut wire_cst_ldk_node, ) { - wire_ldk_node_list_balances_impl(port_, that) + wire__crate__api__node__ldk_node_list_balances_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_list_channels( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_list_channels( port_: i64, that: *mut wire_cst_ldk_node, ) { - wire_ldk_node_list_channels_impl(port_, that) + wire__crate__api__node__ldk_node_list_channels_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_list_payments( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_list_payments( port_: i64, that: *mut wire_cst_ldk_node, ) { - wire_ldk_node_list_payments_impl(port_, that) + wire__crate__api__node__ldk_node_list_payments_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_list_payments_with_filter( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_list_payments_with_filter( port_: i64, that: *mut wire_cst_ldk_node, payment_direction: i32, ) { - wire_ldk_node_list_payments_with_filter_impl(port_, that, payment_direction) + wire__crate__api__node__ldk_node_list_payments_with_filter_impl(port_, that, payment_direction) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_list_peers( + port_: i64, + that: *mut wire_cst_ldk_node, +) { + wire__crate__api__node__ldk_node_list_peers_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_list_peers( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_listening_addresses( port_: i64, that: *mut wire_cst_ldk_node, ) { - wire_ldk_node_list_peers_impl(port_, that) + wire__crate__api__node__ldk_node_listening_addresses_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_listening_addresses( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_network_graph( port_: i64, that: *mut wire_cst_ldk_node, ) { - wire_ldk_node_listening_addresses_impl(port_, that) + wire__crate__api__node__ldk_node_network_graph_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_next_event( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_next_event( port_: i64, that: *mut wire_cst_ldk_node, ) { - wire_ldk_node_next_event_impl(port_, that) + wire__crate__api__node__ldk_node_next_event_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_next_event_async( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_next_event_async( port_: i64, that: *mut wire_cst_ldk_node, ) { - wire_ldk_node_next_event_async_impl(port_, that) + wire__crate__api__node__ldk_node_next_event_async_impl(port_, that) } #[no_mangle] -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) +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_node_id( + port_: i64, + that: *mut wire_cst_ldk_node, +) { + wire__crate__api__node__ldk_node_node_id_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_on_chain_payment( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_on_chain_payment( port_: i64, ptr: *mut wire_cst_ldk_node, ) { - wire_ldk_node_on_chain_payment_impl(port_, ptr) + wire__crate__api__node__ldk_node_on_chain_payment_impl(port_, ptr) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_payment( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_payment( port_: i64, that: *mut wire_cst_ldk_node, payment_id: *mut wire_cst_payment_id, ) { - wire_ldk_node_payment_impl(port_, that, payment_id) + wire__crate__api__node__ldk_node_payment_impl(port_, that, payment_id) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_remove_payment( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_remove_payment( port_: i64, that: *mut wire_cst_ldk_node, payment_id: *mut wire_cst_payment_id, ) { - wire_ldk_node_remove_payment_impl(port_, that, payment_id) + wire__crate__api__node__ldk_node_remove_payment_impl(port_, that, payment_id) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_sign_message( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_sign_message( port_: i64, that: *mut wire_cst_ldk_node, msg: *mut wire_cst_list_prim_u_8_loose, ) { - wire_ldk_node_sign_message_impl(port_, that, msg) + wire__crate__api__node__ldk_node_sign_message_impl(port_, that, msg) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_spontaneous_payment( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_spontaneous_payment( port_: i64, ptr: *mut wire_cst_ldk_node, ) { - wire_ldk_node_spontaneous_payment_impl(port_, ptr) + wire__crate__api__node__ldk_node_spontaneous_payment_impl(port_, ptr) } #[no_mangle] -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) +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_start( + port_: i64, + that: *mut wire_cst_ldk_node, +) { + wire__crate__api__node__ldk_node_start_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_status(port_: i64, that: *mut wire_cst_ldk_node) { - wire_ldk_node_status_impl(port_, that) +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_status( + port_: i64, + that: *mut wire_cst_ldk_node, +) { + wire__crate__api__node__ldk_node_status_impl(port_, that) } #[no_mangle] -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) +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_stop( + port_: i64, + that: *mut wire_cst_ldk_node, +) { + wire__crate__api__node__ldk_node_stop_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_sync_wallets( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_sync_wallets( port_: i64, that: *mut wire_cst_ldk_node, ) { - wire_ldk_node_sync_wallets_impl(port_, that) + wire__crate__api__node__ldk_node_sync_wallets_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_update_channel_config( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_update_channel_config( port_: i64, that: *mut wire_cst_ldk_node, user_channel_id: *mut wire_cst_user_channel_id, counterparty_node_id: *mut wire_cst_public_key, channel_config: *mut wire_cst_channel_config, ) { - wire_ldk_node_update_channel_config_impl( + wire__crate__api__node__ldk_node_update_channel_config_impl( port_, that, user_channel_id, @@ -1936,69 +2663,102 @@ pub extern "C" fn frbgen_ldk_node_wire_ldk_node_update_channel_config( } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_verify_signature( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_verify_signature( port_: i64, that: *mut wire_cst_ldk_node, msg: *mut wire_cst_list_prim_u_8_loose, sig: *mut wire_cst_list_prim_u_8_strict, public_key: *mut wire_cst_public_key, ) { - wire_ldk_node_verify_signature_impl(port_, that, msg, sig, public_key) + wire__crate__api__node__ldk_node_verify_signature_impl(port_, that, msg, sig, public_key) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_wait_next_event( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_wait_next_event( port_: i64, that: *mut wire_cst_ldk_node, ) { - wire_ldk_node_wait_next_event_impl(port_, that) + wire__crate__api__node__ldk_node_wait_next_event_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_on_chain_payment_new_address( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_new_address( port_: i64, that: *mut wire_cst_ldk_on_chain_payment, ) { - wire_ldk_on_chain_payment_new_address_impl(port_, that) + wire__crate__api__on_chain__ldk_on_chain_payment_new_address_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_on_chain_payment_send_all_to_address( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address( port_: i64, that: *mut wire_cst_ldk_on_chain_payment, address: *mut wire_cst_address, ) { - wire_ldk_on_chain_payment_send_all_to_address_impl(port_, that, address) + wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address_impl(port_, that, address) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_on_chain_payment_send_to_address( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address( port_: i64, that: *mut wire_cst_ldk_on_chain_payment, address: *mut wire_cst_address, amount_sats: u64, ) { - wire_ldk_on_chain_payment_send_to_address_impl(port_, that, address, amount_sats) + wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address_impl( + port_, + that, + address, + amount_sats, + ) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_spontaneous_payment_send( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__spontaneous__ldk_spontaneous_payment_send( port_: i64, that: *mut wire_cst_ldk_spontaneous_payment, amount_msat: u64, node_id: *mut wire_cst_public_key, ) { - wire_ldk_spontaneous_payment_send_impl(port_, that, amount_msat, node_id) + wire__crate__api__spontaneous__ldk_spontaneous_payment_send_impl( + port_, + that, + amount_msat, + node_id, + ) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_spontaneous_payment_send_probes( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes( port_: i64, that: *mut wire_cst_ldk_spontaneous_payment, amount_msat: u64, node_id: *mut wire_cst_public_key, ) { - wire_ldk_spontaneous_payment_send_probes_impl(port_, that, amount_msat, node_id) + wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes_impl( + port_, + that, + amount_msat, + node_id, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } } #[no_mangle] @@ -2020,20 +2780,56 @@ pub extern "C" fn frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_Nod } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( +pub extern "C" fn frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( ptr: *const std::ffi::c_void, ) { unsafe { - StdArc::>::increment_strong_count(ptr as _); + StdArc::>::increment_strong_count(ptr as _); } } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( +pub extern "C" fn frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( ptr: *const std::ffi::c_void, ) { unsafe { - StdArc::>::decrement_strong_count(ptr as _); + StdArc::>::decrement_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilder( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::::increment_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilder( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::::decrement_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraph( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::::increment_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraph( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::::decrement_strong_count(ptr as _); } } @@ -2096,6 +2892,14 @@ pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_address() -> *mut wire_cst flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_address::new_with_null_ptr()) } +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_anchor_channels_config( +) -> *mut wire_cst_anchor_channels_config { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_anchor_channels_config::new_with_null_ptr(), + ) +} + #[no_mangle] pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_bolt_11_invoice( ) -> *mut wire_cst_bolt_11_invoice { @@ -2104,6 +2908,14 @@ pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_bolt_11_invoice( ) } +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_bolt_12_parse_error( +) -> *mut wire_cst_bolt_12_parse_error { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_bolt_12_parse_error::new_with_null_ptr(), + ) +} + #[no_mangle] pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_chain_data_source_config( ) -> *mut wire_cst_chain_data_source_config { @@ -2125,6 +2937,19 @@ 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_channel_info() -> *mut wire_cst_channel_info { + flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_channel_info::new_with_null_ptr()) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_channel_update_info( +) -> *mut wire_cst_channel_update_info { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_channel_update_info::new_with_null_ptr(), + ) +} + #[no_mangle] pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_closure_reason( ) -> *mut wire_cst_closure_reason { @@ -2138,6 +2963,11 @@ pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_config() -> *mut wire_cst_ flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_config::new_with_null_ptr()) } +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_decode_error() -> *mut wire_cst_decode_error { + flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_decode_error::new_with_null_ptr()) +} + #[no_mangle] pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_entropy_source_config( ) -> *mut wire_cst_entropy_source_config { @@ -2167,11 +2997,27 @@ pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_ldk_bolt_11_payment( ) } +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_ldk_bolt_12_payment( +) -> *mut wire_cst_ldk_bolt_12_payment { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_ldk_bolt_12_payment::new_with_null_ptr(), + ) +} + #[no_mangle] 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_ldk_network_graph( +) -> *mut wire_cst_ldk_network_graph { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_ldk_network_graph::new_with_null_ptr(), + ) +} + #[no_mangle] 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()) @@ -2217,6 +3063,16 @@ pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_max_dust_htlc_exposure( ) } +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_offer() -> *mut wire_cst_offer { + flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_offer::new_with_null_ptr()) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_offer_id() -> *mut wire_cst_offer_id { + flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_offer_id::new_with_null_ptr()) +} + #[no_mangle] pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_out_point() -> *mut wire_cst_out_point { flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_out_point::new_with_null_ptr()) @@ -2268,6 +3124,11 @@ pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_public_key() -> *mut wire_ flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_public_key::new_with_null_ptr()) } +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_refund() -> *mut wire_cst_refund { + flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_refund::new_with_null_ptr()) +} + #[no_mangle] pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_socket_address( ) -> *mut wire_cst_socket_address { @@ -2332,6 +3193,18 @@ pub extern "C" fn frbgen_ldk_node_cst_new_list_lightning_balance( flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) } +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_list_node_id(len: i32) -> *mut wire_cst_list_node_id { + let wrap = wire_cst_list_node_id { + 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, @@ -2374,6 +3247,17 @@ pub extern "C" fn frbgen_ldk_node_cst_new_list_pending_sweep_balance( flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) } +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_list_prim_u_64_strict( + len: i32, +) -> *mut wire_cst_list_prim_u_64_strict { + let ans = wire_cst_list_prim_u_64_strict { + ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr(Default::default(), len), + len, + }; + flutter_rust_bridge::for_generated::new_leak_box_ptr(ans) +} + #[no_mangle] pub extern "C" fn frbgen_ldk_node_cst_new_list_prim_u_8_loose( len: i32, @@ -2431,6 +3315,12 @@ pub struct wire_cst_address { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_anchor_channels_config { + trusted_peers_no_reserve: *mut wire_cst_list_public_key, + per_channel_reserve_sats: u64, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_balance_details { total_onchain_balance_sats: u64, spendable_onchain_balance_sats: u64, @@ -2451,6 +3341,46 @@ pub struct wire_cst_bolt_11_invoice { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_bolt_12_invoice { + data: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_bolt_12_parse_error { + tag: i32, + kind: Bolt12ParseErrorKind, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub union Bolt12ParseErrorKind { + Bech32: wire_cst_Bolt12ParseError_Bech32, + Decode: wire_cst_Bolt12ParseError_Decode, + InvalidSemantics: wire_cst_Bolt12ParseError_InvalidSemantics, + InvalidSignature: wire_cst_Bolt12ParseError_InvalidSignature, + nil__: (), +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_Bolt12ParseError_Bech32 { + field0: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_Bolt12ParseError_Decode { + field0: *mut wire_cst_decode_error, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_Bolt12ParseError_InvalidSemantics { + field0: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_Bolt12ParseError_InvalidSignature { + field0: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_chain_data_source_config { tag: i32, kind: ChainDataSourceConfigKind, @@ -2515,6 +3445,25 @@ pub struct wire_cst_channel_id { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_channel_info { + node_one: wire_cst_node_id, + one_to_two: *mut wire_cst_channel_update_info, + node_two: wire_cst_node_id, + two_to_one: *mut wire_cst_channel_update_info, + capacity_sats: *mut u64, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_channel_update_info { + last_update: u32, + enabled: bool, + cltv_expiry_delta: u16, + htlc_minimum_msat: u64, + htlc_maximum_msat: u64, + fees: wire_cst_routing_fees, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_closure_reason { tag: i32, kind: ClosureReasonKind, @@ -2550,6 +3499,24 @@ pub struct wire_cst_config { trusted_peers_0conf: *mut wire_cst_list_public_key, probing_liquidity_limit_multiplier: u64, log_level: i32, + anchor_channels_config: *mut wire_cst_anchor_channels_config, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_decode_error { + tag: i32, + kind: DecodeErrorKind, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub union DecodeErrorKind { + Io: wire_cst_DecodeError_Io, + nil__: (), +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_DecodeError_Io { + field0: *mut wire_cst_list_prim_u_8_strict, } #[repr(C)] #[derive(Clone, Copy)] @@ -2590,6 +3557,7 @@ pub struct wire_cst_event { #[repr(C)] #[derive(Clone, Copy)] pub union EventKind { + PaymentClaimable: wire_cst_Event_PaymentClaimable, PaymentSuccessful: wire_cst_Event_PaymentSuccessful, PaymentFailed: wire_cst_Event_PaymentFailed, PaymentReceived: wire_cst_Event_PaymentReceived, @@ -2600,6 +3568,14 @@ pub union EventKind { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_Event_PaymentClaimable { + payment_id: *mut wire_cst_payment_id, + payment_hash: *mut wire_cst_payment_hash, + claimable_amount_msat: u64, + claim_deadline: *mut u32, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_Event_PaymentSuccessful { payment_id: *mut wire_cst_payment_id, payment_hash: *mut wire_cst_payment_hash, @@ -2667,16 +3643,49 @@ pub struct wire_cst_ldk_bolt_11_payment { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_ldk_bolt_12_payment { + ptr: usize, +} +#[repr(C)] +#[derive(Clone, Copy)] 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_ldk_network_graph { + inner: usize, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_ldk_node { ptr: usize, } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_ldk_node_error { + tag: i32, + kind: LdkNodeErrorKind, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub union LdkNodeErrorKind { + Decode: wire_cst_LdkNodeError_Decode, + Bolt12Parse: wire_cst_LdkNodeError_Bolt12Parse, + nil__: (), +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_LdkNodeError_Decode { + field0: *mut wire_cst_decode_error, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_LdkNodeError_Bolt12Parse { + field0: *mut wire_cst_bolt_12_parse_error, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_ldk_on_chain_payment { ptr: usize, } @@ -2772,6 +3781,12 @@ pub struct wire_cst_list_lightning_balance { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_list_node_id { + ptr: *mut wire_cst_node_id, + len: i32, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_list_payment_details { ptr: *mut wire_cst_payment_details, len: i32, @@ -2790,6 +3805,12 @@ pub struct wire_cst_list_pending_sweep_balance { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_list_prim_u_64_strict { + ptr: *mut u64, + len: i32, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_list_prim_u_8_loose { ptr: *mut u8, len: i32, @@ -2843,6 +3864,11 @@ pub struct wire_cst_MaxDustHTLCExposure_FeeRateMultiplier { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_node_id { + compressed: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_node_status { is_running: bool, is_listening: bool, @@ -2855,6 +3881,16 @@ pub struct wire_cst_node_status { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_offer { + s: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_offer_id { + field0: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_out_point { txid: wire_cst_txid, vout: u32, @@ -2890,6 +3926,8 @@ pub union PaymentKindKind { Bolt11: wire_cst_PaymentKind_Bolt11, Bolt11Jit: wire_cst_PaymentKind_Bolt11Jit, Spontaneous: wire_cst_PaymentKind_Spontaneous, + Bolt12Offer: wire_cst_PaymentKind_Bolt12Offer, + Bolt12Refund: wire_cst_PaymentKind_Bolt12Refund, nil__: (), } #[repr(C)] @@ -2915,6 +3953,21 @@ pub struct wire_cst_PaymentKind_Spontaneous { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_PaymentKind_Bolt12Offer { + hash: *mut wire_cst_payment_hash, + preimage: *mut wire_cst_payment_preimage, + secret: *mut wire_cst_payment_secret, + offer_id: *mut wire_cst_offer_id, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_PaymentKind_Bolt12Refund { + hash: *mut wire_cst_payment_hash, + preimage: *mut wire_cst_payment_preimage, + secret: *mut wire_cst_payment_secret, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_payment_preimage { data: *mut wire_cst_list_prim_u_8_strict, } @@ -2981,6 +4034,17 @@ pub struct wire_cst_record_socket_address_public_key_opt_string { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_refund { + s: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_routing_fees { + base_msat: u32, + proportional_millionths: u32, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_socket_address { tag: i32, kind: SocketAddressKind, diff --git a/rust/src/frb_generated.rs b/rust/src/frb_generated.rs index a55ae33..4e35af8 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.31. +// Generated by `flutter_rust_bridge`@ 2.0.0. #![allow( non_camel_case_types, @@ -14,14 +14,23 @@ clippy::double_parens, clippy::let_and_return, clippy::too_many_arguments, - clippy::match_single_binding + clippy::match_single_binding, + clippy::clone_on_copy, + clippy::let_unit_value, + clippy::deref_addrof, + clippy::explicit_auto_deref, + clippy::borrow_deref_ref, + clippy::needless_borrow )] // Section: imports +use crate::api::bolt12::*; +use crate::api::builder::*; use crate::api::node::*; +use crate::*; use flutter_rust_bridge::for_generated::byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt}; -use flutter_rust_bridge::for_generated::transform_result_dco; +use flutter_rust_bridge::for_generated::{transform_result_dco, Lifetimeable, Lockable}; use flutter_rust_bridge::{Handler, IntoIntoDart}; // Section: boilerplate @@ -31,7 +40,8 @@ flutter_rust_bridge::frb_generated_boilerplate!( default_rust_opaque = RustOpaqueNom, default_rust_auto_opaque = RustAutoOpaqueNom, ); -pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.0.0-dev.31"; +pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.0.0"; +pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = 1452486004; // Section: executor @@ -39,180 +49,267 @@ flutter_rust_bridge::frb_generated_default_handler!(); // Section: wire_funcs -fn wire_NodeBuilder_build_impl( +fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_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, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBuilder_build", + debug_name: "ldk_bolt_11_payment_receive", 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::NodeBuilder::build(api_that))()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt11::LdkBolt11Payment::receive( + &api_that, + api_amount_msat, + api_description, + api_expiry_secs, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_NodeBuilder_build_with_fs_store_impl( +fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, + description: impl CstDecode, + expiry_secs: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBuilder_build_with_fs_store", + debug_name: "ldk_bolt_11_payment_receive_variable_amount", 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::NodeBuilder::build_with_fs_store(api_that) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt11::LdkBolt11Payment::receive_variable_amount( + &api_that, + api_description, + api_expiry_secs, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_NodeBuilder_create_builder_impl( +fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel_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, + 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: "ldk_bolt_11_payment_receive_variable_amount_via_jit_channel", 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();let api_max_proportional_lsp_fee_limit_ppm_msat = max_proportional_lsp_fee_limit_ppm_msat.cst_decode(); move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt11::LdkBolt11Payment::receive_variable_amount_via_jit_channel(&api_that, api_description, api_expiry_secs, api_max_proportional_lsp_fee_limit_ppm_msat)?; Ok(output_ok) + })()) + } }) +} +fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + 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: "NodeBuilder_create_builder", + debug_name: "ldk_bolt_11_payment_receive_via_jit_channel", 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(); + 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::NodeBuilder::create_builder( - api_config, - api_chain_data_source_config, - api_entropy_source_config, - api_gossip_source_config, - api_liquidity_source_config, - ) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt11::LdkBolt11Payment::receive_via_jit_channel( + &api_that, + api_amount_msat, + api_description, + api_expiry_secs, + api_max_total_lsp_fee_limit_msat, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_bolt_11_payment_receive_impl( +fn wire__crate__api__bolt11__ldk_bolt_11_payment_send_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: "ldk_bolt_11_payment_send", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_invoice = invoice.cst_decode(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = + crate::api::bolt11::LdkBolt11Payment::send(&api_that, api_invoice)?; + Ok(output_ok) + })( + )) + } + }, + ) +} +fn wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode, + invoice: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ldk_bolt_11_payment_send_probes", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_invoice = invoice.cst_decode(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = + crate::api::bolt11::LdkBolt11Payment::send_probes(&api_that, api_invoice)?; + Ok(output_ok) + })( + )) + } + }, + ) +} +fn wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode, + invoice: 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: "ldk_bolt_11_payment_receive", + debug_name: "ldk_bolt_11_payment_send_probes_using_amount", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); + let api_invoice = invoice.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::LdkBolt11Payment::receive( + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt11::LdkBolt11Payment::send_probes_using_amount( &api_that, + api_invoice, api_amount_msat, - api_description, - api_expiry_secs, - ) - })()) + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_bolt_11_payment_receive_variable_amount_impl( +fn wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - description: impl CstDecode, - expiry_secs: 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: "ldk_bolt_11_payment_receive_variable_amount", + debug_name: "ldk_bolt_11_payment_send_using_amount", 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(); + let api_invoice = invoice.cst_decode(); + let api_amount_msat = amount_msat.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkBolt11Payment::receive_variable_amount( + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt11::LdkBolt11Payment::send_using_amount( &api_that, - api_description, - api_expiry_secs, - ) - })()) + api_invoice, + api_amount_msat, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_bolt_11_payment_receive_variable_amount_via_jit_channel_impl( +fn wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refund_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - description: impl CstDecode, + that: impl CstDecode, + amount_msat: 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: "ldk_bolt_11_payment_receive_variable_amount_via_jit_channel", + debug_name: "ldk_bolt_12_payment_initiate_refund", 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_amount_msat = amount_msat.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::LdkBolt11Payment::receive_variable_amount_via_jit_channel( + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt12::LdkBolt12Payment::initiate_refund( &api_that, - api_description, + api_amount_msat, api_expiry_secs, - api_max_proportional_lsp_fee_limit_ppm_msat, - ) - })()) + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_bolt_11_payment_receive_via_jit_channel_impl( +fn wire__crate__api__bolt12__ldk_bolt_12_payment_receive_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: "ldk_bolt_11_payment_receive_via_jit_channel", + debug_name: "ldk_bolt_12_payment_receive", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -220,123 +317,294 @@ fn wire_ldk_bolt_11_payment_receive_via_jit_channel_impl( 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(); - 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::LdkBolt11Payment::receive_via_jit_channel( + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt12::LdkBolt12Payment::receive( &api_that, api_amount_msat, api_description, - api_expiry_secs, - api_max_total_lsp_fee_limit_msat, - ) - })()) + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_bolt_11_payment_send_impl( +fn wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amount_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - invoice: impl CstDecode, + that: impl CstDecode, + description: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_bolt_11_payment_send", + debug_name: "ldk_bolt_12_payment_receive_variable_amount", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_invoice = invoice.cst_decode(); + let api_description = description.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkBolt11Payment::send(&api_that, api_invoice) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt12::LdkBolt12Payment::receive_variable_amount( + &api_that, + api_description, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_bolt_11_payment_send_probes_impl( +fn wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_payment_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - invoice: impl CstDecode, + that: impl CstDecode, + refund: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_bolt_11_payment_send_probes", + debug_name: "ldk_bolt_12_payment_request_refund_payment", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_invoice = invoice.cst_decode(); + let api_refund = refund.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkBolt11Payment::send_probes(&api_that, api_invoice) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt12::LdkBolt12Payment::request_refund_payment( + &api_that, api_refund, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_bolt_11_payment_send_probes_using_amount_impl( +fn wire__crate__api__bolt12__ldk_bolt_12_payment_send_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - invoice: impl CstDecode, - amount_msat: impl CstDecode, + that: impl CstDecode, + offer: impl CstDecode, + payer_note: impl CstDecode>, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_bolt_11_payment_send_probes_using_amount", + debug_name: "ldk_bolt_12_payment_send", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_invoice = invoice.cst_decode(); - let api_amount_msat = amount_msat.cst_decode(); + let api_offer = offer.cst_decode(); + let api_payer_note = payer_note.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkBolt11Payment::send_probes_using_amount( + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt12::LdkBolt12Payment::send( &api_that, - api_invoice, - api_amount_msat, - ) - })()) + api_offer, + api_payer_note, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_bolt_11_payment_send_using_amount_impl( +fn wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amount_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - invoice: impl CstDecode, + that: impl CstDecode, + offer: impl CstDecode, + payer_note: impl CstDecode>, amount_msat: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_bolt_11_payment_send_using_amount", + debug_name: "ldk_bolt_12_payment_send_using_amount", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_invoice = invoice.cst_decode(); + let api_offer = offer.cst_decode(); + let api_payer_note = payer_note.cst_decode(); let api_amount_msat = amount_msat.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkBolt11Payment::send_using_amount( + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt12::LdkBolt12Payment::send_using_amount( &api_that, - api_invoice, + api_offer, + api_payer_note, api_amount_msat, - ) - })()) + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_mnemonic_generate_impl(port_: flutter_rust_bridge::for_generated::MessagePort) { +fn wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "NodeBuilder_auto_accessor_get_builder", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + transform_result_dco::<_, _, ()>((move || { + let mut api_that_guard = None; + let decode_indices_ = + flutter_rust_bridge::for_generated::lockable_compute_decode_order(vec![ + flutter_rust_bridge::for_generated::LockableOrderInfo::new( + &api_that, 0, false, + ), + ]); + for i in decode_indices_ { + match i { + 0 => api_that_guard = Some(api_that.lockable_decode_sync_ref()), + _ => unreachable!(), + } + } + let api_that_guard = api_that_guard.unwrap(); + let output_ok = Result::<_, ()>::Ok(api_that_guard.builder.clone())?; + Ok(output_ok) + })()) + }, + ) +} +fn wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, + builder: impl CstDecode>, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "NodeBuilder_auto_accessor_set_builder", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + let api_builder = builder.cst_decode(); + transform_result_dco::<_, _, ()>((move || { + let mut api_that_guard = None; + let decode_indices_ = + flutter_rust_bridge::for_generated::lockable_compute_decode_order(vec![ + flutter_rust_bridge::for_generated::LockableOrderInfo::new( + &api_that, 0, true, + ), + ]); + for i in decode_indices_ { + match i { + 0 => api_that_guard = Some(api_that.lockable_decode_sync_ref_mut()), + _ => unreachable!(), + } + } + let mut api_that_guard = api_that_guard.unwrap(); + let output_ok = Result::<_, ()>::Ok({ + { + api_that_guard.builder = api_builder; + }; + })?; + Ok(output_ok) + })()) + }, + ) +} +fn wire__crate__api__builder__NodeBuilder_build_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: "NodeBuilder_build", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkBuilderError>((move || { + let output_ok = crate::api::builder::NodeBuilder::build(api_that)?; + Ok(output_ok) + })( + )) + } + }, + ) +} +fn wire__crate__api__builder__NodeBuilder_build_with_fs_store_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: "NodeBuilder_build_with_fs_store", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkBuilderError>((move || { + let output_ok = + crate::api::builder::NodeBuilder::build_with_fs_store(api_that)?; + Ok(output_ok) + })( + )) + } + }, + ) +} +fn wire__crate__api__builder__NodeBuilder_create_builder_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>, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "NodeBuilder_create_builder", + 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(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkBuilderError>((move || { + let output_ok = crate::api::builder::NodeBuilder::create_builder( + api_config, + api_chain_data_source_config, + api_entropy_source_config, + api_gossip_source_config, + api_liquidity_source_config, + )?; + Ok(output_ok) + })( + )) + } + }, + ) +} +fn wire__crate__api__builder__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: "ldk_mnemonic_generate", @@ -345,14 +613,89 @@ fn wire_ldk_mnemonic_generate_impl(port_: flutter_rust_bridge::for_generated::Me }, move || { move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkMnemonic::generate()) + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::builder::LdkMnemonic::generate())?; + Ok(output_ok) + })()) + } + }, + ) +} +fn wire__crate__api__graph__ldk_network_graph_channel_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode, + short_channel_id: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ldk_network_graph_channel", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_short_channel_id = short_channel_id.cst_decode(); + move |context| { + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::graph::LdkNetworkGraph::channel( + &api_that, + api_short_channel_id, + ))?; + Ok(output_ok) + })()) + } + }, + ) +} +fn wire__crate__api__graph__ldk_network_graph_list_channels_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_network_graph_list_channels", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + move |context| { + transform_result_dco::<_, _, ()>((move || { + let output_ok = Result::<_, ()>::Ok( + crate::api::graph::LdkNetworkGraph::list_channels(&api_that), + )?; + Ok(output_ok) + })()) + } + }, + ) +} +fn wire__crate__api__graph__ldk_network_graph_list_nodes_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_network_graph_list_nodes", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + move |context| { + transform_result_dco::<_, _, ()>((move || { + let output_ok = Result::<_, ()>::Ok( + crate::api::graph::LdkNetworkGraph::list_nodes(&api_that), + )?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_bolt11_payment_impl( +fn wire__crate__api__node__ldk_node_bolt11_payment_impl( port_: flutter_rust_bridge::for_generated::MessagePort, ptr: impl CstDecode, ) { @@ -365,14 +708,38 @@ fn wire_ldk_node_bolt11_payment_impl( move || { let api_ptr = ptr.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::bolt11_payment(api_ptr)) + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::bolt11_payment(api_ptr))?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_close_channel_impl( +fn wire__crate__api__node__ldk_node_bolt12_payment_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + ptr: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ldk_node_bolt12_payment", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_ptr = ptr.cst_decode(); + move |context| { + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::bolt12_payment(api_ptr))?; + Ok(output_ok) + })()) + } + }, + ) +} +fn wire__crate__api__node__ldk_node_close_channel_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, user_channel_id: impl CstDecode, @@ -389,18 +756,20 @@ fn wire_ldk_node_close_channel_impl( 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::LdkNode::close_channel( + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::close_channel( &api_that, api_user_channel_id, api_counterparty_node_id, - ) - })()) + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_config_impl( +fn wire__crate__api__node__ldk_node_config_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, ) { @@ -413,14 +782,16 @@ fn wire_ldk_node_config_impl( move || { let api_that = that.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::config(&api_that)) + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::config(&api_that))?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_connect_impl( +fn wire__crate__api__node__ldk_node_connect_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, node_id: impl CstDecode, @@ -439,19 +810,21 @@ fn wire_ldk_node_connect_impl( let api_address = address.cst_decode(); let api_persist = persist.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::connect( + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::connect( &api_that, api_node_id, api_address, api_persist, - ) - })()) + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_connect_open_channel_impl( +fn wire__crate__api__node__ldk_node_connect_open_channel_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, socket_address: impl CstDecode, @@ -476,8 +849,8 @@ fn wire_ldk_node_connect_open_channel_impl( let api_announce_channel = announce_channel.cst_decode(); let api_channel_config = channel_config.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::connect_open_channel( + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::connect_open_channel( &api_that, api_socket_address, api_node_id, @@ -485,13 +858,15 @@ fn wire_ldk_node_connect_open_channel_impl( api_push_to_counterparty_msat, api_announce_channel, api_channel_config, - ) - })()) + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_disconnect_impl( +fn wire__crate__api__node__ldk_node_disconnect_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, counterparty_node_id: impl CstDecode, @@ -506,14 +881,17 @@ fn wire_ldk_node_disconnect_impl( let api_that = that.cst_decode(); let api_counterparty_node_id = counterparty_node_id.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::disconnect(&api_that, api_counterparty_node_id) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = + crate::api::node::LdkNode::disconnect(&api_that, api_counterparty_node_id)?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_event_handled_impl( +fn wire__crate__api__node__ldk_node_event_handled_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, ) { @@ -526,14 +904,47 @@ fn wire_ldk_node_event_handled_impl( move || { let api_that = that.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::event_handled(&api_that)) + transform_result_dco::<_, _, ()>((move || { + let output_ok = Result::<_, ()>::Ok({ + crate::api::node::LdkNode::event_handled(&api_that); + })?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_list_balances_impl( +fn wire__crate__api__node__ldk_node_force_close_channel_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode, + user_channel_id: impl CstDecode, + counterparty_node_id: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ldk_node_force_close_channel", + 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::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::force_close_channel( + &api_that, + api_user_channel_id, + api_counterparty_node_id, + )?; + Ok(output_ok) + })( + )) + } + }, + ) +} +fn wire__crate__api__node__ldk_node_list_balances_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, ) { @@ -546,14 +957,16 @@ fn wire_ldk_node_list_balances_impl( move || { let api_that = that.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::list_balances(&api_that) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::list_balances(&api_that)?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_list_channels_impl( +fn wire__crate__api__node__ldk_node_list_channels_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, ) { @@ -566,14 +979,16 @@ fn wire_ldk_node_list_channels_impl( move || { let api_that = that.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::list_channels(&api_that)) + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::list_channels(&api_that))?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_list_payments_impl( +fn wire__crate__api__node__ldk_node_list_payments_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, ) { @@ -586,14 +1001,16 @@ fn wire_ldk_node_list_payments_impl( move || { let api_that = that.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::list_payments(&api_that)) + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::list_payments(&api_that))?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_list_payments_with_filter_impl( +fn wire__crate__api__node__ldk_node_list_payments_with_filter_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, payment_direction: impl CstDecode, @@ -608,17 +1025,19 @@ fn wire_ldk_node_list_payments_with_filter_impl( let api_that = that.cst_decode(); let api_payment_direction = payment_direction.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::list_payments_with_filter( - &api_that, - api_payment_direction, - )) + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::list_payments_with_filter( + &api_that, + api_payment_direction, + ))?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_list_peers_impl( +fn wire__crate__api__node__ldk_node_list_peers_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, ) { @@ -631,14 +1050,16 @@ fn wire_ldk_node_list_peers_impl( move || { let api_that = that.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::list_peers(&api_that)) + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::list_peers(&api_that))?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_listening_addresses_impl( +fn wire__crate__api__node__ldk_node_listening_addresses_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, ) { @@ -651,14 +1072,39 @@ fn wire_ldk_node_listening_addresses_impl( move || { let api_that = that.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::listening_addresses(&api_that)) + transform_result_dco::<_, _, ()>((move || { + let output_ok = Result::<_, ()>::Ok( + crate::api::node::LdkNode::listening_addresses(&api_that), + )?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_next_event_impl( +fn wire__crate__api__node__ldk_node_network_graph_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_network_graph", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + move |context| { + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::network_graph(&api_that))?; + Ok(output_ok) + })()) + } + }, + ) +} +fn wire__crate__api__node__ldk_node_next_event_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, ) { @@ -671,14 +1117,16 @@ fn wire_ldk_node_next_event_impl( move || { let api_that = that.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::next_event(&api_that)) + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::next_event(&api_that))?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_next_event_async_impl( +fn wire__crate__api__node__ldk_node_next_event_async_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, ) { @@ -691,11 +1139,12 @@ fn wire_ldk_node_next_event_async_impl( move || { let api_that = that.cst_decode(); move |context| async move { - transform_result_dco( + transform_result_dco::<_, _, ()>( (move || async move { - Result::<_, ()>::Ok( + let output_ok = Result::<_, ()>::Ok( crate::api::node::LdkNode::next_event_async(&api_that).await, - ) + )?; + Ok(output_ok) })() .await, ) @@ -703,7 +1152,7 @@ fn wire_ldk_node_next_event_async_impl( }, ) } -fn wire_ldk_node_node_id_impl( +fn wire__crate__api__node__ldk_node_node_id_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, ) { @@ -716,14 +1165,16 @@ fn wire_ldk_node_node_id_impl( move || { let api_that = that.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::node_id(&api_that)) + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::node_id(&api_that))?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_on_chain_payment_impl( +fn wire__crate__api__node__ldk_node_on_chain_payment_impl( port_: flutter_rust_bridge::for_generated::MessagePort, ptr: impl CstDecode, ) { @@ -736,14 +1187,16 @@ fn wire_ldk_node_on_chain_payment_impl( move || { let api_ptr = ptr.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::on_chain_payment(api_ptr)) + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::on_chain_payment(api_ptr))?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_payment_impl( +fn wire__crate__api__node__ldk_node_payment_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, payment_id: impl CstDecode, @@ -758,17 +1211,18 @@ fn wire_ldk_node_payment_impl( let api_that = that.cst_decode(); let api_payment_id = payment_id.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::payment( + transform_result_dco::<_, _, ()>((move || { + let output_ok = Result::<_, ()>::Ok(crate::api::node::LdkNode::payment( &api_that, api_payment_id, - )) + ))?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_remove_payment_impl( +fn wire__crate__api__node__ldk_node_remove_payment_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, payment_id: impl CstDecode, @@ -783,14 +1237,17 @@ fn wire_ldk_node_remove_payment_impl( let api_that = that.cst_decode(); let api_payment_id = payment_id.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::remove_payment(&api_that, api_payment_id) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = + crate::api::node::LdkNode::remove_payment(&api_that, api_payment_id)?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_sign_message_impl( +fn wire__crate__api__node__ldk_node_sign_message_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, msg: impl CstDecode>, @@ -805,14 +1262,16 @@ fn wire_ldk_node_sign_message_impl( let api_that = that.cst_decode(); let api_msg = msg.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::sign_message(&api_that, api_msg) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::sign_message(&api_that, api_msg)?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_spontaneous_payment_impl( +fn wire__crate__api__node__ldk_node_spontaneous_payment_impl( port_: flutter_rust_bridge::for_generated::MessagePort, ptr: impl CstDecode, ) { @@ -825,14 +1284,17 @@ fn wire_ldk_node_spontaneous_payment_impl( move || { let api_ptr = ptr.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::spontaneous_payment(api_ptr)) + transform_result_dco::<_, _, ()>((move || { + let output_ok = Result::<_, ()>::Ok( + crate::api::node::LdkNode::spontaneous_payment(api_ptr), + )?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_start_impl( +fn wire__crate__api__node__ldk_node_start_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, ) { @@ -845,12 +1307,16 @@ fn wire_ldk_node_start_impl( move || { let api_that = that.cst_decode(); move |context| { - transform_result_dco((move || crate::api::node::LdkNode::start(&api_that))()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::start(&api_that)?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_status_impl( +fn wire__crate__api__node__ldk_node_status_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, ) { @@ -863,14 +1329,16 @@ fn wire_ldk_node_status_impl( move || { let api_that = that.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::status(&api_that)) + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::status(&api_that))?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_stop_impl( +fn wire__crate__api__node__ldk_node_stop_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, ) { @@ -883,12 +1351,16 @@ fn wire_ldk_node_stop_impl( move || { let api_that = that.cst_decode(); move |context| { - transform_result_dco((move || crate::api::node::LdkNode::stop(&api_that))()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::stop(&api_that)?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_sync_wallets_impl( +fn wire__crate__api__node__ldk_node_sync_wallets_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, ) { @@ -901,12 +1373,16 @@ fn wire_ldk_node_sync_wallets_impl( move || { let api_that = that.cst_decode(); move |context| { - transform_result_dco((move || crate::api::node::LdkNode::sync_wallets(&api_that))()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::sync_wallets(&api_that)?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_update_channel_config_impl( +fn wire__crate__api__node__ldk_node_update_channel_config_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, user_channel_id: impl CstDecode, @@ -925,19 +1401,21 @@ fn wire_ldk_node_update_channel_config_impl( 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::LdkNode::update_channel_config( + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::update_channel_config( &api_that, api_user_channel_id, api_counterparty_node_id, api_channel_config, - ) - })()) + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_verify_signature_impl( +fn wire__crate__api__node__ldk_node_verify_signature_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, msg: impl CstDecode>, @@ -956,19 +1434,21 @@ fn wire_ldk_node_verify_signature_impl( let api_sig = sig.cst_decode(); let api_public_key = public_key.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::verify_signature( + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::verify_signature( &api_that, api_msg, api_sig, api_public_key, - ) - })()) + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_wait_next_event_impl( +fn wire__crate__api__node__ldk_node_wait_next_event_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, ) { @@ -981,16 +1461,18 @@ fn wire_ldk_node_wait_next_event_impl( move || { let api_that = that.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::wait_next_event(&api_that)) + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::wait_next_event(&api_that))?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_on_chain_payment_new_address_impl( +fn wire__crate__api__on_chain__ldk_on_chain_payment_new_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 { @@ -1001,16 +1483,19 @@ fn wire_ldk_on_chain_payment_new_address_impl( move || { let api_that = that.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkOnChainPayment::new_address(&api_that) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = + crate::api::on_chain::LdkOnChainPayment::new_address(&api_that)?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_on_chain_payment_send_all_to_address_impl( +fn wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, address: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( @@ -1023,16 +1508,21 @@ fn wire_ldk_on_chain_payment_send_all_to_address_impl( let api_that = that.cst_decode(); let api_address = address.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkOnChainPayment::send_all_to_address(&api_that, api_address) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::on_chain::LdkOnChainPayment::send_all_to_address( + &api_that, + api_address, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_on_chain_payment_send_to_address_impl( +fn wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, address: impl CstDecode, amount_sats: impl CstDecode, ) { @@ -1047,20 +1537,22 @@ fn wire_ldk_on_chain_payment_send_to_address_impl( let api_address = address.cst_decode(); let api_amount_sats = amount_sats.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkOnChainPayment::send_to_address( + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::on_chain::LdkOnChainPayment::send_to_address( &api_that, api_address, api_amount_sats, - ) - })()) + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_spontaneous_payment_send_impl( +fn wire__crate__api__spontaneous__ldk_spontaneous_payment_send_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, amount_msat: impl CstDecode, node_id: impl CstDecode, ) { @@ -1075,20 +1567,22 @@ fn wire_ldk_spontaneous_payment_send_impl( let api_amount_msat = amount_msat.cst_decode(); let api_node_id = node_id.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkSpontaneousPayment::send( + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::spontaneous::LdkSpontaneousPayment::send( &api_that, api_amount_msat, api_node_id, - ) - })()) + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_spontaneous_payment_send_probes_impl( +fn wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, amount_msat: impl CstDecode, node_id: impl CstDecode, ) { @@ -1103,13 +1597,15 @@ fn wire_ldk_spontaneous_payment_send_probes_impl( let api_amount_msat = amount_msat.cst_decode(); let api_node_id = node_id.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkSpontaneousPayment::send_probes( + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::spontaneous::LdkSpontaneousPayment::send_probes( &api_that, api_amount_msat, api_node_id, - ) - })()) + )?; + Ok(output_ok) + })( + )) } }, ) @@ -1123,33 +1619,33 @@ impl CstDecode for bool { self } } -impl CstDecode for i32 { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::error::BuilderException { - match 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::InvalidPublicKey, - _ => unreachable!("Invalid variant for BuilderException: {}", self), - } - } -} impl CstDecode for i32 { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> i32 { self } } +impl CstDecode for i32 { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::utils::error::LdkBuilderError { + match self { + 0 => crate::utils::error::LdkBuilderError::SocketAddressParseError, + 1 => crate::utils::error::LdkBuilderError::InvalidSeedBytes, + 2 => crate::utils::error::LdkBuilderError::InvalidSeedFile, + 3 => crate::utils::error::LdkBuilderError::InvalidSystemTime, + 4 => crate::utils::error::LdkBuilderError::InvalidChannelMonitor, + 5 => crate::utils::error::LdkBuilderError::InvalidListeningAddress, + 6 => crate::utils::error::LdkBuilderError::ReadFailed, + 7 => crate::utils::error::LdkBuilderError::WriteFailed, + 8 => crate::utils::error::LdkBuilderError::StoragePathAccessFailed, + 9 => crate::utils::error::LdkBuilderError::KVStoreSetupFailed, + 10 => crate::utils::error::LdkBuilderError::WalletSetupFailed, + 11 => crate::utils::error::LdkBuilderError::LoggerSetupFailed, + 12 => crate::utils::error::LdkBuilderError::InvalidPublicKey, + _ => unreachable!("Invalid variant for LdkBuilderError: {}", self), + } + } +} impl CstDecode for i32 { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::LogLevel { @@ -1176,50 +1672,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::error::NodeException { - match 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, - 31 => crate::api::error::NodeException::LiquidityRequestFailed, - 32 => crate::api::error::NodeException::LiquiditySourceUnavailable, - 33 => crate::api::error::NodeException::LiquidityFeeTooHigh, - 34 => crate::api::error::NodeException::InvalidPaymentId, - 35 => crate::api::error::NodeException::DecodeError, - _ => unreachable!("Invalid variant for NodeException: {}", self), - } - } -} impl CstDecode for i32 { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::PaymentDirection { @@ -1289,9 +1741,17 @@ impl SseDecode for NodeBuilder { // 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 = , + flutter_rust_bridge::for_generated::RustAutoOpaqueInner, >>::sse_decode(deserializer); - return inner.rust_auto_opaque_decode_owned(); + return flutter_rust_bridge::for_generated::rust_auto_opaque_decode_owned(inner); + } +} + +impl SseDecode for RustOpaqueNom> { + // 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 unsafe { decode_rust_opaque_nom(inner) }; } } @@ -1304,7 +1764,7 @@ impl SseDecode for RustOpaqueNom { } impl SseDecode - for RustOpaqueNom> + for RustOpaqueNom> { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -1313,6 +1773,22 @@ impl SseDecode } } +impl SseDecode for RustOpaqueNom { + // 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 unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode for RustOpaqueNom { + // 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 unsafe { decode_rust_opaque_nom(inner) }; + } +} + impl SseDecode for RustOpaqueNom { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -1353,6 +1829,19 @@ impl SseDecode for crate::api::types::Address { } } +impl SseDecode for crate::api::types::AnchorChannelsConfig { + // 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_trustedPeersNoReserve = + >::sse_decode(deserializer); + let mut var_perChannelReserveSats = ::sse_decode(deserializer); + return crate::api::types::AnchorChannelsConfig { + trusted_peers_no_reserve: var_trustedPeersNoReserve, + per_channel_reserve_sats: var_perChannelReserveSats, + }; + } +} + 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 { @@ -1385,43 +1874,62 @@ impl SseDecode for crate::api::types::BestBlock { } } -impl SseDecode for crate::api::types::Bolt11Invoice { +impl SseDecode for crate::api::bolt11::Bolt11Invoice { // 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_signedRawInvoice = ::sse_decode(deserializer); - return crate::api::types::Bolt11Invoice { + return crate::api::bolt11::Bolt11Invoice { signed_raw_invoice: var_signedRawInvoice, }; } } -impl SseDecode for bool { +impl SseDecode for crate::api::bolt12::Bolt12Invoice { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - deserializer.cursor.read_u8().unwrap() != 0 + let mut var_data = >::sse_decode(deserializer); + return crate::api::bolt12::Bolt12Invoice { data: var_data }; } } -impl SseDecode for crate::api::error::BuilderException { +impl SseDecode for crate::utils::error::Bolt12ParseError { // 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::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::InvalidPublicKey, - _ => unreachable!("Invalid variant for BuilderException: {}", inner), - }; + let mut tag_ = ::sse_decode(deserializer); + match tag_ { + 0 => { + return crate::utils::error::Bolt12ParseError::InvalidContinuation; + } + 1 => { + return crate::utils::error::Bolt12ParseError::InvalidBech32Hrp; + } + 2 => { + let mut var_field0 = ::sse_decode(deserializer); + return crate::utils::error::Bolt12ParseError::Bech32(var_field0); + } + 3 => { + let mut var_field0 = ::sse_decode(deserializer); + return crate::utils::error::Bolt12ParseError::Decode(var_field0); + } + 4 => { + let mut var_field0 = ::sse_decode(deserializer); + return crate::utils::error::Bolt12ParseError::InvalidSemantics(var_field0); + } + 5 => { + let mut var_field0 = ::sse_decode(deserializer); + return crate::utils::error::Bolt12ParseError::InvalidSignature(var_field0); + } + _ => { + unimplemented!(""); + } + } + } +} + +impl SseDecode for bool { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + deserializer.cursor.read_u8().unwrap() != 0 } } @@ -1539,6 +2047,46 @@ impl SseDecode for crate::api::types::ChannelId { } } +impl SseDecode for crate::api::graph::ChannelInfo { + // 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_nodeOne = ::sse_decode(deserializer); + let mut var_oneToTwo = + >::sse_decode(deserializer); + let mut var_nodeTwo = ::sse_decode(deserializer); + let mut var_twoToOne = + >::sse_decode(deserializer); + let mut var_capacitySats = >::sse_decode(deserializer); + return crate::api::graph::ChannelInfo { + node_one: var_nodeOne, + one_to_two: var_oneToTwo, + node_two: var_nodeTwo, + two_to_one: var_twoToOne, + capacity_sats: var_capacitySats, + }; + } +} + +impl SseDecode for crate::api::graph::ChannelUpdateInfo { + // 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_lastUpdate = ::sse_decode(deserializer); + let mut var_enabled = ::sse_decode(deserializer); + let mut var_cltvExpiryDelta = ::sse_decode(deserializer); + let mut var_htlcMinimumMsat = ::sse_decode(deserializer); + let mut var_htlcMaximumMsat = ::sse_decode(deserializer); + let mut var_fees = ::sse_decode(deserializer); + return crate::api::graph::ChannelUpdateInfo { + last_update: var_lastUpdate, + enabled: var_enabled, + cltv_expiry_delta: var_cltvExpiryDelta, + htlc_minimum_msat: var_htlcMinimumMsat, + htlc_maximum_msat: var_htlcMaximumMsat, + fees: var_fees, + }; + } +} + 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 { @@ -1610,6 +2158,8 @@ impl SseDecode for crate::api::types::Config { >::sse_decode(deserializer); let mut var_probingLiquidityLimitMultiplier = ::sse_decode(deserializer); let mut var_logLevel = ::sse_decode(deserializer); + let mut var_anchorChannelsConfig = + >::sse_decode(deserializer); return crate::api::types::Config { storage_dir_path: var_storageDirPath, log_dir_path: var_logDirPath, @@ -1622,10 +2172,48 @@ impl SseDecode for crate::api::types::Config { trusted_peers_0conf: var_trustedPeers0Conf, probing_liquidity_limit_multiplier: var_probingLiquidityLimitMultiplier, log_level: var_logLevel, + anchor_channels_config: var_anchorChannelsConfig, }; } } +impl SseDecode for crate::utils::error::DecodeError { + // 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 => { + return crate::utils::error::DecodeError::UnknownVersion; + } + 1 => { + return crate::utils::error::DecodeError::UnknownRequiredFeature; + } + 2 => { + return crate::utils::error::DecodeError::InvalidValue; + } + 3 => { + return crate::utils::error::DecodeError::ShortRead; + } + 4 => { + return crate::utils::error::DecodeError::BadLengthDescriptor; + } + 5 => { + let mut var_field0 = ::sse_decode(deserializer); + return crate::utils::error::DecodeError::Io(var_field0); + } + 6 => { + return crate::utils::error::DecodeError::UnsupportedCompression; + } + 7 => { + return crate::utils::error::DecodeError::DangerousValue; + } + _ => { + unimplemented!(""); + } + } + } +} + impl SseDecode for crate::api::types::EntropySourceConfig { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -1640,7 +2228,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, @@ -1660,6 +2248,19 @@ impl SseDecode for crate::api::types::Event { let mut tag_ = ::sse_decode(deserializer); match tag_ { 0 => { + let mut var_paymentId = ::sse_decode(deserializer); + let mut var_paymentHash = + ::sse_decode(deserializer); + let mut var_claimableAmountMsat = ::sse_decode(deserializer); + let mut var_claimDeadline = >::sse_decode(deserializer); + return crate::api::types::Event::PaymentClaimable { + payment_id: var_paymentId, + payment_hash: var_paymentHash, + claimable_amount_msat: var_claimableAmountMsat, + claim_deadline: var_claimDeadline, + }; + } + 1 => { let mut var_paymentId = >::sse_decode(deserializer); let mut var_paymentHash = @@ -1671,7 +2272,7 @@ impl SseDecode for crate::api::types::Event { fee_paid_msat: var_feePaidMsat, }; } - 1 => { + 2 => { let mut var_paymentId = >::sse_decode(deserializer); let mut var_paymentHash = @@ -1684,7 +2285,7 @@ impl SseDecode for crate::api::types::Event { reason: var_reason, }; } - 2 => { + 3 => { let mut var_paymentId = >::sse_decode(deserializer); let mut var_paymentHash = @@ -1696,7 +2297,7 @@ impl SseDecode for crate::api::types::Event { amount_msat: var_amountMsat, }; } - 3 => { + 4 => { let mut var_channelId = ::sse_decode(deserializer); let mut var_userChannelId = ::sse_decode(deserializer); @@ -1713,7 +2314,7 @@ impl SseDecode for crate::api::types::Event { funding_txo: var_fundingTxo, }; } - 4 => { + 5 => { let mut var_channelId = ::sse_decode(deserializer); let mut var_userChannelId = ::sse_decode(deserializer); @@ -1725,7 +2326,7 @@ impl SseDecode for crate::api::types::Event { counterparty_node_id: var_counterpartyNodeId, }; } - 5 => { + 6 => { let mut var_channelId = ::sse_decode(deserializer); let mut var_userChannelId = ::sse_decode(deserializer); @@ -1773,25 +2374,66 @@ impl SseDecode for i32 { } } -impl SseDecode for crate::api::node::LdkBolt11Payment { +impl SseDecode for crate::api::bolt11::LdkBolt11Payment { // 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::LdkBolt11Payment { ptr: var_ptr }; + return crate::api::bolt11::LdkBolt11Payment { ptr: var_ptr }; + } +} + +impl SseDecode for crate::api::bolt12::LdkBolt12Payment { + // 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::bolt12::LdkBolt12Payment { ptr: var_ptr }; + } +} + +impl SseDecode for crate::utils::error::LdkBuilderError { + // 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::utils::error::LdkBuilderError::SocketAddressParseError, + 1 => crate::utils::error::LdkBuilderError::InvalidSeedBytes, + 2 => crate::utils::error::LdkBuilderError::InvalidSeedFile, + 3 => crate::utils::error::LdkBuilderError::InvalidSystemTime, + 4 => crate::utils::error::LdkBuilderError::InvalidChannelMonitor, + 5 => crate::utils::error::LdkBuilderError::InvalidListeningAddress, + 6 => crate::utils::error::LdkBuilderError::ReadFailed, + 7 => crate::utils::error::LdkBuilderError::WriteFailed, + 8 => crate::utils::error::LdkBuilderError::StoragePathAccessFailed, + 9 => crate::utils::error::LdkBuilderError::KVStoreSetupFailed, + 10 => crate::utils::error::LdkBuilderError::WalletSetupFailed, + 11 => crate::utils::error::LdkBuilderError::LoggerSetupFailed, + 12 => crate::utils::error::LdkBuilderError::InvalidPublicKey, + _ => unreachable!("Invalid variant for LdkBuilderError: {}", inner), + }; } } -impl SseDecode for crate::api::node::LdkMnemonic { +impl SseDecode for crate::api::builder::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 var_seedPhrase = ::sse_decode(deserializer); - return crate::api::node::LdkMnemonic { + return crate::api::builder::LdkMnemonic { seed_phrase: var_seedPhrase, }; } } +impl SseDecode for crate::api::graph::LdkNetworkGraph { + // 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_inner = + >::sse_decode(deserializer); + return crate::api::graph::LdkNetworkGraph { inner: var_inner }; + } +} + 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 { @@ -1800,21 +2442,183 @@ impl SseDecode for crate::api::node::LdkNode { } } -impl SseDecode for crate::api::node::LdkOnChainPayment { +impl SseDecode for crate::utils::error::LdkNodeError { + // 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 => { + return crate::utils::error::LdkNodeError::InvalidTxid; + } + 1 => { + return crate::utils::error::LdkNodeError::AlreadyRunning; + } + 2 => { + return crate::utils::error::LdkNodeError::NotRunning; + } + 3 => { + return crate::utils::error::LdkNodeError::OnchainTxCreationFailed; + } + 4 => { + return crate::utils::error::LdkNodeError::ConnectionFailed; + } + 5 => { + return crate::utils::error::LdkNodeError::InvoiceCreationFailed; + } + 6 => { + return crate::utils::error::LdkNodeError::PaymentSendingFailed; + } + 7 => { + return crate::utils::error::LdkNodeError::ProbeSendingFailed; + } + 8 => { + return crate::utils::error::LdkNodeError::ChannelCreationFailed; + } + 9 => { + return crate::utils::error::LdkNodeError::ChannelClosingFailed; + } + 10 => { + return crate::utils::error::LdkNodeError::ChannelConfigUpdateFailed; + } + 11 => { + return crate::utils::error::LdkNodeError::PersistenceFailed; + } + 12 => { + return crate::utils::error::LdkNodeError::WalletOperationFailed; + } + 13 => { + return crate::utils::error::LdkNodeError::OnchainTxSigningFailed; + } + 14 => { + return crate::utils::error::LdkNodeError::MessageSigningFailed; + } + 15 => { + return crate::utils::error::LdkNodeError::TxSyncFailed; + } + 16 => { + return crate::utils::error::LdkNodeError::GossipUpdateFailed; + } + 17 => { + return crate::utils::error::LdkNodeError::InvalidAddress; + } + 18 => { + return crate::utils::error::LdkNodeError::InvalidSocketAddress; + } + 19 => { + return crate::utils::error::LdkNodeError::InvalidPublicKey; + } + 20 => { + return crate::utils::error::LdkNodeError::InvalidSecretKey; + } + 21 => { + return crate::utils::error::LdkNodeError::InvalidPaymentHash; + } + 22 => { + return crate::utils::error::LdkNodeError::InvalidPaymentPreimage; + } + 23 => { + return crate::utils::error::LdkNodeError::InvalidPaymentSecret; + } + 24 => { + return crate::utils::error::LdkNodeError::InvalidAmount; + } + 25 => { + return crate::utils::error::LdkNodeError::InvalidInvoice; + } + 26 => { + return crate::utils::error::LdkNodeError::InvalidChannelId; + } + 27 => { + return crate::utils::error::LdkNodeError::InvalidNetwork; + } + 28 => { + return crate::utils::error::LdkNodeError::DuplicatePayment; + } + 29 => { + return crate::utils::error::LdkNodeError::InsufficientFunds; + } + 30 => { + return crate::utils::error::LdkNodeError::FeerateEstimationUpdateFailed; + } + 31 => { + return crate::utils::error::LdkNodeError::LiquidityRequestFailed; + } + 32 => { + return crate::utils::error::LdkNodeError::LiquiditySourceUnavailable; + } + 33 => { + return crate::utils::error::LdkNodeError::LiquidityFeeTooHigh; + } + 34 => { + return crate::utils::error::LdkNodeError::InvalidPaymentId; + } + 35 => { + let mut var_field0 = ::sse_decode(deserializer); + return crate::utils::error::LdkNodeError::Decode(var_field0); + } + 36 => { + let mut var_field0 = + ::sse_decode(deserializer); + return crate::utils::error::LdkNodeError::Bolt12Parse(var_field0); + } + 37 => { + return crate::utils::error::LdkNodeError::InvoiceRequestCreationFailed; + } + 38 => { + return crate::utils::error::LdkNodeError::OfferCreationFailed; + } + 39 => { + return crate::utils::error::LdkNodeError::RefundCreationFailed; + } + 40 => { + return crate::utils::error::LdkNodeError::FeerateEstimationUpdateTimeout; + } + 41 => { + return crate::utils::error::LdkNodeError::WalletOperationTimeout; + } + 42 => { + return crate::utils::error::LdkNodeError::TxSyncTimeout; + } + 43 => { + return crate::utils::error::LdkNodeError::GossipUpdateTimeout; + } + 44 => { + return crate::utils::error::LdkNodeError::InvalidOfferId; + } + 45 => { + return crate::utils::error::LdkNodeError::InvalidNodeId; + } + 46 => { + return crate::utils::error::LdkNodeError::InvalidOffer; + } + 47 => { + return crate::utils::error::LdkNodeError::InvalidRefund; + } + 48 => { + return crate::utils::error::LdkNodeError::UnsupportedCurrency; + } + _ => { + unimplemented!(""); + } + } + } +} + +impl SseDecode for crate::api::on_chain::LdkOnChainPayment { // 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::LdkOnChainPayment { ptr: var_ptr }; + return crate::api::on_chain::LdkOnChainPayment { ptr: var_ptr }; } } -impl SseDecode for crate::api::node::LdkSpontaneousPayment { +impl SseDecode for crate::api::spontaneous::LdkSpontaneousPayment { // 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::LdkSpontaneousPayment { ptr: var_ptr }; + return crate::api::spontaneous::LdkSpontaneousPayment { ptr: var_ptr }; } } @@ -1958,6 +2762,18 @@ 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 { @@ -1998,6 +2814,18 @@ 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 { @@ -2096,48 +2924,12 @@ impl SseDecode for crate::api::types::Network { } } -impl SseDecode for crate::api::error::NodeException { +impl SseDecode for crate::api::graph::NodeId { // 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::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, - 31 => crate::api::error::NodeException::LiquidityRequestFailed, - 32 => crate::api::error::NodeException::LiquiditySourceUnavailable, - 33 => crate::api::error::NodeException::LiquidityFeeTooHigh, - 34 => crate::api::error::NodeException::InvalidPaymentId, - 35 => crate::api::error::NodeException::DecodeError, - _ => unreachable!("Invalid variant for NodeException: {}", inner), + let mut var_compressed = >::sse_decode(deserializer); + return crate::api::graph::NodeId { + compressed: var_compressed, }; } } @@ -2168,6 +2960,22 @@ impl SseDecode for crate::api::types::NodeStatus { } } +impl SseDecode for crate::api::bolt12::Offer { + // 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_s = ::sse_decode(deserializer); + return crate::api::bolt12::Offer { s: var_s }; + } +} + +impl SseDecode for crate::api::types::OfferId { + // 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 = <[u8; 32]>::sse_decode(deserializer); + return crate::api::types::OfferId(var_field0); + } +} + 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 { @@ -2179,6 +2987,19 @@ 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 { @@ -2214,6 +3035,30 @@ 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 { @@ -2325,6 +3170,17 @@ 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 { @@ -2535,6 +3391,34 @@ impl SseDecode for crate::api::types::PaymentKind { preimage: var_preimage, }; } + 4 => { + let mut var_hash = + >::sse_decode(deserializer); + let mut var_preimage = + >::sse_decode(deserializer); + let mut var_secret = + >::sse_decode(deserializer); + let mut var_offerId = ::sse_decode(deserializer); + return crate::api::types::PaymentKind::Bolt12Offer { + hash: var_hash, + preimage: var_preimage, + secret: var_secret, + offer_id: var_offerId, + }; + } + 5 => { + let mut var_hash = + >::sse_decode(deserializer); + let mut var_preimage = + >::sse_decode(deserializer); + let mut var_secret = + >::sse_decode(deserializer); + return crate::api::types::PaymentKind::Bolt12Refund { + hash: var_hash, + preimage: var_preimage, + secret: var_secret, + }; + } _ => { unimplemented!(""); } @@ -2660,6 +3544,26 @@ impl SseDecode } } +impl SseDecode for crate::api::bolt12::Refund { + // 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_s = ::sse_decode(deserializer); + return crate::api::bolt12::Refund { s: var_s }; + } +} + +impl SseDecode for crate::api::graph::RoutingFees { + // 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_baseMsat = ::sse_decode(deserializer); + let mut var_proportionalMillionths = ::sse_decode(deserializer); + return crate::api::graph::RoutingFees { + base_msat: var_baseMsat, + proportional_millionths: var_proportionalMillionths, + }; + } +} + impl SseDecode for crate::api::types::SocketAddress { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -2863,6 +3767,27 @@ 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::AnchorChannelsConfig { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [ + self.trusted_peers_no_reserve.into_into_dart().into_dart(), + self.per_channel_reserve_sats.into_into_dart().into_dart(), + ] + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::AnchorChannelsConfig +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::AnchorChannelsConfig +{ + fn into_into_dart(self) -> crate::api::types::AnchorChannelsConfig { + self + } +} +// 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 { [ @@ -2911,50 +3836,73 @@ impl flutter_rust_bridge::IntoIntoDart } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::Bolt11Invoice { +impl flutter_rust_bridge::IntoDart for crate::api::bolt11::Bolt11Invoice { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { [self.signed_raw_invoice.into_into_dart().into_dart()].into_dart() } } impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::Bolt11Invoice + for crate::api::bolt11::Bolt11Invoice +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::bolt11::Bolt11Invoice +{ + fn into_into_dart(self) -> crate::api::bolt11::Bolt11Invoice { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::bolt12::Bolt12Invoice { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.data.into_into_dart().into_dart()].into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::bolt12::Bolt12Invoice { } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::Bolt11Invoice +impl flutter_rust_bridge::IntoIntoDart + for crate::api::bolt12::Bolt12Invoice { - fn into_into_dart(self) -> crate::api::types::Bolt11Invoice { + fn into_into_dart(self) -> crate::api::bolt12::Bolt12Invoice { self } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::error::BuilderException { +impl flutter_rust_bridge::IntoDart for crate::utils::error::Bolt12ParseError { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { match self { - Self::SocketAddressParseError => 0.into_dart(), - Self::InvalidSeedBytes => 1.into_dart(), - Self::InvalidSeedFile => 2.into_dart(), - Self::InvalidSystemTime => 3.into_dart(), - Self::InvalidChannelMonitor => 4.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::InvalidPublicKey => 12.into_dart(), + crate::utils::error::Bolt12ParseError::InvalidContinuation => { + [0.into_dart()].into_dart() + } + crate::utils::error::Bolt12ParseError::InvalidBech32Hrp => [1.into_dart()].into_dart(), + crate::utils::error::Bolt12ParseError::Bech32(field0) => { + [2.into_dart(), field0.into_into_dart().into_dart()].into_dart() + } + crate::utils::error::Bolt12ParseError::Decode(field0) => { + [3.into_dart(), field0.into_into_dart().into_dart()].into_dart() + } + crate::utils::error::Bolt12ParseError::InvalidSemantics(field0) => { + [4.into_dart(), field0.into_into_dart().into_dart()].into_dart() + } + crate::utils::error::Bolt12ParseError::InvalidSignature(field0) => { + [5.into_dart(), field0.into_into_dart().into_dart()].into_dart() + } + _ => { + unimplemented!(""); + } } } } impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::error::BuilderException + for crate::utils::error::Bolt12ParseError { } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::error::BuilderException +impl flutter_rust_bridge::IntoIntoDart + for crate::utils::error::Bolt12ParseError { - fn into_into_dart(self) -> crate::api::error::BuilderException { + fn into_into_dart(self) -> crate::utils::error::Bolt12ParseError { self } } @@ -2965,6 +3913,9 @@ impl flutter_rust_bridge::IntoDart for crate::api::types::ChainDataSourceConfig crate::api::types::ChainDataSourceConfig::Esplora(field0) => { [0.into_dart(), field0.into_into_dart().into_dart()].into_dart() } + _ => { + unimplemented!(""); + } } } } @@ -3090,6 +4041,55 @@ impl flutter_rust_bridge::IntoIntoDart } } // Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::graph::ChannelInfo { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [ + self.node_one.into_into_dart().into_dart(), + self.one_to_two.into_into_dart().into_dart(), + self.node_two.into_into_dart().into_dart(), + self.two_to_one.into_into_dart().into_dart(), + self.capacity_sats.into_into_dart().into_dart(), + ] + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::graph::ChannelInfo +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::graph::ChannelInfo +{ + fn into_into_dart(self) -> crate::api::graph::ChannelInfo { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::graph::ChannelUpdateInfo { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [ + self.last_update.into_into_dart().into_dart(), + self.enabled.into_into_dart().into_dart(), + self.cltv_expiry_delta.into_into_dart().into_dart(), + self.htlc_minimum_msat.into_into_dart().into_dart(), + self.htlc_maximum_msat.into_into_dart().into_dart(), + self.fees.into_into_dart().into_dart(), + ] + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::graph::ChannelUpdateInfo +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::graph::ChannelUpdateInfo +{ + fn into_into_dart(self) -> crate::api::graph::ChannelUpdateInfo { + self + } +} +// 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 { @@ -3118,6 +4118,9 @@ impl flutter_rust_bridge::IntoDart for crate::api::types::ClosureReason { } crate::api::types::ClosureReason::FundingBatchClosure => [11.into_dart()].into_dart(), crate::api::types::ClosureReason::HTLCsTimedOut => [12.into_dart()].into_dart(), + _ => { + unimplemented!(""); + } } } } @@ -3153,6 +4156,7 @@ impl flutter_rust_bridge::IntoDart for crate::api::types::Config { .into_into_dart() .into_dart(), self.log_level.into_into_dart().into_dart(), + self.anchor_channels_config.into_into_dart().into_dart(), ] .into_dart() } @@ -3164,6 +4168,37 @@ impl flutter_rust_bridge::IntoIntoDart for crate::api } } // Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::utils::error::DecodeError { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + match self { + crate::utils::error::DecodeError::UnknownVersion => [0.into_dart()].into_dart(), + crate::utils::error::DecodeError::UnknownRequiredFeature => [1.into_dart()].into_dart(), + crate::utils::error::DecodeError::InvalidValue => [2.into_dart()].into_dart(), + crate::utils::error::DecodeError::ShortRead => [3.into_dart()].into_dart(), + crate::utils::error::DecodeError::BadLengthDescriptor => [4.into_dart()].into_dart(), + crate::utils::error::DecodeError::Io(field0) => { + [5.into_dart(), field0.into_into_dart().into_dart()].into_dart() + } + crate::utils::error::DecodeError::UnsupportedCompression => [6.into_dart()].into_dart(), + crate::utils::error::DecodeError::DangerousValue => [7.into_dart()].into_dart(), + _ => { + unimplemented!(""); + } + } + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::utils::error::DecodeError +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::utils::error::DecodeError +{ + fn into_into_dart(self) -> crate::utils::error::DecodeError { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs impl flutter_rust_bridge::IntoDart for crate::api::types::EntropySourceConfig { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { match self { @@ -3182,6 +4217,9 @@ impl flutter_rust_bridge::IntoDart for crate::api::types::EntropySourceConfig { passphrase.into_into_dart().into_dart(), ] .into_dart(), + _ => { + unimplemented!(""); + } } } } @@ -3200,12 +4238,25 @@ 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::PaymentClaimable { + payment_id, + payment_hash, + claimable_amount_msat, + claim_deadline, + } => [ + 0.into_dart(), + payment_id.into_into_dart().into_dart(), + payment_hash.into_into_dart().into_dart(), + claimable_amount_msat.into_into_dart().into_dart(), + claim_deadline.into_into_dart().into_dart(), + ] + .into_dart(), crate::api::types::Event::PaymentSuccessful { payment_id, payment_hash, fee_paid_msat, } => [ - 0.into_dart(), + 1.into_dart(), payment_id.into_into_dart().into_dart(), payment_hash.into_into_dart().into_dart(), fee_paid_msat.into_into_dart().into_dart(), @@ -3216,7 +4267,7 @@ impl flutter_rust_bridge::IntoDart for crate::api::types::Event { payment_hash, reason, } => [ - 1.into_dart(), + 2.into_dart(), payment_id.into_into_dart().into_dart(), payment_hash.into_into_dart().into_dart(), reason.into_into_dart().into_dart(), @@ -3227,7 +4278,7 @@ impl flutter_rust_bridge::IntoDart for crate::api::types::Event { payment_hash, amount_msat, } => [ - 2.into_dart(), + 3.into_dart(), payment_id.into_into_dart().into_dart(), payment_hash.into_into_dart().into_dart(), amount_msat.into_into_dart().into_dart(), @@ -3240,7 +4291,7 @@ impl flutter_rust_bridge::IntoDart for crate::api::types::Event { counterparty_node_id, funding_txo, } => [ - 3.into_dart(), + 4.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(), @@ -3253,7 +4304,7 @@ impl flutter_rust_bridge::IntoDart for crate::api::types::Event { user_channel_id, counterparty_node_id, } => [ - 4.into_dart(), + 5.into_dart(), channel_id.into_into_dart().into_dart(), user_channel_id.into_into_dart().into_dart(), counterparty_node_id.into_into_dart().into_dart(), @@ -3265,13 +4316,16 @@ impl flutter_rust_bridge::IntoDart for crate::api::types::Event { counterparty_node_id, reason, } => [ - 5.into_dart(), + 6.into_dart(), channel_id.into_into_dart().into_dart(), user_channel_id.into_into_dart().into_dart(), counterparty_node_id.into_into_dart().into_dart(), reason.into_into_dart().into_dart(), ] .into_dart(), + _ => { + unimplemented!(""); + } } } } @@ -3285,52 +4339,124 @@ impl flutter_rust_bridge::IntoIntoDart for crate::api: impl flutter_rust_bridge::IntoDart for crate::api::types::GossipSourceConfig { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { match self { - crate::api::types::GossipSourceConfig::P2PNetwork => [0.into_dart()].into_dart(), - crate::api::types::GossipSourceConfig::RapidGossipSync(field0) => { - [1.into_dart(), field0.into_into_dart().into_dart()].into_dart() - } + crate::api::types::GossipSourceConfig::P2PNetwork => [0.into_dart()].into_dart(), + crate::api::types::GossipSourceConfig::RapidGossipSync(field0) => { + [1.into_dart(), field0.into_into_dart().into_dart()].into_dart() + } + _ => { + unimplemented!(""); + } + } + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::GossipSourceConfig +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::GossipSourceConfig +{ + fn into_into_dart(self) -> crate::api::types::GossipSourceConfig { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::bolt11::LdkBolt11Payment { + 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::bolt11::LdkBolt11Payment +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::bolt11::LdkBolt11Payment +{ + fn into_into_dart(self) -> crate::api::bolt11::LdkBolt11Payment { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::bolt12::LdkBolt12Payment { + 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::bolt12::LdkBolt12Payment +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::bolt12::LdkBolt12Payment +{ + fn into_into_dart(self) -> crate::api::bolt12::LdkBolt12Payment { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::utils::error::LdkBuilderError { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + match self { + Self::SocketAddressParseError => 0.into_dart(), + Self::InvalidSeedBytes => 1.into_dart(), + Self::InvalidSeedFile => 2.into_dart(), + Self::InvalidSystemTime => 3.into_dart(), + Self::InvalidChannelMonitor => 4.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::InvalidPublicKey => 12.into_dart(), + _ => unreachable!(), } } } impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::GossipSourceConfig + for crate::utils::error::LdkBuilderError { } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::GossipSourceConfig +impl flutter_rust_bridge::IntoIntoDart + for crate::utils::error::LdkBuilderError { - fn into_into_dart(self) -> crate::api::types::GossipSourceConfig { + fn into_into_dart(self) -> crate::utils::error::LdkBuilderError { self } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::node::LdkBolt11Payment { +impl flutter_rust_bridge::IntoDart for crate::api::builder::LdkMnemonic { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [self.ptr.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::node::LdkBolt11Payment + for crate::api::builder::LdkMnemonic { } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::node::LdkBolt11Payment +impl flutter_rust_bridge::IntoIntoDart + for crate::api::builder::LdkMnemonic { - fn into_into_dart(self) -> crate::api::node::LdkBolt11Payment { + fn into_into_dart(self) -> crate::api::builder::LdkMnemonic { self } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::node::LdkMnemonic { +impl flutter_rust_bridge::IntoDart for crate::api::graph::LdkNetworkGraph { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [self.seed_phrase.into_into_dart().into_dart()].into_dart() + [self.inner.into_into_dart().into_dart()].into_dart() } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::node::LdkMnemonic {} -impl flutter_rust_bridge::IntoIntoDart - for crate::api::node::LdkMnemonic +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::graph::LdkNetworkGraph +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::graph::LdkNetworkGraph { - fn into_into_dart(self) -> crate::api::node::LdkMnemonic { + fn into_into_dart(self) -> crate::api::graph::LdkNetworkGraph { self } } @@ -3347,36 +4473,132 @@ impl flutter_rust_bridge::IntoIntoDart for crate::api } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::node::LdkOnChainPayment { +impl flutter_rust_bridge::IntoDart for crate::utils::error::LdkNodeError { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + match self { + crate::utils::error::LdkNodeError::InvalidTxid => [0.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::AlreadyRunning => [1.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::NotRunning => [2.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::OnchainTxCreationFailed => { + [3.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::ConnectionFailed => [4.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvoiceCreationFailed => [5.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::PaymentSendingFailed => [6.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::ProbeSendingFailed => [7.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::ChannelCreationFailed => [8.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::ChannelClosingFailed => [9.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::ChannelConfigUpdateFailed => { + [10.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::PersistenceFailed => [11.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::WalletOperationFailed => { + [12.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::OnchainTxSigningFailed => { + [13.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::MessageSigningFailed => [14.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::TxSyncFailed => [15.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::GossipUpdateFailed => [16.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidAddress => [17.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidSocketAddress => [18.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidPublicKey => [19.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidSecretKey => [20.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidPaymentHash => [21.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidPaymentPreimage => { + [22.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::InvalidPaymentSecret => [23.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidAmount => [24.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidInvoice => [25.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidChannelId => [26.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidNetwork => [27.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::DuplicatePayment => [28.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InsufficientFunds => [29.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::FeerateEstimationUpdateFailed => { + [30.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::LiquidityRequestFailed => { + [31.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::LiquiditySourceUnavailable => { + [32.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::LiquidityFeeTooHigh => [33.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidPaymentId => [34.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::Decode(field0) => { + [35.into_dart(), field0.into_into_dart().into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::Bolt12Parse(field0) => { + [36.into_dart(), field0.into_into_dart().into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::InvoiceRequestCreationFailed => { + [37.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::OfferCreationFailed => [38.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::RefundCreationFailed => [39.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::FeerateEstimationUpdateTimeout => { + [40.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::WalletOperationTimeout => { + [41.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::TxSyncTimeout => [42.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::GossipUpdateTimeout => [43.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidOfferId => [44.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidNodeId => [45.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidOffer => [46.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidRefund => [47.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::UnsupportedCurrency => [48.into_dart()].into_dart(), + _ => { + unimplemented!(""); + } + } + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::utils::error::LdkNodeError +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::utils::error::LdkNodeError +{ + fn into_into_dart(self) -> crate::utils::error::LdkNodeError { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::on_chain::LdkOnChainPayment { 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::LdkOnChainPayment + for crate::api::on_chain::LdkOnChainPayment { } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::node::LdkOnChainPayment +impl flutter_rust_bridge::IntoIntoDart + for crate::api::on_chain::LdkOnChainPayment { - fn into_into_dart(self) -> crate::api::node::LdkOnChainPayment { + fn into_into_dart(self) -> crate::api::on_chain::LdkOnChainPayment { self } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::node::LdkSpontaneousPayment { +impl flutter_rust_bridge::IntoDart for crate::api::spontaneous::LdkSpontaneousPayment { 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::LdkSpontaneousPayment + for crate::api::spontaneous::LdkSpontaneousPayment { } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::node::LdkSpontaneousPayment +impl flutter_rust_bridge::IntoIntoDart + for crate::api::spontaneous::LdkSpontaneousPayment { - fn into_into_dart(self) -> crate::api::node::LdkSpontaneousPayment { + fn into_into_dart(self) -> crate::api::spontaneous::LdkSpontaneousPayment { self } } @@ -3466,6 +4688,9 @@ impl flutter_rust_bridge::IntoDart for crate::api::types::LightningBalance { amount_satoshis.into_into_dart().into_dart(), ] .into_dart(), + _ => { + unimplemented!(""); + } } } } @@ -3507,6 +4732,7 @@ impl flutter_rust_bridge::IntoDart for crate::api::types::LogLevel { Self::Info => 3.into_dart(), Self::Warn => 4.into_dart(), Self::Error => 5.into_dart(), + _ => unreachable!(), } } } @@ -3551,6 +4777,9 @@ impl flutter_rust_bridge::IntoDart for crate::api::types::MaxDustHTLCExposure { crate::api::types::MaxDustHTLCExposure::FeeRateMultiplier(field0) => { [1.into_dart(), field0.into_into_dart().into_dart()].into_dart() } + _ => { + unimplemented!(""); + } } } } @@ -3573,6 +4802,7 @@ impl flutter_rust_bridge::IntoDart for crate::api::types::Network { Self::Testnet => 1.into_dart(), Self::Signet => 2.into_dart(), Self::Regtest => 3.into_dart(), + _ => unreachable!(), } } } @@ -3583,56 +4813,14 @@ 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::error::NodeException { +impl flutter_rust_bridge::IntoDart for crate::api::graph::NodeId { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - match self { - 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(), - Self::LiquidityRequestFailed => 31.into_dart(), - Self::LiquiditySourceUnavailable => 32.into_dart(), - Self::LiquidityFeeTooHigh => 33.into_dart(), - Self::InvalidPaymentId => 34.into_dart(), - Self::DecodeError => 35.into_dart(), - } + [self.compressed.into_into_dart().into_dart()].into_dart() } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::error::NodeException -{ -} -impl flutter_rust_bridge::IntoIntoDart - for crate::api::error::NodeException -{ - fn into_into_dart(self) -> crate::api::error::NodeException { +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::graph::NodeId {} +impl flutter_rust_bridge::IntoIntoDart for crate::api::graph::NodeId { + fn into_into_dart(self) -> crate::api::graph::NodeId { self } } @@ -3671,6 +4859,30 @@ impl flutter_rust_bridge::IntoIntoDart } } // Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::bolt12::Offer { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.s.into_into_dart().into_dart()].into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::bolt12::Offer {} +impl flutter_rust_bridge::IntoIntoDart for crate::api::bolt12::Offer { + fn into_into_dart(self) -> crate::api::bolt12::Offer { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::OfferId { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.0.into_into_dart().into_dart()].into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::OfferId {} +impl flutter_rust_bridge::IntoIntoDart for crate::api::types::OfferId { + fn into_into_dart(self) -> crate::api::types::OfferId { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs impl flutter_rust_bridge::IntoDart for crate::api::types::OutPoint { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { [ @@ -3718,6 +4930,7 @@ impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentDirection { match self { Self::Inbound => 0.into_dart(), Self::Outbound => 1.into_dart(), + _ => unreachable!(), } } } @@ -3742,6 +4955,7 @@ impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentFailureReason { Self::PaymentExpired => 3.into_dart(), Self::RouteNotFound => 4.into_dart(), Self::UnexpectedError => 5.into_dart(), + _ => unreachable!(), } } } @@ -3822,6 +5036,33 @@ impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentKind { preimage.into_into_dart().into_dart(), ] .into_dart(), + crate::api::types::PaymentKind::Bolt12Offer { + hash, + preimage, + secret, + offer_id, + } => [ + 4.into_dart(), + hash.into_into_dart().into_dart(), + preimage.into_into_dart().into_dart(), + secret.into_into_dart().into_dart(), + offer_id.into_into_dart().into_dart(), + ] + .into_dart(), + crate::api::types::PaymentKind::Bolt12Refund { + hash, + preimage, + secret, + } => [ + 5.into_dart(), + hash.into_into_dart().into_dart(), + preimage.into_into_dart().into_dart(), + secret.into_into_dart().into_dart(), + ] + .into_dart(), + _ => { + unimplemented!(""); + } } } } @@ -3877,6 +5118,7 @@ impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentStatus { Self::Pending => 0.into_dart(), Self::Succeeded => 1.into_dart(), Self::Failed => 2.into_dart(), + _ => unreachable!(), } } } @@ -3954,6 +5196,9 @@ impl flutter_rust_bridge::IntoDart for crate::api::types::PendingSweepBalance { amount_satoshis.into_into_dart().into_dart(), ] .into_dart(), + _ => { + unimplemented!(""); + } } } } @@ -3983,6 +5228,39 @@ impl flutter_rust_bridge::IntoIntoDart } } // Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::bolt12::Refund { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.s.into_into_dart().into_dart()].into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::bolt12::Refund {} +impl flutter_rust_bridge::IntoIntoDart for crate::api::bolt12::Refund { + fn into_into_dart(self) -> crate::api::bolt12::Refund { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::graph::RoutingFees { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [ + self.base_msat.into_into_dart().into_dart(), + self.proportional_millionths.into_into_dart().into_dart(), + ] + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::graph::RoutingFees +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::graph::RoutingFees +{ + fn into_into_dart(self) -> crate::api::graph::RoutingFees { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs impl flutter_rust_bridge::IntoDart for crate::api::types::SocketAddress { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { match self { @@ -4020,6 +5298,9 @@ impl flutter_rust_bridge::IntoDart for crate::api::types::SocketAddress { port.into_into_dart().into_dart(), ] .into_dart(), + _ => { + unimplemented!(""); + } } } } @@ -4067,7 +5348,16 @@ impl flutter_rust_bridge::IntoIntoDart impl SseEncode for NodeBuilder { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - >>::sse_encode(flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self), serializer); + >>::sse_encode(flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self), serializer); + } +} + +impl SseEncode for RustOpaqueNom> { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); } } @@ -4081,7 +5371,7 @@ impl SseEncode for RustOpaqueNom { } impl SseEncode - for RustOpaqueNom> + for RustOpaqueNom> { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -4091,6 +5381,24 @@ impl SseEncode } } +impl SseEncode for RustOpaqueNom { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode for RustOpaqueNom { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + impl SseEncode for RustOpaqueNom { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -4132,6 +5440,14 @@ impl SseEncode for crate::api::types::Address { } } +impl SseEncode for crate::api::types::AnchorChannelsConfig { + // 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.trusted_peers_no_reserve, serializer); + ::sse_encode(self.per_channel_reserve_sats, serializer); + } +} + 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) { @@ -4154,44 +5470,57 @@ impl SseEncode for crate::api::types::BestBlock { } } -impl SseEncode for crate::api::types::Bolt11Invoice { +impl SseEncode for crate::api::bolt11::Bolt11Invoice { // 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.signed_raw_invoice, serializer); } } -impl SseEncode for bool { +impl SseEncode for crate::api::bolt12::Bolt12Invoice { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - serializer.cursor.write_u8(self as _).unwrap(); + >::sse_encode(self.data, serializer); } } -impl SseEncode for crate::api::error::BuilderException { +impl SseEncode for crate::utils::error::Bolt12ParseError { // 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::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::InvalidPublicKey => 12, - _ => { - unimplemented!(""); - } - }, - serializer, - ); + match self { + crate::utils::error::Bolt12ParseError::InvalidContinuation => { + ::sse_encode(0, serializer); + } + crate::utils::error::Bolt12ParseError::InvalidBech32Hrp => { + ::sse_encode(1, serializer); + } + crate::utils::error::Bolt12ParseError::Bech32(field0) => { + ::sse_encode(2, serializer); + ::sse_encode(field0, serializer); + } + crate::utils::error::Bolt12ParseError::Decode(field0) => { + ::sse_encode(3, serializer); + ::sse_encode(field0, serializer); + } + crate::utils::error::Bolt12ParseError::InvalidSemantics(field0) => { + ::sse_encode(4, serializer); + ::sse_encode(field0, serializer); + } + crate::utils::error::Bolt12ParseError::InvalidSignature(field0) => { + ::sse_encode(5, serializer); + ::sse_encode(field0, serializer); + } + _ => { + unimplemented!(""); + } + } + } +} + +impl SseEncode for bool { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + serializer.cursor.write_u8(self as _).unwrap(); } } @@ -4203,6 +5532,9 @@ impl SseEncode for crate::api::types::ChainDataSourceConfig { ::sse_encode(0, serializer); ::sse_encode(field0, serializer); } + _ => { + unimplemented!(""); + } } } } @@ -4269,6 +5601,29 @@ impl SseEncode for crate::api::types::ChannelId { } } +impl SseEncode for crate::api::graph::ChannelInfo { + // 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.node_one, serializer); + >::sse_encode(self.one_to_two, serializer); + ::sse_encode(self.node_two, serializer); + >::sse_encode(self.two_to_one, serializer); + >::sse_encode(self.capacity_sats, serializer); + } +} + +impl SseEncode for crate::api::graph::ChannelUpdateInfo { + // 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.last_update, serializer); + ::sse_encode(self.enabled, serializer); + ::sse_encode(self.cltv_expiry_delta, serializer); + ::sse_encode(self.htlc_minimum_msat, serializer); + ::sse_encode(self.htlc_maximum_msat, serializer); + ::sse_encode(self.fees, serializer); + } +} + 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) { @@ -4314,30 +5669,73 @@ impl SseEncode for crate::api::types::ClosureReason { crate::api::types::ClosureReason::HTLCsTimedOut => { ::sse_encode(12, serializer); } + _ => { + unimplemented!(""); + } + } + } +} + +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) { + ::sse_encode(self.storage_dir_path, serializer); + >::sse_encode(self.log_dir_path, serializer); + ::sse_encode(self.network, serializer); + >>::sse_encode( + self.listening_addresses, + serializer, + ); + ::sse_encode(self.default_cltv_expiry_delta, serializer); + ::sse_encode(self.onchain_wallet_sync_interval_secs, serializer); + ::sse_encode(self.wallet_sync_interval_secs, serializer); + ::sse_encode(self.fee_rate_cache_update_interval_secs, serializer); + >::sse_encode(self.trusted_peers_0conf, serializer); + ::sse_encode(self.probing_liquidity_limit_multiplier, serializer); + ::sse_encode(self.log_level, serializer); + >::sse_encode( + self.anchor_channels_config, + serializer, + ); + } +} + +impl SseEncode for crate::utils::error::DecodeError { + // 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::utils::error::DecodeError::UnknownVersion => { + ::sse_encode(0, serializer); + } + crate::utils::error::DecodeError::UnknownRequiredFeature => { + ::sse_encode(1, serializer); + } + crate::utils::error::DecodeError::InvalidValue => { + ::sse_encode(2, serializer); + } + crate::utils::error::DecodeError::ShortRead => { + ::sse_encode(3, serializer); + } + crate::utils::error::DecodeError::BadLengthDescriptor => { + ::sse_encode(4, serializer); + } + crate::utils::error::DecodeError::Io(field0) => { + ::sse_encode(5, serializer); + ::sse_encode(field0, serializer); + } + crate::utils::error::DecodeError::UnsupportedCompression => { + ::sse_encode(6, serializer); + } + crate::utils::error::DecodeError::DangerousValue => { + ::sse_encode(7, serializer); + } + _ => { + unimplemented!(""); + } } } } -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) { - ::sse_encode(self.storage_dir_path, serializer); - >::sse_encode(self.log_dir_path, serializer); - ::sse_encode(self.network, serializer); - >>::sse_encode( - self.listening_addresses, - serializer, - ); - ::sse_encode(self.default_cltv_expiry_delta, serializer); - ::sse_encode(self.onchain_wallet_sync_interval_secs, serializer); - ::sse_encode(self.wallet_sync_interval_secs, serializer); - ::sse_encode(self.fee_rate_cache_update_interval_secs, serializer); - >::sse_encode(self.trusted_peers_0conf, serializer); - ::sse_encode(self.probing_liquidity_limit_multiplier, serializer); - ::sse_encode(self.log_level, serializer); - } -} - impl SseEncode for crate::api::types::EntropySourceConfig { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -4355,9 +5753,12 @@ impl SseEncode for crate::api::types::EntropySourceConfig { passphrase, } => { ::sse_encode(2, serializer); - ::sse_encode(mnemonic, serializer); + ::sse_encode(mnemonic, serializer); >::sse_encode(passphrase, serializer); } + _ => { + unimplemented!(""); + } } } } @@ -4366,12 +5767,24 @@ 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::PaymentClaimable { + payment_id, + payment_hash, + claimable_amount_msat, + claim_deadline, + } => { + ::sse_encode(0, serializer); + ::sse_encode(payment_id, serializer); + ::sse_encode(payment_hash, serializer); + ::sse_encode(claimable_amount_msat, serializer); + >::sse_encode(claim_deadline, serializer); + } crate::api::types::Event::PaymentSuccessful { payment_id, payment_hash, fee_paid_msat, } => { - ::sse_encode(0, serializer); + ::sse_encode(1, serializer); >::sse_encode(payment_id, serializer); ::sse_encode(payment_hash, serializer); >::sse_encode(fee_paid_msat, serializer); @@ -4381,7 +5794,7 @@ impl SseEncode for crate::api::types::Event { payment_hash, reason, } => { - ::sse_encode(1, serializer); + ::sse_encode(2, serializer); >::sse_encode(payment_id, serializer); ::sse_encode(payment_hash, serializer); >::sse_encode(reason, serializer); @@ -4391,7 +5804,7 @@ impl SseEncode for crate::api::types::Event { payment_hash, amount_msat, } => { - ::sse_encode(2, serializer); + ::sse_encode(3, serializer); >::sse_encode(payment_id, serializer); ::sse_encode(payment_hash, serializer); ::sse_encode(amount_msat, serializer); @@ -4403,7 +5816,7 @@ impl SseEncode for crate::api::types::Event { counterparty_node_id, funding_txo, } => { - ::sse_encode(3, serializer); + ::sse_encode(4, serializer); ::sse_encode(channel_id, serializer); ::sse_encode(user_channel_id, serializer); ::sse_encode(former_temporary_channel_id, serializer); @@ -4415,7 +5828,7 @@ impl SseEncode for crate::api::types::Event { user_channel_id, counterparty_node_id, } => { - ::sse_encode(4, serializer); + ::sse_encode(5, serializer); ::sse_encode(channel_id, serializer); ::sse_encode(user_channel_id, serializer); >::sse_encode( @@ -4429,7 +5842,7 @@ impl SseEncode for crate::api::types::Event { counterparty_node_id, reason, } => { - ::sse_encode(5, serializer); + ::sse_encode(6, serializer); ::sse_encode(channel_id, serializer); ::sse_encode(user_channel_id, serializer); >::sse_encode( @@ -4438,6 +5851,9 @@ impl SseEncode for crate::api::types::Event { ); >::sse_encode(reason, serializer); } + _ => { + unimplemented!(""); + } } } } @@ -4453,6 +5869,9 @@ impl SseEncode for crate::api::types::GossipSourceConfig { ::sse_encode(1, serializer); ::sse_encode(field0, serializer); } + _ => { + unimplemented!(""); + } } } } @@ -4464,20 +5883,61 @@ impl SseEncode for i32 { } } -impl SseEncode for crate::api::node::LdkBolt11Payment { +impl SseEncode for crate::api::bolt11::LdkBolt11Payment { // 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::node::LdkMnemonic { +impl SseEncode for crate::api::bolt12::LdkBolt12Payment { + // 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::utils::error::LdkBuilderError { + // 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::utils::error::LdkBuilderError::SocketAddressParseError => 0, + crate::utils::error::LdkBuilderError::InvalidSeedBytes => 1, + crate::utils::error::LdkBuilderError::InvalidSeedFile => 2, + crate::utils::error::LdkBuilderError::InvalidSystemTime => 3, + crate::utils::error::LdkBuilderError::InvalidChannelMonitor => 4, + crate::utils::error::LdkBuilderError::InvalidListeningAddress => 5, + crate::utils::error::LdkBuilderError::ReadFailed => 6, + crate::utils::error::LdkBuilderError::WriteFailed => 7, + crate::utils::error::LdkBuilderError::StoragePathAccessFailed => 8, + crate::utils::error::LdkBuilderError::KVStoreSetupFailed => 9, + crate::utils::error::LdkBuilderError::WalletSetupFailed => 10, + crate::utils::error::LdkBuilderError::LoggerSetupFailed => 11, + crate::utils::error::LdkBuilderError::InvalidPublicKey => 12, + _ => { + unimplemented!(""); + } + }, + serializer, + ); + } +} + +impl SseEncode for crate::api::builder::LdkMnemonic { // 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::graph::LdkNetworkGraph { + // 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.inner, serializer); + } +} + 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) { @@ -4485,14 +5945,174 @@ impl SseEncode for crate::api::node::LdkNode { } } -impl SseEncode for crate::api::node::LdkOnChainPayment { +impl SseEncode for crate::utils::error::LdkNodeError { + // 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::utils::error::LdkNodeError::InvalidTxid => { + ::sse_encode(0, serializer); + } + crate::utils::error::LdkNodeError::AlreadyRunning => { + ::sse_encode(1, serializer); + } + crate::utils::error::LdkNodeError::NotRunning => { + ::sse_encode(2, serializer); + } + crate::utils::error::LdkNodeError::OnchainTxCreationFailed => { + ::sse_encode(3, serializer); + } + crate::utils::error::LdkNodeError::ConnectionFailed => { + ::sse_encode(4, serializer); + } + crate::utils::error::LdkNodeError::InvoiceCreationFailed => { + ::sse_encode(5, serializer); + } + crate::utils::error::LdkNodeError::PaymentSendingFailed => { + ::sse_encode(6, serializer); + } + crate::utils::error::LdkNodeError::ProbeSendingFailed => { + ::sse_encode(7, serializer); + } + crate::utils::error::LdkNodeError::ChannelCreationFailed => { + ::sse_encode(8, serializer); + } + crate::utils::error::LdkNodeError::ChannelClosingFailed => { + ::sse_encode(9, serializer); + } + crate::utils::error::LdkNodeError::ChannelConfigUpdateFailed => { + ::sse_encode(10, serializer); + } + crate::utils::error::LdkNodeError::PersistenceFailed => { + ::sse_encode(11, serializer); + } + crate::utils::error::LdkNodeError::WalletOperationFailed => { + ::sse_encode(12, serializer); + } + crate::utils::error::LdkNodeError::OnchainTxSigningFailed => { + ::sse_encode(13, serializer); + } + crate::utils::error::LdkNodeError::MessageSigningFailed => { + ::sse_encode(14, serializer); + } + crate::utils::error::LdkNodeError::TxSyncFailed => { + ::sse_encode(15, serializer); + } + crate::utils::error::LdkNodeError::GossipUpdateFailed => { + ::sse_encode(16, serializer); + } + crate::utils::error::LdkNodeError::InvalidAddress => { + ::sse_encode(17, serializer); + } + crate::utils::error::LdkNodeError::InvalidSocketAddress => { + ::sse_encode(18, serializer); + } + crate::utils::error::LdkNodeError::InvalidPublicKey => { + ::sse_encode(19, serializer); + } + crate::utils::error::LdkNodeError::InvalidSecretKey => { + ::sse_encode(20, serializer); + } + crate::utils::error::LdkNodeError::InvalidPaymentHash => { + ::sse_encode(21, serializer); + } + crate::utils::error::LdkNodeError::InvalidPaymentPreimage => { + ::sse_encode(22, serializer); + } + crate::utils::error::LdkNodeError::InvalidPaymentSecret => { + ::sse_encode(23, serializer); + } + crate::utils::error::LdkNodeError::InvalidAmount => { + ::sse_encode(24, serializer); + } + crate::utils::error::LdkNodeError::InvalidInvoice => { + ::sse_encode(25, serializer); + } + crate::utils::error::LdkNodeError::InvalidChannelId => { + ::sse_encode(26, serializer); + } + crate::utils::error::LdkNodeError::InvalidNetwork => { + ::sse_encode(27, serializer); + } + crate::utils::error::LdkNodeError::DuplicatePayment => { + ::sse_encode(28, serializer); + } + crate::utils::error::LdkNodeError::InsufficientFunds => { + ::sse_encode(29, serializer); + } + crate::utils::error::LdkNodeError::FeerateEstimationUpdateFailed => { + ::sse_encode(30, serializer); + } + crate::utils::error::LdkNodeError::LiquidityRequestFailed => { + ::sse_encode(31, serializer); + } + crate::utils::error::LdkNodeError::LiquiditySourceUnavailable => { + ::sse_encode(32, serializer); + } + crate::utils::error::LdkNodeError::LiquidityFeeTooHigh => { + ::sse_encode(33, serializer); + } + crate::utils::error::LdkNodeError::InvalidPaymentId => { + ::sse_encode(34, serializer); + } + crate::utils::error::LdkNodeError::Decode(field0) => { + ::sse_encode(35, serializer); + ::sse_encode(field0, serializer); + } + crate::utils::error::LdkNodeError::Bolt12Parse(field0) => { + ::sse_encode(36, serializer); + ::sse_encode(field0, serializer); + } + crate::utils::error::LdkNodeError::InvoiceRequestCreationFailed => { + ::sse_encode(37, serializer); + } + crate::utils::error::LdkNodeError::OfferCreationFailed => { + ::sse_encode(38, serializer); + } + crate::utils::error::LdkNodeError::RefundCreationFailed => { + ::sse_encode(39, serializer); + } + crate::utils::error::LdkNodeError::FeerateEstimationUpdateTimeout => { + ::sse_encode(40, serializer); + } + crate::utils::error::LdkNodeError::WalletOperationTimeout => { + ::sse_encode(41, serializer); + } + crate::utils::error::LdkNodeError::TxSyncTimeout => { + ::sse_encode(42, serializer); + } + crate::utils::error::LdkNodeError::GossipUpdateTimeout => { + ::sse_encode(43, serializer); + } + crate::utils::error::LdkNodeError::InvalidOfferId => { + ::sse_encode(44, serializer); + } + crate::utils::error::LdkNodeError::InvalidNodeId => { + ::sse_encode(45, serializer); + } + crate::utils::error::LdkNodeError::InvalidOffer => { + ::sse_encode(46, serializer); + } + crate::utils::error::LdkNodeError::InvalidRefund => { + ::sse_encode(47, serializer); + } + crate::utils::error::LdkNodeError::UnsupportedCurrency => { + ::sse_encode(48, serializer); + } + _ => { + unimplemented!(""); + } + } + } +} + +impl SseEncode for crate::api::on_chain::LdkOnChainPayment { // 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::node::LdkSpontaneousPayment { +impl SseEncode for crate::api::spontaneous::LdkSpontaneousPayment { // 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); @@ -4579,6 +6199,9 @@ impl SseEncode for crate::api::types::LightningBalance { ::sse_encode(counterparty_node_id, serializer); ::sse_encode(amount_satoshis, serializer); } + _ => { + unimplemented!(""); + } } } } @@ -4614,6 +6237,16 @@ 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) { @@ -4644,6 +6277,16 @@ 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) { @@ -4714,6 +6357,9 @@ impl SseEncode for crate::api::types::MaxDustHTLCExposure { ::sse_encode(1, serializer); ::sse_encode(field0, serializer); } + _ => { + unimplemented!(""); + } } } } @@ -4736,53 +6382,10 @@ impl SseEncode for crate::api::types::Network { } } -impl SseEncode for crate::api::error::NodeException { +impl SseEncode for crate::api::graph::NodeId { // 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::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, - crate::api::error::NodeException::LiquidityRequestFailed => 31, - crate::api::error::NodeException::LiquiditySourceUnavailable => 32, - crate::api::error::NodeException::LiquidityFeeTooHigh => 33, - crate::api::error::NodeException::InvalidPaymentId => 34, - crate::api::error::NodeException::DecodeError => 35, - _ => { - unimplemented!(""); - } - }, - serializer, - ); + >::sse_encode(self.compressed, serializer); } } @@ -4803,6 +6406,20 @@ impl SseEncode for crate::api::types::NodeStatus { } } +impl SseEncode for crate::api::bolt12::Offer { + // 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.s, serializer); + } +} + +impl SseEncode for crate::api::types::OfferId { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + <[u8; 32]>::sse_encode(self.0, 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) { @@ -4813,6 +6430,16 @@ 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) { @@ -4843,6 +6470,26 @@ 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) { @@ -4933,6 +6580,16 @@ 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) { @@ -5116,6 +6773,31 @@ impl SseEncode for crate::api::types::PaymentKind { ::sse_encode(hash, serializer); >::sse_encode(preimage, serializer); } + crate::api::types::PaymentKind::Bolt12Offer { + hash, + preimage, + secret, + offer_id, + } => { + ::sse_encode(4, serializer); + >::sse_encode(hash, serializer); + >::sse_encode(preimage, serializer); + >::sse_encode(secret, serializer); + ::sse_encode(offer_id, serializer); + } + crate::api::types::PaymentKind::Bolt12Refund { + hash, + preimage, + secret, + } => { + ::sse_encode(5, serializer); + >::sse_encode(hash, serializer); + >::sse_encode(preimage, serializer); + >::sse_encode(secret, serializer); + } + _ => { + unimplemented!(""); + } } } } @@ -5198,6 +6880,9 @@ impl SseEncode for crate::api::types::PendingSweepBalance { ::sse_encode(confirmation_height, serializer); ::sse_encode(amount_satoshis, serializer); } + _ => { + unimplemented!(""); + } } } } @@ -5224,6 +6909,21 @@ impl SseEncode } } +impl SseEncode for crate::api::bolt12::Refund { + // 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.s, serializer); + } +} + +impl SseEncode for crate::api::graph::RoutingFees { + // 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.base_msat, serializer); + ::sse_encode(self.proportional_millionths, serializer); + } +} + impl SseEncode for crate::api::types::SocketAddress { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -5259,6 +6959,9 @@ impl SseEncode for crate::api::types::SocketAddress { ::sse_encode(addr, serializer); ::sse_encode(port, serializer); } + _ => { + unimplemented!(""); + } } } } @@ -5390,10 +7093,3 @@ impl SseEncode for usize { mod io; #[cfg(not(target_family = "wasm"))] pub use io::*; - -/// cbindgen:ignore -#[cfg(target_family = "wasm")] -#[path = "frb_generated.web.rs"] -mod web; -#[cfg(target_family = "wasm")] -pub use web::*; diff --git a/rust/src/frb_generated.web.rs b/rust/src/frb_generated.web.rs index 9a02f7d..e91baec 100644 --- a/rust/src/frb_generated.web.rs +++ b/rust/src/frb_generated.web.rs @@ -1,14 +1,16 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. +// Generated by `flutter_rust_bridge`@ 2.0.0. // Section: imports use super::*; +use crate::api::builder::*; use crate::api::node::*; +use crate::*; use flutter_rust_bridge::for_generated::byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt}; -use flutter_rust_bridge::for_generated::transform_result_dco; use flutter_rust_bridge::for_generated::wasm_bindgen; use flutter_rust_bridge::for_generated::wasm_bindgen::prelude::*; +use flutter_rust_bridge::for_generated::{transform_result_dco, Lifetimeable, Lockable}; use flutter_rust_bridge::{Handler, IntoIntoDart}; // Section: boilerplate @@ -42,6 +44,26 @@ 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::AnchorChannelsConfig { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 2, + "Expected 2 elements, got {}", + self_.length() + ); + crate::api::types::AnchorChannelsConfig { + trusted_peers_no_reserve: self_.get(0).cst_decode(), + per_channel_reserve_sats: self_.get(1).cst_decode(), + } + } +} impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { @@ -104,6 +126,23 @@ 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::utils::error::Bolt12ParseError { + let self_ = self.unchecked_into::(); + match self_.get(0).unchecked_into_f64() as _ { + 0 => crate::utils::error::Bolt12ParseError::InvalidContinuation, + 1 => crate::utils::error::Bolt12ParseError::InvalidBech32Hrp, + 2 => crate::utils::error::Bolt12ParseError::Bech32(self_.get(1).cst_decode()), + 3 => crate::utils::error::Bolt12ParseError::Decode(self_.get(1).cst_decode()), + 4 => crate::utils::error::Bolt12ParseError::InvalidSemantics(self_.get(1).cst_decode()), + 5 => crate::utils::error::Bolt12ParseError::InvalidSignature(self_.get(1).cst_decode()), + _ => unreachable!(), + } + } +} impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { @@ -205,6 +244,53 @@ 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::graph::ChannelInfo { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 5, + "Expected 5 elements, got {}", + self_.length() + ); + crate::api::graph::ChannelInfo { + node_one: self_.get(0).cst_decode(), + one_to_two: self_.get(1).cst_decode(), + node_two: self_.get(2).cst_decode(), + two_to_one: self_.get(3).cst_decode(), + capacity_sats: 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::graph::ChannelUpdateInfo { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 6, + "Expected 6 elements, got {}", + self_.length() + ); + crate::api::graph::ChannelUpdateInfo { + last_update: self_.get(0).cst_decode(), + enabled: self_.get(1).cst_decode(), + cltv_expiry_delta: self_.get(2).cst_decode(), + htlc_minimum_msat: self_.get(3).cst_decode(), + htlc_maximum_msat: self_.get(4).cst_decode(), + fees: self_.get(5).cst_decode(), + } + } +} impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { @@ -243,8 +329,8 @@ impl CstDecode .unwrap(); assert_eq!( self_.length(), - 11, - "Expected 11 elements, got {}", + 12, + "Expected 12 elements, got {}", self_.length() ); crate::api::types::Config { @@ -259,6 +345,26 @@ impl CstDecode trusted_peers_0conf: self_.get(8).cst_decode(), probing_liquidity_limit_multiplier: self_.get(9).cst_decode(), log_level: self_.get(10).cst_decode(), + anchor_channels_config: self_.get(11).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::utils::error::DecodeError { + let self_ = self.unchecked_into::(); + match self_.get(0).unchecked_into_f64() as _ { + 0 => crate::utils::error::DecodeError::UnknownVersion, + 1 => crate::utils::error::DecodeError::UnknownRequiredFeature, + 2 => crate::utils::error::DecodeError::InvalidValue, + 3 => crate::utils::error::DecodeError::ShortRead, + 4 => crate::utils::error::DecodeError::BadLengthDescriptor, + 5 => crate::utils::error::DecodeError::Io(self_.get(1).cst_decode()), + 6 => crate::utils::error::DecodeError::UnsupportedCompression, + 7 => crate::utils::error::DecodeError::DangerousValue, + _ => unreachable!(), } } } @@ -286,34 +392,40 @@ impl CstDecode fn cst_decode(self) -> crate::api::types::Event { let self_ = self.unchecked_into::(); match self_.get(0).unchecked_into_f64() as _ { - 0 => crate::api::types::Event::PaymentSuccessful { + 0 => crate::api::types::Event::PaymentClaimable { + payment_id: self_.get(1).cst_decode(), + payment_hash: self_.get(2).cst_decode(), + claimable_amount_msat: self_.get(3).cst_decode(), + claim_deadline: self_.get(4).cst_decode(), + }, + 1 => crate::api::types::Event::PaymentSuccessful { payment_id: self_.get(1).cst_decode(), payment_hash: self_.get(2).cst_decode(), fee_paid_msat: self_.get(3).cst_decode(), }, - 1 => crate::api::types::Event::PaymentFailed { + 2 => crate::api::types::Event::PaymentFailed { payment_id: self_.get(1).cst_decode(), payment_hash: self_.get(2).cst_decode(), reason: self_.get(3).cst_decode(), }, - 2 => crate::api::types::Event::PaymentReceived { + 3 => crate::api::types::Event::PaymentReceived { payment_id: self_.get(1).cst_decode(), payment_hash: self_.get(2).cst_decode(), amount_msat: self_.get(3).cst_decode(), }, - 3 => crate::api::types::Event::ChannelPending { + 4 => crate::api::types::Event::ChannelPending { 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(), }, - 4 => crate::api::types::Event::ChannelReady { + 5 => crate::api::types::Event::ChannelReady { 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 { + 6 => 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(), @@ -336,11 +448,11 @@ 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::node::LdkBolt11Payment { + fn cst_decode(self) -> crate::api::bolt11::LdkBolt11Payment { let self_ = self .dyn_into::() .unwrap(); @@ -350,16 +462,16 @@ impl CstDecode "Expected 1 elements, got {}", self_.length() ); - crate::api::node::LdkBolt11Payment { + crate::api::bolt11::LdkBolt11Payment { ptr: 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::node::LdkMnemonic { + fn cst_decode(self) -> crate::api::bolt12::LdkBolt12Payment { let self_ = self .dyn_into::() .unwrap(); @@ -369,11 +481,49 @@ impl CstDecode "Expected 1 elements, got {}", self_.length() ); - crate::api::node::LdkMnemonic { + crate::api::bolt12::LdkBolt12Payment { + 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::builder::LdkMnemonic { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 1, + "Expected 1 elements, got {}", + self_.length() + ); + crate::api::builder::LdkMnemonic { 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::graph::LdkNetworkGraph { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 1, + "Expected 1 elements, got {}", + self_.length() + ); + crate::api::graph::LdkNetworkGraph { + inner: self_.get(0).cst_decode(), + } + } +} impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { @@ -393,11 +543,71 @@ 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::node::LdkOnChainPayment { + fn cst_decode(self) -> crate::utils::error::LdkNodeError { + let self_ = self.unchecked_into::(); + match self_.get(0).unchecked_into_f64() as _ { + 0 => crate::utils::error::LdkNodeError::InvalidTxid, + 1 => crate::utils::error::LdkNodeError::AlreadyRunning, + 2 => crate::utils::error::LdkNodeError::NotRunning, + 3 => crate::utils::error::LdkNodeError::OnchainTxCreationFailed, + 4 => crate::utils::error::LdkNodeError::ConnectionFailed, + 5 => crate::utils::error::LdkNodeError::InvoiceCreationFailed, + 6 => crate::utils::error::LdkNodeError::PaymentSendingFailed, + 7 => crate::utils::error::LdkNodeError::ProbeSendingFailed, + 8 => crate::utils::error::LdkNodeError::ChannelCreationFailed, + 9 => crate::utils::error::LdkNodeError::ChannelClosingFailed, + 10 => crate::utils::error::LdkNodeError::ChannelConfigUpdateFailed, + 11 => crate::utils::error::LdkNodeError::PersistenceFailed, + 12 => crate::utils::error::LdkNodeError::WalletOperationFailed, + 13 => crate::utils::error::LdkNodeError::OnchainTxSigningFailed, + 14 => crate::utils::error::LdkNodeError::MessageSigningFailed, + 15 => crate::utils::error::LdkNodeError::TxSyncFailed, + 16 => crate::utils::error::LdkNodeError::GossipUpdateFailed, + 17 => crate::utils::error::LdkNodeError::InvalidAddress, + 18 => crate::utils::error::LdkNodeError::InvalidSocketAddress, + 19 => crate::utils::error::LdkNodeError::InvalidPublicKey, + 20 => crate::utils::error::LdkNodeError::InvalidSecretKey, + 21 => crate::utils::error::LdkNodeError::InvalidPaymentHash, + 22 => crate::utils::error::LdkNodeError::InvalidPaymentPreimage, + 23 => crate::utils::error::LdkNodeError::InvalidPaymentSecret, + 24 => crate::utils::error::LdkNodeError::InvalidAmount, + 25 => crate::utils::error::LdkNodeError::InvalidInvoice, + 26 => crate::utils::error::LdkNodeError::InvalidChannelId, + 27 => crate::utils::error::LdkNodeError::InvalidNetwork, + 28 => crate::utils::error::LdkNodeError::DuplicatePayment, + 29 => crate::utils::error::LdkNodeError::InsufficientFunds, + 30 => crate::utils::error::LdkNodeError::FeerateEstimationUpdateFailed, + 31 => crate::utils::error::LdkNodeError::LiquidityRequestFailed, + 32 => crate::utils::error::LdkNodeError::LiquiditySourceUnavailable, + 33 => crate::utils::error::LdkNodeError::LiquidityFeeTooHigh, + 34 => crate::utils::error::LdkNodeError::InvalidPaymentId, + 35 => crate::utils::error::LdkNodeError::Decode(self_.get(1).cst_decode()), + 36 => crate::utils::error::LdkNodeError::Bolt12Parse(self_.get(1).cst_decode()), + 37 => crate::utils::error::LdkNodeError::InvoiceRequestCreationFailed, + 38 => crate::utils::error::LdkNodeError::OfferCreationFailed, + 39 => crate::utils::error::LdkNodeError::RefundCreationFailed, + 40 => crate::utils::error::LdkNodeError::FeerateEstimationUpdateTimeout, + 41 => crate::utils::error::LdkNodeError::WalletOperationTimeout, + 42 => crate::utils::error::LdkNodeError::TxSyncTimeout, + 43 => crate::utils::error::LdkNodeError::GossipUpdateTimeout, + 44 => crate::utils::error::LdkNodeError::InvalidOfferId, + 45 => crate::utils::error::LdkNodeError::InvalidNodeId, + 46 => crate::utils::error::LdkNodeError::InvalidOffer, + 47 => crate::utils::error::LdkNodeError::InvalidRefund, + 48 => crate::utils::error::LdkNodeError::UnsupportedCurrency, + _ => unreachable!(), + } + } +} +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::on_chain::LdkOnChainPayment { let self_ = self .dyn_into::() .unwrap(); @@ -407,16 +617,16 @@ impl CstDecode "Expected 1 elements, got {}", self_.length() ); - crate::api::node::LdkOnChainPayment { + crate::api::on_chain::LdkOnChainPayment { ptr: 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::node::LdkSpontaneousPayment { + fn cst_decode(self) -> crate::api::spontaneous::LdkSpontaneousPayment { let self_ = self .dyn_into::() .unwrap(); @@ -426,7 +636,7 @@ impl CstDecode "Expected 1 elements, got {}", self_.length() ); - crate::api::node::LdkSpontaneousPayment { + crate::api::spontaneous::LdkSpontaneousPayment { ptr: self_.get(0).cst_decode(), } } @@ -523,6 +733,18 @@ 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 { @@ -559,6 +781,12 @@ impl CstDecode> .collect() } } +impl CstDecode> for Box<[u64]> { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Vec { + self.into_vec() + } +} impl CstDecode> for Box<[u8]> { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> Vec { @@ -624,6 +852,25 @@ 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::graph::NodeId { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 1, + "Expected 1 elements, got {}", + self_.length() + ); + crate::api::graph::NodeId { + compressed: self_.get(0).cst_decode(), + } + } +} impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { @@ -650,6 +897,23 @@ 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::OfferId { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 1, + "Expected 1 elements, got {}", + self_.length() + ); + crate::api::types::OfferId(self_.get(0).cst_decode()) + } +} impl CstDecode> for Option { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> Option { @@ -758,6 +1022,17 @@ impl CstDecode hash: self_.get(1).cst_decode(), preimage: self_.get(2).cst_decode(), }, + 4 => crate::api::types::PaymentKind::Bolt12Offer { + hash: self_.get(1).cst_decode(), + preimage: self_.get(2).cst_decode(), + secret: self_.get(3).cst_decode(), + offer_id: self_.get(4).cst_decode(), + }, + 5 => crate::api::types::PaymentKind::Bolt12Refund { + hash: self_.get(1).cst_decode(), + preimage: self_.get(2).cst_decode(), + secret: self_.get(3).cst_decode(), + }, _ => unreachable!(), } } @@ -899,6 +1174,26 @@ impl ) } } +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::graph::RoutingFees { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 2, + "Expected 2 elements, got {}", + self_.length() + ); + crate::api::graph::RoutingFees { + base_msat: self_.get(0).cst_decode(), + proportional_millionths: self_.get(1).cst_decode(), + } + } +} impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { @@ -1005,10 +1300,23 @@ 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) -> NodeBuilder { - CstDecode::< - RustOpaqueNom>, - >::cst_decode(self) - .rust_auto_opaque_decode_owned() + flutter_rust_bridge::for_generated::rust_auto_opaque_decode_owned(CstDecode::< + RustOpaqueNom>, + >::cst_decode( + self + )) + } +} +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) -> RustOpaqueNom> { + #[cfg(target_pointer_width = "64")] + { + compile_error!("64-bit pointers are not supported."); + } + unsafe { decode_rust_opaque_nom((self.as_f64().unwrap() as usize) as _) } } } impl CstDecode> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { @@ -1021,13 +1329,37 @@ impl CstDecode> for flutter_rust_bridge::for_generated::wasm unsafe { decode_rust_opaque_nom((self.as_f64().unwrap() as usize) as _) } } } -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, - ) -> RustOpaqueNom> { + ) -> RustOpaqueNom> { + #[cfg(target_pointer_width = "64")] + { + compile_error!("64-bit pointers are not supported."); + } + unsafe { decode_rust_opaque_nom((self.as_f64().unwrap() as usize) as _) } + } +} +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) -> RustOpaqueNom { + #[cfg(target_pointer_width = "64")] + { + compile_error!("64-bit pointers are not supported."); + } + unsafe { decode_rust_opaque_nom((self.as_f64().unwrap() as usize) as _) } + } +} +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) -> RustOpaqueNom { #[cfg(target_pointer_width = "64")] { compile_error!("64-bit pointers are not supported."); @@ -1083,18 +1415,28 @@ 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) -> i32 { + self.unchecked_into_f64() as _ + } +} +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::BuilderException { + fn cst_decode(self) -> crate::utils::error::LdkBuilderError { (self.unchecked_into_f64() as i32).cst_decode() } } -impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { +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) -> i32 { - self.unchecked_into_f64() as _ + fn cst_decode(self) -> Vec { + let buf = self + .dyn_into::() + .unwrap(); + let buf = flutter_rust_bridge::for_generated::js_sys::Uint8Array::new(&buf.buffer()); + flutter_rust_bridge::for_generated::slice_from_byte_buffer(buf.to_vec()).into() } } impl CstDecode> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { @@ -1121,14 +1463,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::error::NodeException { - (self.unchecked_into_f64() as i32).cst_decode() - } -} impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { @@ -1168,11 +1502,7 @@ impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValu 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) -> u64 { - ::std::convert::TryInto::try_into( - self.dyn_into::() - .unwrap(), - ) - .unwrap() + ::std::convert::TryInto::::try_into(self).unwrap() as _ } } impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { @@ -1219,194 +1549,270 @@ impl CstDecode<[u8; 64]> for flutter_rust_bridge::for_generated::wasm_bindgen::J 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) -> usize { - self.unchecked_into_f64() as _ + ::std::convert::TryInto::::try_into(self).unwrap() as _ } } #[wasm_bindgen] -pub fn wire_NodeBuilder_build( +pub fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + amount_msat: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + description: String, + expiry_secs: u32, ) { - wire_NodeBuilder_build_impl(port_, that) + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_impl( + port_, + that, + amount_msat, + description, + expiry_secs, + ) } #[wasm_bindgen] -pub fn wire_NodeBuilder_build_with_fs_store( +pub fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + description: String, + expiry_secs: u32, ) { - wire_NodeBuilder_build_with_fs_store_impl(port_, that) + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_impl( + port_, + that, + description, + expiry_secs, + ) } #[wasm_bindgen] -pub fn wire_NodeBuilder_create_builder( +pub fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel( 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, + description: String, + expiry_secs: u32, + max_proportional_lsp_fee_limit_ppm_msat: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_NodeBuilder_create_builder_impl( + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel_impl( port_, - config, - chain_data_source_config, - entropy_source_config, - gossip_source_config, - liquidity_source_config, + that, + description, + expiry_secs, + max_proportional_lsp_fee_limit_ppm_msat, ) } #[wasm_bindgen] -pub fn wire_ldk_bolt_11_payment_receive( +pub fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - amount_msat: u64, + amount_msat: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, description: String, expiry_secs: u32, + max_total_lsp_fee_limit_msat: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_bolt_11_payment_receive_impl(port_, that, amount_msat, description, expiry_secs) + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel_impl( + port_, + that, + amount_msat, + description, + expiry_secs, + max_total_lsp_fee_limit_msat, + ) } #[wasm_bindgen] -pub fn wire_ldk_bolt_11_payment_receive_variable_amount( +pub fn wire__crate__api__bolt11__ldk_bolt_11_payment_send( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - description: String, - expiry_secs: u32, + invoice: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_bolt_11_payment_receive_variable_amount_impl(port_, that, description, expiry_secs) + wire__crate__api__bolt11__ldk_bolt_11_payment_send_impl(port_, that, invoice) } #[wasm_bindgen] -pub fn wire_ldk_bolt_11_payment_receive_variable_amount_via_jit_channel( +pub fn wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes( 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, + invoice: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_impl(port_, that, invoice) +} + +#[wasm_bindgen] +pub fn wire__crate__api__bolt11__ldk_bolt_11_payment_send_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: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_bolt_11_payment_receive_variable_amount_via_jit_channel_impl( + wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount_impl( port_, that, - description, - expiry_secs, - max_proportional_lsp_fee_limit_ppm_msat, + invoice, + amount_msat, ) } #[wasm_bindgen] -pub fn wire_ldk_bolt_11_payment_receive_via_jit_channel( +pub fn wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount( 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, + invoice: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + amount_msat: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_bolt_11_payment_receive_via_jit_channel_impl( + wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount_impl( port_, that, + invoice, amount_msat, - description, - expiry_secs, - max_total_lsp_fee_limit_msat, ) } #[wasm_bindgen] -pub fn wire_ldk_bolt_11_payment_send( +pub fn wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder( + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder_impl(that) +} + +#[wasm_bindgen] +pub fn wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder( + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + builder: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder_impl(that, builder) +} + +#[wasm_bindgen] +pub fn wire__crate__api__builder__NodeBuilder_build( 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_ldk_bolt_11_payment_send_impl(port_, that, invoice) + wire__crate__api__builder__NodeBuilder_build_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_bolt_11_payment_send_probes( +pub fn wire__crate__api__builder__NodeBuilder_build_with_fs_store( 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_ldk_bolt_11_payment_send_probes_impl(port_, that, invoice) + wire__crate__api__builder__NodeBuilder_build_with_fs_store_impl(port_, that) +} + +#[wasm_bindgen] +pub fn wire__crate__api__builder__NodeBuilder_create_builder( + 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, +) { + wire__crate__api__builder__NodeBuilder_create_builder_impl( + port_, + config, + chain_data_source_config, + entropy_source_config, + gossip_source_config, + liquidity_source_config, + ) +} + +#[wasm_bindgen] +pub fn wire__crate__api__builder__ldk_mnemonic_generate( + port_: flutter_rust_bridge::for_generated::MessagePort, +) { + wire__crate__api__builder__ldk_mnemonic_generate_impl(port_) } #[wasm_bindgen] -pub fn wire_ldk_bolt_11_payment_send_probes_using_amount( +pub fn wire__crate__api__graph__ldk_network_graph_channel( 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, + short_channel_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_bolt_11_payment_send_probes_using_amount_impl(port_, that, invoice, amount_msat) + wire__crate__api__graph__ldk_network_graph_channel_impl(port_, that, short_channel_id) } #[wasm_bindgen] -pub fn wire_ldk_bolt_11_payment_send_using_amount( +pub fn wire__crate__api__graph__ldk_network_graph_list_channels( 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_ldk_bolt_11_payment_send_using_amount_impl(port_, that, invoice, amount_msat) + wire__crate__api__graph__ldk_network_graph_list_channels_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_mnemonic_generate(port_: flutter_rust_bridge::for_generated::MessagePort) { - wire_ldk_mnemonic_generate_impl(port_) +pub fn wire__crate__api__graph__ldk_network_graph_list_nodes( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire__crate__api__graph__ldk_network_graph_list_nodes_impl(port_, that) +} + +#[wasm_bindgen] +pub fn wire__crate__api__node__ldk_node_bolt11_payment( + port_: flutter_rust_bridge::for_generated::MessagePort, + ptr: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire__crate__api__node__ldk_node_bolt11_payment_impl(port_, ptr) } #[wasm_bindgen] -pub fn wire_ldk_node_bolt11_payment( +pub fn wire__crate__api__node__ldk_node_bolt12_payment( port_: flutter_rust_bridge::for_generated::MessagePort, ptr: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_bolt11_payment_impl(port_, ptr) + wire__crate__api__node__ldk_node_bolt12_payment_impl(port_, ptr) } #[wasm_bindgen] -pub fn wire_ldk_node_close_channel( +pub fn wire__crate__api__node__ldk_node_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_ldk_node_close_channel_impl(port_, that, user_channel_id, counterparty_node_id) + wire__crate__api__node__ldk_node_close_channel_impl( + port_, + that, + user_channel_id, + counterparty_node_id, + ) } #[wasm_bindgen] -pub fn wire_ldk_node_config( +pub fn wire__crate__api__node__ldk_node_config( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_config_impl(port_, that) + wire__crate__api__node__ldk_node_config_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_connect( +pub fn wire__crate__api__node__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_ldk_node_connect_impl(port_, that, node_id, address, persist) + wire__crate__api__node__ldk_node_connect_impl(port_, that, node_id, address, persist) } #[wasm_bindgen] -pub fn wire_ldk_node_connect_open_channel( +pub fn wire__crate__api__node__ldk_node_connect_open_channel( port_: flutter_rust_bridge::for_generated::MessagePort, that: 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, + channel_amount_sats: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, 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_ldk_node_connect_open_channel_impl( + wire__crate__api__node__ldk_node_connect_open_channel_impl( port_, that, socket_address, @@ -1419,179 +1825,202 @@ pub fn wire_ldk_node_connect_open_channel( } #[wasm_bindgen] -pub fn wire_ldk_node_disconnect( +pub fn wire__crate__api__node__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_ldk_node_disconnect_impl(port_, that, counterparty_node_id) + wire__crate__api__node__ldk_node_disconnect_impl(port_, that, counterparty_node_id) } #[wasm_bindgen] -pub fn wire_ldk_node_event_handled( +pub fn wire__crate__api__node__ldk_node_event_handled( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_event_handled_impl(port_, that) + wire__crate__api__node__ldk_node_event_handled_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_list_balances( +pub fn wire__crate__api__node__ldk_node_force_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_ldk_node_list_balances_impl(port_, that) + wire__crate__api__node__ldk_node_force_close_channel_impl( + port_, + that, + user_channel_id, + counterparty_node_id, + ) } #[wasm_bindgen] -pub fn wire_ldk_node_list_channels( +pub fn wire__crate__api__node__ldk_node_list_balances( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_list_channels_impl(port_, that) + wire__crate__api__node__ldk_node_list_balances_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_list_payments( +pub fn wire__crate__api__node__ldk_node_list_channels( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_list_payments_impl(port_, that) + wire__crate__api__node__ldk_node_list_channels_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_list_payments_with_filter( +pub fn wire__crate__api__node__ldk_node_list_payments( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire__crate__api__node__ldk_node_list_payments_impl(port_, that) +} + +#[wasm_bindgen] +pub fn wire__crate__api__node__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_ldk_node_list_payments_with_filter_impl(port_, that, payment_direction) + wire__crate__api__node__ldk_node_list_payments_with_filter_impl(port_, that, payment_direction) +} + +#[wasm_bindgen] +pub fn wire__crate__api__node__ldk_node_list_peers( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire__crate__api__node__ldk_node_list_peers_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_list_peers( +pub fn wire__crate__api__node__ldk_node_listening_addresses( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_list_peers_impl(port_, that) + wire__crate__api__node__ldk_node_listening_addresses_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_listening_addresses( +pub fn wire__crate__api__node__ldk_node_network_graph( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_listening_addresses_impl(port_, that) + wire__crate__api__node__ldk_node_network_graph_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_next_event( +pub fn wire__crate__api__node__ldk_node_next_event( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_next_event_impl(port_, that) + wire__crate__api__node__ldk_node_next_event_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_next_event_async( +pub fn wire__crate__api__node__ldk_node_next_event_async( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_next_event_async_impl(port_, that) + wire__crate__api__node__ldk_node_next_event_async_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_node_id( +pub fn wire__crate__api__node__ldk_node_node_id( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_node_id_impl(port_, that) + wire__crate__api__node__ldk_node_node_id_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_on_chain_payment( +pub fn wire__crate__api__node__ldk_node_on_chain_payment( port_: flutter_rust_bridge::for_generated::MessagePort, ptr: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_on_chain_payment_impl(port_, ptr) + wire__crate__api__node__ldk_node_on_chain_payment_impl(port_, ptr) } #[wasm_bindgen] -pub fn wire_ldk_node_payment( +pub fn wire__crate__api__node__ldk_node_payment( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, payment_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_payment_impl(port_, that, payment_id) + wire__crate__api__node__ldk_node_payment_impl(port_, that, payment_id) } #[wasm_bindgen] -pub fn wire_ldk_node_remove_payment( +pub fn wire__crate__api__node__ldk_node_remove_payment( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, payment_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_remove_payment_impl(port_, that, payment_id) + wire__crate__api__node__ldk_node_remove_payment_impl(port_, that, payment_id) } #[wasm_bindgen] -pub fn wire_ldk_node_sign_message( +pub fn wire__crate__api__node__ldk_node_sign_message( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, msg: Box<[u8]>, ) { - wire_ldk_node_sign_message_impl(port_, that, msg) + wire__crate__api__node__ldk_node_sign_message_impl(port_, that, msg) } #[wasm_bindgen] -pub fn wire_ldk_node_spontaneous_payment( +pub fn wire__crate__api__node__ldk_node_spontaneous_payment( port_: flutter_rust_bridge::for_generated::MessagePort, ptr: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_spontaneous_payment_impl(port_, ptr) + wire__crate__api__node__ldk_node_spontaneous_payment_impl(port_, ptr) } #[wasm_bindgen] -pub fn wire_ldk_node_start( +pub fn wire__crate__api__node__ldk_node_start( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_start_impl(port_, that) + wire__crate__api__node__ldk_node_start_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_status( +pub fn wire__crate__api__node__ldk_node_status( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_status_impl(port_, that) + wire__crate__api__node__ldk_node_status_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_stop( +pub fn wire__crate__api__node__ldk_node_stop( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_stop_impl(port_, that) + wire__crate__api__node__ldk_node_stop_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_sync_wallets( +pub fn wire__crate__api__node__ldk_node_sync_wallets( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_sync_wallets_impl(port_, that) + wire__crate__api__node__ldk_node_sync_wallets_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_update_channel_config( +pub fn wire__crate__api__node__ldk_node_update_channel_config( 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, channel_config: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_update_channel_config_impl( + wire__crate__api__node__ldk_node_update_channel_config_impl( port_, that, user_channel_id, @@ -1601,69 +2030,102 @@ pub fn wire_ldk_node_update_channel_config( } #[wasm_bindgen] -pub fn wire_ldk_node_verify_signature( +pub fn wire__crate__api__node__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, public_key: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_verify_signature_impl(port_, that, msg, sig, public_key) + wire__crate__api__node__ldk_node_verify_signature_impl(port_, that, msg, sig, public_key) } #[wasm_bindgen] -pub fn wire_ldk_node_wait_next_event( +pub fn wire__crate__api__node__ldk_node_wait_next_event( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_wait_next_event_impl(port_, that) + wire__crate__api__node__ldk_node_wait_next_event_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_on_chain_payment_new_address( +pub fn wire__crate__api__on_chain__ldk_on_chain_payment_new_address( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_on_chain_payment_new_address_impl(port_, that) + wire__crate__api__on_chain__ldk_on_chain_payment_new_address_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_on_chain_payment_send_all_to_address( +pub fn wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_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_ldk_on_chain_payment_send_all_to_address_impl(port_, that, address) + wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address_impl(port_, that, address) } #[wasm_bindgen] -pub fn wire_ldk_on_chain_payment_send_to_address( +pub fn wire__crate__api__on_chain__ldk_on_chain_payment_send_to_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, + amount_sats: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_on_chain_payment_send_to_address_impl(port_, that, address, amount_sats) + wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address_impl( + port_, + that, + address, + amount_sats, + ) } #[wasm_bindgen] -pub fn wire_ldk_spontaneous_payment_send( +pub fn wire__crate__api__spontaneous__ldk_spontaneous_payment_send( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - amount_msat: u64, + amount_msat: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, node_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_spontaneous_payment_send_impl(port_, that, amount_msat, node_id) + wire__crate__api__spontaneous__ldk_spontaneous_payment_send_impl( + port_, + that, + amount_msat, + node_id, + ) } #[wasm_bindgen] -pub fn wire_ldk_spontaneous_payment_send_probes( +pub fn wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - amount_msat: u64, + amount_msat: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, node_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_spontaneous_payment_send_probes_impl(port_, that, amount_msat, node_id) + wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes_impl( + port_, + that, + amount_msat, + node_id, + ) +} + +#[wasm_bindgen] +pub fn rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } +} + +#[wasm_bindgen] +pub fn rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } } #[wasm_bindgen] @@ -1681,20 +2143,52 @@ pub fn rust_arc_decrement_strong_count_RustOpaque_Node(ptr: *const std::ffi::c_v } #[wasm_bindgen] -pub fn rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( +pub fn rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } +} + +#[wasm_bindgen] +pub fn rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } +} + +#[wasm_bindgen] +pub fn rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilder(ptr: *const std::ffi::c_void) { + unsafe { + StdArc::::increment_strong_count(ptr as _); + } +} + +#[wasm_bindgen] +pub fn rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilder(ptr: *const std::ffi::c_void) { + unsafe { + StdArc::::decrement_strong_count(ptr as _); + } +} + +#[wasm_bindgen] +pub fn rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraph( ptr: *const std::ffi::c_void, ) { unsafe { - StdArc::>::increment_strong_count(ptr as _); + StdArc::::increment_strong_count(ptr as _); } } #[wasm_bindgen] -pub fn rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNodeBuilder( +pub fn rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraph( ptr: *const std::ffi::c_void, ) { unsafe { - StdArc::>::decrement_strong_count(ptr as _); + StdArc::::decrement_strong_count(ptr as _); } } From 29680bb52ab13cc740c9267c81793eb01d3f2d49 Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Thu, 27 Jun 2024 20:11:00 -0400 Subject: [PATCH 21/48] exported payment handler types --- lib/ldk_node.dart | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/ldk_node.dart b/lib/ldk_node.dart index a21be42..10af5cc 100644 --- a/lib/ldk_node.dart +++ b/lib/ldk_node.dart @@ -1,3 +1,7 @@ +export './src/generated/api/bolt11.dart'; +export './src/generated/api/bolt12.dart'; +export './src/generated/api/on_chain.dart'; +export './src/generated/api/spontaneous.dart'; export './src/generated/api/types.dart' hide Event_ChannelClosed, @@ -11,6 +15,7 @@ export './src/generated/api/types.dart' SocketAddress_OnionV2, EntropySourceConfig, SocketAddress_OnionV3, + $ChainDataSourceConfigCopyWith, SocketAddress_TcpIpV4, SocketAddress_TcpIpV6, MaxDustHTLCExposure_FeeRateMultiplier, From 3a30527b4a8c4323d80561f9d8cfdf49af4af733 Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Thu, 27 Jun 2024 23:52:00 -0400 Subject: [PATCH 22/48] feat(Node): NetworkGraph handler function added --- lib/src/generated/api/graph.dart | 8 +++--- lib/src/generated/api/node.dart | 6 ++--- lib/src/root.dart | 46 ++++++++++++++++++++++++++++++++ rust/src/api/graph.rs | 10 +++---- rust/src/api/node.rs | 7 ++--- 5 files changed, 61 insertions(+), 16 deletions(-) diff --git a/lib/src/generated/api/graph.dart b/lib/src/generated/api/graph.dart index 58338f6..a0e42a2 100644 --- a/lib/src/generated/api/graph.dart +++ b/lib/src/generated/api/graph.dart @@ -104,10 +104,10 @@ class ChannelUpdateInfo { } class LdkNetworkGraph { - final NetworkGraph inner; + final NetworkGraph ptr; const LdkNetworkGraph({ - required this.inner, + required this.ptr, }); /// Returns information on a channel with the given id. @@ -128,14 +128,14 @@ class LdkNetworkGraph { ); @override - int get hashCode => inner.hashCode; + int get hashCode => ptr.hashCode; @override bool operator ==(Object other) => identical(this, other) || other is LdkNetworkGraph && runtimeType == other.runtimeType && - inner == other.inner; + ptr == other.ptr; } ///Represents the compressed public key of a node diff --git a/lib/src/generated/api/node.dart b/lib/src/generated/api/node.dart index d04f6fa..b409039 100644 --- a/lib/src/generated/api/node.dart +++ b/lib/src/generated/api/node.dart @@ -112,10 +112,8 @@ class LdkNode { that: this, ); - Future networkGraph() => - core.instance.api.crateApiNodeLdkNodeNetworkGraph( - that: this, - ); + static Future networkGraph({required LdkNode ptr}) => + core.instance.api.crateApiNodeLdkNodeNetworkGraph(ptr: ptr); Future nextEvent() => core.instance.api.crateApiNodeLdkNodeNextEvent( that: this, diff --git a/lib/src/root.dart b/lib/src/root.dart index fb8577f..312028b 100644 --- a/lib/src/root.dart +++ b/lib/src/root.dart @@ -1,5 +1,7 @@ +import 'package:flutter_rust_bridge/flutter_rust_bridge.dart'; import 'package:ldk_node/src/generated/api/bolt11.dart' as bolt11; import 'package:ldk_node/src/generated/api/bolt12.dart' as bolt12; +import 'package:ldk_node/src/generated/api/graph.dart' as graph; import 'package:ldk_node/src/generated/api/types.dart' as types; import 'package:ldk_node/src/generated/utils/error.dart' as error; import 'package:ldk_node/src/utils/utils.dart'; @@ -246,6 +248,16 @@ class Node extends LdkNode { } } + ///Returns a handler allowing to query the network graph. + Future networkGraph() async { + try { + final res = await LdkNode.networkGraph(ptr: this); + return NetworkGraph._(ptr: res.ptr); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + /// Close a previously opened channel. @override Future closeChannel( @@ -470,6 +482,40 @@ class OnChainPayment extends on_chain.LdkOnChainPayment { } } +class NetworkGraph extends graph.LdkNetworkGraph { + NetworkGraph._({required super.ptr}); + + ///Returns information on a channel with the given id. + @override + Future channel({required BigInt shortChannelId}) { + try { + return super.channel(shortChannelId: shortChannelId); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Returns the list of channels in the graph + @override + Future listChannels() { + try { + return super.listChannels(); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Returns the list of nodes in the graph + @override + Future> listNodes() { + try { + return super.listNodes(); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } +} + ///Represents a syntactically and semantically correct lightning BOLT11 invoice. class Bolt11Payment extends bolt11.LdkBolt11Payment { Bolt11Payment._({required super.ptr}); diff --git a/rust/src/api/graph.rs b/rust/src/api/graph.rs index 7482cd8..ad59736 100644 --- a/rust/src/api/graph.rs +++ b/rust/src/api/graph.rs @@ -115,10 +115,10 @@ impl From for NodeAn } } } -pub struct LdkNetworkGraph {pub inner: RustOpaque } +pub struct LdkNetworkGraph {pub ptr: RustOpaque } impl From for LdkNetworkGraph { fn from(value: ldk_node::graph::NetworkGraph) -> Self { - LdkNetworkGraph {inner: RustOpaque::new(value)} + LdkNetworkGraph { ptr: RustOpaque::new(value)} } } @@ -126,17 +126,17 @@ impl LdkNetworkGraph { /// Returns the list of channels in the graph pub fn list_channels(&self) -> Vec { - self.inner.list_channels() + self.ptr.list_channels() } /// Returns information on a channel with the given id. pub fn channel(&self, short_channel_id: u64) -> Option { - self.inner.channel(short_channel_id).map(|e| e.into()) + self.ptr.channel(short_channel_id).map(|e| e.into()) } /// Returns the list of nodes in the graph pub fn list_nodes(&self) -> Vec { - self.inner.list_nodes().iter().map(|e| e.to_owned().into()).collect() + self.ptr.list_nodes().iter().map(|e| e.to_owned().into()).collect() } // Returns information on a node with the given id. diff --git a/rust/src/api/node.rs b/rust/src/api/node.rs index d2c02ac..599eb8c 100644 --- a/rust/src/api/node.rs +++ b/rust/src/api/node.rs @@ -143,9 +143,7 @@ impl LdkNode { .force_close_channel(&(user_channel_id.try_into()?), counterparty_node_id.try_into()?) .map_err(|e| e.into()) } - pub fn network_graph(&self)-> LdkNetworkGraph { - self.ptr.network_graph().into() - } + pub fn update_channel_config( &self, user_channel_id: UserChannelId, @@ -202,6 +200,9 @@ impl LdkNode { pub fn sign_message(&self, msg: Vec) -> anyhow::Result { self.ptr.sign_message(msg.as_slice()).map_err(|e| e.into()) } + pub fn network_graph(ptr: Self)-> LdkNetworkGraph { + ptr.ptr.network_graph().into() + } pub fn bolt11_payment(ptr: Self) -> LdkBolt11Payment { ptr.ptr.bolt11_payment().into() } From df8b27a44a9e677f5d432da1b7840843e15ed111 Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Fri, 28 Jun 2024 04:32:00 -0400 Subject: [PATCH 23/48] refactor: Doc comments added --- lib/src/root.dart | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/lib/src/root.dart b/lib/src/root.dart index 312028b..9340154 100644 --- a/lib/src/root.dart +++ b/lib/src/root.dart @@ -398,6 +398,7 @@ class Node extends LdkNode { } } + ///Returns a payment handler allowing to create and pay BOLT 11 invoices. Future bolt11Payment() async { try { final res = await LdkNode.bolt11Payment(ptr: this); @@ -407,6 +408,7 @@ class Node extends LdkNode { } } + ///Returns a payment handler allowing to send and receive on-chain payments. Future onChainPayment() async { try { final res = await LdkNode.onChainPayment(ptr: this); @@ -416,6 +418,7 @@ class Node extends LdkNode { } } + ///Returns a payment handler allowing to send spontaneous ("keysend") payments. Future spontaneousPayment() async { try { final res = await LdkNode.spontaneousPayment(ptr: this); @@ -426,8 +429,11 @@ class Node extends LdkNode { } } +///A payment handler allowing to send spontaneous ("keysend") payments. class SpontaneousPayment extends spontaneous.LdkSpontaneousPayment { SpontaneousPayment._({required super.ptr}); + + ///Sends payment probes over all paths of a route that would be used to pay the given amount to the given node_id. @override Future sendProbes( {required BigInt amountMsat, required types.PublicKey nodeId, hint}) { @@ -438,6 +444,7 @@ class SpontaneousPayment extends spontaneous.LdkSpontaneousPayment { } } + ///Send a spontaneous, aka. "keysend", payment @override Future send( {required BigInt amountMsat, @@ -451,6 +458,7 @@ class SpontaneousPayment extends spontaneous.LdkSpontaneousPayment { } } +///A payment handler allowing to send and receive on-chain payments. class OnChainPayment extends on_chain.LdkOnChainPayment { OnChainPayment._({required super.ptr}); @override @@ -482,6 +490,7 @@ class OnChainPayment extends on_chain.LdkOnChainPayment { } } +///Represents the network as nodes and channels between them. class NetworkGraph extends graph.LdkNetworkGraph { NetworkGraph._({required super.ptr}); @@ -519,6 +528,9 @@ class NetworkGraph extends graph.LdkNetworkGraph { ///Represents a syntactically and semantically correct lightning BOLT11 invoice. class Bolt11Payment extends bolt11.LdkBolt11Payment { Bolt11Payment._({required super.ptr}); + + ///Returns a payable invoice that can be used to request and receive a payment of the amount given. + /// The inbound payment will be automatically claimed upon arrival. @override Future receive( {required BigInt amountMsat, @@ -535,6 +547,8 @@ class Bolt11Payment extends bolt11.LdkBolt11Payment { } } + ///Returns a payable invoice that can be used to request and receive a payment for which the amount is to be determined by the user, also known as a "zero-amount" invoice. + /// The inbound payment will be automatically claimed upon arrival. @override Future receiveVariableAmount( {required String description, required int expirySecs, hint}) { @@ -546,6 +560,9 @@ class Bolt11Payment extends bolt11.LdkBolt11Payment { } } + ///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 receiveVariableAmountViaJitChannel( {required String description, @@ -562,6 +579,9 @@ class Bolt11Payment extends bolt11.LdkBolt11Payment { } } + ///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, `maxTotalLspFeeLimitMsat` 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 receiveViaJitChannel( {required BigInt amountMsat, @@ -580,6 +600,7 @@ class Bolt11Payment extends bolt11.LdkBolt11Payment { } } + ///Send a payment given an invoice. @override Future send({required bolt11.Bolt11Invoice invoice, hint}) { try { @@ -589,6 +610,11 @@ class Bolt11Payment extends bolt11.LdkBolt11Payment { } } + ///Sends payment probes over all paths of a route that would be used to pay the given invoice. + /// This may be used to send "pre-flight" probes, i. e., to train our scorer before conducting the actual payment. Note this is only useful if there likely is sufficient time for the probe to settle before sending out the actual payment, e. g., when waiting for user confirmation in a wallet UI. + /// Otherwise, there is a chance the probe could take up some liquidity needed to complete the actual payment. + /// Users should therefore be cautious and might avoid sending probes if liquidity is scarce and/ or they don't expect the probe to return before they send the payment. + /// To mitigate this issue, channels with available liquidity less than the required amount times @override Future sendProbes({required bolt11.Bolt11Invoice invoice, hint}) { try { @@ -598,6 +624,8 @@ class Bolt11Payment extends bolt11.LdkBolt11Payment { } } + ///Sends payment probes over all paths of a route that would be used to pay the given zero-value invoice using the given amount. + /// This can be used to send pre-flight probes for a so-called "zero-amount" invoice, i. e., an invoice that leaves the amount paid to be determined by the user. @override Future sendProbesUsingAmount( {required bolt11.Bolt11Invoice invoice, @@ -611,6 +639,9 @@ class Bolt11Payment extends bolt11.LdkBolt11Payment { } } + ///Send a payment given an invoice and an amount in millisatoshi. + /// This will fail if the amount given is less than the value required by the given invoice. + /// This can be used to pay a so-called "zero-amount" invoice, i. e., an invoice that leaves the amount paid to be determined by the user. @override Future sendUsingAmount( {required bolt11.Bolt11Invoice invoice, From b29d5d107b4807509bd8bb9c97bb3a4c40aa0eb8 Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Fri, 28 Jun 2024 06:22:00 -0400 Subject: [PATCH 24/48] feat(NetworkGraph): Exposed node() --- lib/src/generated/api/graph.dart | 62 +++++++++++++++++++++++++++++++- lib/src/root.dart | 10 ++++++ rust/src/api/graph.rs | 11 +++--- 3 files changed, 77 insertions(+), 6 deletions(-) diff --git a/lib/src/generated/api/graph.dart b/lib/src/generated/api/graph.dart index a0e42a2..6859cec 100644 --- a/lib/src/generated/api/graph.dart +++ b/lib/src/generated/api/graph.dart @@ -5,9 +5,10 @@ import '../frb_generated.dart'; import '../lib.dart'; +import '../utils/error.dart'; import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; +import 'types.dart'; -// These types are ignored because they are not used by any `pub` functions: `NodeAnnouncementInfo`, `NodeInfo` // These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `from`, `from`, `from`, `from`, `from`, `from`, `from`, `try_from` ///Details about a channel (both directions). Received within a channel announcement. @@ -127,6 +128,9 @@ class LdkNetworkGraph { that: this, ); + Future node({required NodeId nodeId}) => core.instance.api + .crateApiGraphLdkNetworkGraphNode(that: this, nodeId: nodeId); + @override int get hashCode => ptr.hashCode; @@ -138,6 +142,38 @@ class LdkNetworkGraph { ptr == other.ptr; } +class NodeAnnouncementInfo { + /// When the last known update to the node state was issued. + /// Value is opaque, as set in the announcement. + final int lastUpdate; + + /// Moniker assigned to the node. + /// May be invalid or malicious (eg control chars), + /// should not be exposed to the user. + final String alias; + + /// List of addresses on which this node is reachable + final List addresses; + + const NodeAnnouncementInfo({ + required this.lastUpdate, + required this.alias, + required this.addresses, + }); + + @override + int get hashCode => lastUpdate.hashCode ^ alias.hashCode ^ addresses.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is NodeAnnouncementInfo && + runtimeType == other.runtimeType && + lastUpdate == other.lastUpdate && + alias == other.alias && + addresses == other.addresses; +} + ///Represents the compressed public key of a node class NodeId { final Uint8List compressed; @@ -157,6 +193,30 @@ class NodeId { compressed == other.compressed; } +///Details about a node in the network, known from the network announcement. +class NodeInfo { + final Uint64List channels; + + ///More information about a node from node_announcement. Optional because we store a Node entry after learning about it from a channel announcement, but before receiving a node announcement. + final NodeAnnouncementInfo? announcementInfo; + + const NodeInfo({ + required this.channels, + this.announcementInfo, + }); + + @override + int get hashCode => channels.hashCode ^ announcementInfo.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is NodeInfo && + runtimeType == other.runtimeType && + channels == other.channels && + announcementInfo == other.announcementInfo; +} + ///Fees for routing via a given channel or a node class RoutingFees { ///Flat routing fee in millisatoshis. diff --git a/lib/src/root.dart b/lib/src/root.dart index 9340154..b263bae 100644 --- a/lib/src/root.dart +++ b/lib/src/root.dart @@ -523,6 +523,16 @@ class NetworkGraph extends graph.LdkNetworkGraph { throw mapLdkNodeError(e); } } + + ///Returns information on a node with the given id. + @override + Future node({required graph.NodeId nodeId}) { + try { + return super.node(nodeId: nodeId); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } } ///Represents a syntactically and semantically correct lightning BOLT11 invoice. diff --git a/rust/src/api/graph.rs b/rust/src/api/graph.rs index ad59736..aae620e 100644 --- a/rust/src/api/graph.rs +++ b/rust/src/api/graph.rs @@ -1,5 +1,6 @@ -use ldk_node::lightning::ln::msgs::SocketAddress; + use ldk_node::lightning::util::ser::Writeable; +use crate::api::types::SocketAddress; use crate::frb_generated::RustOpaque; use crate::utils::error::LdkNodeError; @@ -139,8 +140,8 @@ impl LdkNetworkGraph { self.ptr.list_nodes().iter().map(|e| e.to_owned().into()).collect() } - // Returns information on a node with the given id. - // pub fn node(&self, node_id: NodeId) -> Result, NodeException> { - // Ok(self.inner.node(node_id.try_into().unwrap()).map(|e| e.into())) - // } + + pub fn node(&self, node_id: NodeId) -> Result, LdkNodeError> { + Ok(self.ptr.node(&(node_id.try_into()?)).map(|e| e.into())) + } } \ No newline at end of file From eafddfb60f19624e4d3f29507c78a4b78c331588 Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Fri, 28 Jun 2024 07:21:00 -0400 Subject: [PATCH 25/48] bindings updated --- ios/Classes/frb_generated.h | 47 ++++- lib/src/generated/frb_generated.dart | 232 ++++++++++++++++++++- lib/src/generated/frb_generated.io.dart | 255 ++++++++++++++++++++++-- rust/src/frb_generated.io.rs | 117 ++++++++++- rust/src/frb_generated.rs | 173 +++++++++++++++- 5 files changed, 772 insertions(+), 52 deletions(-) diff --git a/ios/Classes/frb_generated.h b/ios/Classes/frb_generated.h index 1075592..41f719b 100644 --- a/ios/Classes/frb_generated.h +++ b/ios/Classes/frb_generated.h @@ -177,9 +177,13 @@ typedef struct wire_cst_liquidity_source_config { } wire_cst_liquidity_source_config; typedef struct wire_cst_ldk_network_graph { - uintptr_t inner; + uintptr_t ptr; } wire_cst_ldk_network_graph; +typedef struct wire_cst_node_id { + struct wire_cst_list_prim_u_8_strict *compressed; +} wire_cst_node_id; + typedef struct wire_cst_ldk_node { uintptr_t ptr; } wire_cst_ldk_node; @@ -281,10 +285,6 @@ typedef struct wire_cst_channel_id { struct wire_cst_list_prim_u_8_strict *data; } wire_cst_channel_id; -typedef struct wire_cst_node_id { - struct wire_cst_list_prim_u_8_strict *compressed; -} wire_cst_node_id; - typedef struct wire_cst_routing_fees { uint32_t base_msat; uint32_t proportional_millionths; @@ -404,6 +404,22 @@ typedef struct wire_cst_lsp_fee_limits { uint64_t *max_proportional_opening_fee_ppm_msat; } wire_cst_lsp_fee_limits; +typedef struct wire_cst_node_announcement_info { + uint32_t last_update; + struct wire_cst_list_prim_u_8_strict *alias; + struct wire_cst_list_socket_address *addresses; +} wire_cst_node_announcement_info; + +typedef struct wire_cst_list_prim_u_64_strict { + uint64_t *ptr; + int32_t len; +} wire_cst_list_prim_u_64_strict; + +typedef struct wire_cst_node_info { + struct wire_cst_list_prim_u_64_strict *channels; + struct wire_cst_node_announcement_info *announcement_info; +} wire_cst_node_info; + typedef struct wire_cst_offer_id { struct wire_cst_list_prim_u_8_strict *field0; } wire_cst_offer_id; @@ -624,11 +640,6 @@ typedef struct wire_cst_list_pending_sweep_balance { int32_t len; } wire_cst_list_pending_sweep_balance; -typedef struct wire_cst_list_prim_u_64_strict { - uint64_t *ptr; - int32_t len; -} wire_cst_list_prim_u_64_strict; - typedef struct wire_cst_balance_details { uint64_t total_onchain_balance_sats; uint64_t spendable_onchain_balance_sats; @@ -775,6 +786,10 @@ void frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_list_channels(in void frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_list_nodes(int64_t port_, struct wire_cst_ldk_network_graph *that); +void frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_node(int64_t port_, + struct wire_cst_ldk_network_graph *that, + struct wire_cst_node_id *node_id); + void frbgen_ldk_node_wire__crate__api__node__ldk_node_bolt11_payment(int64_t port_, struct wire_cst_ldk_node *ptr); @@ -836,7 +851,7 @@ void frbgen_ldk_node_wire__crate__api__node__ldk_node_listening_addresses(int64_ struct wire_cst_ldk_node *that); void frbgen_ldk_node_wire__crate__api__node__ldk_node_network_graph(int64_t port_, - struct wire_cst_ldk_node *that); + struct wire_cst_ldk_node *ptr); void frbgen_ldk_node_wire__crate__api__node__ldk_node_next_event(int64_t port_, struct wire_cst_ldk_node *that); @@ -996,6 +1011,12 @@ struct wire_cst_lsp_fee_limits *frbgen_ldk_node_cst_new_box_autoadd_lsp_fee_limi struct wire_cst_max_dust_htlc_exposure *frbgen_ldk_node_cst_new_box_autoadd_max_dust_htlc_exposure(void); +struct wire_cst_node_announcement_info *frbgen_ldk_node_cst_new_box_autoadd_node_announcement_info(void); + +struct wire_cst_node_id *frbgen_ldk_node_cst_new_box_autoadd_node_id(void); + +struct wire_cst_node_info *frbgen_ldk_node_cst_new_box_autoadd_node_info(void); + struct wire_cst_offer *frbgen_ldk_node_cst_new_box_autoadd_offer(void); struct wire_cst_offer_id *frbgen_ldk_node_cst_new_box_autoadd_offer_id(void); @@ -1078,6 +1099,9 @@ static int64_t dummy_method_to_enforce_bundling(void) { 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_lsp_fee_limits); 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_node_announcement_info); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_node_id); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_node_info); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_offer); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_offer_id); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_out_point); @@ -1145,6 +1169,7 @@ static int64_t dummy_method_to_enforce_bundling(void) { dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_channel); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_list_channels); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_list_nodes); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_node); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_bolt11_payment); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_bolt12_payment); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_close_channel); diff --git a/lib/src/generated/frb_generated.dart b/lib/src/generated/frb_generated.dart index 0849deb..ea4fb9e 100644 --- a/lib/src/generated/frb_generated.dart +++ b/lib/src/generated/frb_generated.dart @@ -64,7 +64,7 @@ class core extends BaseEntrypoint { String get codegenVersion => '2.0.0'; @override - int get rustContentHash => 1452486004; + int get rustContentHash => -1350521949; static const kDefaultExternalLibraryLoaderConfig = ExternalLibraryLoaderConfig( @@ -172,6 +172,9 @@ abstract class coreApi extends BaseApi { Future> crateApiGraphLdkNetworkGraphListNodes( {required LdkNetworkGraph that}); + Future crateApiGraphLdkNetworkGraphNode( + {required LdkNetworkGraph that, required NodeId nodeId}); + Future crateApiNodeLdkNodeBolt11Payment( {required LdkNode ptr}); @@ -229,7 +232,7 @@ abstract class coreApi extends BaseApi { {required LdkNode that}); Future crateApiNodeLdkNodeNetworkGraph( - {required LdkNode that}); + {required LdkNode ptr}); Future crateApiNodeLdkNodeNextEvent({required LdkNode that}); @@ -1072,6 +1075,32 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { argNames: ["that"], ); + @override + Future crateApiGraphLdkNetworkGraphNode( + {required LdkNetworkGraph that, required NodeId nodeId}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_network_graph(that); + var arg1 = cst_encode_box_autoadd_node_id(nodeId); + return wire.wire__crate__api__graph__ldk_network_graph_node( + port_, arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_opt_box_autoadd_node_info, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiGraphLdkNetworkGraphNodeConstMeta, + argValues: [that, nodeId], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiGraphLdkNetworkGraphNodeConstMeta => + const TaskConstMeta( + debugName: "ldk_network_graph_node", + argNames: ["that", "nodeId"], + ); + @override Future crateApiNodeLdkNodeBolt11Payment( {required LdkNode ptr}) { @@ -1483,10 +1512,10 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { @override Future crateApiNodeLdkNodeNetworkGraph( - {required LdkNode that}) { + {required LdkNode ptr}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); + var arg0 = cst_encode_box_autoadd_ldk_node(ptr); return wire.wire__crate__api__node__ldk_node_network_graph(port_, arg0); }, codec: DcoCodec( @@ -1494,7 +1523,7 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { decodeErrorData: null, ), constMeta: kCrateApiNodeLdkNodeNetworkGraphConstMeta, - argValues: [that], + argValues: [ptr], apiImpl: this, )); } @@ -1502,7 +1531,7 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { TaskConstMeta get kCrateApiNodeLdkNodeNetworkGraphConstMeta => const TaskConstMeta( debugName: "ldk_node_network_graph", - argNames: ["that"], + argNames: ["ptr"], ); @override @@ -2434,6 +2463,25 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { return dco_decode_max_dust_htlc_exposure(raw); } + @protected + NodeAnnouncementInfo dco_decode_box_autoadd_node_announcement_info( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_node_announcement_info(raw); + } + + @protected + NodeId dco_decode_box_autoadd_node_id(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_node_id(raw); + } + + @protected + NodeInfo dco_decode_box_autoadd_node_info(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_node_info(raw); + } + @protected Offer dco_decode_box_autoadd_offer(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -2885,7 +2933,7 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { if (arr.length != 1) throw Exception('unexpected arr length: expect 1 but see ${arr.length}'); return LdkNetworkGraph( - inner: dco_decode_RustOpaque_ldk_nodegraphNetworkGraph(arr[0]), + ptr: dco_decode_RustOpaque_ldk_nodegraphNetworkGraph(arr[0]), ); } @@ -3207,6 +3255,19 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { return Network.values[raw as int]; } + @protected + NodeAnnouncementInfo dco_decode_node_announcement_info(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + final arr = raw as List; + if (arr.length != 3) + throw Exception('unexpected arr length: expect 3 but see ${arr.length}'); + return NodeAnnouncementInfo( + lastUpdate: dco_decode_u_32(arr[0]), + alias: dco_decode_String(arr[1]), + addresses: dco_decode_list_socket_address(arr[2]), + ); + } + @protected NodeId dco_decode_node_id(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -3218,6 +3279,19 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { ); } + @protected + NodeInfo dco_decode_node_info(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 NodeInfo( + channels: dco_decode_list_prim_u_64_strict(arr[0]), + announcementInfo: + dco_decode_opt_box_autoadd_node_announcement_info(arr[1]), + ); + } + @protected NodeStatus dco_decode_node_status(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -3357,6 +3431,21 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { : dco_decode_box_autoadd_max_dust_htlc_exposure(raw); } + @protected + NodeAnnouncementInfo? dco_decode_opt_box_autoadd_node_announcement_info( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw == null + ? null + : dco_decode_box_autoadd_node_announcement_info(raw); + } + + @protected + NodeInfo? dco_decode_opt_box_autoadd_node_info(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw == null ? null : dco_decode_box_autoadd_node_info(raw); + } + @protected OutPoint? dco_decode_opt_box_autoadd_out_point(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -4136,6 +4225,25 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { return (sse_decode_max_dust_htlc_exposure(deserializer)); } + @protected + NodeAnnouncementInfo sse_decode_box_autoadd_node_announcement_info( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_node_announcement_info(deserializer)); + } + + @protected + NodeId sse_decode_box_autoadd_node_id(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_node_id(deserializer)); + } + + @protected + NodeInfo sse_decode_box_autoadd_node_info(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_node_info(deserializer)); + } + @protected Offer sse_decode_box_autoadd_offer(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -4667,9 +4775,8 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { @protected LdkNetworkGraph sse_decode_ldk_network_graph(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - var var_inner = - sse_decode_RustOpaque_ldk_nodegraphNetworkGraph(deserializer); - return LdkNetworkGraph(inner: var_inner); + var var_ptr = sse_decode_RustOpaque_ldk_nodegraphNetworkGraph(deserializer); + return LdkNetworkGraph(ptr: var_ptr); } @protected @@ -5066,6 +5173,17 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { return Network.values[inner]; } + @protected + NodeAnnouncementInfo sse_decode_node_announcement_info( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_lastUpdate = sse_decode_u_32(deserializer); + var var_alias = sse_decode_String(deserializer); + var var_addresses = sse_decode_list_socket_address(deserializer); + return NodeAnnouncementInfo( + lastUpdate: var_lastUpdate, alias: var_alias, addresses: var_addresses); + } + @protected NodeId sse_decode_node_id(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -5073,6 +5191,16 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { return NodeId(compressed: var_compressed); } + @protected + NodeInfo sse_decode_node_info(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_channels = sse_decode_list_prim_u_64_strict(deserializer); + var var_announcementInfo = + sse_decode_opt_box_autoadd_node_announcement_info(deserializer); + return NodeInfo( + channels: var_channels, announcementInfo: var_announcementInfo); + } + @protected NodeStatus sse_decode_node_status(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -5270,6 +5398,29 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { } } + @protected + NodeAnnouncementInfo? sse_decode_opt_box_autoadd_node_announcement_info( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + if (sse_decode_bool(deserializer)) { + return (sse_decode_box_autoadd_node_announcement_info(deserializer)); + } else { + return null; + } + } + + @protected + NodeInfo? sse_decode_opt_box_autoadd_node_info(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + if (sse_decode_bool(deserializer)) { + return (sse_decode_box_autoadd_node_info(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 @@ -6256,6 +6407,26 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { sse_encode_max_dust_htlc_exposure(self, serializer); } + @protected + void sse_encode_box_autoadd_node_announcement_info( + NodeAnnouncementInfo self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_node_announcement_info(self, serializer); + } + + @protected + void sse_encode_box_autoadd_node_id(NodeId self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_node_id(self, serializer); + } + + @protected + void sse_encode_box_autoadd_node_info( + NodeInfo self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_node_info(self, serializer); + } + @protected void sse_encode_box_autoadd_offer(Offer self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -6697,7 +6868,7 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { void sse_encode_ldk_network_graph( LdkNetworkGraph self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_RustOpaque_ldk_nodegraphNetworkGraph(self.inner, serializer); + sse_encode_RustOpaque_ldk_nodegraphNetworkGraph(self.ptr, serializer); } @protected @@ -7058,12 +7229,29 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { sse_encode_i_32(self.index, serializer); } + @protected + void sse_encode_node_announcement_info( + NodeAnnouncementInfo self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_u_32(self.lastUpdate, serializer); + sse_encode_String(self.alias, serializer); + sse_encode_list_socket_address(self.addresses, serializer); + } + @protected void sse_encode_node_id(NodeId self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_list_prim_u_8_strict(self.compressed, serializer); } + @protected + void sse_encode_node_info(NodeInfo self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_list_prim_u_64_strict(self.channels, serializer); + sse_encode_opt_box_autoadd_node_announcement_info( + self.announcementInfo, serializer); + } + @protected void sse_encode_node_status(NodeStatus self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -7234,6 +7422,28 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { } } + @protected + void sse_encode_opt_box_autoadd_node_announcement_info( + NodeAnnouncementInfo? 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_node_announcement_info(self, serializer); + } + } + + @protected + void sse_encode_opt_box_autoadd_node_info( + NodeInfo? 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_node_info(self, serializer); + } + } + @protected void sse_encode_opt_box_autoadd_out_point( OutPoint? self, SseSerializer serializer) { diff --git a/lib/src/generated/frb_generated.io.dart b/lib/src/generated/frb_generated.io.dart index 2e30b3b..2a81baf 100644 --- a/lib/src/generated/frb_generated.io.dart +++ b/lib/src/generated/frb_generated.io.dart @@ -208,6 +208,16 @@ abstract class coreApiImplPlatform extends BaseApiImpl { MaxDustHTLCExposure dco_decode_box_autoadd_max_dust_htlc_exposure( dynamic raw); + @protected + NodeAnnouncementInfo dco_decode_box_autoadd_node_announcement_info( + dynamic raw); + + @protected + NodeId dco_decode_box_autoadd_node_id(dynamic raw); + + @protected + NodeInfo dco_decode_box_autoadd_node_info(dynamic raw); + @protected Offer dco_decode_box_autoadd_offer(dynamic raw); @@ -377,9 +387,15 @@ abstract class coreApiImplPlatform extends BaseApiImpl { @protected Network dco_decode_network(dynamic raw); + @protected + NodeAnnouncementInfo dco_decode_node_announcement_info(dynamic raw); + @protected NodeId dco_decode_node_id(dynamic raw); + @protected + NodeInfo dco_decode_node_info(dynamic raw); + @protected NodeStatus dco_decode_node_status(dynamic raw); @@ -435,6 +451,13 @@ abstract class coreApiImplPlatform extends BaseApiImpl { MaxDustHTLCExposure? dco_decode_opt_box_autoadd_max_dust_htlc_exposure( dynamic raw); + @protected + NodeAnnouncementInfo? dco_decode_opt_box_autoadd_node_announcement_info( + dynamic raw); + + @protected + NodeInfo? dco_decode_opt_box_autoadd_node_info(dynamic raw); + @protected OutPoint? dco_decode_opt_box_autoadd_out_point(dynamic raw); @@ -729,6 +752,16 @@ abstract class coreApiImplPlatform extends BaseApiImpl { MaxDustHTLCExposure sse_decode_box_autoadd_max_dust_htlc_exposure( SseDeserializer deserializer); + @protected + NodeAnnouncementInfo sse_decode_box_autoadd_node_announcement_info( + SseDeserializer deserializer); + + @protected + NodeId sse_decode_box_autoadd_node_id(SseDeserializer deserializer); + + @protected + NodeInfo sse_decode_box_autoadd_node_info(SseDeserializer deserializer); + @protected Offer sse_decode_box_autoadd_offer(SseDeserializer deserializer); @@ -916,9 +949,16 @@ abstract class coreApiImplPlatform extends BaseApiImpl { @protected Network sse_decode_network(SseDeserializer deserializer); + @protected + NodeAnnouncementInfo sse_decode_node_announcement_info( + SseDeserializer deserializer); + @protected NodeId sse_decode_node_id(SseDeserializer deserializer); + @protected + NodeInfo sse_decode_node_info(SseDeserializer deserializer); + @protected NodeStatus sse_decode_node_status(SseDeserializer deserializer); @@ -978,6 +1018,13 @@ abstract class coreApiImplPlatform extends BaseApiImpl { MaxDustHTLCExposure? sse_decode_opt_box_autoadd_max_dust_htlc_exposure( SseDeserializer deserializer); + @protected + NodeAnnouncementInfo? sse_decode_opt_box_autoadd_node_announcement_info( + SseDeserializer deserializer); + + @protected + NodeInfo? sse_decode_opt_box_autoadd_node_info(SseDeserializer deserializer); + @protected OutPoint? sse_decode_opt_box_autoadd_out_point(SseDeserializer deserializer); @@ -1346,6 +1393,32 @@ abstract class coreApiImplPlatform extends BaseApiImpl { return ptr; } + @protected + ffi.Pointer + cst_encode_box_autoadd_node_announcement_info(NodeAnnouncementInfo raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_node_announcement_info(); + cst_api_fill_to_wire_node_announcement_info(raw, ptr.ref); + return ptr; + } + + @protected + ffi.Pointer cst_encode_box_autoadd_node_id(NodeId raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_node_id(); + cst_api_fill_to_wire_node_id(raw, ptr.ref); + return ptr; + } + + @protected + ffi.Pointer cst_encode_box_autoadd_node_info( + NodeInfo raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_node_info(); + cst_api_fill_to_wire_node_info(raw, ptr.ref); + return ptr; + } + @protected ffi.Pointer cst_encode_box_autoadd_offer(Offer raw) { // Codec=Cst (C-struct based), see doc to use other codecs @@ -1712,6 +1785,23 @@ abstract class coreApiImplPlatform extends BaseApiImpl { : cst_encode_box_autoadd_max_dust_htlc_exposure(raw); } + @protected + ffi.Pointer + cst_encode_opt_box_autoadd_node_announcement_info( + NodeAnnouncementInfo? raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw == null + ? ffi.nullptr + : cst_encode_box_autoadd_node_announcement_info(raw); + } + + @protected + ffi.Pointer cst_encode_opt_box_autoadd_node_info( + NodeInfo? raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw == null ? ffi.nullptr : cst_encode_box_autoadd_node_info(raw); + } + @protected ffi.Pointer cst_encode_opt_box_autoadd_out_point( OutPoint? raw) { @@ -2106,6 +2196,25 @@ abstract class coreApiImplPlatform extends BaseApiImpl { cst_api_fill_to_wire_max_dust_htlc_exposure(apiObj, wireObj.ref); } + @protected + void cst_api_fill_to_wire_box_autoadd_node_announcement_info( + NodeAnnouncementInfo apiObj, + ffi.Pointer wireObj) { + cst_api_fill_to_wire_node_announcement_info(apiObj, wireObj.ref); + } + + @protected + void cst_api_fill_to_wire_box_autoadd_node_id( + NodeId apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_node_id(apiObj, wireObj.ref); + } + + @protected + void cst_api_fill_to_wire_box_autoadd_node_info( + NodeInfo apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_node_info(apiObj, wireObj.ref); + } + @protected void cst_api_fill_to_wire_box_autoadd_offer( Offer apiObj, ffi.Pointer wireObj) { @@ -2592,8 +2701,7 @@ abstract class coreApiImplPlatform extends BaseApiImpl { @protected void cst_api_fill_to_wire_ldk_network_graph( LdkNetworkGraph apiObj, wire_cst_ldk_network_graph wireObj) { - wireObj.inner = - cst_encode_RustOpaque_ldk_nodegraphNetworkGraph(apiObj.inner); + wireObj.ptr = cst_encode_RustOpaque_ldk_nodegraphNetworkGraph(apiObj.ptr); } @protected @@ -2961,11 +3069,28 @@ abstract class coreApiImplPlatform extends BaseApiImpl { } } + @protected + void cst_api_fill_to_wire_node_announcement_info( + NodeAnnouncementInfo apiObj, wire_cst_node_announcement_info wireObj) { + wireObj.last_update = cst_encode_u_32(apiObj.lastUpdate); + wireObj.alias = cst_encode_String(apiObj.alias); + wireObj.addresses = cst_encode_list_socket_address(apiObj.addresses); + } + @protected void cst_api_fill_to_wire_node_id(NodeId apiObj, wire_cst_node_id wireObj) { wireObj.compressed = cst_encode_list_prim_u_8_strict(apiObj.compressed); } + @protected + void cst_api_fill_to_wire_node_info( + NodeInfo apiObj, wire_cst_node_info wireObj) { + wireObj.channels = cst_encode_list_prim_u_64_strict(apiObj.channels); + wireObj.announcement_info = + cst_encode_opt_box_autoadd_node_announcement_info( + apiObj.announcementInfo); + } + @protected void cst_api_fill_to_wire_node_status( NodeStatus apiObj, wire_cst_node_status wireObj) { @@ -3501,6 +3626,17 @@ abstract class coreApiImplPlatform extends BaseApiImpl { void sse_encode_box_autoadd_max_dust_htlc_exposure( MaxDustHTLCExposure self, SseSerializer serializer); + @protected + void sse_encode_box_autoadd_node_announcement_info( + NodeAnnouncementInfo self, SseSerializer serializer); + + @protected + void sse_encode_box_autoadd_node_id(NodeId self, SseSerializer serializer); + + @protected + void sse_encode_box_autoadd_node_info( + NodeInfo self, SseSerializer serializer); + @protected void sse_encode_box_autoadd_offer(Offer self, SseSerializer serializer); @@ -3702,9 +3838,16 @@ abstract class coreApiImplPlatform extends BaseApiImpl { @protected void sse_encode_network(Network self, SseSerializer serializer); + @protected + void sse_encode_node_announcement_info( + NodeAnnouncementInfo self, SseSerializer serializer); + @protected void sse_encode_node_id(NodeId self, SseSerializer serializer); + @protected + void sse_encode_node_info(NodeInfo self, SseSerializer serializer); + @protected void sse_encode_node_status(NodeStatus self, SseSerializer serializer); @@ -3764,6 +3907,14 @@ abstract class coreApiImplPlatform extends BaseApiImpl { void sse_encode_opt_box_autoadd_max_dust_htlc_exposure( MaxDustHTLCExposure? self, SseSerializer serializer); + @protected + void sse_encode_opt_box_autoadd_node_announcement_info( + NodeAnnouncementInfo? self, SseSerializer serializer); + + @protected + void sse_encode_opt_box_autoadd_node_info( + NodeInfo? self, SseSerializer serializer); + @protected void sse_encode_opt_box_autoadd_out_point( OutPoint? self, SseSerializer serializer); @@ -4545,6 +4696,30 @@ class coreWire implements BaseWire { _wire__crate__api__graph__ldk_network_graph_list_nodesPtr.asFunction< void Function(int, ffi.Pointer)>(); + void wire__crate__api__graph__ldk_network_graph_node( + int port_, + ffi.Pointer that, + ffi.Pointer node_id, + ) { + return _wire__crate__api__graph__ldk_network_graph_node( + port_, + that, + node_id, + ); + } + + late final _wire__crate__api__graph__ldk_network_graph_nodePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_node'); + late final _wire__crate__api__graph__ldk_network_graph_node = + _wire__crate__api__graph__ldk_network_graph_nodePtr.asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer)>(); + void wire__crate__api__node__ldk_node_bolt11_payment( int port_, ffi.Pointer ptr, @@ -4893,11 +5068,11 @@ class coreWire implements BaseWire { void wire__crate__api__node__ldk_node_network_graph( int port_, - ffi.Pointer that, + ffi.Pointer ptr, ) { return _wire__crate__api__node__ldk_node_network_graph( port_, - that, + ptr, ); } @@ -5900,6 +6075,39 @@ class coreWire implements BaseWire { _cst_new_box_autoadd_max_dust_htlc_exposurePtr.asFunction< ffi.Pointer Function()>(); + ffi.Pointer + cst_new_box_autoadd_node_announcement_info() { + return _cst_new_box_autoadd_node_announcement_info(); + } + + late final _cst_new_box_autoadd_node_announcement_infoPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_node_announcement_info'); + late final _cst_new_box_autoadd_node_announcement_info = + _cst_new_box_autoadd_node_announcement_infoPtr.asFunction< + ffi.Pointer Function()>(); + + ffi.Pointer cst_new_box_autoadd_node_id() { + return _cst_new_box_autoadd_node_id(); + } + + late final _cst_new_box_autoadd_node_idPtr = + _lookup Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_node_id'); + late final _cst_new_box_autoadd_node_id = _cst_new_box_autoadd_node_idPtr + .asFunction Function()>(); + + ffi.Pointer cst_new_box_autoadd_node_info() { + return _cst_new_box_autoadd_node_info(); + } + + late final _cst_new_box_autoadd_node_infoPtr = + _lookup Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_node_info'); + late final _cst_new_box_autoadd_node_info = _cst_new_box_autoadd_node_infoPtr + .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_offer() { return _cst_new_box_autoadd_offer(); } @@ -6508,7 +6716,11 @@ final class wire_cst_liquidity_source_config extends ffi.Struct { final class wire_cst_ldk_network_graph extends ffi.Struct { @ffi.UintPtr() - external int inner; + external int ptr; +} + +final class wire_cst_node_id extends ffi.Struct { + external ffi.Pointer compressed; } final class wire_cst_ldk_node extends ffi.Struct { @@ -6639,10 +6851,6 @@ final class wire_cst_channel_id extends ffi.Struct { external ffi.Pointer data; } -final class wire_cst_node_id extends ffi.Struct { - external ffi.Pointer compressed; -} - final class wire_cst_routing_fees extends ffi.Struct { @ffi.Uint32() external int base_msat; @@ -6814,6 +7022,28 @@ final class wire_cst_lsp_fee_limits extends ffi.Struct { external ffi.Pointer max_proportional_opening_fee_ppm_msat; } +final class wire_cst_node_announcement_info extends ffi.Struct { + @ffi.Uint32() + external int last_update; + + external ffi.Pointer alias; + + external ffi.Pointer addresses; +} + +final class wire_cst_list_prim_u_64_strict extends ffi.Struct { + external ffi.Pointer ptr; + + @ffi.Int32() + external int len; +} + +final class wire_cst_node_info extends ffi.Struct { + external ffi.Pointer channels; + + external ffi.Pointer announcement_info; +} + final class wire_cst_offer_id extends ffi.Struct { external ffi.Pointer field0; } @@ -7181,13 +7411,6 @@ final class wire_cst_list_pending_sweep_balance extends ffi.Struct { external int len; } -final class wire_cst_list_prim_u_64_strict 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; diff --git a/rust/src/frb_generated.io.rs b/rust/src/frb_generated.io.rs index 9bc6adf..e31850e 100644 --- a/rust/src/frb_generated.io.rs +++ b/rust/src/frb_generated.io.rs @@ -348,6 +348,27 @@ impl CstDecode for *mut wire_cst_max_dus CstDecode::::cst_decode(*wrap).into() } } +impl CstDecode for *mut wire_cst_node_announcement_info { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::NodeAnnouncementInfo { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} +impl CstDecode for *mut wire_cst_node_id { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::NodeId { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} +impl CstDecode for *mut wire_cst_node_info { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::NodeInfo { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} impl CstDecode for *mut wire_cst_offer { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::bolt12::Offer { @@ -778,7 +799,7 @@ impl CstDecode for wire_cst_ldk_network_grap // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::graph::LdkNetworkGraph { crate::api::graph::LdkNetworkGraph { - inner: self.inner.cst_decode(), + ptr: self.ptr.cst_decode(), } } } @@ -1079,6 +1100,16 @@ impl CstDecode for wire_cst_max_dust_htl } } } +impl CstDecode for wire_cst_node_announcement_info { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::NodeAnnouncementInfo { + crate::api::graph::NodeAnnouncementInfo { + last_update: self.last_update.cst_decode(), + alias: self.alias.cst_decode(), + addresses: self.addresses.cst_decode(), + } + } +} impl CstDecode for wire_cst_node_id { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::graph::NodeId { @@ -1087,6 +1118,15 @@ impl CstDecode for wire_cst_node_id { } } } +impl CstDecode for wire_cst_node_info { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::NodeInfo { + crate::api::graph::NodeInfo { + channels: self.channels.cst_decode(), + announcement_info: self.announcement_info.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 { @@ -1739,7 +1779,7 @@ impl Default for wire_cst_ldk_mnemonic { impl NewWithNullPtr for wire_cst_ldk_network_graph { fn new_with_null_ptr() -> Self { Self { - inner: Default::default(), + ptr: Default::default(), } } } @@ -1848,6 +1888,20 @@ impl Default for wire_cst_max_dust_htlc_exposure { Self::new_with_null_ptr() } } +impl NewWithNullPtr for wire_cst_node_announcement_info { + fn new_with_null_ptr() -> Self { + Self { + last_update: Default::default(), + alias: core::ptr::null_mut(), + addresses: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_node_announcement_info { + fn default() -> Self { + Self::new_with_null_ptr() + } +} impl NewWithNullPtr for wire_cst_node_id { fn new_with_null_ptr() -> Self { Self { @@ -1860,6 +1914,19 @@ impl Default for wire_cst_node_id { Self::new_with_null_ptr() } } +impl NewWithNullPtr for wire_cst_node_info { + fn new_with_null_ptr() -> Self { + Self { + channels: core::ptr::null_mut(), + announcement_info: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_node_info { + fn default() -> Self { + Self::new_with_null_ptr() + } +} impl NewWithNullPtr for wire_cst_node_status { fn new_with_null_ptr() -> Self { Self { @@ -2384,6 +2451,15 @@ pub extern "C" fn frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_lis wire__crate__api__graph__ldk_network_graph_list_nodes_impl(port_, that) } +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_node( + port_: i64, + that: *mut wire_cst_ldk_network_graph, + node_id: *mut wire_cst_node_id, +) { + wire__crate__api__graph__ldk_network_graph_node_impl(port_, that, node_id) +} + #[no_mangle] pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_bolt11_payment( port_: i64, @@ -2541,9 +2617,9 @@ pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_listening_add #[no_mangle] pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_network_graph( port_: i64, - that: *mut wire_cst_ldk_node, + ptr: *mut wire_cst_ldk_node, ) { - wire__crate__api__node__ldk_node_network_graph_impl(port_, that) + wire__crate__api__node__ldk_node_network_graph_impl(port_, ptr) } #[no_mangle] @@ -3063,6 +3139,24 @@ pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_max_dust_htlc_exposure( ) } +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_node_announcement_info( +) -> *mut wire_cst_node_announcement_info { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_node_announcement_info::new_with_null_ptr(), + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_node_id() -> *mut wire_cst_node_id { + flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_node_id::new_with_null_ptr()) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_node_info() -> *mut wire_cst_node_info { + flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_node_info::new_with_null_ptr()) +} + #[no_mangle] pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_offer() -> *mut wire_cst_offer { flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_offer::new_with_null_ptr()) @@ -3654,7 +3748,7 @@ pub struct wire_cst_ldk_mnemonic { #[repr(C)] #[derive(Clone, Copy)] pub struct wire_cst_ldk_network_graph { - inner: usize, + ptr: usize, } #[repr(C)] #[derive(Clone, Copy)] @@ -3864,11 +3958,24 @@ pub struct wire_cst_MaxDustHTLCExposure_FeeRateMultiplier { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_node_announcement_info { + last_update: u32, + alias: *mut wire_cst_list_prim_u_8_strict, + addresses: *mut wire_cst_list_socket_address, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_node_id { compressed: *mut wire_cst_list_prim_u_8_strict, } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_node_info { + channels: *mut wire_cst_list_prim_u_64_strict, + announcement_info: *mut wire_cst_node_announcement_info, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_node_status { is_running: bool, is_listening: bool, diff --git a/rust/src/frb_generated.rs b/rust/src/frb_generated.rs index 4e35af8..88c1758 100644 --- a/rust/src/frb_generated.rs +++ b/rust/src/frb_generated.rs @@ -41,7 +41,7 @@ flutter_rust_bridge::frb_generated_boilerplate!( default_rust_auto_opaque = RustAutoOpaqueNom, ); pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.0.0"; -pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = 1452486004; +pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = -1350521949; // Section: executor @@ -695,6 +695,31 @@ fn wire__crate__api__graph__ldk_network_graph_list_nodes_impl( }, ) } +fn wire__crate__api__graph__ldk_network_graph_node_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode, + node_id: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ldk_network_graph_node", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_node_id = node_id.cst_decode(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = + crate::api::graph::LdkNetworkGraph::node(&api_that, api_node_id)?; + Ok(output_ok) + })( + )) + } + }, + ) +} fn wire__crate__api__node__ldk_node_bolt11_payment_impl( port_: flutter_rust_bridge::for_generated::MessagePort, ptr: impl CstDecode, @@ -1084,7 +1109,7 @@ fn wire__crate__api__node__ldk_node_listening_addresses_impl( } fn wire__crate__api__node__ldk_node_network_graph_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + ptr: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { @@ -1093,11 +1118,11 @@ fn wire__crate__api__node__ldk_node_network_graph_impl( mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { - let api_that = that.cst_decode(); + let api_ptr = ptr.cst_decode(); move |context| { transform_result_dco::<_, _, ()>((move || { let output_ok = - Result::<_, ()>::Ok(crate::api::node::LdkNode::network_graph(&api_that))?; + Result::<_, ()>::Ok(crate::api::node::LdkNode::network_graph(api_ptr))?; Ok(output_ok) })()) } @@ -2428,9 +2453,8 @@ impl SseDecode for crate::api::builder::LdkMnemonic { impl SseDecode for crate::api::graph::LdkNetworkGraph { // 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_inner = - >::sse_decode(deserializer); - return crate::api::graph::LdkNetworkGraph { inner: var_inner }; + let mut var_ptr = >::sse_decode(deserializer); + return crate::api::graph::LdkNetworkGraph { ptr: var_ptr }; } } @@ -2924,6 +2948,20 @@ impl SseDecode for crate::api::types::Network { } } +impl SseDecode for crate::api::graph::NodeAnnouncementInfo { + // 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_lastUpdate = ::sse_decode(deserializer); + let mut var_alias = ::sse_decode(deserializer); + let mut var_addresses = >::sse_decode(deserializer); + return crate::api::graph::NodeAnnouncementInfo { + last_update: var_lastUpdate, + alias: var_alias, + addresses: var_addresses, + }; + } +} + impl SseDecode for crate::api::graph::NodeId { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -2934,6 +2972,19 @@ impl SseDecode for crate::api::graph::NodeId { } } +impl SseDecode for crate::api::graph::NodeInfo { + // 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_channels = >::sse_decode(deserializer); + let mut var_announcementInfo = + >::sse_decode(deserializer); + return crate::api::graph::NodeInfo { + channels: var_channels, + announcement_info: var_announcementInfo, + }; + } +} + 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 { @@ -3133,6 +3184,30 @@ 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 { @@ -4446,7 +4521,7 @@ impl flutter_rust_bridge::IntoIntoDart // Codec=Dco (DartCObject based), see doc to use other codecs impl flutter_rust_bridge::IntoDart for crate::api::graph::LdkNetworkGraph { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [self.inner.into_into_dart().into_dart()].into_dart() + [self.ptr.into_into_dart().into_dart()].into_dart() } } impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive @@ -4813,6 +4888,28 @@ 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::graph::NodeAnnouncementInfo { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [ + self.last_update.into_into_dart().into_dart(), + self.alias.into_into_dart().into_dart(), + self.addresses.into_into_dart().into_dart(), + ] + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::graph::NodeAnnouncementInfo +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::graph::NodeAnnouncementInfo +{ + fn into_into_dart(self) -> crate::api::graph::NodeAnnouncementInfo { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs impl flutter_rust_bridge::IntoDart for crate::api::graph::NodeId { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { [self.compressed.into_into_dart().into_dart()].into_dart() @@ -4825,6 +4922,24 @@ impl flutter_rust_bridge::IntoIntoDart for crate::api } } // Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::graph::NodeInfo { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [ + self.channels.into_into_dart().into_dart(), + self.announcement_info.into_into_dart().into_dart(), + ] + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::graph::NodeInfo {} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::graph::NodeInfo +{ + fn into_into_dart(self) -> crate::api::graph::NodeInfo { + 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 { [ @@ -5934,7 +6049,7 @@ impl SseEncode for crate::api::builder::LdkMnemonic { impl SseEncode for crate::api::graph::LdkNetworkGraph { // 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.inner, serializer); + >::sse_encode(self.ptr, serializer); } } @@ -6382,6 +6497,15 @@ impl SseEncode for crate::api::types::Network { } } +impl SseEncode for crate::api::graph::NodeAnnouncementInfo { + // 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.last_update, serializer); + ::sse_encode(self.alias, serializer); + >::sse_encode(self.addresses, serializer); + } +} + impl SseEncode for crate::api::graph::NodeId { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -6389,6 +6513,17 @@ impl SseEncode for crate::api::graph::NodeId { } } +impl SseEncode for crate::api::graph::NodeInfo { + // 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.channels, serializer); + >::sse_encode( + self.announcement_info, + serializer, + ); + } +} + 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) { @@ -6550,6 +6685,26 @@ 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) { From 28e98c4a26c6eb459b7095c361fd2c65e3c3e3e4 Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Fri, 28 Jun 2024 14:49:00 -0400 Subject: [PATCH 26/48] code formatted --- rust/src/api/builder.rs | 59 ++--- rust/src/api/graph.rs | 74 +++--- rust/src/api/mod.rs | 10 +- rust/src/api/node.rs | 55 +++-- rust/src/api/on_chain.rs | 34 ++- rust/src/api/spontaneous.rs | 17 +- rust/src/api/types.rs | 470 ++++++++++++++++++++---------------- rust/src/utils/error.rs | 75 +++--- rust/src/utils/mod.rs | 2 +- 9 files changed, 454 insertions(+), 342 deletions(-) diff --git a/rust/src/api/builder.rs b/rust/src/api/builder.rs index 5d1d1f3..0411f2d 100644 --- a/rust/src/api/builder.rs +++ b/rust/src/api/builder.rs @@ -1,10 +1,12 @@ -use std::str::FromStr; -use flutter_rust_bridge::frb; -use ldk_node::lightning::util::ser::Writeable; use crate::api::node::LdkNode; -use crate::api::types::{ChainDataSourceConfig, Config, EntropySourceConfig, GossipSourceConfig, LiquiditySourceConfig}; +use crate::api::types::{ + ChainDataSourceConfig, Config, EntropySourceConfig, GossipSourceConfig, LiquiditySourceConfig, +}; use crate::frb_generated::RustOpaque; use crate::utils::error::LdkBuilderError; +use flutter_rust_bridge::frb; +use ldk_node::lightning::util::ser::Writeable; +use std::str::FromStr; #[derive(Debug, Clone)] pub struct LdkMnemonic { @@ -33,7 +35,7 @@ impl LdkMnemonic { #[frb(opaque)] pub struct NodeBuilder { - pub builder: RustOpaque + pub builder: RustOpaque, } impl NodeBuilder { @@ -52,7 +54,10 @@ impl NodeBuilder { EntropySourceConfig::Bip39Mnemonic { mnemonic, passphrase, - } => builder.set_entropy_bip39_mnemonic(>::try_into(mnemonic)?, passphrase), + } => builder.set_entropy_bip39_mnemonic( + >::try_into(mnemonic)?, + passphrase, + ), }; } if let Some(source) = chain_data_source_config { @@ -69,16 +74,19 @@ impl NodeBuilder { if let Some(liquidity) = liquidity_source_config { builder.set_liquidity_source_lsps2( liquidity.lsps2_service.0.try_into()?, - liquidity.lsps2_service.1.try_into().map_err(|_| LdkBuilderError::InvalidPublicKey)?, + liquidity + .lsps2_service + .1 + .try_into() + .map_err(|_| LdkBuilderError::InvalidPublicKey)?, liquidity.lsps2_service.2, ); } - Ok(NodeBuilder { builder: RustOpaque::new(builder) }) + Ok(NodeBuilder { + builder: RustOpaque::new(builder), + }) } - pub fn build( - self - ) -> anyhow::Result { - + pub fn build(self) -> anyhow::Result { match self.builder.build() { Ok(e) => Ok(LdkNode { ptr: RustOpaque::new(e), @@ -86,10 +94,7 @@ impl NodeBuilder { Err(e) => Err(e.into()), } } - pub fn build_with_fs_store( - self - ) -> anyhow::Result { - + pub fn build_with_fs_store(self) -> anyhow::Result { match self.builder.build_with_fs_store() { Ok(e) => Ok(LdkNode { ptr: RustOpaque::new(e), @@ -97,16 +102,16 @@ impl NodeBuilder { Err(e) => Err(e.into()), } } -// fn build_with_store( -// self -// ) -> anyhow::Result { -// match self.builder.build_with_store(Arc::new(())) { -// Ok(e) => Ok(LdkNode { -// ptr: RustOpaque::new(e), -// }), -// Err(e) => Err(e.into()), -// } -// } + // fn build_with_store( + // self + // ) -> anyhow::Result { + // match self.builder.build_with_store(Arc::new(())) { + // Ok(e) => Ok(LdkNode { + // ptr: RustOpaque::new(e), + // }), + // Err(e) => Err(e.into()), + // } + // } } // pub fn build_with_vss_store( @@ -118,4 +123,4 @@ impl NodeBuilder { // }), // Err(e) => Err(e.into()), // } -// } \ No newline at end of file +// } diff --git a/rust/src/api/graph.rs b/rust/src/api/graph.rs index aae620e..f745e4c 100644 --- a/rust/src/api/graph.rs +++ b/rust/src/api/graph.rs @@ -1,22 +1,26 @@ - -use ldk_node::lightning::util::ser::Writeable; use crate::api::types::SocketAddress; use crate::frb_generated::RustOpaque; use crate::utils::error::LdkNodeError; +use ldk_node::lightning::util::ser::Writeable; ///Represents the compressed public key of a node -pub struct NodeId{pub compressed: Vec } +pub struct NodeId { + pub compressed: Vec, +} -impl From for NodeId{ +impl From for NodeId { fn from(value: ldk_node::lightning::routing::gossip::NodeId) -> Self { - Self{compressed: value.encode()} + Self { + compressed: value.encode(), + } } } -impl TryFrom for ldk_node::lightning::routing::gossip::NodeId{ +impl TryFrom for ldk_node::lightning::routing::gossip::NodeId { type Error = LdkNodeError; fn try_from(value: NodeId) -> Result { - ldk_node::lightning::routing::gossip::NodeId::from_slice(value.compressed.as_slice()).map_err(|e| e.into()) + ldk_node::lightning::routing::gossip::NodeId::from_slice(value.compressed.as_slice()) + .map_err(|e| e.into()) } } ///Fees for routing via a given channel or a node @@ -26,9 +30,12 @@ pub struct RoutingFees { ///Liquidity-based routing fee in millionths of a routed amount. In other words, 10000 is 1%. pub proportional_millionths: u32, } -impl From for RoutingFees{ +impl From for RoutingFees { fn from(value: ldk_node::lightning_invoice::RoutingFees) -> Self { - Self{ base_msat: value.base_msat, proportional_millionths: value.proportional_millionths } + Self { + base_msat: value.base_msat, + proportional_millionths: value.proportional_millionths, + } } } pub struct ChannelUpdateInfo { @@ -47,7 +54,7 @@ pub struct ChannelUpdateInfo { } ///Details about a channel (both directions). Received within a channel announcement. -pub struct ChannelInfo{ +pub struct ChannelInfo { ///Source node of the first direction of a channel pub node_one: NodeId, ///Details about the first direction of a channel @@ -59,13 +66,13 @@ pub struct ChannelInfo{ ///The channel capacity as seen on-chain, if chain lookup is available. pub capacity_sats: Option, } -impl From for ChannelInfo{ +impl From for ChannelInfo { fn from(value: ldk_node::lightning::routing::gossip::ChannelInfo) -> Self { - Self{ - node_one:value.node_one.into(), + Self { + node_one: value.node_one.into(), one_to_two: value.one_to_two.map(|e| e.into()), node_two: value.node_two.into(), - two_to_one:value.two_to_one.map(|e| e.into()), + two_to_one: value.two_to_one.map(|e| e.into()), capacity_sats: value.capacity_sats, } } @@ -73,8 +80,8 @@ impl From for ChannelInfo{ impl From for ChannelUpdateInfo { fn from(value: ldk_node::lightning::routing::gossip::ChannelUpdateInfo) -> Self { - ChannelUpdateInfo{ - last_update: value.last_update, + ChannelUpdateInfo { + last_update: value.last_update, enabled: value.enabled, cltv_expiry_delta: value.cltv_expiry_delta, htlc_minimum_msat: value.htlc_minimum_msat, @@ -90,9 +97,12 @@ pub struct NodeInfo { pub announcement_info: Option, } -impl From for NodeInfo{ +impl From for NodeInfo { fn from(value: ldk_node::lightning::routing::gossip::NodeInfo) -> Self { - NodeInfo{ channels: value.channels, announcement_info: value.announcement_info.map(|e| e.into()) } + NodeInfo { + channels: value.channels, + announcement_info: value.announcement_info.map(|e| e.into()), + } } } pub struct NodeAnnouncementInfo { @@ -107,24 +117,31 @@ pub struct NodeAnnouncementInfo { pub addresses: Vec, } -impl From for NodeAnnouncementInfo{ +impl From for NodeAnnouncementInfo { fn from(value: ldk_node::lightning::routing::gossip::NodeAnnouncementInfo) -> Self { - Self{ + Self { last_update: value.last_update, alias: value.alias.to_string(), - addresses: value.addresses().iter().map(|e| e.to_owned().into()).collect(), + addresses: value + .addresses() + .iter() + .map(|e| e.to_owned().into()) + .collect(), } } } -pub struct LdkNetworkGraph {pub ptr: RustOpaque } +pub struct LdkNetworkGraph { + pub ptr: RustOpaque, +} impl From for LdkNetworkGraph { fn from(value: ldk_node::graph::NetworkGraph) -> Self { - LdkNetworkGraph { ptr: RustOpaque::new(value)} + LdkNetworkGraph { + ptr: RustOpaque::new(value), + } } } impl LdkNetworkGraph { - /// Returns the list of channels in the graph pub fn list_channels(&self) -> Vec { self.ptr.list_channels() @@ -137,11 +154,14 @@ impl LdkNetworkGraph { /// Returns the list of nodes in the graph pub fn list_nodes(&self) -> Vec { - self.ptr.list_nodes().iter().map(|e| e.to_owned().into()).collect() + self.ptr + .list_nodes() + .iter() + .map(|e| e.to_owned().into()) + .collect() } - pub fn node(&self, node_id: NodeId) -> Result, LdkNodeError> { Ok(self.ptr.node(&(node_id.try_into()?)).map(|e| e.into())) } -} \ No newline at end of file +} diff --git a/rust/src/api/mod.rs b/rust/src/api/mod.rs index 8da3638..045ddfe 100644 --- a/rust/src/api/mod.rs +++ b/rust/src/api/mod.rs @@ -1,8 +1,8 @@ -pub mod node; -pub mod types; -pub mod graph; -pub mod bolt12; pub mod bolt11; +pub mod bolt12; +pub mod builder; +pub mod graph; +pub mod node; pub mod on_chain; pub mod spontaneous; -pub mod builder; +pub mod types; diff --git a/rust/src/api/node.rs b/rust/src/api/node.rs index 599eb8c..e320984 100644 --- a/rust/src/api/node.rs +++ b/rust/src/api/node.rs @@ -1,17 +1,14 @@ -use crate::api::types::*; -use crate::frb_generated::RustOpaque; -pub use ldk_node::io::sqlite_store::SqliteStore; -pub use ldk_node::Node; -pub use std::sync::{ Arc, Mutex }; use crate::api::bolt11::LdkBolt11Payment; use crate::api::bolt12::LdkBolt12Payment; use crate::api::graph::LdkNetworkGraph; use crate::api::on_chain::LdkOnChainPayment; use crate::api::spontaneous::LdkSpontaneousPayment; -use crate::utils::error::{LdkNodeError}; - - - +use crate::api::types::*; +use crate::frb_generated::RustOpaque; +use crate::utils::error::LdkNodeError; +pub use ldk_node::io::sqlite_store::SqliteStore; +pub use ldk_node::Node; +pub use std::sync::{Arc, Mutex}; pub struct LdkNode { pub ptr: RustOpaque, @@ -64,13 +61,8 @@ impl LdkNode { Ok(self.ptr.list_balances().into()) } - pub fn list_channels(&self) -> Vec { - self.ptr - .list_channels() - .iter() - .map(|x| x.into()) - .collect() + self.ptr.list_channels().iter().map(|x| x.into()).collect() } pub fn connect( @@ -130,7 +122,10 @@ impl LdkNode { counterparty_node_id: PublicKey, ) -> anyhow::Result<(), LdkNodeError> { self.ptr - .close_channel(&(user_channel_id.try_into()?), counterparty_node_id.try_into()?) + .close_channel( + &(user_channel_id.try_into()?), + counterparty_node_id.try_into()?, + ) .map_err(|e| e.into()) } @@ -140,7 +135,10 @@ impl LdkNode { counterparty_node_id: PublicKey, ) -> anyhow::Result<(), LdkNodeError> { self.ptr - .force_close_channel(&(user_channel_id.try_into()?), counterparty_node_id.try_into()?) + .force_close_channel( + &(user_channel_id.try_into()?), + counterparty_node_id.try_into()?, + ) .map_err(|e| e.into()) } @@ -148,13 +146,13 @@ impl LdkNode { &self, user_channel_id: UserChannelId, counterparty_node_id: PublicKey, - channel_config: ChannelConfig + channel_config: ChannelConfig, ) -> anyhow::Result<(), LdkNodeError> { self.ptr .update_channel_config( &(user_channel_id.try_into()?), counterparty_node_id.try_into()?, - Arc::new(channel_config.into()) + Arc::new(channel_config.into()), ) .map_err(|e| e.into()) } @@ -167,12 +165,14 @@ impl LdkNode { } pub fn remove_payment(&self, payment_id: PaymentId) -> Result<(), LdkNodeError> { - self.ptr.remove_payment(&(payment_id.into())).map_err(|e| e.into()) + self.ptr + .remove_payment(&(payment_id.into())) + .map_err(|e| e.into()) } pub fn list_payments_with_filter( &self, - payment_direction: PaymentDirection + payment_direction: PaymentDirection, ) -> Vec { self.ptr .list_payments_with_filter(|p| p.direction == payment_direction.into()) @@ -200,7 +200,7 @@ impl LdkNode { pub fn sign_message(&self, msg: Vec) -> anyhow::Result { self.ptr.sign_message(msg.as_slice()).map_err(|e| e.into()) } - pub fn network_graph(ptr: Self)-> LdkNetworkGraph { + pub fn network_graph(ptr: Self) -> LdkNetworkGraph { ptr.ptr.network_graph().into() } pub fn bolt11_payment(ptr: Self) -> LdkBolt11Payment { @@ -213,16 +213,19 @@ impl LdkNode { ptr.ptr.spontaneous_payment().into() } pub fn bolt12_payment(ptr: Self) -> LdkBolt12Payment { - LdkBolt12Payment{ptr:RustOpaque::new(ptr.ptr.bolt12_payment())} + LdkBolt12Payment { + ptr: RustOpaque::new(ptr.ptr.bolt12_payment()), + } } pub fn verify_signature( &self, msg: Vec, sig: String, - public_key: PublicKey + public_key: PublicKey, ) -> anyhow::Result { - Ok(self.ptr.verify_signature(msg.as_slice(), sig.as_str(), &public_key.try_into()?)) + Ok(self + .ptr + .verify_signature(msg.as_slice(), sig.as_str(), &public_key.try_into()?)) } } - diff --git a/rust/src/api/on_chain.rs b/rust/src/api/on_chain.rs index 2bece90..14e5fea 100644 --- a/rust/src/api/on_chain.rs +++ b/rust/src/api/on_chain.rs @@ -1,31 +1,39 @@ - use crate::api::types::{Address, Txid}; use crate::frb_generated::RustOpaque; use crate::utils::error::LdkNodeError; pub struct LdkOnChainPayment { - pub ptr:RustOpaque + pub ptr: RustOpaque, } impl From for LdkOnChainPayment { fn from(value: ldk_node::payment::OnchainPayment) -> Self { - LdkOnChainPayment {ptr:RustOpaque::new(value)} + LdkOnChainPayment { + ptr: RustOpaque::new(value), + } } } impl LdkOnChainPayment { pub fn new_address(&self) -> Result { - self.ptr.new_address().map_err(|e| e.into()).map(|e| e.into()) + self.ptr + .new_address() + .map_err(|e| e.into()) + .map(|e| e.into()) } pub fn send_to_address( - &self, address: Address, amount_sats: u64, + &self, + address: Address, + amount_sats: u64, ) -> Result { - self.ptr.send_to_address(&(address.try_into()?), amount_sats).map_err(|e| e.into()).map(|e| e.into()) + self.ptr + .send_to_address(&(address.try_into()?), amount_sats) + .map_err(|e| e.into()) + .map(|e| e.into()) } - pub fn send_all_to_address( - &self, address: Address, - ) -> Result { - self.ptr.send_all_to_address(&(address.try_into()?)).map_err(|e| e.into()).map(|e| e.into()) + pub fn send_all_to_address(&self, address: Address) -> Result { + self.ptr + .send_all_to_address(&(address.try_into()?)) + .map_err(|e| e.into()) + .map(|e| e.into()) } - - -} \ No newline at end of file +} diff --git a/rust/src/api/spontaneous.rs b/rust/src/api/spontaneous.rs index 96e1147..c46f61b 100644 --- a/rust/src/api/spontaneous.rs +++ b/rust/src/api/spontaneous.rs @@ -1,21 +1,28 @@ - use crate::api::types::{PaymentId, PublicKey}; use crate::frb_generated::RustOpaque; use crate::utils::error::LdkNodeError; pub struct LdkSpontaneousPayment { - pub ptr:RustOpaque + pub ptr: RustOpaque, } impl From for LdkSpontaneousPayment { fn from(value: ldk_node::payment::SpontaneousPayment) -> Self { - Self{ptr:RustOpaque::new(value)} + Self { + ptr: RustOpaque::new(value), + } } } impl LdkSpontaneousPayment { pub fn send(&self, amount_msat: u64, node_id: PublicKey) -> Result { - self.ptr.send(amount_msat, node_id.try_into()?).map_err(|e| e.into()).map(|e| e.into()) + self.ptr + .send(amount_msat, node_id.try_into()?) + .map_err(|e| e.into()) + .map(|e| e.into()) } pub fn send_probes(&self, amount_msat: u64, node_id: PublicKey) -> Result<(), LdkNodeError> { - self.ptr.send_probes(amount_msat, node_id.try_into()?).map_err(|e| e.into()).map(|e| e.into()) + self.ptr + .send_probes(amount_msat, node_id.try_into()?) + .map_err(|e| e.into()) + .map(|e| e.into()) } } diff --git a/rust/src/api/types.rs b/rust/src/api/types.rs index a7e748c..a9fbf8e 100644 --- a/rust/src/api/types.rs +++ b/rust/src/api/types.rs @@ -1,10 +1,10 @@ +use crate::api::builder::LdkMnemonic; +use crate::utils::error::{LdkBuilderError, LdkNodeError}; use flutter_rust_bridge::*; -use ldk_node::lightning::util::ser::{ Readable, Writeable }; +use ldk_node::lightning::util::ser::{Readable, Writeable}; +use std::default::Default; use std::str::FromStr; use std::string::ToString; -use std::default::Default; -use crate::api::builder::LdkMnemonic; -use crate::utils::error::{LdkBuilderError, LdkNodeError}; ///The addresses on which the node will listen for incoming connections. #[derive(Debug, Clone, PartialEq, Eq)] @@ -44,13 +44,12 @@ impl From for SocketAddress { checksum, version, port, - } => - SocketAddress::OnionV3 { - ed25519_pubkey, - checksum, - version, - port, - }, + } => SocketAddress::OnionV3 { + ed25519_pubkey, + checksum, + version, + port, + }, ldk_node::lightning::ln::msgs::SocketAddress::Hostname { hostname, port } => { SocketAddress::Hostname { addr: hostname.to_string(), @@ -74,17 +73,20 @@ impl TryFrom for ldk_node::lightning::ln::msgs::SocketAddress { SocketAddress::OnionV2(e) => { Ok(ldk_node::lightning::ln::msgs::SocketAddress::OnionV2(e)) } - SocketAddress::OnionV3 { ed25519_pubkey, checksum, version, port } => - Ok(ldk_node::lightning::ln::msgs::SocketAddress::OnionV3 { - ed25519_pubkey, - checksum, - version, - port, - }), + SocketAddress::OnionV3 { + ed25519_pubkey, + checksum, + version, + port, + } => Ok(ldk_node::lightning::ln::msgs::SocketAddress::OnionV3 { + ed25519_pubkey, + checksum, + version, + port, + }), SocketAddress::Hostname { addr, port } => { Ok(ldk_node::lightning::ln::msgs::SocketAddress::Hostname { - hostname: ldk_node::lightning::util::ser::Hostname - ::try_from(addr) + hostname: ldk_node::lightning::util::ser::Hostname::try_from(addr) .map_err(|_| LdkBuilderError::SocketAddressParseError)?, port, }) @@ -262,14 +264,18 @@ impl From for ClosureReason { ldk_node::lightning::events::ClosureReason::FundingBatchClosure => { ClosureReason::FundingBatchClosure } - ldk_node::lightning::events::ClosureReason::LegacyCooperativeClosure => - ClosureReason::LegacyCooperativeClosure, - ldk_node::lightning::events::ClosureReason::CounterpartyInitiatedCooperativeClosure => - ClosureReason::CounterpartyInitiatedCooperativeClosure, - ldk_node::lightning::events::ClosureReason::LocallyInitiatedCooperativeClosure => - ClosureReason::LocallyInitiatedCooperativeClosure, - ldk_node::lightning::events::ClosureReason::HTLCsTimedOut => - ClosureReason::HTLCsTimedOut, + ldk_node::lightning::events::ClosureReason::LegacyCooperativeClosure => { + ClosureReason::LegacyCooperativeClosure + } + ldk_node::lightning::events::ClosureReason::CounterpartyInitiatedCooperativeClosure => { + ClosureReason::CounterpartyInitiatedCooperativeClosure + } + ldk_node::lightning::events::ClosureReason::LocallyInitiatedCooperativeClosure => { + ClosureReason::LocallyInitiatedCooperativeClosure + } + ldk_node::lightning::events::ClosureReason::HTLCsTimedOut => { + ClosureReason::HTLCsTimedOut + } } } } @@ -506,81 +512,89 @@ pub enum Event { impl From for Event { fn from(value: ldk_node::Event) -> Self { match value { - ldk_node::Event::PaymentSuccessful { payment_id, payment_hash, fee_paid_msat } => - Event::PaymentSuccessful { - payment_id: payment_id.map(|e| e.into()), - payment_hash: PaymentHash { - data: payment_hash.0, - }, - fee_paid_msat, - }, - ldk_node::Event::PaymentFailed { payment_id, payment_hash, reason } => - Event::PaymentFailed { - payment_id: payment_id.map(|e| e.into()), - payment_hash: PaymentHash { - data: payment_hash.0, - }, - reason: reason.map(|e| e.into()), + ldk_node::Event::PaymentSuccessful { + payment_id, + payment_hash, + fee_paid_msat, + } => Event::PaymentSuccessful { + payment_id: payment_id.map(|e| e.into()), + payment_hash: PaymentHash { + data: payment_hash.0, }, - ldk_node::Event::PaymentReceived { payment_id, payment_hash, amount_msat } => - Event::PaymentReceived { - payment_id: payment_id.map(|e| e.into()), - payment_hash: PaymentHash { - data: payment_hash.0, - }, - amount_msat, + fee_paid_msat, + }, + ldk_node::Event::PaymentFailed { + payment_id, + payment_hash, + reason, + } => Event::PaymentFailed { + payment_id: payment_id.map(|e| e.into()), + payment_hash: PaymentHash { + data: payment_hash.0, }, - ldk_node::Event::ChannelReady { channel_id, user_channel_id, counterparty_node_id } => - Event::ChannelReady { - 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::PaymentReceived { + payment_id, + payment_hash, + amount_msat, + } => Event::PaymentReceived { + payment_id: payment_id.map(|e| e.into()), + payment_hash: PaymentHash { + data: payment_hash.0, }, + amount_msat, + }, + ldk_node::Event::ChannelReady { + channel_id, + user_channel_id, + counterparty_node_id, + } => Event::ChannelReady { + channel_id: channel_id.into(), + user_channel_id: user_channel_id.into(), + counterparty_node_id: counterparty_node_id.map(|x| x.into()), + }, ldk_node::Event::ChannelClosed { 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()), - }, + } => 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, user_channel_id, former_temporary_channel_id, counterparty_node_id, funding_txo, - } => - Event::ChannelPending { - channel_id: channel_id.into(), - user_channel_id: user_channel_id.into(), - former_temporary_channel_id: former_temporary_channel_id.into(), - counterparty_node_id: PublicKey { - hex: counterparty_node_id.to_string(), - }, - funding_txo: funding_txo.into(), + } => Event::ChannelPending { + channel_id: channel_id.into(), + user_channel_id: user_channel_id.into(), + former_temporary_channel_id: former_temporary_channel_id.into(), + counterparty_node_id: PublicKey { + hex: counterparty_node_id.to_string(), }, + funding_txo: funding_txo.into(), + }, ldk_node::Event::PaymentClaimable { payment_id, payment_hash, claimable_amount_msat, claim_deadline, - } => - Event::PaymentClaimable { - payment_id: payment_id.into(), - payment_hash: payment_hash.into(), - claimable_amount_msat: claimable_amount_msat, - claim_deadline: claim_deadline, - }, + } => Event::PaymentClaimable { + payment_id: payment_id.into(), + payment_hash: payment_hash.into(), + claimable_amount_msat: claimable_amount_msat, + claim_deadline: claim_deadline, + }, } } } - ///A bitcoin transaction hash/transaction ID. /// #[derive(Debug, Clone, PartialEq, Eq)] @@ -592,8 +606,7 @@ impl TryFrom for ldk_node::bitcoin::Txid { type Error = LdkNodeError; fn try_from(value: Txid) -> Result { - ldk_node::bitcoin::Txid - ::from_str(value.hash.as_str()) + ldk_node::bitcoin::Txid::from_str(value.hash.as_str()) .map_err(|_| LdkNodeError::InvalidTxid) } } @@ -705,6 +718,12 @@ impl From for PaymentPreimage { Self { data: value.0 } } } + +impl From for ldk_node::lightning::ln::PaymentPreimage { + fn from(value: PaymentPreimage) -> Self { + ldk_node::lightning::ln::PaymentPreimage(value.data) + } +} /// payment_secret type, use to authenticate sender to the receiver and tie MPP HTLCs together /// #[derive(Hash, Copy, Clone, PartialEq, Eq, Debug)] @@ -847,37 +866,52 @@ impl From for PaymentKind { fn from(value: ldk_node::payment::PaymentKind) -> Self { match value { ldk_node::payment::PaymentKind::Onchain => PaymentKind::Onchain, - ldk_node::payment::PaymentKind::Bolt11 { hash, preimage, secret } => - PaymentKind::Bolt11 { - hash: hash.into(), - preimage: preimage.map(|e| e.into()), - secret: secret.map(|e| e.into()), - }, - ldk_node::payment::PaymentKind::Bolt11Jit { hash, preimage, secret, lsp_fee_limits } => - PaymentKind::Bolt11Jit { - hash: hash.into(), - preimage: preimage.map(|e| e.into()), - secret: secret.map(|e| e.into()), - lsp_fee_limits: lsp_fee_limits.into(), - }, - ldk_node::payment::PaymentKind::Spontaneous { hash, preimage } => + ldk_node::payment::PaymentKind::Bolt11 { + hash, + preimage, + secret, + } => PaymentKind::Bolt11 { + hash: hash.into(), + preimage: preimage.map(|e| e.into()), + secret: secret.map(|e| e.into()), + }, + ldk_node::payment::PaymentKind::Bolt11Jit { + hash, + preimage, + secret, + lsp_fee_limits, + } => PaymentKind::Bolt11Jit { + hash: hash.into(), + preimage: preimage.map(|e| e.into()), + secret: secret.map(|e| e.into()), + lsp_fee_limits: lsp_fee_limits.into(), + }, + ldk_node::payment::PaymentKind::Spontaneous { hash, preimage } => { PaymentKind::Spontaneous { hash: hash.into(), preimage: preimage.map(|e| e.into()), - }, - ldk_node::payment::PaymentKind::Bolt12Offer { hash, preimage, secret, offer_id } => - PaymentKind::Bolt12Offer { - hash: hash.map(|e| e.into()), - preimage: preimage.map(|e| e.into()), - secret: secret.map(|e| e.into()), - offer_id: offer_id.into(), - }, - ldk_node::payment::PaymentKind::Bolt12Refund { hash, preimage, secret } => - PaymentKind::Bolt12Refund { - hash: hash.map(|e| e.into()), - preimage: preimage.map(|e| e.into()), - secret: secret.map(|e| e.into()), - }, + } + } + ldk_node::payment::PaymentKind::Bolt12Offer { + hash, + preimage, + secret, + offer_id, + } => PaymentKind::Bolt12Offer { + hash: hash.map(|e| e.into()), + preimage: preimage.map(|e| e.into()), + secret: secret.map(|e| e.into()), + offer_id: offer_id.into(), + }, + ldk_node::payment::PaymentKind::Bolt12Refund { + hash, + preimage, + secret, + } => PaymentKind::Bolt12Refund { + hash: hash.map(|e| e.into()), + preimage: preimage.map(|e| e.into()), + secret: secret.map(|e| e.into()), + }, } } } @@ -893,8 +927,7 @@ impl TryFrom for ldk_node::bitcoin::secp256k1::PublicKey { type Error = LdkNodeError; fn try_from(value: PublicKey) -> Result { - ldk_node::bitcoin::secp256k1::PublicKey - ::from_str(value.hex.as_str()) + ldk_node::bitcoin::secp256k1::PublicKey::from_str(value.hex.as_str()) .map_err(|_| LdkNodeError::InvalidPublicKey) } } @@ -915,8 +948,7 @@ impl TryFrom
for ldk_node::bitcoin::Address { type Error = LdkNodeError; fn try_from(value: Address) -> Result { - ldk_node::bitcoin::Address - ::from_str(value.s.as_str()) + ldk_node::bitcoin::Address::from_str(value.s.as_str()) .map(|e| e.assume_checked()) .map_err(|_| LdkNodeError::InvalidAddress) } @@ -1062,12 +1094,22 @@ impl From<&ldk_node::ChannelDetails> for ChannelDetails { 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, + 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, @@ -1255,28 +1297,35 @@ pub struct AnchorChannelsConfig { pub per_channel_reserve_sats: u64, } -impl TryFrom for ldk_node::AnchorChannelsConfig{ +impl TryFrom for ldk_node::AnchorChannelsConfig { type Error = LdkBuilderError; fn try_from(value: AnchorChannelsConfig) -> Result { - let trusted_peers_no_reserve: Result< + let trusted_peers_no_reserve: Result< Vec, - LdkBuilderError - > = value.trusted_peers_no_reserve + LdkBuilderError, + > = value + .trusted_peers_no_reserve .into_iter() - .map(|x| { x.try_into().map_err(|_| LdkBuilderError::InvalidPublicKey) }) + .map(|x| x.try_into().map_err(|_| LdkBuilderError::InvalidPublicKey)) .collect(); - Ok(Self { trusted_peers_no_reserve: trusted_peers_no_reserve?, per_channel_reserve_sats: value.per_channel_reserve_sats }) + Ok(Self { + trusted_peers_no_reserve: trusted_peers_no_reserve?, + per_channel_reserve_sats: value.per_channel_reserve_sats, + }) } } impl From for AnchorChannelsConfig { fn from(value: ldk_node::AnchorChannelsConfig) -> Self { - Self{ trusted_peers_no_reserve: value.trusted_peers_no_reserve - .into_iter() - .map(|e| e.into()) - .collect() - , per_channel_reserve_sats: value.per_channel_reserve_sats } + Self { + trusted_peers_no_reserve: value + .trusted_peers_no_reserve + .into_iter() + .map(|e| e.into()) + .collect(), + per_channel_reserve_sats: value.per_channel_reserve_sats, + } } } @@ -1287,7 +1336,7 @@ impl TryFrom for ldk_node::Config { let addresses = if let Some(addresses) = value.listening_addresses { let addr_vec: Result< Vec, - LdkBuilderError + LdkBuilderError, > = addresses .into_iter() .map(|socket_addr| socket_addr.try_into()) @@ -1296,20 +1345,21 @@ impl TryFrom for ldk_node::Config { } else { None }; - let anchor_channels_config = if let Some(anchor_channels_config) = value.anchor_channels_config{ - let anchr_channels_config: Result< - ldk_node::AnchorChannelsConfig, - LdkBuilderError> = anchor_channels_config.try_into(); - Some(anchr_channels_config?) - }else { - None - }; + let anchor_channels_config = + if let Some(anchor_channels_config) = value.anchor_channels_config { + let anchr_channels_config: Result = + anchor_channels_config.try_into(); + Some(anchr_channels_config?) + } else { + None + }; let trusted_peers_0conf: Result< Vec, - LdkBuilderError - > = value.trusted_peers_0conf + LdkBuilderError, + > = value + .trusted_peers_0conf .into_iter() - .map(|x| { x.try_into().map_err(|_| LdkBuilderError::InvalidPublicKey) }) + .map(|x| x.try_into().map_err(|_| LdkBuilderError::InvalidPublicKey)) .collect(); Ok(ldk_node::Config { @@ -1344,7 +1394,8 @@ impl From for Config { 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 + trusted_peers_0conf: value + .trusted_peers_0conf .into_iter() .map(|x| x.into()) .collect(), @@ -1429,7 +1480,7 @@ impl Default for Config { trusted_peers_0conf: vec![], probing_liquidity_limit_multiplier: 3, log_level: DEFAULT_LOG_LEVEL, - anchor_channels_config:Some(Default::default()), + anchor_channels_config: Some(Default::default()), } } } @@ -1466,11 +1517,13 @@ impl From for BalanceDetails { 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 + lightning_balances: value + .lightning_balances .iter() .map(|e| e.clone().into()) .collect(), - pending_balances_from_channel_closures: value.pending_balances_from_channel_closures + pending_balances_from_channel_closures: value + .pending_balances_from_channel_closures .iter() .map(|e| e.clone().into()) .collect(), @@ -1614,24 +1667,22 @@ impl From for LightningBalance { channel_id, counterparty_node_id, amount_satoshis, - } => - LightningBalance::ClaimableOnChannelClose { - channel_id: channel_id.into(), - counterparty_node_id: counterparty_node_id.into(), - 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, - }, + } => 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, @@ -1639,53 +1690,49 @@ impl From for LightningBalance { 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(), - }, + } => 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(), - }, + } => 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(), - }, + } => 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, - }, + } => LightningBalance::CounterpartyRevokedOutputClaimable { + channel_id: channel_id.into(), + counterparty_node_id: counterparty_node_id.into(), + amount_satoshis, + }, } } } @@ -1735,37 +1782,37 @@ pub enum PendingSweepBalance { 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::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, - }, + } => 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, - }, + } => 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, + }, } } } @@ -1832,7 +1879,8 @@ impl From for NodeStatus { 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, + latest_node_announcement_broadcast_timestamp: value + .latest_node_announcement_broadcast_timestamp, } } } diff --git a/rust/src/utils/error.rs b/rust/src/utils/error.rs index a5a11e0..a988553 100644 --- a/rust/src/utils/error.rs +++ b/rust/src/utils/error.rs @@ -1,6 +1,4 @@ -use ldk_node::{ BuildError, NodeError }; - - +use ldk_node::{BuildError, NodeError}; #[derive(Debug, PartialEq)] pub enum LdkNodeError { @@ -82,13 +80,13 @@ pub enum LdkNodeError { ///Offer creation failed. OfferCreationFailed, ///Refund creation failed. - RefundCreationFailed , + RefundCreationFailed, ///A fee rate estimation update timed out. - FeerateEstimationUpdateTimeout , + FeerateEstimationUpdateTimeout, ///A wallet operation timed out. - WalletOperationTimeout , + WalletOperationTimeout, ///A transaction sync operation timed out. - TxSyncTimeout , + TxSyncTimeout, ///A gossip updating operation timed out. GossipUpdateTimeout, ///The given offer id is invalid. @@ -100,7 +98,7 @@ pub enum LdkNodeError { ///The given refund is invalid. InvalidRefund, ///The provided offer was denominated in an unsupported currency. - UnsupportedCurrency + UnsupportedCurrency, } #[allow(dead_code)] #[derive(Debug)] @@ -169,15 +167,17 @@ impl From for LdkNodeError { NodeError::LiquiditySourceUnavailable => LdkNodeError::LiquiditySourceUnavailable, NodeError::LiquidityFeeTooHigh => LdkNodeError::LiquidityFeeTooHigh, NodeError::InvalidPaymentId => LdkNodeError::InvalidPaymentId, - NodeError::InvoiceRequestCreationFailed =>LdkNodeError::InvoiceRequestCreationFailed, + NodeError::InvoiceRequestCreationFailed => LdkNodeError::InvoiceRequestCreationFailed, NodeError::OfferCreationFailed => LdkNodeError::OfferCreationFailed, NodeError::RefundCreationFailed => LdkNodeError::RefundCreationFailed, - NodeError::FeerateEstimationUpdateTimeout => LdkNodeError::FeerateEstimationUpdateTimeout, - NodeError::WalletOperationTimeout =>LdkNodeError::WalletOperationTimeout, - NodeError::TxSyncTimeout =>LdkNodeError::TxSyncTimeout, + NodeError::FeerateEstimationUpdateTimeout => { + LdkNodeError::FeerateEstimationUpdateTimeout + } + NodeError::WalletOperationTimeout => LdkNodeError::WalletOperationTimeout, + NodeError::TxSyncTimeout => LdkNodeError::TxSyncTimeout, NodeError::GossipUpdateTimeout => LdkNodeError::GossipUpdateTimeout, NodeError::InvalidOfferId => LdkNodeError::InvalidOfferId, - NodeError::InvalidNodeId =>LdkNodeError::InvalidNodeId, + NodeError::InvalidNodeId => LdkNodeError::InvalidNodeId, NodeError::InvalidOffer => LdkNodeError::InvalidOffer, NodeError::InvalidRefund => LdkNodeError::InvalidRefund, NodeError::UnsupportedCurrency => LdkNodeError::UnsupportedCurrency, @@ -221,14 +221,24 @@ impl From for LdkNodeError { impl From for DecodeError { fn from(e: ldk_node::lightning::ln::msgs::DecodeError) -> Self { match e { - ldk_node::lightning::ln::msgs::DecodeError::UnknownVersion => DecodeError::UnknownVersion, - ldk_node::lightning::ln::msgs::DecodeError::UnknownRequiredFeature => DecodeError::UnknownRequiredFeature, + ldk_node::lightning::ln::msgs::DecodeError::UnknownVersion => { + DecodeError::UnknownVersion + } + ldk_node::lightning::ln::msgs::DecodeError::UnknownRequiredFeature => { + DecodeError::UnknownRequiredFeature + } ldk_node::lightning::ln::msgs::DecodeError::InvalidValue => DecodeError::InvalidValue, - ldk_node::lightning::ln::msgs:: DecodeError::ShortRead => DecodeError::ShortRead, - ldk_node::lightning::ln::msgs::DecodeError::BadLengthDescriptor => DecodeError::BadLengthDescriptor, + ldk_node::lightning::ln::msgs::DecodeError::ShortRead => DecodeError::ShortRead, + ldk_node::lightning::ln::msgs::DecodeError::BadLengthDescriptor => { + DecodeError::BadLengthDescriptor + } ldk_node::lightning::ln::msgs::DecodeError::Io(e) => DecodeError::Io(e.to_string()), - ldk_node::lightning::ln::msgs::DecodeError::UnsupportedCompression => DecodeError::UnsupportedCompression, - ldk_node::lightning::ln::msgs::DecodeError::DangerousValue => DecodeError::DangerousValue, + ldk_node::lightning::ln::msgs::DecodeError::UnsupportedCompression => { + DecodeError::UnsupportedCompression + } + ldk_node::lightning::ln::msgs::DecodeError::DangerousValue => { + DecodeError::DangerousValue + } } } } @@ -255,14 +265,25 @@ pub enum Bolt12ParseError { } impl From for LdkNodeError { fn from(value: ldk_node::lightning::offers::parse::Bolt12ParseError) -> Self { - match value{ - ldk_node::lightning::offers::parse::Bolt12ParseError::InvalidContinuation => LdkNodeError::Bolt12Parse(Bolt12ParseError::InvalidContinuation), - ldk_node::lightning::offers::parse::Bolt12ParseError::InvalidBech32Hrp => LdkNodeError::Bolt12Parse(Bolt12ParseError::InvalidBech32Hrp), - ldk_node::lightning::offers::parse::Bolt12ParseError::Bech32(e) =>LdkNodeError::Bolt12Parse(Bolt12ParseError::Bech32(e.to_string())), - ldk_node::lightning::offers::parse::Bolt12ParseError::Decode(e) => LdkNodeError::Bolt12Parse(Bolt12ParseError::Decode(e.into())), - ldk_node::lightning::offers::parse::Bolt12ParseError::InvalidSemantics(e) => LdkNodeError::Bolt12Parse( - Bolt12ParseError::InvalidSemantics(format!("{:?}", e))), - ldk_node::lightning::offers::parse::Bolt12ParseError::InvalidSignature(e) => LdkNodeError::Bolt12Parse(Bolt12ParseError::InvalidSignature(e.to_string())), + match value { + ldk_node::lightning::offers::parse::Bolt12ParseError::InvalidContinuation => { + LdkNodeError::Bolt12Parse(Bolt12ParseError::InvalidContinuation) + } + ldk_node::lightning::offers::parse::Bolt12ParseError::InvalidBech32Hrp => { + LdkNodeError::Bolt12Parse(Bolt12ParseError::InvalidBech32Hrp) + } + ldk_node::lightning::offers::parse::Bolt12ParseError::Bech32(e) => { + LdkNodeError::Bolt12Parse(Bolt12ParseError::Bech32(e.to_string())) + } + ldk_node::lightning::offers::parse::Bolt12ParseError::Decode(e) => { + LdkNodeError::Bolt12Parse(Bolt12ParseError::Decode(e.into())) + } + ldk_node::lightning::offers::parse::Bolt12ParseError::InvalidSemantics(e) => { + LdkNodeError::Bolt12Parse(Bolt12ParseError::InvalidSemantics(format!("{:?}", e))) + } + ldk_node::lightning::offers::parse::Bolt12ParseError::InvalidSignature(e) => { + LdkNodeError::Bolt12Parse(Bolt12ParseError::InvalidSignature(e.to_string())) + } } } } diff --git a/rust/src/utils/mod.rs b/rust/src/utils/mod.rs index a281f3e..a91e735 100644 --- a/rust/src/utils/mod.rs +++ b/rust/src/utils/mod.rs @@ -1 +1 @@ -pub mod error; \ No newline at end of file +pub mod error; From 337efd2bd1fd0b75b2fb87a83d9b1dab04a2105b Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Fri, 28 Jun 2024 18:35:00 -0400 Subject: [PATCH 27/48] feat(Bolt11Payment): Added claimForHash, failForHash, receiveForHash & receiveVariableAmountForHash --- lib/src/generated/api/bolt11.dart | 37 +++++++++ lib/src/root.dart | 73 +++++++++++++++++ rust/src/api/bolt11.rs | 131 ++++++++++++++++++++---------- 3 files changed, 200 insertions(+), 41 deletions(-) diff --git a/lib/src/generated/api/bolt11.dart b/lib/src/generated/api/bolt11.dart index 8cf3a2e..a81e48c 100644 --- a/lib/src/generated/api/bolt11.dart +++ b/lib/src/generated/api/bolt11.dart @@ -38,6 +38,20 @@ class LdkBolt11Payment { required this.ptr, }); + Future claimForHash( + {required PaymentHash paymentHash, + required BigInt claimableAmountMsat, + required PaymentPreimage preimage}) => + core.instance.api.crateApiBolt11LdkBolt11PaymentClaimForHash( + that: this, + paymentHash: paymentHash, + claimableAmountMsat: claimableAmountMsat, + preimage: preimage); + + Future failForHash({required PaymentHash paymentHash}) => + core.instance.api.crateApiBolt11LdkBolt11PaymentFailForHash( + that: this, paymentHash: paymentHash); + Future receive( {required BigInt amountMsat, required String description, @@ -48,11 +62,34 @@ class LdkBolt11Payment { description: description, expirySecs: expirySecs); + Future receiveForHash( + {required PaymentHash paymentHash, + required BigInt amountMsat, + required String description, + required int expirySecs}) => + core.instance.api.crateApiBolt11LdkBolt11PaymentReceiveForHash( + that: this, + paymentHash: paymentHash, + amountMsat: amountMsat, + description: description, + expirySecs: expirySecs); + Future receiveVariableAmount( {required String description, required int expirySecs}) => core.instance.api.crateApiBolt11LdkBolt11PaymentReceiveVariableAmount( that: this, description: description, expirySecs: expirySecs); + Future receiveVariableAmountForHash( + {required String description, + required int expirySecs, + required PaymentHash paymentHash}) => + core.instance.api + .crateApiBolt11LdkBolt11PaymentReceiveVariableAmountForHash( + that: this, + description: description, + expirySecs: expirySecs, + paymentHash: paymentHash); + Future receiveVariableAmountViaJitChannel( {required String description, required int expirySecs, diff --git a/lib/src/root.dart b/lib/src/root.dart index b263bae..9b324d0 100644 --- a/lib/src/root.dart +++ b/lib/src/root.dart @@ -539,6 +539,79 @@ class NetworkGraph extends graph.LdkNetworkGraph { class Bolt11Payment extends bolt11.LdkBolt11Payment { Bolt11Payment._({required super.ptr}); + ///Allows to attempt manually claiming payments with the given preimage that have previously been registered via + ///`receiveForHash` or `receiveVariableAmountForHash`. + /// This should be called in response to a PaymentClaimable event as soon as the preimage is available. + /// Will check that the payment is known, and that the given preimage and claimable amount match our expectations before attempting to claim the payment, and will return an error otherwise. + /// When claiming the payment has succeeded, a PaymentReceived event will be emitted. + @override + Future claimForHash( + {required types.PaymentHash paymentHash, + required BigInt claimableAmountMsat, + required types.PaymentPreimage preimage}) { + try { + return super.claimForHash( + paymentHash: paymentHash, + claimableAmountMsat: claimableAmountMsat, + preimage: preimage); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Allows to manually fail payments with the given hash that have previously been registered via + ///`receiveForHash` or `receiveVariableAmountForHash`. + /// This should be called in response to a PaymentClaimable event if the payment needs to be failed back, e. g., if the correct preimage can't be retrieved in time before the claim deadline has been reached. + /// Will check that the payment is known before failing the payment, and will return an error otherwise. + @override + Future failForHash({required types.PaymentHash paymentHash}) { + try { + return super.failForHash(paymentHash: paymentHash); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Returns a payable invoice that can be used to request a payment of the amount given for the given payment hash. + /// We will register the given payment hash and emit a PaymentClaimable event once the inbound payment arrives. + /// Note: users MUST handle this event and claim the payment manually via claimForHash as soon as they have obtained access to the preimage of the given payment hash. + /// If they're unable to obtain the preimage, they MUST immediately fail the payment via failForHash. + @override + Future receiveForHash( + {required types.PaymentHash paymentHash, + required BigInt amountMsat, + required String description, + required int expirySecs}) { + try { + return super.receiveForHash( + paymentHash: paymentHash, + amountMsat: amountMsat, + description: description, + expirySecs: expirySecs); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Returns a payable invoice that can be used to request a payment for the given payment hash and the amount to be determined by the user, also known as a "zero-amount" invoice. + /// We will register the given payment hash and emit a PaymentClaimable event once the inbound payment arrives. + /// Note: users MUST handle this event and claim the payment manually via `claimForHash` as soon as they have obtained access to the preimage + /// of the given payment hash. If they're unable to obtain the preimage, they MUST immediately fail the payment via `failForHash`. + @override + Future receiveVariableAmountForHash( + {required String description, + required int expirySecs, + required types.PaymentHash paymentHash}) { + try { + return super.receiveVariableAmountForHash( + description: description, + expirySecs: expirySecs, + paymentHash: paymentHash); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + ///Returns a payable invoice that can be used to request and receive a payment of the amount given. /// The inbound payment will be automatically claimed upon arrival. @override diff --git a/rust/src/api/bolt11.rs b/rust/src/api/bolt11.rs index 0df9352..42ad08a 100644 --- a/rust/src/api/bolt11.rs +++ b/rust/src/api/bolt11.rs @@ -1,14 +1,16 @@ -use std::str::FromStr; -use crate::api::types::{ PaymentId}; +use crate::api::types::{PaymentHash, PaymentId, PaymentPreimage}; use crate::frb_generated::RustOpaque; use crate::utils::error::LdkNodeError; +use std::str::FromStr; pub struct LdkBolt11Payment { - pub ptr:RustOpaque + pub ptr: RustOpaque, } impl From for LdkBolt11Payment { fn from(value: ldk_node::payment::Bolt11Payment) -> Self { - LdkBolt11Payment {ptr:RustOpaque::new(value)} + LdkBolt11Payment { + ptr: RustOpaque::new(value), + } } } #[derive(Debug, Clone, PartialEq, Eq)] @@ -22,8 +24,7 @@ impl TryFrom for ldk_node::lightning_invoice::Bolt11Invoice { type Error = LdkNodeError; fn try_from(value: Bolt11Invoice) -> Result { - ldk_node::lightning_invoice::Bolt11Invoice - ::from_str(value.signed_raw_invoice.as_str()) + ldk_node::lightning_invoice::Bolt11Invoice::from_str(value.signed_raw_invoice.as_str()) .map_err(|_| LdkNodeError::InvalidInvoice) } } @@ -36,6 +37,53 @@ impl From for Bolt11Invoice { } impl LdkBolt11Payment { + pub fn send(&self, invoice: Bolt11Invoice) -> Result { + self.ptr + .send(&(invoice.try_into()?)) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + pub fn send_using_amount( + &self, + invoice: Bolt11Invoice, + amount_msat: u64, + ) -> anyhow::Result { + self.ptr + .send_using_amount(&(invoice.try_into()?), amount_msat) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + + pub fn send_probes(&self, invoice: Bolt11Invoice) -> anyhow::Result<(), LdkNodeError> { + self.ptr + .send_probes(&(invoice.try_into()?)) + .map_err(|e| e.into()) + } + + pub fn send_probes_using_amount( + &self, + invoice: Bolt11Invoice, + amount_msat: u64, + ) -> Result<(), LdkNodeError> { + self.ptr + .send_probes_using_amount(&(invoice.try_into()?), amount_msat) + .map_err(|e| e.into()) + } + pub fn claim_for_hash( + &self, + payment_hash: PaymentHash, + claimable_amount_msat: u64, + preimage: PaymentPreimage, + ) -> anyhow::Result<(), LdkNodeError> { + self.ptr + .claim_for_hash(payment_hash.into(), claimable_amount_msat, preimage.into()) + .map_err(|e| e.into()) + } + pub fn fail_for_hash(&self, payment_hash: PaymentHash) -> anyhow::Result<(), LdkNodeError> { + self.ptr + .fail_for_hash(payment_hash.into()) + .map_err(|e| e.into()) + } pub fn receive( &self, amount_msat: u64, @@ -47,14 +95,31 @@ impl LdkBolt11Payment { .map_err(|e| e.into()) .map(|e| e.into()) } + + pub fn receive_for_hash( + &self, + payment_hash: PaymentHash, + amount_msat: u64, + description: String, + expiry_secs: u32, + ) -> anyhow::Result { + self.ptr + .receive_for_hash( + amount_msat, + description.as_str(), + expiry_secs, + payment_hash.into(), + ) + .map_err(|e| e.into()) + .map(|e| e.into()) + } pub fn receive_variable_amount( &self, description: String, expiry_secs: u32, ) -> anyhow::Result { self.ptr - .receive_variable_amount - (description.as_str(), expiry_secs) + .receive_variable_amount(description.as_str(), expiry_secs) .map_err(|e| e.into()) .map(|e| e.into()) } @@ -74,6 +139,22 @@ impl LdkBolt11Payment { } } + pub fn receive_variable_amount_for_hash( + &self, + description: String, + expiry_secs: u32, + payment_hash: PaymentHash + ) -> anyhow::Result { + match self.ptr.receive_variable_amount_for_hash( + description.as_str(), + expiry_secs, + payment_hash.into() + ) { + Ok(e) => Ok(e.into()), + Err(e) => Err(e.into()), + } + } + pub fn receive_via_jit_channel( &self, amount_msat: u64, @@ -91,36 +172,4 @@ impl LdkBolt11Payment { Err(e) => Err(e.into()), } } - - - pub fn send_probes(&self, invoice: Bolt11Invoice) -> anyhow::Result<(), LdkNodeError> { - self.ptr - .send_probes(&(invoice.try_into()?)) - .map_err(|e| e.into()) - } - - - pub fn send_probes_using_amount( - &self, - invoice: Bolt11Invoice, - amount_msat: u64, - ) -> Result<(), LdkNodeError> { - self.ptr - .send_probes_using_amount(&(invoice.try_into()?), amount_msat) - .map_err(|e| e.into()) - } - - pub fn send(&self, invoice: Bolt11Invoice) -> Result { - self.ptr.send(&(invoice.try_into()?)).map_err(|e| e.into()).map(|e| e.into()) - } - pub fn send_using_amount( - &self, - invoice: Bolt11Invoice, - amount_msat: u64, - ) -> anyhow::Result { - self.ptr - .send_using_amount(&(invoice.try_into()?), amount_msat) - .map_err(|e| e.into()) - .map(|e| e.into()) - } -} \ No newline at end of file +} From 1b5343cf342772cf9b23b05ca716a899423a5e6b Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Fri, 28 Jun 2024 23:06:00 -0400 Subject: [PATCH 28/48] code cleanup --- ios/Classes/frb_generated.h | 43 +++++-- lib/src/generated/frb_generated.dart | 158 +++++++++++++++++++++++- lib/src/generated/frb_generated.io.dart | 155 +++++++++++++++++++++-- rust/src/api/bolt12.rs | 77 +++++++----- rust/src/frb_generated.io.rs | 62 ++++++++++ rust/src/frb_generated.rs | 132 +++++++++++++++++++- 6 files changed, 578 insertions(+), 49 deletions(-) diff --git a/ios/Classes/frb_generated.h b/ios/Classes/frb_generated.h index 41f719b..620c796 100644 --- a/ios/Classes/frb_generated.h +++ b/ios/Classes/frb_generated.h @@ -23,6 +23,14 @@ typedef struct wire_cst_list_prim_u_8_strict { int32_t len; } wire_cst_list_prim_u_8_strict; +typedef struct wire_cst_payment_hash { + struct wire_cst_list_prim_u_8_strict *data; +} wire_cst_payment_hash; + +typedef struct wire_cst_payment_preimage { + struct wire_cst_list_prim_u_8_strict *data; +} wire_cst_payment_preimage; + typedef struct wire_cst_bolt_11_invoice { struct wire_cst_list_prim_u_8_strict *signed_raw_invoice; } wire_cst_bolt_11_invoice; @@ -325,10 +333,6 @@ typedef struct wire_cst_closure_reason { union ClosureReasonKind kind; } wire_cst_closure_reason; -typedef struct wire_cst_payment_hash { - struct wire_cst_list_prim_u_8_strict *data; -} wire_cst_payment_hash; - typedef struct wire_cst_Event_PaymentClaimable { struct wire_cst_payment_id *payment_id; struct wire_cst_payment_hash *payment_hash; @@ -424,10 +428,6 @@ typedef struct wire_cst_offer_id { struct wire_cst_list_prim_u_8_strict *field0; } wire_cst_offer_id; -typedef struct wire_cst_payment_preimage { - struct wire_cst_list_prim_u_8_strict *data; -} wire_cst_payment_preimage; - typedef struct wire_cst_payment_secret { struct wire_cst_list_prim_u_8_strict *data; } wire_cst_payment_secret; @@ -686,17 +686,40 @@ typedef struct wire_cst_node_status { uint64_t *latest_node_announcement_broadcast_timestamp; } wire_cst_node_status; +void frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hash(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + struct wire_cst_payment_hash *payment_hash, + uint64_t claimable_amount_msat, + struct wire_cst_payment_preimage *preimage); + +void frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hash(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + struct wire_cst_payment_hash *payment_hash); + void frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive(int64_t port_, struct wire_cst_ldk_bolt_11_payment *that, uint64_t amount_msat, struct wire_cst_list_prim_u_8_strict *description, uint32_t expiry_secs); +void frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hash(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + struct wire_cst_payment_hash *payment_hash, + uint64_t amount_msat, + struct wire_cst_list_prim_u_8_strict *description, + uint32_t expiry_secs); + void frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount(int64_t port_, struct wire_cst_ldk_bolt_11_payment *that, struct wire_cst_list_prim_u_8_strict *description, uint32_t expiry_secs); +void frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hash(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + struct wire_cst_list_prim_u_8_strict *description, + uint32_t expiry_secs, + struct wire_cst_payment_hash *payment_hash); + void frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel(int64_t port_, struct wire_cst_ldk_bolt_11_payment *that, struct wire_cst_list_prim_u_8_strict *description, @@ -1146,8 +1169,12 @@ static int64_t dummy_method_to_enforce_bundling(void) { dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hash); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hash); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hash); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hash); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send); diff --git a/lib/src/generated/frb_generated.dart b/lib/src/generated/frb_generated.dart index ea4fb9e..e65c14f 100644 --- a/lib/src/generated/frb_generated.dart +++ b/lib/src/generated/frb_generated.dart @@ -64,7 +64,7 @@ class core extends BaseEntrypoint { String get codegenVersion => '2.0.0'; @override - int get rustContentHash => -1350521949; + int get rustContentHash => 1761952349; static const kDefaultExternalLibraryLoaderConfig = ExternalLibraryLoaderConfig( @@ -75,17 +75,40 @@ class core extends BaseEntrypoint { } abstract class coreApi extends BaseApi { + Future crateApiBolt11LdkBolt11PaymentClaimForHash( + {required LdkBolt11Payment that, + required PaymentHash paymentHash, + required BigInt claimableAmountMsat, + required PaymentPreimage preimage}); + + Future crateApiBolt11LdkBolt11PaymentFailForHash( + {required LdkBolt11Payment that, required PaymentHash paymentHash}); + Future crateApiBolt11LdkBolt11PaymentReceive( {required LdkBolt11Payment that, required BigInt amountMsat, required String description, required int expirySecs}); + Future crateApiBolt11LdkBolt11PaymentReceiveForHash( + {required LdkBolt11Payment that, + required PaymentHash paymentHash, + required BigInt amountMsat, + required String description, + required int expirySecs}); + Future crateApiBolt11LdkBolt11PaymentReceiveVariableAmount( {required LdkBolt11Payment that, required String description, required int expirySecs}); + Future + crateApiBolt11LdkBolt11PaymentReceiveVariableAmountForHash( + {required LdkBolt11Payment that, + required String description, + required int expirySecs, + required PaymentHash paymentHash}); + Future crateApiBolt11LdkBolt11PaymentReceiveVariableAmountViaJitChannel( {required LdkBolt11Payment that, @@ -371,6 +394,64 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { required super.portManager, }); + @override + Future crateApiBolt11LdkBolt11PaymentClaimForHash( + {required LdkBolt11Payment that, + required PaymentHash paymentHash, + required BigInt claimableAmountMsat, + required PaymentPreimage preimage}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); + var arg1 = cst_encode_box_autoadd_payment_hash(paymentHash); + var arg2 = cst_encode_u_64(claimableAmountMsat); + var arg3 = cst_encode_box_autoadd_payment_preimage(preimage); + return wire + .wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hash( + port_, arg0, arg1, arg2, arg3); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiBolt11LdkBolt11PaymentClaimForHashConstMeta, + argValues: [that, paymentHash, claimableAmountMsat, preimage], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiBolt11LdkBolt11PaymentClaimForHashConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_claim_for_hash", + argNames: ["that", "paymentHash", "claimableAmountMsat", "preimage"], + ); + + @override + Future crateApiBolt11LdkBolt11PaymentFailForHash( + {required LdkBolt11Payment that, required PaymentHash paymentHash}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); + var arg1 = cst_encode_box_autoadd_payment_hash(paymentHash); + return wire.wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hash( + port_, arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiBolt11LdkBolt11PaymentFailForHashConstMeta, + argValues: [that, paymentHash], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiBolt11LdkBolt11PaymentFailForHashConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_fail_for_hash", + argNames: ["that", "paymentHash"], + ); + @override Future crateApiBolt11LdkBolt11PaymentReceive( {required LdkBolt11Payment that, @@ -402,6 +483,46 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { argNames: ["that", "amountMsat", "description", "expirySecs"], ); + @override + Future crateApiBolt11LdkBolt11PaymentReceiveForHash( + {required LdkBolt11Payment that, + required PaymentHash paymentHash, + required BigInt amountMsat, + required String description, + required int expirySecs}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); + var arg1 = cst_encode_box_autoadd_payment_hash(paymentHash); + var arg2 = cst_encode_u_64(amountMsat); + var arg3 = cst_encode_String(description); + var arg4 = cst_encode_u_32(expirySecs); + return wire + .wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hash( + port_, arg0, arg1, arg2, arg3, arg4); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_bolt_11_invoice, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiBolt11LdkBolt11PaymentReceiveForHashConstMeta, + argValues: [that, paymentHash, amountMsat, description, expirySecs], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiBolt11LdkBolt11PaymentReceiveForHashConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_receive_for_hash", + argNames: [ + "that", + "paymentHash", + "amountMsat", + "description", + "expirySecs" + ], + ); + @override Future crateApiBolt11LdkBolt11PaymentReceiveVariableAmount( {required LdkBolt11Payment that, @@ -433,6 +554,41 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { argNames: ["that", "description", "expirySecs"], ); + @override + Future + crateApiBolt11LdkBolt11PaymentReceiveVariableAmountForHash( + {required LdkBolt11Payment that, + required String description, + required int expirySecs, + required PaymentHash paymentHash}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); + var arg1 = cst_encode_String(description); + var arg2 = cst_encode_u_32(expirySecs); + var arg3 = cst_encode_box_autoadd_payment_hash(paymentHash); + return wire + .wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hash( + port_, arg0, arg1, arg2, arg3); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_bolt_11_invoice, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: + kCrateApiBolt11LdkBolt11PaymentReceiveVariableAmountForHashConstMeta, + argValues: [that, description, expirySecs, paymentHash], + apiImpl: this, + )); + } + + TaskConstMeta + get kCrateApiBolt11LdkBolt11PaymentReceiveVariableAmountForHashConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_receive_variable_amount_for_hash", + argNames: ["that", "description", "expirySecs", "paymentHash"], + ); + @override Future crateApiBolt11LdkBolt11PaymentReceiveVariableAmountViaJitChannel( diff --git a/lib/src/generated/frb_generated.io.dart b/lib/src/generated/frb_generated.io.dart index 2a81baf..a49e574 100644 --- a/lib/src/generated/frb_generated.io.dart +++ b/lib/src/generated/frb_generated.io.dart @@ -4097,6 +4097,68 @@ class coreWire implements BaseWire { late final _store_dart_post_cobject = _store_dart_post_cobjectPtr .asFunction(); + void wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hash( + int port_, + ffi.Pointer that, + ffi.Pointer payment_hash, + int claimable_amount_msat, + ffi.Pointer preimage, + ) { + return _wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hash( + port_, + that, + payment_hash, + claimable_amount_msat, + preimage, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hashPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Uint64, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hash'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hash = + _wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hashPtr + .asFunction< + void Function( + int, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + + void wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hash( + int port_, + ffi.Pointer that, + ffi.Pointer payment_hash, + ) { + return _wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hash( + port_, + that, + payment_hash, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hashPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hash'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hash = + _wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hashPtr + .asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer)>(); + void wire__crate__api__bolt11__ldk_bolt_11_payment_receive( int port_, ffi.Pointer that, @@ -4127,6 +4189,46 @@ class coreWire implements BaseWire { void Function(int, ffi.Pointer, int, ffi.Pointer, int)>(); + void wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hash( + int port_, + ffi.Pointer that, + ffi.Pointer payment_hash, + int amount_msat, + ffi.Pointer description, + int expiry_secs, + ) { + return _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hash( + port_, + that, + payment_hash, + amount_msat, + description, + expiry_secs, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hashPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Uint64, + ffi.Pointer, + ffi.Uint32)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hash'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hash = + _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hashPtr + .asFunction< + void Function( + int, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + int)>(); + void wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount( int port_, ffi.Pointer that, @@ -4156,6 +4258,43 @@ class coreWire implements BaseWire { void Function(int, ffi.Pointer, ffi.Pointer, int)>(); + void + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hash( + int port_, + ffi.Pointer that, + ffi.Pointer description, + int expiry_secs, + ffi.Pointer payment_hash, + ) { + return _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hash( + port_, + that, + description, + expiry_secs, + payment_hash, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hashPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Uint32, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hash'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hash = + _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hashPtr + .asFunction< + void Function( + int, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + void wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel( int port_, @@ -6506,6 +6645,14 @@ final class wire_cst_list_prim_u_8_strict extends ffi.Struct { external int len; } +final class wire_cst_payment_hash extends ffi.Struct { + external ffi.Pointer data; +} + +final class wire_cst_payment_preimage extends ffi.Struct { + external ffi.Pointer data; +} + final class wire_cst_bolt_11_invoice extends ffi.Struct { external ffi.Pointer signed_raw_invoice; } @@ -6912,10 +7059,6 @@ final class wire_cst_closure_reason extends ffi.Struct { external ClosureReasonKind kind; } -final class wire_cst_payment_hash extends ffi.Struct { - external ffi.Pointer data; -} - final class wire_cst_Event_PaymentClaimable extends ffi.Struct { external ffi.Pointer payment_id; @@ -7048,10 +7191,6 @@ final class wire_cst_offer_id extends ffi.Struct { external ffi.Pointer field0; } -final class wire_cst_payment_preimage extends ffi.Struct { - external ffi.Pointer data; -} - final class wire_cst_payment_secret extends ffi.Struct { external ffi.Pointer data; } diff --git a/rust/src/api/bolt12.rs b/rust/src/api/bolt12.rs index 42ccc5d..553bb2f 100644 --- a/rust/src/api/bolt12.rs +++ b/rust/src/api/bolt12.rs @@ -1,7 +1,7 @@ +use crate::api::types::PaymentId; +use ldk_node::lightning::util::ser::Writeable; use std::str::FromStr; use std::sync::Arc; -use ldk_node::lightning::util::ser::Writeable; -use crate::api::types::{ PaymentId}; use crate::frb_generated::RustOpaque; use crate::utils::error::LdkNodeError; @@ -15,17 +15,21 @@ use crate::utils::error::LdkNodeError; /// latter. /// -pub struct Offer{pub s: String } -impl TryFrom for ldk_node::lightning::offers::offer::Offer{ +pub struct Offer { + pub s: String, +} +impl TryFrom for ldk_node::lightning::offers::offer::Offer { type Error = LdkNodeError; fn try_from(value: Offer) -> Result { ldk_node::lightning::offers::offer::Offer::from_str(value.s.as_str()).map_err(|e| e.into()) } } -impl From for Offer{ +impl From for Offer { fn from(value: ldk_node::lightning::offers::offer::Offer) -> Self { - Offer{s: value.to_string()} + Offer { + s: value.to_string(), + } } } ///A Refund is a request to send an `Bolt12Invoice` without a preceding `Offer`. @@ -33,27 +37,31 @@ impl From for Offer{ // Typically, after an invoice is paid, the recipient may publish a refund allowing the sender to recoup their funds. // A refund may be used more generally as an “offer for money”, such as with a bitcoin ATM. -pub struct Refund{pub s: String } +pub struct Refund { + pub s: String, +} -impl TryFrom for ldk_node::lightning::offers::refund::Refund{ +impl TryFrom for ldk_node::lightning::offers::refund::Refund { type Error = LdkNodeError; fn try_from(value: Refund) -> Result { - ldk_node::lightning::offers::refund::Refund::from_str(value.s.as_str()).map_err(|e| e.into()) + ldk_node::lightning::offers::refund::Refund::from_str(value.s.as_str()) + .map_err(|e| e.into()) } } -impl From for Refund{ +impl From for Refund { fn from(value: ldk_node::lightning::offers::refund::Refund) -> Self { - Refund{s: value.to_string()} + Refund { + s: value.to_string(), + } } } - #[derive(Debug, Clone, PartialEq, Eq)] ///A Bolt12Invoice is a payment request, typically corresponding to an Offer or a Refund. // An invoice may be sent in response to an InvoiceRequest in the case of an offer or sent directly after scanning a refund. It includes all the information needed to pay a recipient. pub struct Bolt12Invoice { - pub data: Vec + pub data: Vec, } impl TryFrom for ldk_node::lightning::offers::invoice::Bolt12Invoice { @@ -64,22 +72,32 @@ impl TryFrom for ldk_node::lightning::offers::invoice::Bolt12Invo .map_err(|_| LdkNodeError::InvalidInvoice) } } -impl From< ldk_node::lightning::offers::invoice::Bolt12Invoice> for Bolt12Invoice { - fn from(value: ldk_node::lightning::offers::invoice::Bolt12Invoice) -> Self { +impl From for Bolt12Invoice { + fn from(value: ldk_node::lightning::offers::invoice::Bolt12Invoice) -> Self { Bolt12Invoice { data: value.encode(), } } } -pub struct LdkBolt12Payment{ - pub ptr: RustOpaque> +pub struct LdkBolt12Payment { + pub ptr: RustOpaque>, } -impl LdkBolt12Payment{ - pub fn send(&self, offer:Offer, payer_note: Option)-> Result { - self.ptr.send(&(offer.try_into()?), payer_note).map_err(|e| e.into()).map(|e| e.into()) - } +impl LdkBolt12Payment { + pub fn send( + &self, + offer: Offer, + payer_note: Option, + ) -> Result { + self.ptr + .send(&(offer.try_into()?), payer_note) + .map_err(|e| e.into()) + .map(|e| e.into()) + } pub fn send_using_amount( - &self, offer: Offer, payer_note: Option, amount_msat: u64 + &self, + offer: Offer, + payer_note: Option, + amount_msat: u64, ) -> anyhow::Result { self.ptr .send_using_amount(&(offer.try_into()?), payer_note, amount_msat) @@ -101,8 +119,7 @@ impl LdkBolt12Payment{ description: String, ) -> anyhow::Result { self.ptr - .receive_variable_amount - (description.as_str()) + .receive_variable_amount(description.as_str()) .map_err(|e| e.into()) .map(|e| e.into()) } @@ -112,21 +129,19 @@ impl LdkBolt12Payment{ refund: Refund, ) -> anyhow::Result { self.ptr - .request_refund_payment - (&(refund.try_into()?)) + .request_refund_payment(&(refund.try_into()?)) .map_err(|e| e.into()) .map(|e| e.into()) } pub fn initiate_refund( - &self, amount_msat: u64, expiry_secs: u32 + &self, + amount_msat: u64, + expiry_secs: u32, ) -> anyhow::Result { self.ptr - .initiate_refund - (amount_msat, expiry_secs) + .initiate_refund(amount_msat, expiry_secs) .map_err(|e| e.into()) .map(|e| e.into()) } - - } diff --git a/rust/src/frb_generated.io.rs b/rust/src/frb_generated.io.rs index e31850e..bdef0c3 100644 --- a/rust/src/frb_generated.io.rs +++ b/rust/src/frb_generated.io.rs @@ -2176,6 +2176,32 @@ impl Default for wire_cst_user_channel_id { } } +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hash( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + payment_hash: *mut wire_cst_payment_hash, + claimable_amount_msat: u64, + preimage: *mut wire_cst_payment_preimage, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hash_impl( + port_, + that, + payment_hash, + claimable_amount_msat, + preimage, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hash( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + payment_hash: *mut wire_cst_payment_hash, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hash_impl(port_, that, payment_hash) +} + #[no_mangle] pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive( port_: i64, @@ -2193,6 +2219,25 @@ pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_ ) } +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hash( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + payment_hash: *mut wire_cst_payment_hash, + amount_msat: u64, + description: *mut wire_cst_list_prim_u_8_strict, + expiry_secs: u32, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hash_impl( + port_, + that, + payment_hash, + amount_msat, + description, + expiry_secs, + ) +} + #[no_mangle] pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount( port_: i64, @@ -2208,6 +2253,23 @@ pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_ ) } +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hash( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + description: *mut wire_cst_list_prim_u_8_strict, + expiry_secs: u32, + payment_hash: *mut wire_cst_payment_hash, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hash_impl( + port_, + that, + description, + expiry_secs, + payment_hash, + ) +} + #[no_mangle] pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel( port_: i64, diff --git a/rust/src/frb_generated.rs b/rust/src/frb_generated.rs index 88c1758..025f9e4 100644 --- a/rust/src/frb_generated.rs +++ b/rust/src/frb_generated.rs @@ -41,7 +41,7 @@ flutter_rust_bridge::frb_generated_boilerplate!( default_rust_auto_opaque = RustAutoOpaqueNom, ); pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.0.0"; -pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = -1350521949; +pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = 1761952349; // Section: executor @@ -49,6 +49,66 @@ flutter_rust_bridge::frb_generated_default_handler!(); // Section: wire_funcs +fn wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hash_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode, + payment_hash: impl CstDecode, + claimable_amount_msat: impl CstDecode, + preimage: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ldk_bolt_11_payment_claim_for_hash", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_payment_hash = payment_hash.cst_decode(); + let api_claimable_amount_msat = claimable_amount_msat.cst_decode(); + let api_preimage = preimage.cst_decode(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt11::LdkBolt11Payment::claim_for_hash( + &api_that, + api_payment_hash, + api_claimable_amount_msat, + api_preimage, + )?; + Ok(output_ok) + })( + )) + } + }, + ) +} +fn wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hash_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode, + payment_hash: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ldk_bolt_11_payment_fail_for_hash", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_payment_hash = payment_hash.cst_decode(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt11::LdkBolt11Payment::fail_for_hash( + &api_that, + api_payment_hash, + )?; + Ok(output_ok) + })( + )) + } + }, + ) +} fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, @@ -82,6 +142,42 @@ fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_impl( }, ) } +fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hash_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode, + payment_hash: 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: "ldk_bolt_11_payment_receive_for_hash", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_payment_hash = payment_hash.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::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt11::LdkBolt11Payment::receive_for_hash( + &api_that, + api_payment_hash, + api_amount_msat, + api_description, + api_expiry_secs, + )?; + Ok(output_ok) + })( + )) + } + }, + ) +} fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, @@ -112,6 +208,40 @@ fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_impl( }, ) } +fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hash_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode, + description: impl CstDecode, + expiry_secs: impl CstDecode, + payment_hash: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ldk_bolt_11_payment_receive_variable_amount_for_hash", + 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(); + let api_payment_hash = payment_hash.cst_decode(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = + crate::api::bolt11::LdkBolt11Payment::receive_variable_amount_for_hash( + &api_that, + api_description, + api_expiry_secs, + api_payment_hash, + )?; + Ok(output_ok) + })( + )) + } + }, + ) +} fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, From 97afc892ccb7c896f9c006f15aeca47736abf5be Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Sat, 29 Jun 2024 12:13:00 -0400 Subject: [PATCH 29/48] version updated to 0.3.0 --- example/ios/Podfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index fdb695d..4c8d391 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1,6 +1,6 @@ PODS: - Flutter (1.0.0) - - ldk_node (0.2.3-dev): + - ldk_node (0.3.0): - Flutter - path_provider_foundation (0.0.1): - Flutter @@ -21,8 +21,8 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 - ldk_node: 9a905c37e1b20c9cbd3632f385d5cf2bbdc2942e - path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c + ldk_node: 4a64d0c424f716c522130b900a00405f5b2df367 + path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 PODFILE CHECKSUM: 4e8f8b2be68aeea4c0d5beb6ff1e79fface1d048 From c305bf8d0d1247900202a2a3ad0efda7d8a8c198 Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Sat, 29 Jun 2024 20:13:00 -0400 Subject: [PATCH 30/48] default_services.dart added --- lib/src/root.dart | 35 +++++++++++++++++++++++++++++ lib/src/utils/default_services.dart | 14 ++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 lib/src/utils/default_services.dart diff --git a/lib/src/root.dart b/lib/src/root.dart index 9b324d0..33d02df 100644 --- a/lib/src/root.dart +++ b/lib/src/root.dart @@ -4,6 +4,7 @@ import 'package:ldk_node/src/generated/api/bolt12.dart' as bolt12; import 'package:ldk_node/src/generated/api/graph.dart' as graph; import 'package:ldk_node/src/generated/api/types.dart' as types; import 'package:ldk_node/src/generated/utils/error.dart' as error; +import 'package:ldk_node/src/utils/default_services.dart'; import 'package:ldk_node/src/utils/utils.dart'; import 'package:path_provider/path_provider.dart'; @@ -858,6 +859,40 @@ class Builder { )); } + /// Creates a new builder instance with default services configured for testnet. + /// + factory Builder.testnet({types.Config? config}) { + final Builder builder = + config != null ? Builder.fromConfig(config: config) : Builder(); + + return builder + .setNetwork(types.Network.testnet) + .setEsploraServer(DefaultServicesTestnet.esploraServerUrl) + .setGossipSourceRgs(DefaultServicesTestnet.rgsServerUrl); + } + + /// Creates a new builder instance with default services configured for mutinynet. + /// + factory Builder.mutinynet({types.Config? config}) { + final Builder builder = + config != null ? Builder.fromConfig(config: config) : Builder(); + + return builder + .setNetwork(types.Network.signet) + .setEsploraServer(DefaultServicesMutinynet.esploraServerUrl) + .setGossipSourceRgs(DefaultServicesMutinynet.rgsServerUrl) + .setLiquiditySourceLsps2( + address: types.SocketAddress.hostname( + addr: DefaultServicesMutinynet.lsps2SourceAddress, + port: DefaultServicesMutinynet.lsps2SourcePort, + ), + publicKey: types.PublicKey( + hex: DefaultServicesMutinynet.lsps2SourcePublicKey, + ), + token: DefaultServicesMutinynet.lsps2SourceToken, + ); + } + /// Configures the [Node] instance to source its wallet entropy from a seed file on disk. /// /// If the given file does not exist a new random seed file will be generated and diff --git a/lib/src/utils/default_services.dart b/lib/src/utils/default_services.dart new file mode 100644 index 0000000..e1b5637 --- /dev/null +++ b/lib/src/utils/default_services.dart @@ -0,0 +1,14 @@ +class DefaultServicesTestnet { + static const String esploraServerUrl = 'https://testnet.ltbl.io/api'; + static const String rgsServerUrl = 'https://testnet.ltbl.io/snapshot'; +} + +class DefaultServicesMutinynet { + static const String esploraServerUrl = 'https://mutinynet.ltbl.io/api'; + static const String rgsServerUrl = 'https://mutinynet.ltbl.io/snapshot'; + static const String lsps2SourceAddress = '44.219.111.31'; + static const int lsps2SourcePort = 39735; + static const String lsps2SourcePublicKey = + '0371d6fd7d75de2d0372d03ea00e8bacdacb50c27d0eaea0a76a0622eff1f5ef2b'; + static const String lsps2SourceToken = 'JZWN9YLW'; +} From 3abe3cb769e0eaff22494d14f58b9916aeaf6379 Mon Sep 17 00:00:00 2001 From: Bitcoin Zavior <93057399+BitcoinZavior@users.noreply.github.com> Date: Sat, 29 Jun 2024 20:21:35 -0400 Subject: [PATCH 31/48] Update precompile_binaries.yml --- .github/workflows/precompile_binaries.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/precompile_binaries.yml b/.github/workflows/precompile_binaries.yml index 4ef54fd..426688d 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: [main, upgrade-v0.3.0] name: Precompile Binaries From 9338ffc22b7874373e92f0f2c03c0503094367f6 Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Sat, 29 Jun 2024 21:21:21 -0400 Subject: [PATCH 32/48] Updated company name --- ios/ldk_node.podspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/ldk_node.podspec b/ios/ldk_node.podspec index efbef9a..78bda57 100644 --- a/ios/ldk_node.podspec +++ b/ios/ldk_node.podspec @@ -2,9 +2,9 @@ Pod::Spec.new do |s| s.name = 'ldk_node' s.version = '0.3.0' s.summary = 'A ready-to-go Lightning node library built using LDK and BDK.' - s.homepage = 'http://example.com' + s.homepage = 'https://www.LtbL.io' s.license = { :file => '../LICENSE' } - s.author = { 'Your Company' => 'email@example.com' } + s.author = { 'Let there be Lightning, Inc' => 'hello@LtbL.io' } s.source = { :path => '.' } s.source_files = 'Classes/**/*' s.dependency 'Flutter' From f1bae0efca8f516e402356647ef6dd2a863efff7 Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Sat, 29 Jun 2024 21:22:23 -0400 Subject: [PATCH 33/48] Changed compile config --- .github/workflows/precompile_binaries.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/precompile_binaries.yml b/.github/workflows/precompile_binaries.yml index 426688d..44c08ba 100644 --- a/.github/workflows/precompile_binaries.yml +++ b/.github/workflows/precompile_binaries.yml @@ -8,7 +8,7 @@ jobs: Precompile: runs-on: ${{ matrix.os }} strategy: - fail-fast: false + fail-fast: true matrix: os: - ubuntu-20.04 @@ -24,7 +24,7 @@ jobs: run: | mkdir -p .cargo echo "[profile.release]" >> .cargo/config.toml - echo "opt-level = 'z'" >> .cargo/config.toml + echo "opt-level = '3'" >> .cargo/config.toml echo "lto = true" >> .cargo/config.toml echo "codegen-units = 1" >> .cargo/config.toml echo "panic = 'abort'" >> .cargo/config.toml From b101cd7c2216bbb53eb4ecc32599cc406f4eb0aa Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Sat, 29 Jun 2024 21:54:12 -0400 Subject: [PATCH 34/48] chaning opt level to 3 --- .github/workflows/precompile_binaries.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/precompile_binaries.yml b/.github/workflows/precompile_binaries.yml index 44c08ba..a69aaf4 100644 --- a/.github/workflows/precompile_binaries.yml +++ b/.github/workflows/precompile_binaries.yml @@ -6,13 +6,11 @@ name: Precompile Binaries jobs: Precompile: - runs-on: ${{ matrix.os }} strategy: fail-fast: true matrix: - os: - - ubuntu-20.04 - - macOS-latest + os: [ubuntu-20.04, macOS-latest] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: actions-rs/toolchain@v1 @@ -24,7 +22,7 @@ jobs: run: | mkdir -p .cargo echo "[profile.release]" >> .cargo/config.toml - echo "opt-level = '3'" >> .cargo/config.toml + echo "opt-level = 3" >> .cargo/config.toml echo "lto = true" >> .cargo/config.toml echo "codegen-units = 1" >> .cargo/config.toml echo "panic = 'abort'" >> .cargo/config.toml @@ -33,14 +31,14 @@ jobs: with: channel: 'stable' - name: Precompile (with iOS) - if: (matrix.os == 'macOS-latest') + if: matrix.os == 'macOS-latest' run: dart run build_tool precompile-binaries -v --manifest-dir=../../rust --repository=LtbLightning/ldk-node-flutter working-directory: cargokit/build_tool env: GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} PRIVATE_KEY: ${{ secrets.CARGOKIT_PRIVATE_KEY }} - name: Precompile (with Android) - if: (matrix.os == 'ubuntu-20.04') + if: matrix.os == 'ubuntu-20.04' run: dart run build_tool precompile-binaries -v --manifest-dir=../../rust --repository=LtbLightning/ldk-node-flutter --android-sdk-location=/usr/local/lib/android/sdk --android-ndk-version=24.0.8215888 --android-min-sdk-version=23 working-directory: cargokit/build_tool env: From bcad2f0ce76edeaf2a686477893b9edf7a2dc941 Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Sun, 30 Jun 2024 12:43:00 -0400 Subject: [PATCH 35/48] branches updated in precompile_binaries.yml --- .github/workflows/precompile_binaries.yml | 26 +- CHANGELOG.md | 4 +- README.md | 4 +- example/ios/Podfile.lock | 6 +- example/lib/main.dart | 100 +- example/pubspec.lock | 118 +- flutter_rust_bridge.yaml | 7 +- ios/Classes/frb_generated.h | 1022 +- ios/ldk_node.podspec | 2 +- lib/ldk_node.dart | 9 +- lib/src/generated/api/bolt11.dart | 142 + lib/src/generated/api/bolt12.dart | 126 + lib/src/generated/api/builder.dart | 61 + lib/src/generated/api/error.dart | 137 - lib/src/generated/api/graph.dart | 243 + lib/src/generated/api/node.dart | 412 +- lib/src/generated/api/on_chain.dart | 44 + lib/src/generated/api/spontaneous.dart | 40 + lib/src/generated/api/types.dart | 1119 +- lib/src/generated/api/types.freezed.dart | 11181 ++++++-- lib/src/generated/frb_generated.dart | 6545 ++++- lib/src/generated/frb_generated.io.dart | 5849 ++++- lib/src/generated/frb_generated.web.dart | 1846 -- lib/src/generated/lib.dart | 90 + lib/src/generated/utils/error.dart | 272 + lib/src/generated/utils/error.freezed.dart | 26142 +++++++++++++++++++ lib/src/root.dart | 839 +- lib/src/utils/default_services.dart | 5 + lib/src/utils/exceptions.dart | 215 +- lib/src/utils/utils.dart | 4 +- makefile | 2 +- pubspec.yaml | 15 +- rust/Cargo.lock | 700 +- rust/Cargo.toml | 10 +- rust/cargokit.yaml | 7 +- rust/src/api/bolt11.rs | 175 + rust/src/api/bolt12.rs | 147 + rust/src/api/builder.rs | 126 + rust/src/api/error.rs | 162 - rust/src/api/graph.rs | 167 + rust/src/api/mod.rs | 9 +- rust/src/api/node.rs | 299 +- rust/src/api/on_chain.rs | 39 + rust/src/api/spontaneous.rs | 28 + rust/src/api/types.rs | 1444 +- rust/src/frb_generated.io.rs | 2919 ++- rust/src/frb_generated.rs | 7645 ++++-- rust/src/frb_generated.web.rs | 1779 +- rust/src/lib.rs | 1 + rust/src/utils/error.rs | 289 + rust/src/utils/mod.rs | 1 + 51 files changed, 62430 insertions(+), 10144 deletions(-) create mode 100644 lib/src/generated/api/bolt11.dart create mode 100644 lib/src/generated/api/bolt12.dart create mode 100644 lib/src/generated/api/builder.dart delete mode 100644 lib/src/generated/api/error.dart create mode 100644 lib/src/generated/api/graph.dart create mode 100644 lib/src/generated/api/on_chain.dart create mode 100644 lib/src/generated/api/spontaneous.dart delete mode 100644 lib/src/generated/frb_generated.web.dart create mode 100644 lib/src/generated/lib.dart create mode 100644 lib/src/generated/utils/error.dart create mode 100644 lib/src/generated/utils/error.freezed.dart create mode 100644 rust/src/api/bolt11.rs create mode 100644 rust/src/api/bolt12.rs create mode 100644 rust/src/api/builder.rs delete mode 100644 rust/src/api/error.rs create mode 100644 rust/src/api/graph.rs create mode 100644 rust/src/api/on_chain.rs create mode 100644 rust/src/api/spontaneous.rs create mode 100644 rust/src/utils/error.rs create mode 100644 rust/src/utils/mod.rs diff --git a/.github/workflows/precompile_binaries.yml b/.github/workflows/precompile_binaries.yml index c2442a8..4ecdbac 100644 --- a/.github/workflows/precompile_binaries.yml +++ b/.github/workflows/precompile_binaries.yml @@ -1,19 +1,16 @@ on: push: - branches: [v0.2.2-dev, main] + branches: [main, upgrade-v0.3.0, v0.3.0] name: Precompile Binaries jobs: Precompile: - runs-on: ${{ matrix.os }} strategy: - fail-fast: false + fail-fast: true matrix: - os: - - ubuntu-20.04 - - macOS-latest - - windows-latest + os: [ubuntu-20.04, macOS-latest] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: actions-rs/toolchain@v1 @@ -25,7 +22,7 @@ jobs: run: | mkdir -p .cargo echo "[profile.release]" >> .cargo/config.toml - echo "opt-level = 'z'" >> .cargo/config.toml + echo "opt-level = 3" >> .cargo/config.toml echo "lto = true" >> .cargo/config.toml echo "codegen-units = 1" >> .cargo/config.toml echo "panic = 'abort'" >> .cargo/config.toml @@ -33,24 +30,15 @@ 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') || (matrix.os == 'windows-latest') + if: matrix.os == 'macOS-latest' run: dart run build_tool precompile-binaries -v --manifest-dir=../../rust --repository=LtbLightning/ldk-node-flutter working-directory: cargokit/build_tool env: GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} PRIVATE_KEY: ${{ secrets.CARGOKIT_PRIVATE_KEY }} - name: Precompile (with Android) - if: (matrix.os == 'ubuntu-20.04') + if: matrix.os == 'ubuntu-20.04' run: dart run build_tool precompile-binaries -v --manifest-dir=../../rust --repository=LtbLightning/ldk-node-flutter --android-sdk-location=/usr/local/lib/android/sdk --android-ndk-version=24.0.8215888 --android-min-sdk-version=23 working-directory: cargokit/build_tool env: diff --git a/CHANGELOG.md b/CHANGELOG.md index 16f6ba8..f0423dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +## [0.3.0] + ## [0.2.2-dev] Updated Rust and Flutter dependencies. #### APIs added @@ -117,4 +119,4 @@ This is the first release of `ldk_node`. It features support for sourcing chain `stop`- Disconnects all peers, stops all running background tasks, and shuts down Node. -`syncWallets`- Sync the `LDK & BDK` wallets with the current chain state. +`syncWallets`- Sync the `LDK & BDK` wallets with the current chain state. \ No newline at end of file diff --git a/README.md b/README.md index 8a41c4b..c7cda5e 100644 --- a/README.md +++ b/README.md @@ -40,12 +40,12 @@ To use the `ldk_node` package in your project, add it as a dependency in your pr ```dart dependencies: - ldk_node: ^0.2.2-dev + ldk_node: ^0.3.0 ``` or add from pub.dev using `pub add` command ``` - flutter pub add ldk_node@0.2.2-dev + flutter pub add ldk_node ``` ### Examples diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 0bbacec..4c8d391 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1,6 +1,6 @@ PODS: - Flutter (1.0.0) - - ldk_node (0.2.2-dev): + - ldk_node (0.3.0): - Flutter - path_provider_foundation (0.0.1): - Flutter @@ -21,8 +21,8 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 - ldk_node: 5b3cacf9e7a5d5ae0d5c24e133af5c37c3da338b - path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c + ldk_node: 4a64d0c424f716c522130b900a00405f5b2df367 + path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 PODFILE CHECKSUM: 4e8f8b2be68aeea4c0d5beb6ff1e79fface1d048 diff --git a/example/lib/main.dart b/example/lib/main.dart index cee0032..8097cd2 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -26,7 +26,7 @@ class _MyAppState extends State { String displayText = ""; ldk.SocketAddress? bobAddr; ldk.Bolt11Invoice? invoice; - ldk.ChannelId? channelId; + ldk.UserChannelId? userChannelId; // Replace this with your local esplora url String esploraUrl = @@ -48,14 +48,14 @@ class _MyAppState extends State { final directory = await getApplicationDocumentsDirectory(); final nodePath = "${directory.path}/ldk_cache/$path"; final config = ldk.Config( - probingLiquidityLimitMultiplier: 3, + probingLiquidityLimitMultiplier: BigInt.from(3), trustedPeers0Conf: [], storageDirPath: nodePath, network: ldk.Network.regtest, listeningAddresses: [address], - onchainWalletSyncIntervalSecs: 60, - walletSyncIntervalSecs: 20, - feeRateCacheUpdateIntervalSecs: 600, + onchainWalletSyncIntervalSecs: BigInt.from(60), + walletSyncIntervalSecs: BigInt.from(20), + feeRateCacheUpdateIntervalSecs: BigInt.from(600), logLevel: ldk.LogLevel.debug, defaultCltvExpiryDelta: 144); return config; @@ -63,7 +63,7 @@ class _MyAppState extends State { closeChannel() async { await aliceNode.closeChannel( - channelId: channelId!, counterpartyNodeId: bobNodeId!); + userChannelId: userChannelId!, counterpartyNodeId: bobNodeId!); } Future initAliceNode() async { @@ -108,23 +108,21 @@ class _MyAppState extends State { final res = await bobNode.nodeId(); setState(() { bobNodeId = res; - displayText = "$bobNodeId started successfully"; + displayText = "${bobNodeId!.hex} started successfully"; }); } totalOnchainBalanceSats() async { - final alice = await aliceNode.totalOnchainBalanceSats(); - final bob = await bobNode.totalOnchainBalanceSats(); + final alice = await aliceNode.listBalances(); + final bob = await bobNode.listBalances(); if (kDebugMode) { - 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()}"); + 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}"); } setState(() { - aliceBalance = alice; + aliceBalance = alice.spendableOnchainBalanceSats.toInt(); }); } @@ -143,6 +141,7 @@ class _MyAppState extends State { print("======Channels========"); for (var e in res) { print("nodeId: ${aliceNodeId!.hex}"); + print("userChannelId: ${e.userChannelId.data}"); print("channelId: ${e.channelId.data}"); print("isChannelReady: ${e.isChannelReady}"); print("isUsable: ${e.isUsable}"); @@ -161,9 +160,8 @@ class _MyAppState extends State { print("======Payments========"); for (var e in res) { print("amountMsat: ${e.amountMsat}"); - print("hash: ${e.hash.data}"); - print("preimage: ${e.preimage?.data}"); - print("secret: ${e.secret!.data}"); + print("paymentId: ${e.id.field0}"); + print("status: ${e.status.name}"); } } } @@ -176,7 +174,7 @@ class _MyAppState extends State { removeLastPayment() async { final lastPayment = await listPaymentsWithFilter(false); if (lastPayment != null) { - final _ = await aliceNode.removePayment(paymentHash: lastPayment.hash); + final _ = await aliceNode.removePayment(paymentId: lastPayment.id); setState(() { displayText = "${lastPayment.hash.internal} removed"; }); @@ -184,8 +182,8 @@ class _MyAppState extends State { } Future> newOnchainAddress() async { - final alice = await aliceNode.newOnchainAddress(); - final bob = await bobNode.newOnchainAddress(); + final alice = await (await aliceNode.onChainPayment()).newAddress(); + final bob = await (await bobNode.onChainPayment()).newAddress(); if (kDebugMode) { print("alice's address: ${alice.s}"); print("bob's address: ${bob.s}"); @@ -212,45 +210,32 @@ class _MyAppState extends State { connectOpenChannel() async { final funding_amount_sat = 80000; final push_msat = (funding_amount_sat / 2) * 1000; - await aliceNode.connectOpenChannel( - channelAmountSats: funding_amount_sat, + userChannelId = await aliceNode.connectOpenChannel( + channelAmountSats: BigInt.from(funding_amount_sat), announceChannel: true, socketAddress: bobAddr!, - pushToCounterpartyMsat: push_msat.toInt(), + pushToCounterpartyMsat: BigInt.from(push_msat), nodeId: bobNodeId!); } receiveAndSendPayments() async { - invoice = await bobNode.receivePayment( - amountMsat: 2500000, description: 'asdf', expirySecs: 9217); + final bobBolt11Handler = await bobNode.bolt11Payment(); + final aliceBolt11Handler = await aliceNode.bolt11Payment(); + invoice = await bobBolt11Handler.receive( + amountMsat: BigInt.from(2500000), + description: 'asdf', + expirySecs: 9217); setState(() { displayText = invoice.toString(); }); - final paymentHash = await aliceNode.sendPayment(invoice: invoice!); - final res = await aliceNode.payment(paymentHash: paymentHash); + final paymentId = await aliceBolt11Handler.send(invoice: invoice!); + final res = await aliceNode.payment(paymentId: paymentId); setState(() { - displayText = "send payment success ${res?.hash.data}"; + displayText = + "Payment status: ${res?.status.name}\n PaymentId: ${res?.id.field0}"; }); } - 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(); @@ -285,6 +270,11 @@ class _MyAppState extends State { print( "channelClosed: ${e.channelId.data}, userChannelId: ${e.userChannelId.data}"); } + }, paymentClaimable: (e) { + if (kDebugMode) { + print( + "paymentId: ${e.paymentId.field0.toString()}, claimableAmountMsat: ${e.claimableAmountMsat}, userChannelId: ${e.claimDeadline}"); + } }); await node.eventHandled(); } @@ -462,20 +452,6 @@ 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(); diff --git a/example/pubspec.lock b/example/pubspec.lock index f297b01..d7b0271 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: transitive description: name: args - sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" url: "https://pub.dev" source: hosted - version: "2.4.2" + version: "2.5.0" async: dependency: transitive description: @@ -69,10 +69,10 @@ packages: dependency: "direct main" description: name: cupertino_icons - sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 url: "https://pub.dev" source: hosted - version: "1.0.6" + version: "1.0.8" fake_async: dependency: transitive description: @@ -85,10 +85,10 @@ packages: dependency: transitive description: name: ffi - sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" + sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.2" fixnum: dependency: transitive description: @@ -114,10 +114,10 @@ packages: dependency: transitive description: name: flutter_rust_bridge - sha256: e9a8716b1ad2fc81c434f3e4bf84b86c578578678c57e568b44aea7acf210102 + sha256: f703c4b50e253e53efc604d50281bbaefe82d615856f8ae1e7625518ae252e98 url: "https://pub.dev" source: hosted - version: "2.0.0-dev.31" + version: "2.0.0" flutter_test: dependency: "direct dev" description: flutter @@ -143,10 +143,10 @@ packages: dependency: transitive description: name: http - sha256: a2bbf9d017fcced29139daa8ed2bba4ece450ab222871df93ca9eec6f80c34ba + sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.1" http_parser: dependency: transitive description: @@ -155,29 +155,45 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.2" - js: - dependency: transitive - description: - name: js - sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf - url: "https://pub.dev" - source: hosted - version: "0.7.1" json_annotation: dependency: transitive description: name: json_annotation - sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" url: "https://pub.dev" source: hosted - version: "4.8.1" + version: "4.9.0" ldk_node: dependency: "direct main" description: path: ".." relative: true source: path - version: "0.2.2-dev" + version: "0.3.0" + 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,58 +206,58 @@ 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: name: path_provider - sha256: b27217933eeeba8ff24845c34003b003b2b22151de3c908d0e679e8fe1aa078b + sha256: c9e7d3a4cd1410877472158bee69963a4579f78b68c65a2b7d40d1a7a88bb161 url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.3" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: "477184d672607c0a3bf68fbbf601805f92ef79c82b64b4d6eb318cbca4c48668" + sha256: bca87b0165ffd7cdb9cad8edd22d18d2201e886d9a9f19b4fb3452ea7df3a72a url: "https://pub.dev" source: hosted - version: "2.2.2" + version: "2.2.6" path_provider_foundation: dependency: transitive description: name: path_provider_foundation - sha256: "5a7999be66e000916500be4f15a3633ebceb8302719b47b9cc49ce924125350f" + sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16 url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.4.0" path_provider_linux: dependency: transitive description: @@ -270,10 +286,10 @@ packages: dependency: transitive description: name: platform - sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec" + sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65" url: "https://pub.dev" source: hosted - version: "3.1.4" + version: "3.1.5" plugin_platform_interface: dependency: transitive description: @@ -339,10 +355,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: @@ -355,10 +371,10 @@ packages: dependency: transitive description: name: uuid - sha256: cd210a09f7c18cbe5a02511718e0334de6559871052c90a90c0cca46a4aa81c8 + sha256: "814e9e88f21a176ae1359149021870e87f7cddaf633ab678a5d2b0bff7fd1ba8" url: "https://pub.dev" source: hosted - version: "4.3.3" + version: "4.4.0" vector_math: dependency: transitive description: @@ -367,22 +383,30 @@ 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: name: web - sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" url: "https://pub.dev" source: hosted - version: "0.3.0" + version: "0.5.1" win32: dependency: transitive description: name: win32 - sha256: "464f5674532865248444b4c3daca12bd9bf2d7c47f759ce2617986e7229494a8" + sha256: a79dbe579cb51ecd6d30b17e0cae4e0ea15e2c0e66f69ad4198f22a6789e94f4 url: "https://pub.dev" source: hosted - version: "5.2.0" + version: "5.5.1" xdg_directories: dependency: transitive description: @@ -392,5 +416,5 @@ packages: source: hosted version: "1.0.4" sdks: - dart: ">=3.2.0 <4.0.0" - flutter: ">=3.10.0" + dart: ">=3.4.0 <4.0.0" + flutter: ">=3.22.0" diff --git a/flutter_rust_bridge.yaml b/flutter_rust_bridge.yaml index 8524d59..53f8e62 100644 --- a/flutter_rust_bridge.yaml +++ b/flutter_rust_bridge.yaml @@ -1,5 +1,8 @@ -rust_input: rust/src/api/*.rs +rust_input: crate::api +rust_root: rust/ dart_output: lib/src/generated/ full_dep: true +web: false +dart3: true c_output: ios/Classes/frb_generated.h -dart_entrypoint_class_name: LdkCore \ No newline at end of file +dart_entrypoint_class_name: core \ No newline at end of file diff --git a/ios/Classes/frb_generated.h b/ios/Classes/frb_generated.h index a72914e..620c796 100644 --- a/ios/Classes/frb_generated.h +++ b/ios/Classes/frb_generated.h @@ -14,11 +14,39 @@ void store_dart_post_cobject(DartPostCObjectFnType ptr); // EXTRA END typedef struct _Dart_Handle* Dart_Handle; +typedef struct wire_cst_ldk_bolt_11_payment { + uintptr_t ptr; +} wire_cst_ldk_bolt_11_payment; + 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_payment_hash { + struct wire_cst_list_prim_u_8_strict *data; +} wire_cst_payment_hash; + +typedef struct wire_cst_payment_preimage { + struct wire_cst_list_prim_u_8_strict *data; +} wire_cst_payment_preimage; + +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_ldk_bolt_12_payment { + uintptr_t ptr; +} wire_cst_ldk_bolt_12_payment; + +typedef struct wire_cst_refund { + struct wire_cst_list_prim_u_8_strict *s; +} wire_cst_refund; + +typedef struct wire_cst_offer { + struct wire_cst_list_prim_u_8_strict *s; +} wire_cst_offer; + typedef struct wire_cst_SocketAddress_TcpIpV4 { struct wire_cst_list_prim_u_8_strict *addr; uint16_t port; @@ -72,6 +100,11 @@ typedef struct wire_cst_list_public_key { int32_t len; } wire_cst_list_public_key; +typedef struct wire_cst_anchor_channels_config { + struct wire_cst_list_public_key *trusted_peers_no_reserve; + uint64_t per_channel_reserve_sats; +} wire_cst_anchor_channels_config; + typedef struct wire_cst_config { struct wire_cst_list_prim_u_8_strict *storage_dir_path; struct wire_cst_list_prim_u_8_strict *log_dir_path; @@ -84,6 +117,7 @@ typedef struct wire_cst_config { struct wire_cst_list_public_key *trusted_peers_0conf; uint64_t probing_liquidity_limit_multiplier; int32_t log_level; + struct wire_cst_anchor_channels_config *anchor_channels_config; } wire_cst_config; typedef struct wire_cst_ChainDataSourceConfig_Esplora { @@ -140,13 +174,31 @@ 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_network_graph { + uintptr_t ptr; +} wire_cst_ldk_network_graph; + +typedef struct wire_cst_node_id { + struct wire_cst_list_prim_u_8_strict *compressed; +} wire_cst_node_id; + typedef struct wire_cst_ldk_node { uintptr_t ptr; } wire_cst_ldk_node; -typedef struct wire_cst_channel_id { +typedef struct wire_cst_user_channel_id { struct wire_cst_list_prim_u_8_strict *data; -} wire_cst_channel_id; +} wire_cst_user_channel_id; typedef struct wire_cst_MaxDustHTLCExposure_FixedLimitMsat { uint64_t field0; @@ -170,57 +222,142 @@ 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; + 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_payment_id { + struct wire_cst_list_prim_u_8_strict *field0; +} wire_cst_payment_id; + +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_ldk_on_chain_payment { + uintptr_t ptr; +} wire_cst_ldk_on_chain_payment; 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_ldk_spontaneous_payment { + uintptr_t ptr; +} wire_cst_ldk_spontaneous_payment; -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_Bolt12ParseError_Bech32 { + struct wire_cst_list_prim_u_8_strict *field0; +} wire_cst_Bolt12ParseError_Bech32; + +typedef struct wire_cst_DecodeError_Io { + struct wire_cst_list_prim_u_8_strict *field0; +} wire_cst_DecodeError_Io; + +typedef union DecodeErrorKind { + struct wire_cst_DecodeError_Io Io; +} DecodeErrorKind; + +typedef struct wire_cst_decode_error { + int32_t tag; + union DecodeErrorKind kind; +} wire_cst_decode_error; + +typedef struct wire_cst_Bolt12ParseError_Decode { + struct wire_cst_decode_error *field0; +} wire_cst_Bolt12ParseError_Decode; + +typedef struct wire_cst_Bolt12ParseError_InvalidSemantics { + struct wire_cst_list_prim_u_8_strict *field0; +} wire_cst_Bolt12ParseError_InvalidSemantics; + +typedef struct wire_cst_Bolt12ParseError_InvalidSignature { + struct wire_cst_list_prim_u_8_strict *field0; +} wire_cst_Bolt12ParseError_InvalidSignature; + +typedef union Bolt12ParseErrorKind { + struct wire_cst_Bolt12ParseError_Bech32 Bech32; + struct wire_cst_Bolt12ParseError_Decode Decode; + struct wire_cst_Bolt12ParseError_InvalidSemantics InvalidSemantics; + struct wire_cst_Bolt12ParseError_InvalidSignature InvalidSignature; +} Bolt12ParseErrorKind; + +typedef struct wire_cst_bolt_12_parse_error { + int32_t tag; + union Bolt12ParseErrorKind kind; +} wire_cst_bolt_12_parse_error; + +typedef struct wire_cst_channel_id { + struct wire_cst_list_prim_u_8_strict *data; +} wire_cst_channel_id; + +typedef struct wire_cst_routing_fees { + uint32_t base_msat; + uint32_t proportional_millionths; +} wire_cst_routing_fees; + +typedef struct wire_cst_channel_update_info { + uint32_t last_update; + bool enabled; + uint16_t cltv_expiry_delta; + uint64_t htlc_minimum_msat; + uint64_t htlc_maximum_msat; + struct wire_cst_routing_fees fees; +} wire_cst_channel_update_info; + +typedef struct wire_cst_channel_info { + struct wire_cst_node_id node_one; + struct wire_cst_channel_update_info *one_to_two; + struct wire_cst_node_id node_two; + struct wire_cst_channel_update_info *two_to_one; + uint64_t *capacity_sats; +} wire_cst_channel_info; + +typedef struct wire_cst_ClosureReason_CounterpartyForceClosed { + struct wire_cst_list_prim_u_8_strict *peer_msg; +} wire_cst_ClosureReason_CounterpartyForceClosed; + +typedef struct wire_cst_ClosureReason_ProcessingError { + struct wire_cst_list_prim_u_8_strict *err; +} wire_cst_ClosureReason_ProcessingError; + +typedef union ClosureReasonKind { + struct wire_cst_ClosureReason_CounterpartyForceClosed CounterpartyForceClosed; + struct wire_cst_ClosureReason_ProcessingError ProcessingError; +} ClosureReasonKind; + +typedef struct wire_cst_closure_reason { + int32_t tag; + union ClosureReasonKind kind; +} wire_cst_closure_reason; + +typedef struct wire_cst_Event_PaymentClaimable { + struct wire_cst_payment_id *payment_id; + struct wire_cst_payment_hash *payment_hash; + uint64_t claimable_amount_msat; + uint32_t *claim_deadline; +} wire_cst_Event_PaymentClaimable; typedef struct wire_cst_Event_PaymentSuccessful { + struct wire_cst_payment_id *payment_id; 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_id *payment_id; struct wire_cst_payment_hash *payment_hash; + int32_t *reason; } wire_cst_Event_PaymentFailed; typedef struct wire_cst_Event_PaymentReceived { + struct wire_cst_payment_id *payment_id; struct wire_cst_payment_hash *payment_hash; 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; @@ -238,13 +375,27 @@ 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_PaymentClaimable PaymentClaimable; 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 { @@ -252,18 +403,82 @@ typedef struct wire_cst_event { union EventKind kind; } wire_cst_event; -typedef struct wire_cst_payment_preimage { - struct wire_cst_list_prim_u_8_strict *data; -} wire_cst_payment_preimage; +typedef struct wire_cst_lsp_fee_limits { + uint64_t *max_total_opening_fee_msat; + uint64_t *max_proportional_opening_fee_ppm_msat; +} wire_cst_lsp_fee_limits; + +typedef struct wire_cst_node_announcement_info { + uint32_t last_update; + struct wire_cst_list_prim_u_8_strict *alias; + struct wire_cst_list_socket_address *addresses; +} wire_cst_node_announcement_info; + +typedef struct wire_cst_list_prim_u_64_strict { + uint64_t *ptr; + int32_t len; +} wire_cst_list_prim_u_64_strict; + +typedef struct wire_cst_node_info { + struct wire_cst_list_prim_u_64_strict *channels; + struct wire_cst_node_announcement_info *announcement_info; +} wire_cst_node_info; + +typedef struct wire_cst_offer_id { + struct wire_cst_list_prim_u_8_strict *field0; +} wire_cst_offer_id; typedef struct wire_cst_payment_secret { struct wire_cst_list_prim_u_8_strict *data; } wire_cst_payment_secret; -typedef struct wire_cst_payment_details { - struct wire_cst_payment_hash hash; +typedef struct wire_cst_PaymentKind_Bolt11 { + struct wire_cst_payment_hash *hash; + struct wire_cst_payment_preimage *preimage; + struct wire_cst_payment_secret *secret; +} wire_cst_PaymentKind_Bolt11; + +typedef struct wire_cst_PaymentKind_Bolt11Jit { + struct wire_cst_payment_hash *hash; + struct wire_cst_payment_preimage *preimage; + struct wire_cst_payment_secret *secret; + struct wire_cst_lsp_fee_limits *lsp_fee_limits; +} wire_cst_PaymentKind_Bolt11Jit; + +typedef struct wire_cst_PaymentKind_Spontaneous { + struct wire_cst_payment_hash *hash; + struct wire_cst_payment_preimage *preimage; +} wire_cst_PaymentKind_Spontaneous; + +typedef struct wire_cst_PaymentKind_Bolt12Offer { + struct wire_cst_payment_hash *hash; struct wire_cst_payment_preimage *preimage; struct wire_cst_payment_secret *secret; + struct wire_cst_offer_id *offer_id; +} wire_cst_PaymentKind_Bolt12Offer; + +typedef struct wire_cst_PaymentKind_Bolt12Refund { + struct wire_cst_payment_hash *hash; + struct wire_cst_payment_preimage *preimage; + struct wire_cst_payment_secret *secret; +} wire_cst_PaymentKind_Bolt12Refund; + +typedef union PaymentKindKind { + struct wire_cst_PaymentKind_Bolt11 Bolt11; + struct wire_cst_PaymentKind_Bolt11Jit Bolt11Jit; + struct wire_cst_PaymentKind_Spontaneous Spontaneous; + struct wire_cst_PaymentKind_Bolt12Offer Bolt12Offer; + struct wire_cst_PaymentKind_Bolt12Refund Bolt12Refund; +} PaymentKindKind; + +typedef struct wire_cst_payment_kind { + int32_t tag; + union PaymentKindKind kind; +} wire_cst_payment_kind; + +typedef struct wire_cst_payment_details { + struct wire_cst_payment_id id; + struct wire_cst_payment_kind kind; uint64_t *amount_msat; int32_t direction; int32_t status; @@ -272,12 +487,11 @@ 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_list_prim_u_8_strict *funding_txo; + struct wire_cst_out_point *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; @@ -286,6 +500,19 @@ 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 { @@ -293,6 +520,74 @@ 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_node_id { + struct wire_cst_node_id *ptr; + int32_t len; +} wire_cst_list_node_id; + typedef struct wire_cst_list_payment_details { struct wire_cst_payment_details *ptr; int32_t len; @@ -309,194 +604,470 @@ typedef struct wire_cst_list_peer_details { int32_t len; } wire_cst_list_peer_details; -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_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; + +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_bolt_12_invoice { + struct wire_cst_list_prim_u_8_strict *data; +} wire_cst_bolt_12_invoice; -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); +typedef struct wire_cst_LdkNodeError_Decode { + struct wire_cst_decode_error *field0; +} wire_cst_LdkNodeError_Decode; -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); +typedef struct wire_cst_LdkNodeError_Bolt12Parse { + struct wire_cst_bolt_12_parse_error *field0; +} wire_cst_LdkNodeError_Bolt12Parse; -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); +typedef union LdkNodeErrorKind { + struct wire_cst_LdkNodeError_Decode Decode; + struct wire_cst_LdkNodeError_Bolt12Parse Bolt12Parse; +} LdkNodeErrorKind; -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); +typedef struct wire_cst_ldk_node_error { + int32_t tag; + union LdkNodeErrorKind kind; +} wire_cst_ldk_node_error; + +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__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hash(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + struct wire_cst_payment_hash *payment_hash, + uint64_t claimable_amount_msat, + struct wire_cst_payment_preimage *preimage); + +void frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hash(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + struct wire_cst_payment_hash *payment_hash); + +void frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + uint64_t amount_msat, + struct wire_cst_list_prim_u_8_strict *description, + uint32_t expiry_secs); + +void frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hash(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + struct wire_cst_payment_hash *payment_hash, + uint64_t amount_msat, + struct wire_cst_list_prim_u_8_strict *description, + uint32_t expiry_secs); + +void frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + struct wire_cst_list_prim_u_8_strict *description, + uint32_t expiry_secs); + +void frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hash(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + struct wire_cst_list_prim_u_8_strict *description, + uint32_t expiry_secs, + struct wire_cst_payment_hash *payment_hash); + +void frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *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__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *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__crate__api__bolt11__ldk_bolt_11_payment_send(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + struct wire_cst_bolt_11_invoice *invoice); + +void frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + struct wire_cst_bolt_11_invoice *invoice); + +void frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + struct wire_cst_bolt_11_invoice *invoice, + uint64_t amount_msat); + +void frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + struct wire_cst_bolt_11_invoice *invoice, + uint64_t amount_msat); + +void frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refund(int64_t port_, + struct wire_cst_ldk_bolt_12_payment *that, + uint64_t amount_msat, + uint32_t expiry_secs); + +void frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_receive(int64_t port_, + struct wire_cst_ldk_bolt_12_payment *that, + uint64_t amount_msat, + struct wire_cst_list_prim_u_8_strict *description); + +void frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amount(int64_t port_, + struct wire_cst_ldk_bolt_12_payment *that, + struct wire_cst_list_prim_u_8_strict *description); + +void frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_payment(int64_t port_, + struct wire_cst_ldk_bolt_12_payment *that, + struct wire_cst_refund *refund); + +void frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_send(int64_t port_, + struct wire_cst_ldk_bolt_12_payment *that, + struct wire_cst_offer *offer, + struct wire_cst_list_prim_u_8_strict *payer_note); + +void frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amount(int64_t port_, + struct wire_cst_ldk_bolt_12_payment *that, + struct wire_cst_offer *offer, + struct wire_cst_list_prim_u_8_strict *payer_note, + uint64_t amount_msat); + +WireSyncRust2DartDco frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder(uintptr_t that); + +WireSyncRust2DartDco frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder(uintptr_t that, + uintptr_t builder); + +void frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_build(int64_t port_, uintptr_t that); + +void frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_build_with_fs_store(int64_t port_, + uintptr_t that); + +void frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_create_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__crate__api__builder__ldk_mnemonic_generate(int64_t port_); + +void frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_channel(int64_t port_, + struct wire_cst_ldk_network_graph *that, + uint64_t short_channel_id); + +void frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_list_channels(int64_t port_, + struct wire_cst_ldk_network_graph *that); + +void frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_list_nodes(int64_t port_, + struct wire_cst_ldk_network_graph *that); + +void frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_node(int64_t port_, + struct wire_cst_ldk_network_graph *that, + struct wire_cst_node_id *node_id); + +void frbgen_ldk_node_wire__crate__api__node__ldk_node_bolt11_payment(int64_t port_, + struct wire_cst_ldk_node *ptr); + +void frbgen_ldk_node_wire__crate__api__node__ldk_node_bolt12_payment(int64_t port_, + struct wire_cst_ldk_node *ptr); -void frbgen_ldk_node_wire_ldk_node_event_handled(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_close_channel(int64_t port_, + struct wire_cst_ldk_node *that, + struct wire_cst_user_channel_id *user_channel_id, + struct wire_cst_public_key *counterparty_node_id); -void frbgen_ldk_node_wire_ldk_node_is_running(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_config(int64_t port_, + struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_ldk_node_list_channels(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__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_ldk_node_list_payments(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__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_ldk_node_list_payments_with_filter(int64_t port_, - struct wire_cst_ldk_node *that, - int32_t payment_direction); +void frbgen_ldk_node_wire__crate__api__node__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_ldk_node_list_peers(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_event_handled(int64_t port_, + struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_ldk_node_listening_addresses(int64_t port_, - struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_force_close_channel(int64_t port_, + struct wire_cst_ldk_node *that, + struct wire_cst_user_channel_id *user_channel_id, + struct wire_cst_public_key *counterparty_node_id); -void frbgen_ldk_node_wire_ldk_node_new_onchain_address(int64_t port_, - struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_list_balances(int64_t port_, + struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_ldk_node_next_event(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_list_channels(int64_t port_, + struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_ldk_node_node_id(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_list_payments(int64_t port_, + struct wire_cst_ldk_node *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__crate__api__node__ldk_node_list_payments_with_filter(int64_t port_, + struct wire_cst_ldk_node *that, + int32_t payment_direction); -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__crate__api__node__ldk_node_list_peers(int64_t port_, + struct wire_cst_ldk_node *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__crate__api__node__ldk_node_listening_addresses(int64_t port_, + struct wire_cst_ldk_node *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__crate__api__node__ldk_node_network_graph(int64_t port_, + struct wire_cst_ldk_node *ptr); -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__crate__api__node__ldk_node_next_event(int64_t port_, + struct wire_cst_ldk_node *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__crate__api__node__ldk_node_next_event_async(int64_t port_, + struct wire_cst_ldk_node *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__crate__api__node__ldk_node_node_id(int64_t port_, + struct wire_cst_ldk_node *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__crate__api__node__ldk_node_on_chain_payment(int64_t port_, + struct wire_cst_ldk_node *ptr); -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__crate__api__node__ldk_node_payment(int64_t port_, + struct wire_cst_ldk_node *that, + struct wire_cst_payment_id *payment_id); -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__crate__api__node__ldk_node_remove_payment(int64_t port_, + struct wire_cst_ldk_node *that, + struct wire_cst_payment_id *payment_id); -void frbgen_ldk_node_wire_ldk_node_send_spontaneous_payment_probes(int64_t port_, +void frbgen_ldk_node_wire__crate__api__node__ldk_node_sign_message(int64_t port_, struct wire_cst_ldk_node *that, - uint64_t amount_msat, - struct wire_cst_public_key *node_id); + struct wire_cst_list_prim_u_8_loose *msg); -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__crate__api__node__ldk_node_spontaneous_payment(int64_t port_, + struct wire_cst_ldk_node *ptr); -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__crate__api__node__ldk_node_start(int64_t port_, + struct wire_cst_ldk_node *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__crate__api__node__ldk_node_status(int64_t port_, + struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_ldk_node_start(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_stop(int64_t port_, + struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_ldk_node_stop(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_sync_wallets(int64_t port_, + struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_ldk_node_sync_wallets(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_update_channel_config(int64_t port_, + struct wire_cst_ldk_node *that, + struct wire_cst_user_channel_id *user_channel_id, + struct wire_cst_public_key *counterparty_node_id, + struct wire_cst_channel_config *channel_config); -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__crate__api__node__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 *public_key); + +void frbgen_ldk_node_wire__crate__api__node__ldk_node_wait_next_event(int64_t port_, + struct wire_cst_ldk_node *that); + +void frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_new_address(int64_t port_, + struct wire_cst_ldk_on_chain_payment *that); + +void frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address(int64_t port_, + struct wire_cst_ldk_on_chain_payment *that, + struct wire_cst_address *address); + +void frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address(int64_t port_, + struct wire_cst_ldk_on_chain_payment *that, + struct wire_cst_address *address, + uint64_t amount_sats); -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__crate__api__spontaneous__ldk_spontaneous_payment_send(int64_t port_, + struct wire_cst_ldk_spontaneous_payment *that, + uint64_t amount_msat, + struct wire_cst_public_key *node_id); -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__crate__api__spontaneous__ldk_spontaneous_payment_send_probes(int64_t port_, + struct wire_cst_ldk_spontaneous_payment *that, + uint64_t amount_msat, + struct wire_cst_public_key *node_id); -void frbgen_ldk_node_wire_ldk_node_wait_next_event(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment(const void *ptr); -void frbgen_ldk_node_wire_socket_address_as_string(int64_t port_, - struct wire_cst_socket_address *that); +void frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment(const void *ptr); -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_Node(const void *ptr); -void frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore(const void *ptr); +void frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_Node(const void *ptr); -void frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore(const void *ptr); +void frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder(const void *ptr); + +void frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder(const void *ptr); + +void frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilder(const void *ptr); + +void frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilder(const void *ptr); + +void frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraph(const void *ptr); + +void frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraph(const void *ptr); + +void frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment(const void *ptr); + +void frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment(const void *ptr); + +void frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment(const void *ptr); + +void frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment(const void *ptr); + +void frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment(const void *ptr); + +void frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment(const void *ptr); struct wire_cst_address *frbgen_ldk_node_cst_new_box_autoadd_address(void); +struct wire_cst_anchor_channels_config *frbgen_ldk_node_cst_new_box_autoadd_anchor_channels_config(void); + struct wire_cst_bolt_11_invoice *frbgen_ldk_node_cst_new_box_autoadd_bolt_11_invoice(void); +struct wire_cst_bolt_12_parse_error *frbgen_ldk_node_cst_new_box_autoadd_bolt_12_parse_error(void); + struct wire_cst_chain_data_source_config *frbgen_ldk_node_cst_new_box_autoadd_chain_data_source_config(void); struct wire_cst_channel_config *frbgen_ldk_node_cst_new_box_autoadd_channel_config(void); struct wire_cst_channel_id *frbgen_ldk_node_cst_new_box_autoadd_channel_id(void); +struct wire_cst_channel_info *frbgen_ldk_node_cst_new_box_autoadd_channel_info(void); + +struct wire_cst_channel_update_info *frbgen_ldk_node_cst_new_box_autoadd_channel_update_info(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_decode_error *frbgen_ldk_node_cst_new_box_autoadd_decode_error(void); + struct wire_cst_entropy_source_config *frbgen_ldk_node_cst_new_box_autoadd_entropy_source_config(void); 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_ldk_bolt_11_payment *frbgen_ldk_node_cst_new_box_autoadd_ldk_bolt_11_payment(void); + +struct wire_cst_ldk_bolt_12_payment *frbgen_ldk_node_cst_new_box_autoadd_ldk_bolt_12_payment(void); + struct wire_cst_ldk_mnemonic *frbgen_ldk_node_cst_new_box_autoadd_ldk_mnemonic(void); +struct wire_cst_ldk_network_graph *frbgen_ldk_node_cst_new_box_autoadd_ldk_network_graph(void); + struct wire_cst_ldk_node *frbgen_ldk_node_cst_new_box_autoadd_ldk_node(void); +struct wire_cst_ldk_on_chain_payment *frbgen_ldk_node_cst_new_box_autoadd_ldk_on_chain_payment(void); + +struct wire_cst_ldk_spontaneous_payment *frbgen_ldk_node_cst_new_box_autoadd_ldk_spontaneous_payment(void); + +struct wire_cst_liquidity_source_config *frbgen_ldk_node_cst_new_box_autoadd_liquidity_source_config(void); + +struct wire_cst_lsp_fee_limits *frbgen_ldk_node_cst_new_box_autoadd_lsp_fee_limits(void); + +struct wire_cst_max_dust_htlc_exposure *frbgen_ldk_node_cst_new_box_autoadd_max_dust_htlc_exposure(void); + +struct wire_cst_node_announcement_info *frbgen_ldk_node_cst_new_box_autoadd_node_announcement_info(void); + +struct wire_cst_node_id *frbgen_ldk_node_cst_new_box_autoadd_node_id(void); + +struct wire_cst_node_info *frbgen_ldk_node_cst_new_box_autoadd_node_info(void); + +struct wire_cst_offer *frbgen_ldk_node_cst_new_box_autoadd_offer(void); + +struct wire_cst_offer_id *frbgen_ldk_node_cst_new_box_autoadd_offer_id(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_id *frbgen_ldk_node_cst_new_box_autoadd_payment_id(void); + struct wire_cst_payment_preimage *frbgen_ldk_node_cst_new_box_autoadd_payment_preimage(void); struct wire_cst_payment_secret *frbgen_ldk_node_cst_new_box_autoadd_payment_secret(void); struct wire_cst_public_key *frbgen_ldk_node_cst_new_box_autoadd_public_key(void); +struct wire_cst_refund *frbgen_ldk_node_cst_new_box_autoadd_refund(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); @@ -505,10 +1076,18 @@ 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_node_id *frbgen_ldk_node_cst_new_list_node_id(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_64_strict *frbgen_ldk_node_cst_new_list_prim_u_64_strict(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); @@ -519,74 +1098,141 @@ struct wire_cst_list_socket_address *frbgen_ldk_node_cst_new_list_socket_address static int64_t dummy_method_to_enforce_bundling(void) { int64_t dummy_var = 0; dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_address); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_anchor_channels_config); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_bolt_11_invoice); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_bolt_12_parse_error); 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_channel_info); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_channel_update_info); + 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_decode_error); 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_ldk_bolt_11_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_ldk_bolt_12_payment); 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_network_graph); 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_ldk_on_chain_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_ldk_spontaneous_payment); + 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_lsp_fee_limits); + 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_node_announcement_info); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_node_id); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_node_info); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_offer); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_offer_id); 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_id); 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_refund); 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_node_id); 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_64_strict); 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_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*) frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_Node); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilder); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraph); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_Node); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilder); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraph); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hash); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hash); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hash); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hash); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refund); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_receive); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amount); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_send); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amount); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_build); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_build_with_fs_store); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_create_builder); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__builder__ldk_mnemonic_generate); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_channel); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_list_channels); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_list_nodes); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_node); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_bolt11_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_bolt12_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_close_channel); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_config); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_connect); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_connect_open_channel); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_disconnect); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_event_handled); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_force_close_channel); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_list_balances); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_list_channels); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_list_payments); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_list_payments_with_filter); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_list_peers); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_listening_addresses); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_network_graph); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_next_event); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_next_event_async); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_node_id); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_on_chain_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_remove_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_sign_message); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_spontaneous_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_start); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_status); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_stop); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_sync_wallets); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_update_channel_config); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_verify_signature); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_wait_next_event); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_new_address); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__spontaneous__ldk_spontaneous_payment_send); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes); dummy_var ^= ((int64_t) (void*) store_dart_post_cobject); return dummy_var; } diff --git a/ios/ldk_node.podspec b/ios/ldk_node.podspec index 696a1b2..efbef9a 100644 --- a/ios/ldk_node.podspec +++ b/ios/ldk_node.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'ldk_node' - s.version = '0.2.2-dev' + s.version = '0.3.0' s.summary = 'A ready-to-go Lightning node library built using LDK and BDK.' s.homepage = 'http://example.com' s.license = { :file => '../LICENSE' } diff --git a/lib/ldk_node.dart b/lib/ldk_node.dart index d5934f7..10af5cc 100644 --- a/lib/ldk_node.dart +++ b/lib/ldk_node.dart @@ -1,3 +1,7 @@ +export './src/generated/api/bolt11.dart'; +export './src/generated/api/bolt12.dart'; +export './src/generated/api/on_chain.dart'; +export './src/generated/api/spontaneous.dart'; export './src/generated/api/types.dart' hide Event_ChannelClosed, @@ -11,6 +15,7 @@ export './src/generated/api/types.dart' SocketAddress_OnionV2, EntropySourceConfig, SocketAddress_OnionV3, + $ChainDataSourceConfigCopyWith, SocketAddress_TcpIpV4, SocketAddress_TcpIpV6, MaxDustHTLCExposure_FeeRateMultiplier, @@ -24,7 +29,5 @@ export './src/generated/api/types.dart' GossipSourceConfig, EntropySourceConfig_SeedFile; export 'src/root.dart'; -export 'src/generated/api/node.dart' - show U8Array4, U8Array12, U8Array64, U8Array32; export 'src/utils/utils.dart' - hide LdkException, mapBuilderException, mapNodeException, Frb; + hide ExceptionBase, mapLdkBuilderError, mapLdkNodeError, Frb; diff --git a/lib/src/generated/api/bolt11.dart b/lib/src/generated/api/bolt11.dart new file mode 100644 index 0000000..a81e48c --- /dev/null +++ b/lib/src/generated/api/bolt11.dart @@ -0,0 +1,142 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0. + +// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import + +import '../frb_generated.dart'; +import '../lib.dart'; +import '../utils/error.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; +import 'types.dart'; + +// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `assert_receiver_is_total_eq`, `clone`, `eq`, `fmt`, `from`, `from`, `try_from` + +///Represents a syntactically and semantically correct lightning BOLT11 invoice. +/// +class Bolt11Invoice { + final String signedRawInvoice; + + const Bolt11Invoice({ + required this.signedRawInvoice, + }); + + @override + int get hashCode => signedRawInvoice.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Bolt11Invoice && + runtimeType == other.runtimeType && + signedRawInvoice == other.signedRawInvoice; +} + +class LdkBolt11Payment { + final Bolt11Payment ptr; + + const LdkBolt11Payment({ + required this.ptr, + }); + + Future claimForHash( + {required PaymentHash paymentHash, + required BigInt claimableAmountMsat, + required PaymentPreimage preimage}) => + core.instance.api.crateApiBolt11LdkBolt11PaymentClaimForHash( + that: this, + paymentHash: paymentHash, + claimableAmountMsat: claimableAmountMsat, + preimage: preimage); + + Future failForHash({required PaymentHash paymentHash}) => + core.instance.api.crateApiBolt11LdkBolt11PaymentFailForHash( + that: this, paymentHash: paymentHash); + + Future receive( + {required BigInt amountMsat, + required String description, + required int expirySecs}) => + core.instance.api.crateApiBolt11LdkBolt11PaymentReceive( + that: this, + amountMsat: amountMsat, + description: description, + expirySecs: expirySecs); + + Future receiveForHash( + {required PaymentHash paymentHash, + required BigInt amountMsat, + required String description, + required int expirySecs}) => + core.instance.api.crateApiBolt11LdkBolt11PaymentReceiveForHash( + that: this, + paymentHash: paymentHash, + amountMsat: amountMsat, + description: description, + expirySecs: expirySecs); + + Future receiveVariableAmount( + {required String description, required int expirySecs}) => + core.instance.api.crateApiBolt11LdkBolt11PaymentReceiveVariableAmount( + that: this, description: description, expirySecs: expirySecs); + + Future receiveVariableAmountForHash( + {required String description, + required int expirySecs, + required PaymentHash paymentHash}) => + core.instance.api + .crateApiBolt11LdkBolt11PaymentReceiveVariableAmountForHash( + that: this, + description: description, + expirySecs: expirySecs, + paymentHash: paymentHash); + + Future receiveVariableAmountViaJitChannel( + {required String description, + required int expirySecs, + BigInt? maxProportionalLspFeeLimitPpmMsat}) => + core.instance.api + .crateApiBolt11LdkBolt11PaymentReceiveVariableAmountViaJitChannel( + that: this, + description: description, + expirySecs: expirySecs, + maxProportionalLspFeeLimitPpmMsat: + maxProportionalLspFeeLimitPpmMsat); + + Future receiveViaJitChannel( + {required BigInt amountMsat, + required String description, + required int expirySecs, + BigInt? maxTotalLspFeeLimitMsat}) => + core.instance.api.crateApiBolt11LdkBolt11PaymentReceiveViaJitChannel( + that: this, + amountMsat: amountMsat, + description: description, + expirySecs: expirySecs, + maxTotalLspFeeLimitMsat: maxTotalLspFeeLimitMsat); + + Future send({required Bolt11Invoice invoice}) => core.instance.api + .crateApiBolt11LdkBolt11PaymentSend(that: this, invoice: invoice); + + Future sendProbes({required Bolt11Invoice invoice}) => core.instance.api + .crateApiBolt11LdkBolt11PaymentSendProbes(that: this, invoice: invoice); + + Future sendProbesUsingAmount( + {required Bolt11Invoice invoice, required BigInt amountMsat}) => + core.instance.api.crateApiBolt11LdkBolt11PaymentSendProbesUsingAmount( + that: this, invoice: invoice, amountMsat: amountMsat); + + Future sendUsingAmount( + {required Bolt11Invoice invoice, required BigInt amountMsat}) => + core.instance.api.crateApiBolt11LdkBolt11PaymentSendUsingAmount( + that: this, invoice: invoice, amountMsat: amountMsat); + + @override + int get hashCode => ptr.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LdkBolt11Payment && + runtimeType == other.runtimeType && + ptr == other.ptr; +} diff --git a/lib/src/generated/api/bolt12.dart b/lib/src/generated/api/bolt12.dart new file mode 100644 index 0000000..08f6999 --- /dev/null +++ b/lib/src/generated/api/bolt12.dart @@ -0,0 +1,126 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0. + +// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import + +import '../frb_generated.dart'; +import '../lib.dart'; +import '../utils/error.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; +import 'types.dart'; + +// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `assert_receiver_is_total_eq`, `clone`, `eq`, `fmt`, `from`, `from`, `from`, `try_from`, `try_from`, `try_from` + +// Rust type: RustOpaqueNom> +abstract class ArcBolt12Payment implements RustOpaqueInterface {} + +///A Bolt12Invoice is a payment request, typically corresponding to an Offer or a Refund. +class Bolt12Invoice { + final Uint8List data; + + const Bolt12Invoice({ + required this.data, + }); + + @override + int get hashCode => data.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Bolt12Invoice && + runtimeType == other.runtimeType && + data == other.data; +} + +class LdkBolt12Payment { + final ArcBolt12Payment ptr; + + const LdkBolt12Payment({ + required this.ptr, + }); + + Future initiateRefund( + {required BigInt amountMsat, required int expirySecs}) => + core.instance.api.crateApiBolt12LdkBolt12PaymentInitiateRefund( + that: this, amountMsat: amountMsat, expirySecs: expirySecs); + + Future receive( + {required BigInt amountMsat, required String description}) => + core.instance.api.crateApiBolt12LdkBolt12PaymentReceive( + that: this, amountMsat: amountMsat, description: description); + + Future receiveVariableAmount({required String description}) => + core.instance.api.crateApiBolt12LdkBolt12PaymentReceiveVariableAmount( + that: this, description: description); + + Future requestRefundPayment({required Refund refund}) => + core.instance.api.crateApiBolt12LdkBolt12PaymentRequestRefundPayment( + that: this, refund: refund); + + Future send({required Offer offer, String? payerNote}) => + core.instance.api.crateApiBolt12LdkBolt12PaymentSend( + that: this, offer: offer, payerNote: payerNote); + + Future sendUsingAmount( + {required Offer offer, + String? payerNote, + required BigInt amountMsat}) => + core.instance.api.crateApiBolt12LdkBolt12PaymentSendUsingAmount( + that: this, + offer: offer, + payerNote: payerNote, + amountMsat: amountMsat); + + @override + int get hashCode => ptr.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LdkBolt12Payment && + runtimeType == other.runtimeType && + ptr == other.ptr; +} + +/// An `Offer` is a potentially long-lived proposal for payment of a good or service. +/// +/// An offer is a precursor to an [InvoiceRequest]. A merchant publishes an offer from which a +/// customer may request an [Bolt12Invoice] for a specific quantity and using an amount sufficient +/// to cover that quantity (i.e., at least `quantity * amount`). +/// +/// Offers may be denominated in currency other than bitcoin but are ultimately paid using the +/// latter. +/// +class Offer { + final String s; + + const Offer({ + required this.s, + }); + + @override + int get hashCode => s.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Offer && runtimeType == other.runtimeType && s == other.s; +} + +///A Refund is a request to send an `Bolt12Invoice` without a preceding `Offer`. +class Refund { + final String s; + + const Refund({ + required this.s, + }); + + @override + int get hashCode => s.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Refund && runtimeType == other.runtimeType && s == other.s; +} diff --git a/lib/src/generated/api/builder.dart b/lib/src/generated/api/builder.dart new file mode 100644 index 0000000..a6fd072 --- /dev/null +++ b/lib/src/generated/api/builder.dart @@ -0,0 +1,61 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0. + +// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import + +import '../frb_generated.dart'; +import '../lib.dart'; +import '../utils/error.dart'; +import 'node.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; +import 'types.dart'; + +// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `clone`, `fmt`, `from`, `try_from` + +// Rust type: RustOpaqueNom> +abstract class NodeBuilder implements RustOpaqueInterface { + Builder get builder; + + void set builder(Builder builder); + + Future build(); + + Future buildWithFsStore(); + + static Future createBuilder( + {required Config config, + ChainDataSourceConfig? chainDataSourceConfig, + EntropySourceConfig? entropySourceConfig, + GossipSourceConfig? gossipSourceConfig, + LiquiditySourceConfig? liquiditySourceConfig}) => + core.instance.api.crateApiBuilderNodeBuilderCreateBuilder( + config: config, + chainDataSourceConfig: chainDataSourceConfig, + entropySourceConfig: entropySourceConfig, + gossipSourceConfig: gossipSourceConfig, + liquiditySourceConfig: liquiditySourceConfig); +} + +// Rust type: RustOpaqueNom +abstract class Builder implements RustOpaqueInterface {} + +class LdkMnemonic { + final String seedPhrase; + + const LdkMnemonic({ + required this.seedPhrase, + }); + + static Future generate() => + core.instance.api.crateApiBuilderLdkMnemonicGenerate(); + + @override + int get hashCode => seedPhrase.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LdkMnemonic && + runtimeType == other.runtimeType && + seedPhrase == other.seedPhrase; +} diff --git a/lib/src/generated/api/error.dart b/lib/src/generated/api/error.dart deleted file mode 100644 index f9b1e46..0000000 --- a/lib/src/generated/api/error.dart +++ /dev/null @@ -1,137 +0,0 @@ -// This file is automatically generated, so please do not edit it. -// 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 BuilderException { - socketAddressParseError, - - /// The given seed bytes are invalid, e.g., have invalid length. - invalidSeedBytes, - - /// The given seed file is invalid, e.g., has invalid length, or could not be read. - invalidSeedFile, - - /// The current system time is invalid, clocks might have gone backwards. - invalidSystemTime, - - /// The a read channel monitor is invalid. - invalidChannelMonitor, - - /// The given listening addresses are invalid, e.g. too many were passed. - invalidListeningAddress, - - /// We failed to read data from the [`KVStore`]. - readFailed, - - /// We failed to write data to the [`KVStore`]. - writeFailed, - - /// We failed to access the given `storage_dir_path`. - storagePathAccessFailed, - - /// We failed to setup our [`KVStore`]. - kvStoreSetupFailed, - - /// We failed to setup the onchain wallet. - walletSetupFailed, - - /// We failed to setup the logger. - loggerSetupFailed, - invalidTrustedPeer, -} - -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. - notRunning, - - /// An on-chain transaction could not be created. - onchainTxCreationFailed, - - /// A network connection has been closed. - connectionFailed, - - /// Invoice creation failed. - invoiceCreationFailed, - - /// Sending a payment has failed. - paymentSendingFailed, - - /// Sending a payment probe has failed. - probeSendingFailed, - - /// A channel could not be opened. - channelCreationFailed, - - /// A channel could not be closed. - channelClosingFailed, - - /// A channel config could not be updated. - channelConfigUpdateFailed, - - /// Persistence failed. - persistenceFailed, - - /// A wallet operation failed. - walletOperationFailed, - - /// A signing operation for transaction failed. - onchainTxSigningFailed, - - /// A signing operation for message failed. - messageSigningFailed, - - /// A transaction sync operation failed. - txSyncFailed, - - /// A gossip updating operation failed. - gossipUpdateFailed, - - /// The given address is invalid. - invalidAddress, - - /// The given network address is invalid. - invalidSocketAddress, - - /// The given public key is invalid. - invalidPublicKey, - - /// The given secret key is invalid. - invalidSecretKey, - - /// The given payment hash is invalid. - invalidPaymentHash, - - /// The given payment preimage is invalid. - invalidPaymentPreimage, - - /// The given payment secret is invalid. - invalidPaymentSecret, - - /// The given amount is invalid. - invalidAmount, - - /// The given invoice is invalid. - invalidInvoice, - - /// The given channel ID is invalid. - invalidChannelId, - - /// The given network is invalid. - invalidNetwork, - - /// A payment with the given hash has already been initiated. - duplicatePayment, - - /// There are insufficient funds to complete the given operation. - insufficientFunds, - feerateEstimationUpdateFailed, -} diff --git a/lib/src/generated/api/graph.dart b/lib/src/generated/api/graph.dart new file mode 100644 index 0000000..6859cec --- /dev/null +++ b/lib/src/generated/api/graph.dart @@ -0,0 +1,243 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0. + +// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import + +import '../frb_generated.dart'; +import '../lib.dart'; +import '../utils/error.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; +import 'types.dart'; + +// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `from`, `from`, `from`, `from`, `from`, `from`, `from`, `try_from` + +///Details about a channel (both directions). Received within a channel announcement. +class ChannelInfo { + ///Source node of the first direction of a channel + final NodeId nodeOne; + + ///Details about the first direction of a channel + final ChannelUpdateInfo? oneToTwo; + + ///Source node of the second direction of a channel + final NodeId nodeTwo; + + ///Details about the second direction of a channel + final ChannelUpdateInfo? twoToOne; + + ///The channel capacity as seen on-chain, if chain lookup is available. + final BigInt? capacitySats; + + const ChannelInfo({ + required this.nodeOne, + this.oneToTwo, + required this.nodeTwo, + this.twoToOne, + this.capacitySats, + }); + + @override + int get hashCode => + nodeOne.hashCode ^ + oneToTwo.hashCode ^ + nodeTwo.hashCode ^ + twoToOne.hashCode ^ + capacitySats.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ChannelInfo && + runtimeType == other.runtimeType && + nodeOne == other.nodeOne && + oneToTwo == other.oneToTwo && + nodeTwo == other.nodeTwo && + twoToOne == other.twoToOne && + capacitySats == other.capacitySats; +} + +class ChannelUpdateInfo { + ///When the last update to the channel direction was issued. Value is opaque, as set in the announcement. + final int lastUpdate; + + ///Whether the channel can be currently used for payments (in this one direction). + final bool enabled; + + ///The difference in CLTV values that you must have when routing through this channel. + final int cltvExpiryDelta; + + ///The minimum value, which must be relayed to the next hop via the channel + final BigInt htlcMinimumMsat; + + ///The maximum value which may be relayed to the next hop via the channel. + final BigInt htlcMaximumMsat; + final RoutingFees fees; + + const ChannelUpdateInfo({ + required this.lastUpdate, + required this.enabled, + required this.cltvExpiryDelta, + required this.htlcMinimumMsat, + required this.htlcMaximumMsat, + required this.fees, + }); + + @override + int get hashCode => + lastUpdate.hashCode ^ + enabled.hashCode ^ + cltvExpiryDelta.hashCode ^ + htlcMinimumMsat.hashCode ^ + htlcMaximumMsat.hashCode ^ + fees.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ChannelUpdateInfo && + runtimeType == other.runtimeType && + lastUpdate == other.lastUpdate && + enabled == other.enabled && + cltvExpiryDelta == other.cltvExpiryDelta && + htlcMinimumMsat == other.htlcMinimumMsat && + htlcMaximumMsat == other.htlcMaximumMsat && + fees == other.fees; +} + +class LdkNetworkGraph { + final NetworkGraph ptr; + + const LdkNetworkGraph({ + required this.ptr, + }); + + /// Returns information on a channel with the given id. + Future channel({required BigInt shortChannelId}) => + core.instance.api.crateApiGraphLdkNetworkGraphChannel( + that: this, shortChannelId: shortChannelId); + + /// Returns the list of channels in the graph + Future listChannels() => + core.instance.api.crateApiGraphLdkNetworkGraphListChannels( + that: this, + ); + + /// Returns the list of nodes in the graph + Future> listNodes() => + core.instance.api.crateApiGraphLdkNetworkGraphListNodes( + that: this, + ); + + Future node({required NodeId nodeId}) => core.instance.api + .crateApiGraphLdkNetworkGraphNode(that: this, nodeId: nodeId); + + @override + int get hashCode => ptr.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LdkNetworkGraph && + runtimeType == other.runtimeType && + ptr == other.ptr; +} + +class NodeAnnouncementInfo { + /// When the last known update to the node state was issued. + /// Value is opaque, as set in the announcement. + final int lastUpdate; + + /// Moniker assigned to the node. + /// May be invalid or malicious (eg control chars), + /// should not be exposed to the user. + final String alias; + + /// List of addresses on which this node is reachable + final List addresses; + + const NodeAnnouncementInfo({ + required this.lastUpdate, + required this.alias, + required this.addresses, + }); + + @override + int get hashCode => lastUpdate.hashCode ^ alias.hashCode ^ addresses.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is NodeAnnouncementInfo && + runtimeType == other.runtimeType && + lastUpdate == other.lastUpdate && + alias == other.alias && + addresses == other.addresses; +} + +///Represents the compressed public key of a node +class NodeId { + final Uint8List compressed; + + const NodeId({ + required this.compressed, + }); + + @override + int get hashCode => compressed.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is NodeId && + runtimeType == other.runtimeType && + compressed == other.compressed; +} + +///Details about a node in the network, known from the network announcement. +class NodeInfo { + final Uint64List channels; + + ///More information about a node from node_announcement. Optional because we store a Node entry after learning about it from a channel announcement, but before receiving a node announcement. + final NodeAnnouncementInfo? announcementInfo; + + const NodeInfo({ + required this.channels, + this.announcementInfo, + }); + + @override + int get hashCode => channels.hashCode ^ announcementInfo.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is NodeInfo && + runtimeType == other.runtimeType && + channels == other.channels && + announcementInfo == other.announcementInfo; +} + +///Fees for routing via a given channel or a node +class RoutingFees { + ///Flat routing fee in millisatoshis. + final int baseMsat; + + ///Liquidity-based routing fee in millionths of a routed amount. In other words, 10000 is 1%. + final int proportionalMillionths; + + const RoutingFees({ + required this.baseMsat, + required this.proportionalMillionths, + }); + + @override + int get hashCode => baseMsat.hashCode ^ proportionalMillionths.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is RoutingFees && + runtimeType == other.runtimeType && + baseMsat == other.baseMsat && + proportionalMillionths == other.proportionalMillionths; +} diff --git a/lib/src/generated/api/node.dart b/lib/src/generated/api/node.dart index 20d548f..b409039 100644 --- a/lib/src/generated/api/node.dart +++ b/lib/src/generated/api/node.dart @@ -1,269 +1,189 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. +// Generated by `flutter_rust_bridge`@ 2.0.0. // ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import import '../frb_generated.dart'; -import 'error.dart'; -import 'package:collection/collection.dart'; +import '../lib.dart'; +import '../utils/error.dart'; +import 'bolt11.dart'; +import 'bolt12.dart'; +import 'graph.dart'; +import 'on_chain.dart'; import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; +import 'spontaneous.dart'; import 'types.dart'; -Future buildWithSqliteStore( - {required Config config, - ChainDataSourceConfig? chainDataSourceConfig, - EntropySourceConfig? entropySourceConfig, - GossipSourceConfig? gossipSourceConfig, - dynamic hint}) => - LdkCore.instance.api.buildWithSqliteStore( - config: config, - chainDataSourceConfig: chainDataSourceConfig, - entropySourceConfig: entropySourceConfig, - gossipSourceConfig: gossipSourceConfig, - hint: hint); - -// Rust type: RustOpaqueNom> -@sealed -class NodeSqliteStore extends RustOpaque { - NodeSqliteStore.dcoDecode(List wire) - : super.dcoDecode(wire, _kStaticData); - - NodeSqliteStore.sseDecode(int ptr, int externalSizeOnNative) - : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); - - static final _kStaticData = RustArcStaticData( - rustArcIncrementStrongCount: - LdkCore.instance.api.rust_arc_increment_strong_count_NodeSqliteStore, - rustArcDecrementStrongCount: - LdkCore.instance.api.rust_arc_decrement_strong_count_NodeSqliteStore, - rustArcDecrementStrongCountPtr: - LdkCore.instance.api.rust_arc_decrement_strong_count_NodeSqliteStorePtr, - ); -} - -class LdkMnemonic { - final String seedPhrase; - - const LdkMnemonic({ - required this.seedPhrase, - }); - - static Future generate({dynamic hint}) => - LdkCore.instance.api.ldkMnemonicGenerate(hint: hint); - - @override - int get hashCode => seedPhrase.hashCode; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is LdkMnemonic && - runtimeType == other.runtimeType && - seedPhrase == other.seedPhrase; -} +// Rust type: RustOpaqueNom +abstract class Node implements RustOpaqueInterface {} class LdkNode { - final NodeSqliteStore ptr; + final Node ptr; const LdkNode({ required this.ptr, }); + static Future bolt11Payment({required LdkNode ptr}) => + core.instance.api.crateApiNodeLdkNodeBolt11Payment(ptr: ptr); + + static Future bolt12Payment({required LdkNode ptr}) => + core.instance.api.crateApiNodeLdkNodeBolt12Payment(ptr: ptr); + Future closeChannel( - {required ChannelId channelId, - required PublicKey counterpartyNodeId, - dynamic hint}) => - LdkCore.instance.api.ldkNodeCloseChannel( + {required UserChannelId userChannelId, + required PublicKey counterpartyNodeId}) => + core.instance.api.crateApiNodeLdkNodeCloseChannel( that: this, - channelId: channelId, - counterpartyNodeId: counterpartyNodeId, - hint: hint); + userChannelId: userChannelId, + counterpartyNodeId: counterpartyNodeId); + + Future config() => core.instance.api.crateApiNodeLdkNodeConfig( + that: this, + ); Future connect( {required PublicKey nodeId, required SocketAddress address, - required bool persist, - dynamic hint}) => - LdkCore.instance.api.ldkNodeConnect( - that: this, - nodeId: nodeId, - address: address, - persist: persist, - hint: hint); + required bool persist}) => + core.instance.api.crateApiNodeLdkNodeConnect( + that: this, nodeId: nodeId, address: address, persist: persist); - Future connectOpenChannel( + Future connectOpenChannel( {required SocketAddress socketAddress, required PublicKey nodeId, - required int channelAmountSats, - int? pushToCounterpartyMsat, + required BigInt channelAmountSats, + BigInt? pushToCounterpartyMsat, required bool announceChannel, - ChannelConfig? channelConfig, - dynamic hint}) => - LdkCore.instance.api.ldkNodeConnectOpenChannel( + ChannelConfig? channelConfig}) => + core.instance.api.crateApiNodeLdkNodeConnectOpenChannel( that: this, socketAddress: socketAddress, nodeId: nodeId, channelAmountSats: channelAmountSats, pushToCounterpartyMsat: pushToCounterpartyMsat, announceChannel: announceChannel, - channelConfig: channelConfig, - hint: hint); + channelConfig: channelConfig); + + Future disconnect({required PublicKey counterpartyNodeId}) => + core.instance.api.crateApiNodeLdkNodeDisconnect( + that: this, counterpartyNodeId: counterpartyNodeId); - Future disconnect( - {required PublicKey counterpartyNodeId, dynamic hint}) => - LdkCore.instance.api.ldkNodeDisconnect( - that: this, counterpartyNodeId: counterpartyNodeId, hint: hint); + Future eventHandled() => + core.instance.api.crateApiNodeLdkNodeEventHandled( + that: this, + ); - Future eventHandled({dynamic hint}) => - LdkCore.instance.api.ldkNodeEventHandled(that: this, hint: hint); + Future forceCloseChannel( + {required UserChannelId userChannelId, + required PublicKey counterpartyNodeId}) => + core.instance.api.crateApiNodeLdkNodeForceCloseChannel( + that: this, + userChannelId: userChannelId, + counterpartyNodeId: counterpartyNodeId); - Future isRunning({dynamic hint}) => - LdkCore.instance.api.ldkNodeIsRunning(that: this, hint: hint); + Future listBalances() => + core.instance.api.crateApiNodeLdkNodeListBalances( + that: this, + ); - Future> listChannels({dynamic hint}) => - LdkCore.instance.api.ldkNodeListChannels(that: this, hint: hint); + Future> listChannels() => + core.instance.api.crateApiNodeLdkNodeListChannels( + that: this, + ); - Future> listPayments({dynamic hint}) => - LdkCore.instance.api.ldkNodeListPayments(that: this, hint: hint); + Future> listPayments() => + core.instance.api.crateApiNodeLdkNodeListPayments( + that: this, + ); Future> listPaymentsWithFilter( - {required PaymentDirection paymentDirection, dynamic hint}) => - LdkCore.instance.api.ldkNodeListPaymentsWithFilter( - that: this, paymentDirection: paymentDirection, hint: hint); + {required PaymentDirection paymentDirection}) => + core.instance.api.crateApiNodeLdkNodeListPaymentsWithFilter( + that: this, paymentDirection: paymentDirection); - Future> listPeers({dynamic hint}) => - LdkCore.instance.api.ldkNodeListPeers(that: this, hint: hint); + Future> listPeers() => + core.instance.api.crateApiNodeLdkNodeListPeers( + that: this, + ); - Future?> listeningAddresses({dynamic hint}) => - LdkCore.instance.api.ldkNodeListeningAddresses(that: this, hint: hint); + Future?> listeningAddresses() => + core.instance.api.crateApiNodeLdkNodeListeningAddresses( + that: this, + ); - Future
newOnchainAddress({dynamic hint}) => - LdkCore.instance.api.ldkNodeNewOnchainAddress(that: this, hint: hint); + static Future networkGraph({required LdkNode ptr}) => + core.instance.api.crateApiNodeLdkNodeNetworkGraph(ptr: ptr); - Future nextEvent({dynamic hint}) => - LdkCore.instance.api.ldkNodeNextEvent(that: this, hint: hint); + Future nextEvent() => core.instance.api.crateApiNodeLdkNodeNextEvent( + that: this, + ); - Future nodeId({dynamic hint}) => - LdkCore.instance.api.ldkNodeNodeId(that: this, hint: hint); + Future nextEventAsync() => + core.instance.api.crateApiNodeLdkNodeNextEventAsync( + that: this, + ); - Future payment( - {required PaymentHash paymentHash, dynamic hint}) => - LdkCore.instance.api - .ldkNodePayment(that: this, paymentHash: paymentHash, hint: hint); + Future nodeId() => core.instance.api.crateApiNodeLdkNodeNodeId( + that: this, + ); - Future receivePayment( - {required int amountMsat, - required String description, - required int expirySecs, - dynamic hint}) => - 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.ldkNodeReceiveVariableAmountPayment( - that: this, - description: description, - expirySecs: expirySecs, - hint: hint); - - Future removePayment( - {required PaymentHash paymentHash, dynamic hint}) => - LdkCore.instance.api.ldkNodeRemovePayment( - that: this, paymentHash: paymentHash, hint: hint); - - Future sendAllToOnchainAddress( - {required Address address, dynamic hint}) => - LdkCore.instance.api.ldkNodeSendAllToOnchainAddress( - that: this, address: address, hint: hint); - - Future sendPayment( - {required Bolt11Invoice invoice, dynamic hint}) => - LdkCore.instance.api - .ldkNodeSendPayment(that: this, invoice: invoice, hint: hint); - - Future sendPaymentProbes( - {required Bolt11Invoice invoice, dynamic hint}) => - LdkCore.instance.api - .ldkNodeSendPaymentProbes(that: this, invoice: invoice, hint: hint); - - Future sendPaymentProbesUsingAmount( - {required Bolt11Invoice invoice, - required int amountMsat, - dynamic hint}) => - 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.ldkNodeSendPaymentUsingAmount( - that: this, invoice: invoice, amountMsat: amountMsat, hint: hint); - - Future sendSpontaneousPayment( - {required int amountMsat, required PublicKey nodeId, dynamic hint}) => - 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.ldkNodeSendSpontaneousPaymentProbes( - that: this, amountMsat: amountMsat, nodeId: nodeId, hint: hint); - - Future sendToOnchainAddress( - {required Address address, required int amountSats, dynamic hint}) => - LdkCore.instance.api.ldkNodeSendToOnchainAddress( - that: this, address: address, amountSats: amountSats, hint: hint); - - Future signMessage({required List msg, dynamic hint}) => - LdkCore.instance.api.ldkNodeSignMessage(that: this, msg: msg, hint: hint); - - Future spendableOnchainBalanceSats({dynamic hint}) => - LdkCore.instance.api - .ldkNodeSpendableOnchainBalanceSats(that: this, hint: hint); - - Future start({dynamic hint}) => - LdkCore.instance.api.ldkNodeStart(that: this, hint: hint); - - Future stop({dynamic hint}) => - LdkCore.instance.api.ldkNodeStop(that: this, hint: hint); - - Future syncWallets({dynamic hint}) => - LdkCore.instance.api.ldkNodeSyncWallets(that: this, hint: hint); - - Future totalOnchainBalanceSats({dynamic hint}) => LdkCore.instance.api - .ldkNodeTotalOnchainBalanceSats(that: this, hint: hint); + static Future onChainPayment({required LdkNode ptr}) => + core.instance.api.crateApiNodeLdkNodeOnChainPayment(ptr: ptr); + + Future payment({required PaymentId paymentId}) => + core.instance.api + .crateApiNodeLdkNodePayment(that: this, paymentId: paymentId); + + Future removePayment({required PaymentId paymentId}) => + core.instance.api + .crateApiNodeLdkNodeRemovePayment(that: this, paymentId: paymentId); + + Future signMessage({required List msg}) => + core.instance.api.crateApiNodeLdkNodeSignMessage(that: this, msg: msg); + + static Future spontaneousPayment( + {required LdkNode ptr}) => + core.instance.api.crateApiNodeLdkNodeSpontaneousPayment(ptr: ptr); + + Future start() => core.instance.api.crateApiNodeLdkNodeStart( + that: this, + ); + + Future status() => core.instance.api.crateApiNodeLdkNodeStatus( + that: this, + ); + + Future stop() => core.instance.api.crateApiNodeLdkNodeStop( + that: this, + ); + + Future syncWallets() => + core.instance.api.crateApiNodeLdkNodeSyncWallets( + that: this, + ); Future updateChannelConfig( - {required ChannelId channelId, + {required UserChannelId userChannelId, required PublicKey counterpartyNodeId, - required ChannelConfig channelConfig, - dynamic hint}) => - LdkCore.instance.api.ldkNodeUpdateChannelConfig( + required ChannelConfig channelConfig}) => + core.instance.api.crateApiNodeLdkNodeUpdateChannelConfig( that: this, - channelId: channelId, + userChannelId: userChannelId, counterpartyNodeId: counterpartyNodeId, - channelConfig: channelConfig, - hint: hint); + channelConfig: channelConfig); Future verifySignature( {required List msg, required String sig, - required PublicKey pkey, - dynamic hint}) => - LdkCore.instance.api.ldkNodeVerifySignature( - that: this, msg: msg, sig: sig, pkey: pkey, hint: hint); + required PublicKey publicKey}) => + core.instance.api.crateApiNodeLdkNodeVerifySignature( + that: this, msg: msg, sig: sig, publicKey: publicKey); - Future waitNextEvent({dynamic hint}) => - LdkCore.instance.api.ldkNodeWaitNextEvent(that: this, hint: hint); + Future waitNextEvent() => + core.instance.api.crateApiNodeLdkNodeWaitNextEvent( + that: this, + ); @override int get hashCode => ptr.hashCode; @@ -273,73 +193,3 @@ class LdkNode { identical(this, other) || other is LdkNode && runtimeType == other.runtimeType && ptr == other.ptr; } - -class U8Array12 extends NonGrowableListView { - static const arraySize = 12; - - @internal - Uint8List get inner => _inner; - final Uint8List _inner; - - U8Array12(this._inner) - : assert(_inner.length == arraySize), - super(_inner); - - U8Array12.init() : this(Uint8List(arraySize)); -} - -class U8Array16 extends NonGrowableListView { - static const arraySize = 16; - - @internal - Uint8List get inner => _inner; - final Uint8List _inner; - - U8Array16(this._inner) - : assert(_inner.length == arraySize), - super(_inner); - - U8Array16.init() : this(Uint8List(arraySize)); -} - -class U8Array32 extends NonGrowableListView { - static const arraySize = 32; - - @internal - Uint8List get inner => _inner; - final Uint8List _inner; - - U8Array32(this._inner) - : assert(_inner.length == arraySize), - super(_inner); - - U8Array32.init() : this(Uint8List(arraySize)); -} - -class U8Array4 extends NonGrowableListView { - static const arraySize = 4; - - @internal - Uint8List get inner => _inner; - final Uint8List _inner; - - U8Array4(this._inner) - : assert(_inner.length == arraySize), - super(_inner); - - U8Array4.init() : this(Uint8List(arraySize)); -} - -class U8Array64 extends NonGrowableListView { - static const arraySize = 64; - - @internal - Uint8List get inner => _inner; - final Uint8List _inner; - - U8Array64(this._inner) - : assert(_inner.length == arraySize), - super(_inner); - - U8Array64.init() : this(Uint8List(arraySize)); -} diff --git a/lib/src/generated/api/on_chain.dart b/lib/src/generated/api/on_chain.dart new file mode 100644 index 0000000..2679842 --- /dev/null +++ b/lib/src/generated/api/on_chain.dart @@ -0,0 +1,44 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0. + +// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import + +import '../frb_generated.dart'; +import '../lib.dart'; +import '../utils/error.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; +import 'types.dart'; + +// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `from` + +class LdkOnChainPayment { + final OnchainPayment ptr; + + const LdkOnChainPayment({ + required this.ptr, + }); + + Future
newAddress() => + core.instance.api.crateApiOnChainLdkOnChainPaymentNewAddress( + that: this, + ); + + Future sendAllToAddress({required Address address}) => + core.instance.api.crateApiOnChainLdkOnChainPaymentSendAllToAddress( + that: this, address: address); + + Future sendToAddress( + {required Address address, required BigInt amountSats}) => + core.instance.api.crateApiOnChainLdkOnChainPaymentSendToAddress( + that: this, address: address, amountSats: amountSats); + + @override + int get hashCode => ptr.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LdkOnChainPayment && + runtimeType == other.runtimeType && + ptr == other.ptr; +} diff --git a/lib/src/generated/api/spontaneous.dart b/lib/src/generated/api/spontaneous.dart new file mode 100644 index 0000000..adad377 --- /dev/null +++ b/lib/src/generated/api/spontaneous.dart @@ -0,0 +1,40 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0. + +// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import + +import '../frb_generated.dart'; +import '../lib.dart'; +import '../utils/error.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; +import 'types.dart'; + +// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `from` + +class LdkSpontaneousPayment { + final SpontaneousPayment ptr; + + const LdkSpontaneousPayment({ + required this.ptr, + }); + + Future send( + {required BigInt amountMsat, required PublicKey nodeId}) => + core.instance.api.crateApiSpontaneousLdkSpontaneousPaymentSend( + that: this, amountMsat: amountMsat, nodeId: nodeId); + + Future sendProbes( + {required BigInt amountMsat, required PublicKey nodeId}) => + core.instance.api.crateApiSpontaneousLdkSpontaneousPaymentSendProbes( + that: this, amountMsat: amountMsat, nodeId: nodeId); + + @override + int get hashCode => ptr.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LdkSpontaneousPayment && + runtimeType == other.runtimeType && + ptr == other.ptr; +} diff --git a/lib/src/generated/api/types.dart b/lib/src/generated/api/types.dart index 412aae8..46a07c6 100644 --- a/lib/src/generated/api/types.dart +++ b/lib/src/generated/api/types.dart @@ -1,15 +1,17 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. +// Generated by `flutter_rust_bridge`@ 2.0.0. // ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import import '../frb_generated.dart'; -import 'error.dart'; -import 'node.dart'; +import '../lib.dart'; +import 'builder.dart'; import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; import 'package:freezed_annotation/freezed_annotation.dart' hide protected; part 'types.freezed.dart'; +// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `default`, `default`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `hash`, `hash`, `hash`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from` + /// A Bitcoin address. /// class Address { @@ -28,24 +30,167 @@ class Address { other is Address && runtimeType == other.runtimeType && s == other.s; } -///Represents a syntactically and semantically correct lightning BOLT11 invoice. +/// Configuration options pertaining to 'Anchor' channels, i.e., channels for which the +/// `optionAnchorsZeroFeeHtlcTx` channel type is negotiated. +/// +/// Prior to the introduction of Anchor channels, the on-chain fees paying for the transactions +/// issued on channel closure were pre-determined and locked-in at the time of the channel +/// opening. This required to estimate what fee rate would be sufficient to still have the +/// closing transactions be spendable on-chain (i.e., not be considered dust). This legacy +/// design of pre-anchor channels proved inadequate in the unpredictable, often turbulent, fee +/// markets we experience today. +/// +/// In contrast, Anchor channels allow to determine an adequate fee rate *at the time of channel +/// closure*, making them much more robust in the face of fee spikes. In turn, they require to +/// maintain a reserve of on-chain funds to have the channel closure transactions confirmed +/// on-chain, at least if the channel counterparty can't be trusted to do this for us. +/// +/// See [BOLT 3] for more technical details on Anchor channels. +/// +/// +/// ### Defaults +/// +/// | Parameter | Value | +/// |----------------------------|--------| +/// | `trustedPeersNoReserve` | [] | +/// | `perChannelReserveSats` | 25000 | +/// +/// +/// [BOLT 3]: https://github.com/lightning/bolts/blob/master/03-transactions.md#htlc-timeout-and-htlc-success-transactions +class AnchorChannelsConfig { + /// A list of peers that we trust to get the required channel closing transactions confirmed + /// on-chain. + /// + /// Channels with these peers won't count towards the retained on-chain reserve and we won't + /// take any action to get the required transactions confirmed ourselves. + /// + /// **Note:** Trusting the channel counterparty to take the necessary actions to get the + /// required Anchor spending and HTLC transactions confirmed on-chain is potentially insecure + /// as the channel may not be closed if they refuse to do so, potentially leaving the user + /// funds stuck *or* even allow the counterparty to steal any in-flight funds after the + /// corresponding HTLCs time out. + final List trustedPeersNoReserve; + + /// The amount of satoshis per anchors-negotiated channel with an untrusted peer that we keep + /// as an emergency reserve in our on-chain wallet. + /// + /// This allows for having the required Anchor output spending and HTLC transactions confirmed + /// when the channel is closed. + /// + /// If the channel peer is not marked as trusted via trustedPeersNoReserve, + /// we will always try to spend the Anchor + /// outputs with *any* on-chain funds available, i.e., the total reserve value as well as any + /// spendable funds available in the on-chain wallet. Therefore, this per-channel multiplier is + /// really an emergency reserve that we maintain at all time to reduce reduce the risk of + /// insufficient funds at time of a channel closure. To this end, we will refuse to open + /// outbound or accept inbound channels if we don't have sufficient on-chain funds available to + /// cover the additional reserve requirement. + /// + /// **Note:** Depending on the fee market at the time of closure, this reserve amount might or + /// might not suffice to successfully spend the Anchor output and have the HTLC transactions + /// confirmed on-chain, i.e., you may want to adjust this value accordingly. + final BigInt perChannelReserveSats; + + const AnchorChannelsConfig({ + required this.trustedPeersNoReserve, + required this.perChannelReserveSats, + }); + + @override + int get hashCode => + trustedPeersNoReserve.hashCode ^ perChannelReserveSats.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AnchorChannelsConfig && + runtimeType == other.runtimeType && + trustedPeersNoReserve == other.trustedPeersNoReserve && + perChannelReserveSats == other.perChannelReserveSats; +} + +/// Details of the known available balances returned by `node.listBalances`. /// -class Bolt11Invoice { - final String signedRawInvoice; +class BalanceDetails { + /// The total balance of our on-chain wallet. + final BigInt totalOnchainBalanceSats; + + /// The currently spendable balance of our on-chain wallet. + final BigInt spendableOnchainBalanceSats; - const Bolt11Invoice({ - required this.signedRawInvoice, + /// 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 BigInt 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 => signedRawInvoice.hashCode; + int get hashCode => + totalOnchainBalanceSats.hashCode ^ + spendableOnchainBalanceSats.hashCode ^ + totalLightningBalanceSats.hashCode ^ + lightningBalances.hashCode ^ + pendingBalancesFromChannelClosures.hashCode; @override bool operator ==(Object other) => identical(this, other) || - other is Bolt11Invoice && + other is BalanceDetails && runtimeType == other.runtimeType && - signedRawInvoice == other.signedRawInvoice; + 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; } @freezed @@ -79,7 +224,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. /// @@ -90,18 +235,16 @@ class ChannelConfig { /// When we are not the funder, we require the closing transaction fee pay at least our Background fee estimate, but allow our counterparty to pay as much fee as they like. Thus, this value is ignored when we are not the funder. /// /// Default value: 1000 satoshis. - final int forceCloseAvoidanceMaxFeeSatoshis; + final BigInt 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, - required this.maxDustHtlcExposure, + this.maxDustHtlcExposure, required this.forceCloseAvoidanceMaxFeeSatoshis, required this.acceptUnderpayingHtlcs, }); @@ -130,118 +273,146 @@ class ChannelConfig { acceptUnderpayingHtlcs == other.acceptUnderpayingHtlcs; } -/// Details of a channel, as returned by node.listChannels() -/// class ChannelDetails { - /// 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). + /// 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). + /// /// 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 String? fundingTxo; + final OutPoint? fundingTxo; - ///The value, in satoshis, of this channel as it appears in the funding output. - final int channelValueSats; + /// The value, in satoshis, of this channel as it appears in the funding output. + final BigInt channelValueSats; - /// 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. + /// 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. /// - /// This value is not included in `outbound_capacity_msat` as it can never be spent. + /// This value is not included in `outboundCapacityMsat` as it can never be spent. /// - /// This value will be null for outbound channels until the counterparty accepts the channel. + /// This value will be `None` for outbound channels until the counterparty accepts the channel. /// - final int? unspendablePunishmentReserve; + final BigInt? unspendablePunishmentReserve; - /// 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. - /// + /// The local `user_channel_id` of this channel. 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; - /// 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 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 + /// The amount does not include any pending HTLCs which are not yet 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; + final BigInt outboundCapacityMsat; - /// 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. + /// The available outbound capacity for sending HTLCs to the remote peer. /// - /// 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 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. - /// - final int inboundCapacityMsat; - - /// 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 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 BigInt 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 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; - /// True if the channel was initiated (and thus funded) by us. - /// + /// Returns `true` if the channel was initiated (and therefore funded) by us. final bool isOutbound; - /// 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 - /// + /// 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; - /// 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 is a strict superset of `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. /// + /// This is a strict superset of `is_channel_ready`. final bool isUsable; - /// True if this channel is (or will be) publicly-announced. - /// + /// 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; + + /// 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. + /// + /// This value is not included in [`inbound_capacity_msat`] as it can never be spent. + /// + /// [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat + final BigInt counterpartyUnspendablePunishmentReserve; + + /// The smallest value HTLC (in msat) the remote peer will accept, for this channel. + /// + /// This field is only `None` before we have received either the `OpenChannel` or + /// `AcceptChannel` message from the remote peer. + final BigInt? counterpartyOutboundHtlcMinimumMsat; + + /// The largest value HTLC (in msat) the remote peer currently will accept, for this channel. + final BigInt? 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 BigInt 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 BigInt 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 BigInt inboundHtlcMinimumMsat; + + /// The largest value HTLC (in msat) we currently will accept, for this channel. + final BigInt? inboundHtlcMaximumMsat; + + /// Set of configurable parameters that affect channel operation. + final ChannelConfig config; + const ChannelDetails({ required this.channelId, required this.counterpartyNodeId, @@ -250,7 +421,6 @@ class ChannelDetails { this.unspendablePunishmentReserve, required this.userChannelId, required this.feerateSatPer1000Weight, - required this.balanceMsat, required this.outboundCapacityMsat, required this.inboundCapacityMsat, this.confirmationsRequired, @@ -259,6 +429,19 @@ 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 @@ -270,7 +453,6 @@ class ChannelDetails { unspendablePunishmentReserve.hashCode ^ userChannelId.hashCode ^ feerateSatPer1000Weight.hashCode ^ - balanceMsat.hashCode ^ outboundCapacityMsat.hashCode ^ inboundCapacityMsat.hashCode ^ confirmationsRequired.hashCode ^ @@ -278,7 +460,20 @@ class ChannelDetails { isOutbound.hashCode ^ isChannelReady.hashCode ^ isUsable.hashCode ^ - isPublic.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; @override bool operator ==(Object other) => @@ -292,7 +487,6 @@ class ChannelDetails { unspendablePunishmentReserve == other.unspendablePunishmentReserve && userChannelId == other.userChannelId && feerateSatPer1000Weight == other.feerateSatPer1000Weight && - balanceMsat == other.balanceMsat && outboundCapacityMsat == other.outboundCapacityMsat && inboundCapacityMsat == other.inboundCapacityMsat && confirmationsRequired == other.confirmationsRequired && @@ -300,7 +494,26 @@ class ChannelDetails { isOutbound == other.isOutbound && isChannelReady == other.isChannelReady && isUsable == other.isUsable && - isPublic == other.isPublic; + 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; } /// The global identifier of a channel. @@ -327,6 +540,102 @@ class ChannelId { data == other.data; } +@freezed +sealed class ClosureReason with _$ClosureReason { + const 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. + /// + /// [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel. + 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. + /// + /// This was only set in versions of LDK prior to 0.0.122. + const factory ClosureReason.legacyCooperativeClosure() = + ClosureReason_LegacyCooperativeClosure; + + /// The channel was closed after negotiating a cooperative close and we've now broadcasted + /// the cooperative close transaction. This indicates that the shutdown was initiated by our + /// counterparty. + /// + /// In rare cases where we initiated closure immediately prior to shutting down without + /// persisting, this value may be provided for channels we initiated closure for. + const factory ClosureReason.counterpartyInitiatedCooperativeClosure() = + ClosureReason_CounterpartyInitiatedCooperativeClosure; + + /// The channel was closed after negotiating a cooperative close and we've now broadcasted + /// the cooperative close transaction. This indicates that the shutdown was initiated by us. + const factory ClosureReason.locallyInitiatedCooperativeClosure() = + ClosureReason_LocallyInitiatedCooperativeClosure; + + /// 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. + /// + /// [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor + const factory ClosureReason.disconnectedPeer() = + ClosureReason_DisconnectedPeer; + + /// Closure generated from `ChannelManager::read` if the [`ChannelMonitor`] is newer than + /// the [`ChannelManager`] deserialized. + /// + /// [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor + /// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager + 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; + + /// One of our HTLCs timed out in a channel, causing us to force close the channel. + const factory ClosureReason.htlCsTimedOut() = ClosureReason_HTLCsTimedOut; +} + /// Represents the configuration of an [Node] instance. /// class Config { @@ -347,28 +656,29 @@ class Config { ///The time in-between background sync attempts of the onchain wallet, in seconds. /// Note: A minimum of 10 seconds is always enforced. - int onchainWalletSyncIntervalSecs; + BigInt onchainWalletSyncIntervalSecs; /// The time in-between background sync attempts of the LDK wallet, in seconds. /// Note: A minimum of 10 seconds is always enforced. /// - int walletSyncIntervalSecs; + BigInt walletSyncIntervalSecs; ///The time in-between background update attempts to our fee rate cache, in seconds. /// Note: A minimum of 10 seconds is always enforced. /// - int feeRateCacheUpdateIntervalSecs; + BigInt feeRateCacheUpdateIntervalSecs; ///A list of peers that we allow to establish zero confirmation channels to us. /// ///Note: Allowing payments via zero-confirmation channels is potentially insecure if the funding transaction ends up never being confirmed on-chain. Zero-confirmation channels should therefore only be accepted from trusted peers. final List trustedPeers0Conf; - final int probingLiquidityLimitMultiplier; + final BigInt probingLiquidityLimitMultiplier; ///The level at which we log messages. /// Any messages below this level will be excluded from the logs. /// LogLevel logLevel; + AnchorChannelsConfig? anchorChannelsConfig; Config({ required this.storageDirPath, @@ -382,6 +692,7 @@ class Config { required this.trustedPeers0Conf, required this.probingLiquidityLimitMultiplier, required this.logLevel, + this.anchorChannelsConfig, }); @override @@ -396,7 +707,8 @@ class Config { feeRateCacheUpdateIntervalSecs.hashCode ^ trustedPeers0Conf.hashCode ^ probingLiquidityLimitMultiplier.hashCode ^ - logLevel.hashCode; + logLevel.hashCode ^ + anchorChannelsConfig.hashCode; @override bool operator ==(Object other) => @@ -416,7 +728,8 @@ class Config { trustedPeers0Conf == other.trustedPeers0Conf && probingLiquidityLimitMultiplier == other.probingLiquidityLimitMultiplier && - logLevel == other.logLevel; + logLevel == other.logLevel && + anchorChannelsConfig == other.anchorChannelsConfig; } @freezed @@ -439,64 +752,119 @@ sealed class EntropySourceConfig with _$EntropySourceConfig { sealed class Event with _$Event { const Event._(); + /// A payment for a previously-registered payment hash has been received. + /// + /// This needs to be manually claimed by supplying the correct preimage to `claimForHash`. + /// + /// If the the provided parameters don't match the expectations or the preimage can't be + /// retrieved in time, should be failed-back via [`failForHash`]. + const factory Event.paymentClaimable({ + /// A local identifier used to track the payment. + required PaymentId paymentId, + + /// The hash of the payment. + required PaymentHash paymentHash, + + /// The value, in thousandths of a satoshi, that is claimable. + required BigInt claimableAmountMsat, + + /// The block height at which this payment will be failed back and will no longer be + /// eligible for claiming. + int? claimDeadline, + }) = Event_PaymentClaimable; + /// A sent payment was successful. const factory Event.paymentSuccessful({ + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + PaymentId? paymentId, + /// The hash of the payment. required PaymentHash paymentHash, + + /// The total fee which was spent at intermediate hops in this payment. + BigInt? feePaidMsat, }) = Event_PaymentSuccessful; /// A sent payment has failed. const factory Event.paymentFailed({ + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + PaymentId? paymentId, + /// 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. const factory Event.paymentReceived({ + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + PaymentId? paymentId, + /// The hash of the payment. required PaymentHash paymentHash, /// The value, in thousandths of a satoshi, that has been received. - required int amountMsat, + required BigInt amountMsat, }) = Event_PaymentReceived; + /// A channel has been created and is pending confirmation on-chain. + const factory Event.channelPending({ + /// The `channelId` of the channel. + required ChannelId channelId, + + /// The `userChannelId` of the channel. + required UserChannelId userChannelId, + + /// The `temporaryChannelId` this channel used to be known by during channel establishment. + required ChannelId formerTemporaryChannelId, + + /// The `nodeId` 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 `channelId` of the channel. required ChannelId channelId, - /// The user_channel_id of the channel. + /// The `userChannelId` of the channel. required UserChannelId userChannelId, + + /// The `nodeId` 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 `channelId` of the channel. required ChannelId channelId, - /// The user_channel_id of the channel. + /// The `userChannelId` of the channel. required UserChannelId userChannelId, - PublicKey? counterpartyNodeId, - }) = Event_ChannelClosed; - /// 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 `nodeId` of the channel counterparty. + /// + /// This will be `None` for events serialized by LDK Node v0.1.0 and prior. + PublicKey? counterpartyNodeId, - /// The outpoint of the channel's funding transaction. - required OutPoint fundingTxo, - }) = Event_ChannelPending; + /// This will be `None` for events serialized by LDK Node v0.2.1 and prior. + ClosureReason? reason, + }) = Event_ChannelClosed; } @freezed @@ -509,6 +877,153 @@ sealed class GossipSourceConfig with _$GossipSourceConfig { ) = GossipSourceConfig_RapidGossipSync; } +@freezed +sealed class LightningBalance with _$LightningBalance { + const 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 BigInt 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 BigInt 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 BigInt 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 BigInt 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. + 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 BigInt 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 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 identifier of our channel counterparty. + required PublicKey counterpartyNodeId, + + /// The amount, in satoshis, of the output which we can claim. + required BigInt amountSatoshis, + }) = LightningBalance_CounterpartyRevokedOutputClaimable; +} + +class LiquiditySourceConfig { + final (SocketAddress, PublicKey, String?) lsps2Service; + + const LiquiditySourceConfig({ + required this.lsps2Service, + }); + + @override + int get hashCode => lsps2Service.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LiquiditySourceConfig && + runtimeType == other.runtimeType && + lsps2Service == other.lsps2Service; +} + /// An enum representing the available verbosity levels of the logger. /// enum LogLevel { @@ -535,6 +1050,37 @@ enum LogLevel { /// Designates very serious errors /// error, + ; +} + +/// Limits applying to how much fee we allow an LSP to deduct from the payment amount. +class LSPFeeLimits { + /// The maximal total amount we allow any configured LSP withhold from us when forwarding the + /// payment. + final BigInt? maxTotalOpeningFeeMsat; + + /// The maximal proportional fee, in parts-per-million millisatoshi, we allow any configured + /// LSP withhold from us when forwarding the payment. + final BigInt? maxProportionalOpeningFeePpmMsat; + + const LSPFeeLimits({ + this.maxTotalOpeningFeeMsat, + this.maxProportionalOpeningFeePpmMsat, + }); + + @override + int get hashCode => + maxTotalOpeningFeeMsat.hashCode ^ + maxProportionalOpeningFeePpmMsat.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LSPFeeLimits && + runtimeType == other.runtimeType && + maxTotalOpeningFeeMsat == other.maxTotalOpeningFeeMsat && + maxProportionalOpeningFeePpmMsat == + other.maxProportionalOpeningFeePpmMsat; } @freezed @@ -543,12 +1089,12 @@ sealed class MaxDustHTLCExposure with _$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, + BigInt field0, ) = MaxDustHTLCExposure_FixedLimitMsat; ///This sets a multiplier on the estimated high priority feerate (sats/KW, as obtained from FeeEstimator) to determine the maximum allowed dust exposure. If this variant is used then the maximum dust exposure in millisatoshis is calculated as: high_priority_feerate_per_kw * value. For example, with our default value FeeRateMultiplier(5000): const factory MaxDustHTLCExposure.feeRateMultiplier( - int field0, + BigInt field0, ) = MaxDustHTLCExposure_FeeRateMultiplier; } @@ -570,6 +1116,107 @@ enum Network { ///Bitcoin’s regtest /// 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 BigInt? 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 BigInt? 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 BigInt? 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 BigInt? 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 BigInt? 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; +} + +class OfferId { + final U8Array32 field0; + + const OfferId({ + required this.field0, + }); + + @override + int get hashCode => field0.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is OfferId && + runtimeType == other.runtimeType && + field0 == other.field0; } ///A reference to a transaction output. @@ -596,19 +1243,15 @@ class OutPoint { } /// Represents a payment. -/// class PaymentDetails { - /// The payment hash, i.e., the hash of the `preimage`. - final PaymentHash hash; - - /// The pre-image used by the payment. - final PaymentPreimage? preimage; + /// The identifier of this payment. + final PaymentId id; - /// The secret used by the payment. - final PaymentSecret? secret; + /// The kind of the payment. + final PaymentKind kind; /// The amount transferred. - final int? amountMsat; + final BigInt? amountMsat; /// The direction of the payment. final PaymentDirection direction; @@ -617,9 +1260,8 @@ class PaymentDetails { final PaymentStatus status; const PaymentDetails({ - required this.hash, - this.preimage, - this.secret, + required this.id, + required this.kind, this.amountMsat, required this.direction, required this.status, @@ -627,9 +1269,8 @@ class PaymentDetails { @override int get hashCode => - hash.hashCode ^ - preimage.hashCode ^ - secret.hashCode ^ + id.hashCode ^ + kind.hashCode ^ amountMsat.hashCode ^ direction.hashCode ^ status.hashCode; @@ -639,9 +1280,8 @@ class PaymentDetails { identical(this, other) || other is PaymentDetails && runtimeType == other.runtimeType && - hash == other.hash && - preimage == other.preimage && - secret == other.secret && + id == other.id && + kind == other.kind && amountMsat == other.amountMsat && direction == other.direction && status == other.status; @@ -655,6 +1295,35 @@ enum PaymentDirection { /// The payment is outbound. 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 @@ -677,6 +1346,109 @@ class PaymentHash { data == other.data; } +///A user-provided identifier in channelManager.sendPayment used to uniquely identify a payment and ensure idempotency in LDK. +class PaymentId { + final U8Array32 field0; + + const PaymentId({ + required this.field0, + }); + + @override + int get hashCode => field0.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is PaymentId && + runtimeType == other.runtimeType && + field0 == other.field0; +} + +@freezed +sealed class PaymentKind with _$PaymentKind { + const PaymentKind._(); + + /// An on-chain payment. + const factory PaymentKind.onchain() = PaymentKind_Onchain; + + /// A [BOLT 11] payment. + /// + /// [BOLT 11]: https://github.com/lightning/bolts/blob/master/11-payment-encoding.md + const factory PaymentKind.bolt11({ + /// The payment hash, i.e., the hash of the `preimage`. + required PaymentHash hash, + + /// The pre-image used by the payment. + PaymentPreimage? preimage, + + /// The secret used by the payment. + PaymentSecret? secret, + }) = PaymentKind_Bolt11; + + /// A [BOLT 11] payment intended to open an [LSPS 2] just-in-time channel. + /// + /// [BOLT 11]: https://github.com/lightning/bolts/blob/master/11-payment-encoding.md + /// [LSPS 2]: https://github.com/BitcoinAndLightningLayerSpecs/lsp/blob/main/LSPS2/README.md + const factory PaymentKind.bolt11Jit({ + /// The payment hash, i.e., the hash of the `preimage`. + required PaymentHash hash, + + /// The pre-image used by the payment. + PaymentPreimage? preimage, + + /// The secret used by the payment. + PaymentSecret? secret, + + /// Limits applying to how much fee we allow an LSP to deduct from the payment amount. + /// + /// Allowing them to deduct this fee from the first inbound payment will pay for the LSP's + /// channel opening fees. + /// + required LSPFeeLimits lspFeeLimits, + }) = PaymentKind_Bolt11Jit; + + /// A spontaneous ("keysend") payment. + const factory PaymentKind.spontaneous({ + /// The payment hash, i.e., the hash of the `preimage`. + required PaymentHash hash, + + /// The pre-image used by the payment. + PaymentPreimage? preimage, + }) = PaymentKind_Spontaneous; + + /// A [BOLT 12] offer payment, i.e., a payment for an `Offer`. + /// + /// [BOLT 12]: https://github.com/lightning/bolts/blob/master/12-offer-encoding.md + const factory PaymentKind.bolt12Offer({ + /// The payment hash, i.e., the hash of the `preimage`. + PaymentHash? hash, + + /// The pre-image used by the payment. + PaymentPreimage? preimage, + + /// The secret used by the payment. + PaymentSecret? secret, + + /// The ID of the offer this payment is for. + required OfferId offerId, + }) = PaymentKind_Bolt12Offer; + + /// A [BOLT 12] 'refund' payment, i.e., a payment for a `Refund`. + /// + /// [BOLT 12]: https://github.com/lightning/bolts/blob/master/12-offer-encoding.md + const factory PaymentKind.bolt12Refund({ + /// The payment hash, i.e., the hash of the `preimage`. + PaymentHash? hash, + + /// The pre-image used by the payment. + PaymentPreimage? preimage, + + /// The secret used by the payment. + PaymentSecret? secret, + }) = PaymentKind_Bolt12Refund; +} + /// paymentPreimage type, use to route payment between hop /// class PaymentPreimage { @@ -728,6 +1500,7 @@ enum PaymentStatus { /// The payment failed. failed, + ; } /// Details of a known Lightning peer as returned by `node.listPeers`. @@ -764,6 +1537,59 @@ class PeerDetails { isConnected == other.isConnected; } +@freezed +sealed class PendingSweepBalance with _$PendingSweepBalance { + const 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 BigInt 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 BigInt 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 BigInt amountSatoshis, + }) = PendingSweepBalance_AwaitingThresholdConfirmations; +} + ///A Secp256k1 public key, used for verification of signatures. /// class PublicKey { @@ -809,13 +1635,6 @@ 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. @@ -841,7 +1660,7 @@ class Txid { /// By default, this will be randomly generated for the user to ensure local uniqueness. /// class UserChannelId { - final int data; + final Uint8List 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 1a466c2..ac2bfd5 100644 --- a/lib/src/generated/api/types.freezed.dart +++ b/lib/src/generated/api/types.freezed.dart @@ -230,66 +230,158 @@ abstract class ChainDataSourceConfig_Esplora extends ChainDataSourceConfig { } /// @nodoc -mixin _$EntropySourceConfig { +mixin _$ClosureReason { @optionalTypeArgs TResult when({ - required TResult Function(String field0) seedFile, - required TResult Function(U8Array64 field0) seedBytes, - required TResult Function(LdkMnemonic mnemonic, String? passphrase) - bip39Mnemonic, + required TResult Function(String peerMsg) counterpartyForceClosed, + required TResult Function() holderForceClosed, + required TResult Function() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(String field0)? seedFile, - TResult? Function(U8Array64 field0)? seedBytes, - TResult? Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult maybeWhen({ - TResult Function(String field0)? seedFile, - TResult Function(U8Array64 field0)? seedBytes, - TResult Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, 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, + required TResult Function(ClosureReason_CounterpartyForceClosed value) + counterpartyForceClosed, + required TResult Function(ClosureReason_HolderForceClosed value) + holderForceClosed, + required TResult Function(ClosureReason_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(EntropySourceConfig_SeedFile value)? seedFile, - TResult? Function(EntropySourceConfig_SeedBytes value)? seedBytes, - TResult? Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult maybeMap({ - TResult Function(EntropySourceConfig_SeedFile value)? seedFile, - TResult Function(EntropySourceConfig_SeedBytes value)? seedBytes, - TResult Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, required TResult orElse(), }) => throw _privateConstructorUsedError; } /// @nodoc -abstract class $EntropySourceConfigCopyWith<$Res> { - factory $EntropySourceConfigCopyWith( - EntropySourceConfig value, $Res Function(EntropySourceConfig) then) = - _$EntropySourceConfigCopyWithImpl<$Res, EntropySourceConfig>; +abstract class $ClosureReasonCopyWith<$Res> { + factory $ClosureReasonCopyWith( + ClosureReason value, $Res Function(ClosureReason) then) = + _$ClosureReasonCopyWithImpl<$Res, ClosureReason>; } /// @nodoc -class _$EntropySourceConfigCopyWithImpl<$Res, $Val extends EntropySourceConfig> - implements $EntropySourceConfigCopyWith<$Res> { - _$EntropySourceConfigCopyWithImpl(this._value, this._then); +class _$ClosureReasonCopyWithImpl<$Res, $Val extends ClosureReason> + implements $ClosureReasonCopyWith<$Res> { + _$ClosureReasonCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; @@ -298,34 +390,34 @@ class _$EntropySourceConfigCopyWithImpl<$Res, $Val extends EntropySourceConfig> } /// @nodoc -abstract class _$$EntropySourceConfig_SeedFileImplCopyWith<$Res> { - factory _$$EntropySourceConfig_SeedFileImplCopyWith( - _$EntropySourceConfig_SeedFileImpl value, - $Res Function(_$EntropySourceConfig_SeedFileImpl) then) = - __$$EntropySourceConfig_SeedFileImplCopyWithImpl<$Res>; +abstract class _$$ClosureReason_CounterpartyForceClosedImplCopyWith<$Res> { + factory _$$ClosureReason_CounterpartyForceClosedImplCopyWith( + _$ClosureReason_CounterpartyForceClosedImpl value, + $Res Function(_$ClosureReason_CounterpartyForceClosedImpl) then) = + __$$ClosureReason_CounterpartyForceClosedImplCopyWithImpl<$Res>; @useResult - $Res call({String field0}); + $Res call({String peerMsg}); } /// @nodoc -class __$$EntropySourceConfig_SeedFileImplCopyWithImpl<$Res> - extends _$EntropySourceConfigCopyWithImpl<$Res, - _$EntropySourceConfig_SeedFileImpl> - implements _$$EntropySourceConfig_SeedFileImplCopyWith<$Res> { - __$$EntropySourceConfig_SeedFileImplCopyWithImpl( - _$EntropySourceConfig_SeedFileImpl _value, - $Res Function(_$EntropySourceConfig_SeedFileImpl) _then) +class __$$ClosureReason_CounterpartyForceClosedImplCopyWithImpl<$Res> + extends _$ClosureReasonCopyWithImpl<$Res, + _$ClosureReason_CounterpartyForceClosedImpl> + implements _$$ClosureReason_CounterpartyForceClosedImplCopyWith<$Res> { + __$$ClosureReason_CounterpartyForceClosedImplCopyWithImpl( + _$ClosureReason_CounterpartyForceClosedImpl _value, + $Res Function(_$ClosureReason_CounterpartyForceClosedImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override $Res call({ - Object? field0 = null, + Object? peerMsg = null, }) { - return _then(_$EntropySourceConfig_SeedFileImpl( - null == field0 - ? _value.field0 - : field0 // ignore: cast_nullable_to_non_nullable + return _then(_$ClosureReason_CounterpartyForceClosedImpl( + peerMsg: null == peerMsg + ? _value.peerMsg + : peerMsg // ignore: cast_nullable_to_non_nullable as String, )); } @@ -333,67 +425,105 @@ class __$$EntropySourceConfig_SeedFileImplCopyWithImpl<$Res> /// @nodoc -class _$EntropySourceConfig_SeedFileImpl extends EntropySourceConfig_SeedFile { - const _$EntropySourceConfig_SeedFileImpl(this.field0) : super._(); +class _$ClosureReason_CounterpartyForceClosedImpl + extends ClosureReason_CounterpartyForceClosed { + const _$ClosureReason_CounterpartyForceClosedImpl({required this.peerMsg}) + : 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 field0; + final String peerMsg; @override String toString() { - return 'EntropySourceConfig.seedFile(field0: $field0)'; + return 'ClosureReason.counterpartyForceClosed(peerMsg: $peerMsg)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$EntropySourceConfig_SeedFileImpl && - (identical(other.field0, field0) || other.field0 == field0)); + other is _$ClosureReason_CounterpartyForceClosedImpl && + (identical(other.peerMsg, peerMsg) || other.peerMsg == peerMsg)); } @override - int get hashCode => Object.hash(runtimeType, field0); + int get hashCode => Object.hash(runtimeType, peerMsg); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$EntropySourceConfig_SeedFileImplCopyWith< - _$EntropySourceConfig_SeedFileImpl> - get copyWith => __$$EntropySourceConfig_SeedFileImplCopyWithImpl< - _$EntropySourceConfig_SeedFileImpl>(this, _$identity); + _$$ClosureReason_CounterpartyForceClosedImplCopyWith< + _$ClosureReason_CounterpartyForceClosedImpl> + get copyWith => __$$ClosureReason_CounterpartyForceClosedImplCopyWithImpl< + _$ClosureReason_CounterpartyForceClosedImpl>(this, _$identity); @override @optionalTypeArgs TResult when({ - required TResult Function(String field0) seedFile, - required TResult Function(U8Array64 field0) seedBytes, - required TResult Function(LdkMnemonic mnemonic, String? passphrase) - bip39Mnemonic, + required TResult Function(String peerMsg) counterpartyForceClosed, + required TResult Function() holderForceClosed, + required TResult Function() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, }) { - return seedFile(field0); + return counterpartyForceClosed(peerMsg); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(String field0)? seedFile, - TResult? Function(U8Array64 field0)? seedBytes, - TResult? Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, }) { - return seedFile?.call(field0); + return counterpartyForceClosed?.call(peerMsg); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(String field0)? seedFile, - TResult Function(U8Array64 field0)? seedBytes, - TResult Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, required TResult orElse(), }) { - if (seedFile != null) { - return seedFile(field0); + if (counterpartyForceClosed != null) { + return counterpartyForceClosed(peerMsg); } return orElse(); } @@ -401,150 +531,222 @@ class _$EntropySourceConfig_SeedFileImpl extends EntropySourceConfig_SeedFile { @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, + required TResult Function(ClosureReason_CounterpartyForceClosed value) + counterpartyForceClosed, + required TResult Function(ClosureReason_HolderForceClosed value) + holderForceClosed, + required TResult Function(ClosureReason_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, }) { - return seedFile(this); + return counterpartyForceClosed(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(EntropySourceConfig_SeedFile value)? seedFile, - TResult? Function(EntropySourceConfig_SeedBytes value)? seedBytes, - TResult? Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, }) { - return seedFile?.call(this); + return counterpartyForceClosed?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(EntropySourceConfig_SeedFile value)? seedFile, - TResult Function(EntropySourceConfig_SeedBytes value)? seedBytes, - TResult Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, required TResult orElse(), }) { - if (seedFile != null) { - return seedFile(this); + if (counterpartyForceClosed != null) { + return counterpartyForceClosed(this); } return orElse(); } } -abstract class EntropySourceConfig_SeedFile extends EntropySourceConfig { - const factory EntropySourceConfig_SeedFile(final String field0) = - _$EntropySourceConfig_SeedFileImpl; - const EntropySourceConfig_SeedFile._() : super._(); - - String get field0; +abstract class ClosureReason_CounterpartyForceClosed extends ClosureReason { + const factory ClosureReason_CounterpartyForceClosed( + {required final String peerMsg}) = + _$ClosureReason_CounterpartyForceClosedImpl; + const ClosureReason_CounterpartyForceClosed._() : 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 + String get peerMsg; @JsonKey(ignore: true) - _$$EntropySourceConfig_SeedFileImplCopyWith< - _$EntropySourceConfig_SeedFileImpl> + _$$ClosureReason_CounterpartyForceClosedImplCopyWith< + _$ClosureReason_CounterpartyForceClosedImpl> 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}); +abstract class _$$ClosureReason_HolderForceClosedImplCopyWith<$Res> { + factory _$$ClosureReason_HolderForceClosedImplCopyWith( + _$ClosureReason_HolderForceClosedImpl value, + $Res Function(_$ClosureReason_HolderForceClosedImpl) then) = + __$$ClosureReason_HolderForceClosedImplCopyWithImpl<$Res>; } /// @nodoc -class __$$EntropySourceConfig_SeedBytesImplCopyWithImpl<$Res> - extends _$EntropySourceConfigCopyWithImpl<$Res, - _$EntropySourceConfig_SeedBytesImpl> - implements _$$EntropySourceConfig_SeedBytesImplCopyWith<$Res> { - __$$EntropySourceConfig_SeedBytesImplCopyWithImpl( - _$EntropySourceConfig_SeedBytesImpl _value, - $Res Function(_$EntropySourceConfig_SeedBytesImpl) _then) +class __$$ClosureReason_HolderForceClosedImplCopyWithImpl<$Res> + extends _$ClosureReasonCopyWithImpl<$Res, + _$ClosureReason_HolderForceClosedImpl> + implements _$$ClosureReason_HolderForceClosedImplCopyWith<$Res> { + __$$ClosureReason_HolderForceClosedImplCopyWithImpl( + _$ClosureReason_HolderForceClosedImpl _value, + $Res Function(_$ClosureReason_HolderForceClosedImpl) _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 - extends EntropySourceConfig_SeedBytes { - const _$EntropySourceConfig_SeedBytesImpl(this.field0) : super._(); - - @override - final U8Array64 field0; +class _$ClosureReason_HolderForceClosedImpl + extends ClosureReason_HolderForceClosed { + const _$ClosureReason_HolderForceClosedImpl() : super._(); @override String toString() { - return 'EntropySourceConfig.seedBytes(field0: $field0)'; + return 'ClosureReason.holderForceClosed()'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$EntropySourceConfig_SeedBytesImpl && - const DeepCollectionEquality().equals(other.field0, field0)); + other is _$ClosureReason_HolderForceClosedImpl); } @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); + int get hashCode => runtimeType.hashCode; @override @optionalTypeArgs TResult when({ - required TResult Function(String field0) seedFile, - required TResult Function(U8Array64 field0) seedBytes, - required TResult Function(LdkMnemonic mnemonic, String? passphrase) - bip39Mnemonic, + required TResult Function(String peerMsg) counterpartyForceClosed, + required TResult Function() holderForceClosed, + required TResult Function() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, }) { - return seedBytes(field0); + return holderForceClosed(); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(String field0)? seedFile, - TResult? Function(U8Array64 field0)? seedBytes, - TResult? Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, }) { - return seedBytes?.call(field0); + return holderForceClosed?.call(); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(String field0)? seedFile, - TResult Function(U8Array64 field0)? seedBytes, - TResult Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, required TResult orElse(), }) { - if (seedBytes != null) { - return seedBytes(field0); + if (holderForceClosed != null) { + return holderForceClosed(); } return orElse(); } @@ -552,161 +754,7753 @@ class _$EntropySourceConfig_SeedBytesImpl @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, + required TResult Function(ClosureReason_CounterpartyForceClosed value) + counterpartyForceClosed, + required TResult Function(ClosureReason_HolderForceClosed value) + holderForceClosed, + required TResult Function(ClosureReason_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, }) { - return seedBytes(this); + return holderForceClosed(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(EntropySourceConfig_SeedFile value)? seedFile, - TResult? Function(EntropySourceConfig_SeedBytes value)? seedBytes, - TResult? Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, }) { - return seedBytes?.call(this); + return holderForceClosed?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(EntropySourceConfig_SeedFile value)? seedFile, - TResult Function(EntropySourceConfig_SeedBytes value)? seedBytes, - TResult Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, required TResult orElse(), }) { - if (seedBytes != null) { - return seedBytes(this); + if (holderForceClosed != null) { + return holderForceClosed(this); } return orElse(); } } -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; +abstract class ClosureReason_HolderForceClosed extends ClosureReason { + const factory ClosureReason_HolderForceClosed() = + _$ClosureReason_HolderForceClosedImpl; + const ClosureReason_HolderForceClosed._() : super._(); } /// @nodoc -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}); +abstract class _$$ClosureReason_LegacyCooperativeClosureImplCopyWith<$Res> { + factory _$$ClosureReason_LegacyCooperativeClosureImplCopyWith( + _$ClosureReason_LegacyCooperativeClosureImpl value, + $Res Function(_$ClosureReason_LegacyCooperativeClosureImpl) then) = + __$$ClosureReason_LegacyCooperativeClosureImplCopyWithImpl<$Res>; } /// @nodoc -class __$$EntropySourceConfig_Bip39MnemonicImplCopyWithImpl<$Res> - extends _$EntropySourceConfigCopyWithImpl<$Res, - _$EntropySourceConfig_Bip39MnemonicImpl> - implements _$$EntropySourceConfig_Bip39MnemonicImplCopyWith<$Res> { - __$$EntropySourceConfig_Bip39MnemonicImplCopyWithImpl( - _$EntropySourceConfig_Bip39MnemonicImpl _value, - $Res Function(_$EntropySourceConfig_Bip39MnemonicImpl) _then) +class __$$ClosureReason_LegacyCooperativeClosureImplCopyWithImpl<$Res> + extends _$ClosureReasonCopyWithImpl<$Res, + _$ClosureReason_LegacyCooperativeClosureImpl> + implements _$$ClosureReason_LegacyCooperativeClosureImplCopyWith<$Res> { + __$$ClosureReason_LegacyCooperativeClosureImplCopyWithImpl( + _$ClosureReason_LegacyCooperativeClosureImpl _value, + $Res Function(_$ClosureReason_LegacyCooperativeClosureImpl) _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 _$EntropySourceConfig_Bip39MnemonicImpl - extends EntropySourceConfig_Bip39Mnemonic { - const _$EntropySourceConfig_Bip39MnemonicImpl( - {required this.mnemonic, this.passphrase}) - : super._(); - - @override - final LdkMnemonic mnemonic; - @override - final String? passphrase; +class _$ClosureReason_LegacyCooperativeClosureImpl + extends ClosureReason_LegacyCooperativeClosure { + const _$ClosureReason_LegacyCooperativeClosureImpl() : super._(); @override String toString() { - return 'EntropySourceConfig.bip39Mnemonic(mnemonic: $mnemonic, passphrase: $passphrase)'; + return 'ClosureReason.legacyCooperativeClosure()'; } @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)); + other is _$ClosureReason_LegacyCooperativeClosureImpl); } @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); + int get hashCode => runtimeType.hashCode; @override @optionalTypeArgs TResult when({ - required TResult Function(String field0) seedFile, + required TResult Function(String peerMsg) counterpartyForceClosed, + required TResult Function() holderForceClosed, + required TResult Function() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, + }) { + return legacyCooperativeClosure(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + }) { + return legacyCooperativeClosure?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + required TResult orElse(), + }) { + if (legacyCooperativeClosure != null) { + return legacyCooperativeClosure(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(ClosureReason_CounterpartyForceClosed value) + counterpartyForceClosed, + required TResult Function(ClosureReason_HolderForceClosed value) + holderForceClosed, + required TResult Function(ClosureReason_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, + }) { + return legacyCooperativeClosure(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + }) { + return legacyCooperativeClosure?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + required TResult orElse(), + }) { + if (legacyCooperativeClosure != null) { + return legacyCooperativeClosure(this); + } + return orElse(); + } +} + +abstract class ClosureReason_LegacyCooperativeClosure extends ClosureReason { + const factory ClosureReason_LegacyCooperativeClosure() = + _$ClosureReason_LegacyCooperativeClosureImpl; + const ClosureReason_LegacyCooperativeClosure._() : super._(); +} + +/// @nodoc +abstract class _$$ClosureReason_CounterpartyInitiatedCooperativeClosureImplCopyWith< + $Res> { + factory _$$ClosureReason_CounterpartyInitiatedCooperativeClosureImplCopyWith( + _$ClosureReason_CounterpartyInitiatedCooperativeClosureImpl value, + $Res Function( + _$ClosureReason_CounterpartyInitiatedCooperativeClosureImpl) + then) = + __$$ClosureReason_CounterpartyInitiatedCooperativeClosureImplCopyWithImpl< + $Res>; +} + +/// @nodoc +class __$$ClosureReason_CounterpartyInitiatedCooperativeClosureImplCopyWithImpl< + $Res> + extends _$ClosureReasonCopyWithImpl<$Res, + _$ClosureReason_CounterpartyInitiatedCooperativeClosureImpl> + implements + _$$ClosureReason_CounterpartyInitiatedCooperativeClosureImplCopyWith< + $Res> { + __$$ClosureReason_CounterpartyInitiatedCooperativeClosureImplCopyWithImpl( + _$ClosureReason_CounterpartyInitiatedCooperativeClosureImpl _value, + $Res Function(_$ClosureReason_CounterpartyInitiatedCooperativeClosureImpl) + _then) + : super(_value, _then); +} + +/// @nodoc + +class _$ClosureReason_CounterpartyInitiatedCooperativeClosureImpl + extends ClosureReason_CounterpartyInitiatedCooperativeClosure { + const _$ClosureReason_CounterpartyInitiatedCooperativeClosureImpl() + : super._(); + + @override + String toString() { + return 'ClosureReason.counterpartyInitiatedCooperativeClosure()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other + is _$ClosureReason_CounterpartyInitiatedCooperativeClosureImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(String peerMsg) counterpartyForceClosed, + required TResult Function() holderForceClosed, + required TResult Function() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, + }) { + return counterpartyInitiatedCooperativeClosure(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + }) { + return counterpartyInitiatedCooperativeClosure?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + required TResult orElse(), + }) { + if (counterpartyInitiatedCooperativeClosure != null) { + return counterpartyInitiatedCooperativeClosure(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(ClosureReason_CounterpartyForceClosed value) + counterpartyForceClosed, + required TResult Function(ClosureReason_HolderForceClosed value) + holderForceClosed, + required TResult Function(ClosureReason_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, + }) { + return counterpartyInitiatedCooperativeClosure(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + }) { + return counterpartyInitiatedCooperativeClosure?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + required TResult orElse(), + }) { + if (counterpartyInitiatedCooperativeClosure != null) { + return counterpartyInitiatedCooperativeClosure(this); + } + return orElse(); + } +} + +abstract class ClosureReason_CounterpartyInitiatedCooperativeClosure + extends ClosureReason { + const factory ClosureReason_CounterpartyInitiatedCooperativeClosure() = + _$ClosureReason_CounterpartyInitiatedCooperativeClosureImpl; + const ClosureReason_CounterpartyInitiatedCooperativeClosure._() : super._(); +} + +/// @nodoc +abstract class _$$ClosureReason_LocallyInitiatedCooperativeClosureImplCopyWith< + $Res> { + factory _$$ClosureReason_LocallyInitiatedCooperativeClosureImplCopyWith( + _$ClosureReason_LocallyInitiatedCooperativeClosureImpl value, + $Res Function(_$ClosureReason_LocallyInitiatedCooperativeClosureImpl) + then) = + __$$ClosureReason_LocallyInitiatedCooperativeClosureImplCopyWithImpl< + $Res>; +} + +/// @nodoc +class __$$ClosureReason_LocallyInitiatedCooperativeClosureImplCopyWithImpl<$Res> + extends _$ClosureReasonCopyWithImpl<$Res, + _$ClosureReason_LocallyInitiatedCooperativeClosureImpl> + implements + _$$ClosureReason_LocallyInitiatedCooperativeClosureImplCopyWith<$Res> { + __$$ClosureReason_LocallyInitiatedCooperativeClosureImplCopyWithImpl( + _$ClosureReason_LocallyInitiatedCooperativeClosureImpl _value, + $Res Function(_$ClosureReason_LocallyInitiatedCooperativeClosureImpl) + _then) + : super(_value, _then); +} + +/// @nodoc + +class _$ClosureReason_LocallyInitiatedCooperativeClosureImpl + extends ClosureReason_LocallyInitiatedCooperativeClosure { + const _$ClosureReason_LocallyInitiatedCooperativeClosureImpl() : super._(); + + @override + String toString() { + return 'ClosureReason.locallyInitiatedCooperativeClosure()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ClosureReason_LocallyInitiatedCooperativeClosureImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(String peerMsg) counterpartyForceClosed, + required TResult Function() holderForceClosed, + required TResult Function() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, + }) { + return locallyInitiatedCooperativeClosure(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + }) { + return locallyInitiatedCooperativeClosure?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + required TResult orElse(), + }) { + if (locallyInitiatedCooperativeClosure != null) { + return locallyInitiatedCooperativeClosure(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(ClosureReason_CounterpartyForceClosed value) + counterpartyForceClosed, + required TResult Function(ClosureReason_HolderForceClosed value) + holderForceClosed, + required TResult Function(ClosureReason_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, + }) { + return locallyInitiatedCooperativeClosure(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + }) { + return locallyInitiatedCooperativeClosure?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + required TResult orElse(), + }) { + if (locallyInitiatedCooperativeClosure != null) { + return locallyInitiatedCooperativeClosure(this); + } + return orElse(); + } +} + +abstract class ClosureReason_LocallyInitiatedCooperativeClosure + extends ClosureReason { + const factory ClosureReason_LocallyInitiatedCooperativeClosure() = + _$ClosureReason_LocallyInitiatedCooperativeClosureImpl; + const ClosureReason_LocallyInitiatedCooperativeClosure._() : super._(); +} + +/// @nodoc +abstract class _$$ClosureReason_CommitmentTxConfirmedImplCopyWith<$Res> { + factory _$$ClosureReason_CommitmentTxConfirmedImplCopyWith( + _$ClosureReason_CommitmentTxConfirmedImpl value, + $Res Function(_$ClosureReason_CommitmentTxConfirmedImpl) then) = + __$$ClosureReason_CommitmentTxConfirmedImplCopyWithImpl<$Res>; +} + +/// @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 + extends ClosureReason_CommitmentTxConfirmed { + const _$ClosureReason_CommitmentTxConfirmedImpl() : super._(); + + @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() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, + }) { + return commitmentTxConfirmed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + }) { + return commitmentTxConfirmed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + 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_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, + }) { + return commitmentTxConfirmed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + }) { + return commitmentTxConfirmed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + required TResult orElse(), + }) { + if (commitmentTxConfirmed != null) { + return commitmentTxConfirmed(this); + } + return orElse(); + } +} + +abstract class ClosureReason_CommitmentTxConfirmed extends ClosureReason { + const factory ClosureReason_CommitmentTxConfirmed() = + _$ClosureReason_CommitmentTxConfirmedImpl; + const ClosureReason_CommitmentTxConfirmed._() : super._(); +} + +/// @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 + extends ClosureReason_FundingTimedOut { + const _$ClosureReason_FundingTimedOutImpl() : super._(); + + @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() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, + }) { + return fundingTimedOut(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + }) { + return fundingTimedOut?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + 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_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, + }) { + return fundingTimedOut(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + }) { + return fundingTimedOut?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + required TResult orElse(), + }) { + if (fundingTimedOut != null) { + return fundingTimedOut(this); + } + return orElse(); + } +} + +abstract class ClosureReason_FundingTimedOut extends ClosureReason { + const factory ClosureReason_FundingTimedOut() = + _$ClosureReason_FundingTimedOutImpl; + const ClosureReason_FundingTimedOut._() : super._(); +} + +/// @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 + extends ClosureReason_ProcessingError { + const _$ClosureReason_ProcessingErrorImpl({required this.err}) : super._(); + + /// 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() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, + }) { + return processingError(err); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + }) { + return processingError?.call(err); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + 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_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, + }) { + return processingError(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + }) { + return processingError?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + required TResult orElse(), + }) { + if (processingError != null) { + return processingError(this); + } + return orElse(); + } +} + +abstract class ClosureReason_ProcessingError extends ClosureReason { + const factory ClosureReason_ProcessingError({required final String err}) = + _$ClosureReason_ProcessingErrorImpl; + const ClosureReason_ProcessingError._() : super._(); + + /// 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 + extends ClosureReason_DisconnectedPeer { + const _$ClosureReason_DisconnectedPeerImpl() : super._(); + + @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() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, + }) { + return disconnectedPeer(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + }) { + return disconnectedPeer?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + 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_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, + }) { + return disconnectedPeer(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + }) { + return disconnectedPeer?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + required TResult orElse(), + }) { + if (disconnectedPeer != null) { + return disconnectedPeer(this); + } + return orElse(); + } +} + +abstract class ClosureReason_DisconnectedPeer extends ClosureReason { + const factory ClosureReason_DisconnectedPeer() = + _$ClosureReason_DisconnectedPeerImpl; + const ClosureReason_DisconnectedPeer._() : super._(); +} + +/// @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 + extends ClosureReason_OutdatedChannelManager { + const _$ClosureReason_OutdatedChannelManagerImpl() : super._(); + + @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() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, + }) { + return outdatedChannelManager(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + }) { + return outdatedChannelManager?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + 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_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, + }) { + return outdatedChannelManager(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + }) { + return outdatedChannelManager?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + required TResult orElse(), + }) { + if (outdatedChannelManager != null) { + return outdatedChannelManager(this); + } + return orElse(); + } +} + +abstract class ClosureReason_OutdatedChannelManager extends ClosureReason { + const factory ClosureReason_OutdatedChannelManager() = + _$ClosureReason_OutdatedChannelManagerImpl; + const ClosureReason_OutdatedChannelManager._() : super._(); +} + +/// @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 + extends ClosureReason_CounterpartyCoopClosedUnfundedChannel { + const _$ClosureReason_CounterpartyCoopClosedUnfundedChannelImpl() : super._(); + + @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() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, + }) { + return counterpartyCoopClosedUnfundedChannel(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + }) { + return counterpartyCoopClosedUnfundedChannel?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + 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_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, + }) { + return counterpartyCoopClosedUnfundedChannel(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + }) { + return counterpartyCoopClosedUnfundedChannel?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + required TResult orElse(), + }) { + if (counterpartyCoopClosedUnfundedChannel != null) { + return counterpartyCoopClosedUnfundedChannel(this); + } + return orElse(); + } +} + +abstract class ClosureReason_CounterpartyCoopClosedUnfundedChannel + extends ClosureReason { + const factory ClosureReason_CounterpartyCoopClosedUnfundedChannel() = + _$ClosureReason_CounterpartyCoopClosedUnfundedChannelImpl; + const ClosureReason_CounterpartyCoopClosedUnfundedChannel._() : super._(); +} + +/// @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 + extends ClosureReason_FundingBatchClosure { + const _$ClosureReason_FundingBatchClosureImpl() : super._(); + + @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() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, + }) { + return fundingBatchClosure(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + }) { + return fundingBatchClosure?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + 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_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, + }) { + return fundingBatchClosure(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + }) { + return fundingBatchClosure?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + required TResult orElse(), + }) { + if (fundingBatchClosure != null) { + return fundingBatchClosure(this); + } + return orElse(); + } +} + +abstract class ClosureReason_FundingBatchClosure extends ClosureReason { + const factory ClosureReason_FundingBatchClosure() = + _$ClosureReason_FundingBatchClosureImpl; + const ClosureReason_FundingBatchClosure._() : super._(); +} + +/// @nodoc +abstract class _$$ClosureReason_HTLCsTimedOutImplCopyWith<$Res> { + factory _$$ClosureReason_HTLCsTimedOutImplCopyWith( + _$ClosureReason_HTLCsTimedOutImpl value, + $Res Function(_$ClosureReason_HTLCsTimedOutImpl) then) = + __$$ClosureReason_HTLCsTimedOutImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$ClosureReason_HTLCsTimedOutImplCopyWithImpl<$Res> + extends _$ClosureReasonCopyWithImpl<$Res, _$ClosureReason_HTLCsTimedOutImpl> + implements _$$ClosureReason_HTLCsTimedOutImplCopyWith<$Res> { + __$$ClosureReason_HTLCsTimedOutImplCopyWithImpl( + _$ClosureReason_HTLCsTimedOutImpl _value, + $Res Function(_$ClosureReason_HTLCsTimedOutImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$ClosureReason_HTLCsTimedOutImpl extends ClosureReason_HTLCsTimedOut { + const _$ClosureReason_HTLCsTimedOutImpl() : super._(); + + @override + String toString() { + return 'ClosureReason.htlCsTimedOut()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ClosureReason_HTLCsTimedOutImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(String peerMsg) counterpartyForceClosed, + required TResult Function() holderForceClosed, + required TResult Function() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, + }) { + return htlCsTimedOut(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + }) { + return htlCsTimedOut?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + required TResult orElse(), + }) { + if (htlCsTimedOut != null) { + return htlCsTimedOut(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(ClosureReason_CounterpartyForceClosed value) + counterpartyForceClosed, + required TResult Function(ClosureReason_HolderForceClosed value) + holderForceClosed, + required TResult Function(ClosureReason_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, + }) { + return htlCsTimedOut(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + }) { + return htlCsTimedOut?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + required TResult orElse(), + }) { + if (htlCsTimedOut != null) { + return htlCsTimedOut(this); + } + return orElse(); + } +} + +abstract class ClosureReason_HTLCsTimedOut extends ClosureReason { + const factory ClosureReason_HTLCsTimedOut() = + _$ClosureReason_HTLCsTimedOutImpl; + const ClosureReason_HTLCsTimedOut._() : super._(); +} + +/// @nodoc +mixin _$EntropySourceConfig { + @optionalTypeArgs + TResult when({ + 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 field0)? seedFile, + TResult? Function(U8Array64 field0)? seedBytes, + TResult? Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + 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(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 extends EntropySourceConfig_SeedFile { + const _$EntropySourceConfig_SeedFileImpl(this.field0) : super._(); + + @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(LdkMnemonic mnemonic, String? passphrase) + bip39Mnemonic, + }) { + return seedFile(field0); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String field0)? seedFile, + TResult? Function(U8Array64 field0)? seedBytes, + TResult? Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + }) { + return seedFile?.call(field0); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String field0)? seedFile, + TResult Function(U8Array64 field0)? seedBytes, + TResult Function(LdkMnemonic 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 extends EntropySourceConfig { + const factory EntropySourceConfig_SeedFile(final String field0) = + _$EntropySourceConfig_SeedFileImpl; + const EntropySourceConfig_SeedFile._() : super._(); + + 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 + extends EntropySourceConfig_SeedBytes { + const _$EntropySourceConfig_SeedBytesImpl(this.field0) : super._(); + + @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(LdkMnemonic mnemonic, String? passphrase) + bip39Mnemonic, + }) { + return seedBytes(field0); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String field0)? seedFile, + TResult? Function(U8Array64 field0)? seedBytes, + TResult? Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + }) { + return seedBytes?.call(field0); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String field0)? seedFile, + TResult Function(U8Array64 field0)? seedBytes, + TResult Function(LdkMnemonic 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 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 _$$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 __$$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 _$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 '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(LdkMnemonic mnemonic, String? passphrase) bip39Mnemonic, }) { - return bip39Mnemonic(mnemonic, passphrase); + return bip39Mnemonic(mnemonic, passphrase); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String field0)? seedFile, + TResult? Function(U8Array64 field0)? seedBytes, + TResult? Function(LdkMnemonic 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(LdkMnemonic 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 extends EntropySourceConfig { + const factory EntropySourceConfig_Bip39Mnemonic( + {required final LdkMnemonic mnemonic, + final String? passphrase}) = _$EntropySourceConfig_Bip39MnemonicImpl; + const EntropySourceConfig_Bip39Mnemonic._() : super._(); + + LdkMnemonic 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(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline) + paymentClaimable, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat) + paymentSuccessful, + required TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason) + paymentFailed, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult? Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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_PaymentClaimable value) paymentClaimable, + 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_PaymentClaimable value)? paymentClaimable, + 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_PaymentClaimable value)? paymentClaimable, + 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_PaymentClaimableImplCopyWith<$Res> { + factory _$$Event_PaymentClaimableImplCopyWith( + _$Event_PaymentClaimableImpl value, + $Res Function(_$Event_PaymentClaimableImpl) then) = + __$$Event_PaymentClaimableImplCopyWithImpl<$Res>; + @useResult + $Res call( + {PaymentId paymentId, + PaymentHash paymentHash, + BigInt claimableAmountMsat, + int? claimDeadline}); +} + +/// @nodoc +class __$$Event_PaymentClaimableImplCopyWithImpl<$Res> + extends _$EventCopyWithImpl<$Res, _$Event_PaymentClaimableImpl> + implements _$$Event_PaymentClaimableImplCopyWith<$Res> { + __$$Event_PaymentClaimableImplCopyWithImpl( + _$Event_PaymentClaimableImpl _value, + $Res Function(_$Event_PaymentClaimableImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? paymentId = null, + Object? paymentHash = null, + Object? claimableAmountMsat = null, + Object? claimDeadline = freezed, + }) { + return _then(_$Event_PaymentClaimableImpl( + paymentId: null == paymentId + ? _value.paymentId + : paymentId // ignore: cast_nullable_to_non_nullable + as PaymentId, + paymentHash: null == paymentHash + ? _value.paymentHash + : paymentHash // ignore: cast_nullable_to_non_nullable + as PaymentHash, + claimableAmountMsat: null == claimableAmountMsat + ? _value.claimableAmountMsat + : claimableAmountMsat // ignore: cast_nullable_to_non_nullable + as BigInt, + claimDeadline: freezed == claimDeadline + ? _value.claimDeadline + : claimDeadline // ignore: cast_nullable_to_non_nullable + as int?, + )); + } +} + +/// @nodoc + +class _$Event_PaymentClaimableImpl extends Event_PaymentClaimable { + const _$Event_PaymentClaimableImpl( + {required this.paymentId, + required this.paymentHash, + required this.claimableAmountMsat, + this.claimDeadline}) + : super._(); + + /// A local identifier used to track the payment. + @override + final PaymentId paymentId; + + /// The hash of the payment. + @override + final PaymentHash paymentHash; + + /// The value, in thousandths of a satoshi, that is claimable. + @override + final BigInt claimableAmountMsat; + + /// The block height at which this payment will be failed back and will no longer be + /// eligible for claiming. + @override + final int? claimDeadline; + + @override + String toString() { + return 'Event.paymentClaimable(paymentId: $paymentId, paymentHash: $paymentHash, claimableAmountMsat: $claimableAmountMsat, claimDeadline: $claimDeadline)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Event_PaymentClaimableImpl && + (identical(other.paymentId, paymentId) || + other.paymentId == paymentId) && + (identical(other.paymentHash, paymentHash) || + other.paymentHash == paymentHash) && + (identical(other.claimableAmountMsat, claimableAmountMsat) || + other.claimableAmountMsat == claimableAmountMsat) && + (identical(other.claimDeadline, claimDeadline) || + other.claimDeadline == claimDeadline)); + } + + @override + int get hashCode => Object.hash( + runtimeType, paymentId, paymentHash, claimableAmountMsat, claimDeadline); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$Event_PaymentClaimableImplCopyWith<_$Event_PaymentClaimableImpl> + get copyWith => __$$Event_PaymentClaimableImplCopyWithImpl< + _$Event_PaymentClaimableImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline) + paymentClaimable, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat) + paymentSuccessful, + required TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason) + paymentFailed, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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 paymentClaimable( + paymentId, paymentHash, claimableAmountMsat, claimDeadline); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult? Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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 paymentClaimable?.call( + paymentId, paymentHash, claimableAmountMsat, claimDeadline); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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 (paymentClaimable != null) { + return paymentClaimable( + paymentId, paymentHash, claimableAmountMsat, claimDeadline); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Event_PaymentClaimable value) paymentClaimable, + 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 paymentClaimable(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Event_PaymentClaimable value)? paymentClaimable, + 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 paymentClaimable?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Event_PaymentClaimable value)? paymentClaimable, + 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 (paymentClaimable != null) { + return paymentClaimable(this); + } + return orElse(); + } +} + +abstract class Event_PaymentClaimable extends Event { + const factory Event_PaymentClaimable( + {required final PaymentId paymentId, + required final PaymentHash paymentHash, + required final BigInt claimableAmountMsat, + final int? claimDeadline}) = _$Event_PaymentClaimableImpl; + const Event_PaymentClaimable._() : super._(); + + /// A local identifier used to track the payment. + PaymentId get paymentId; + + /// The hash of the payment. + PaymentHash get paymentHash; + + /// The value, in thousandths of a satoshi, that is claimable. + BigInt get claimableAmountMsat; + + /// The block height at which this payment will be failed back and will no longer be + /// eligible for claiming. + int? get claimDeadline; + @JsonKey(ignore: true) + _$$Event_PaymentClaimableImplCopyWith<_$Event_PaymentClaimableImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$Event_PaymentSuccessfulImplCopyWith<$Res> { + factory _$$Event_PaymentSuccessfulImplCopyWith( + _$Event_PaymentSuccessfulImpl value, + $Res Function(_$Event_PaymentSuccessfulImpl) then) = + __$$Event_PaymentSuccessfulImplCopyWithImpl<$Res>; + @useResult + $Res call( + {PaymentId? paymentId, PaymentHash paymentHash, BigInt? 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? paymentId = freezed, + Object? paymentHash = null, + Object? feePaidMsat = freezed, + }) { + return _then(_$Event_PaymentSuccessfulImpl( + paymentId: freezed == paymentId + ? _value.paymentId + : paymentId // ignore: cast_nullable_to_non_nullable + as PaymentId?, + 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 BigInt?, + )); + } +} + +/// @nodoc + +class _$Event_PaymentSuccessfulImpl extends Event_PaymentSuccessful { + const _$Event_PaymentSuccessfulImpl( + {this.paymentId, required this.paymentHash, this.feePaidMsat}) + : super._(); + + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + @override + final PaymentId? paymentId; + + /// The hash of the payment. + @override + final PaymentHash paymentHash; + + /// The total fee which was spent at intermediate hops in this payment. + @override + final BigInt? feePaidMsat; + + @override + String toString() { + return 'Event.paymentSuccessful(paymentId: $paymentId, paymentHash: $paymentHash, feePaidMsat: $feePaidMsat)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Event_PaymentSuccessfulImpl && + (identical(other.paymentId, paymentId) || + other.paymentId == paymentId) && + (identical(other.paymentHash, paymentHash) || + other.paymentHash == paymentHash) && + (identical(other.feePaidMsat, feePaidMsat) || + other.feePaidMsat == feePaidMsat)); + } + + @override + int get hashCode => + Object.hash(runtimeType, paymentId, 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(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline) + paymentClaimable, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat) + paymentSuccessful, + required TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason) + paymentFailed, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(paymentId, paymentHash, feePaidMsat); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult? Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(paymentId, paymentHash, feePaidMsat); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(paymentId, paymentHash, feePaidMsat); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Event_PaymentClaimable value) paymentClaimable, + 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_PaymentClaimable value)? paymentClaimable, + 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_PaymentClaimable value)? paymentClaimable, + 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 extends Event { + const factory Event_PaymentSuccessful( + {final PaymentId? paymentId, + required final PaymentHash paymentHash, + final BigInt? feePaidMsat}) = _$Event_PaymentSuccessfulImpl; + const Event_PaymentSuccessful._() : super._(); + + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + PaymentId? get paymentId; + + /// The hash of the payment. + PaymentHash get paymentHash; + + /// The total fee which was spent at intermediate hops in this payment. + BigInt? 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( + {PaymentId? paymentId, + 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? paymentId = freezed, + Object? paymentHash = null, + Object? reason = freezed, + }) { + return _then(_$Event_PaymentFailedImpl( + paymentId: freezed == paymentId + ? _value.paymentId + : paymentId // ignore: cast_nullable_to_non_nullable + as PaymentId?, + 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 extends Event_PaymentFailed { + const _$Event_PaymentFailedImpl( + {this.paymentId, required this.paymentHash, this.reason}) + : super._(); + + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + @override + final PaymentId? paymentId; + + /// 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(paymentId: $paymentId, paymentHash: $paymentHash, reason: $reason)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Event_PaymentFailedImpl && + (identical(other.paymentId, paymentId) || + other.paymentId == paymentId) && + (identical(other.paymentHash, paymentHash) || + other.paymentHash == paymentHash) && + (identical(other.reason, reason) || other.reason == reason)); + } + + @override + int get hashCode => Object.hash(runtimeType, paymentId, 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(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline) + paymentClaimable, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat) + paymentSuccessful, + required TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason) + paymentFailed, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(paymentId, paymentHash, reason); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult? Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(paymentId, paymentHash, reason); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(paymentId, paymentHash, reason); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Event_PaymentClaimable value) paymentClaimable, + 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_PaymentClaimable value)? paymentClaimable, + 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_PaymentClaimable value)? paymentClaimable, + 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 extends Event { + const factory Event_PaymentFailed( + {final PaymentId? paymentId, + required final PaymentHash paymentHash, + final PaymentFailureReason? reason}) = _$Event_PaymentFailedImpl; + const Event_PaymentFailed._() : super._(); + + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + PaymentId? get paymentId; + + /// 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({PaymentId? paymentId, PaymentHash paymentHash, BigInt 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? paymentId = freezed, + Object? paymentHash = null, + Object? amountMsat = null, + }) { + return _then(_$Event_PaymentReceivedImpl( + paymentId: freezed == paymentId + ? _value.paymentId + : paymentId // ignore: cast_nullable_to_non_nullable + as PaymentId?, + 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 BigInt, + )); + } +} + +/// @nodoc + +class _$Event_PaymentReceivedImpl extends Event_PaymentReceived { + const _$Event_PaymentReceivedImpl( + {this.paymentId, required this.paymentHash, required this.amountMsat}) + : super._(); + + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + @override + final PaymentId? paymentId; + + /// The hash of the payment. + @override + final PaymentHash paymentHash; + + /// The value, in thousandths of a satoshi, that has been received. + @override + final BigInt amountMsat; + + @override + String toString() { + return 'Event.paymentReceived(paymentId: $paymentId, paymentHash: $paymentHash, amountMsat: $amountMsat)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Event_PaymentReceivedImpl && + (identical(other.paymentId, paymentId) || + other.paymentId == paymentId) && + (identical(other.paymentHash, paymentHash) || + other.paymentHash == paymentHash) && + (identical(other.amountMsat, amountMsat) || + other.amountMsat == amountMsat)); + } + + @override + int get hashCode => + Object.hash(runtimeType, paymentId, 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(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline) + paymentClaimable, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat) + paymentSuccessful, + required TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason) + paymentFailed, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(paymentId, paymentHash, amountMsat); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult? Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(paymentId, paymentHash, amountMsat); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(paymentId, paymentHash, amountMsat); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Event_PaymentClaimable value) paymentClaimable, + 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_PaymentClaimable value)? paymentClaimable, + 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_PaymentClaimable value)? paymentClaimable, + 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 extends Event { + const factory Event_PaymentReceived( + {final PaymentId? paymentId, + required final PaymentHash paymentHash, + required final BigInt amountMsat}) = _$Event_PaymentReceivedImpl; + const Event_PaymentReceived._() : super._(); + + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + PaymentId? get paymentId; + + /// The hash of the payment. + PaymentHash get paymentHash; + + /// The value, in thousandths of a satoshi, that has been received. + BigInt 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 extends Event_ChannelPending { + const _$Event_ChannelPendingImpl( + {required this.channelId, + required this.userChannelId, + required this.formerTemporaryChannelId, + required this.counterpartyNodeId, + required this.fundingTxo}) + : super._(); + + /// The `channelId` of the channel. + @override + final ChannelId channelId; + + /// The `userChannelId` of the channel. + @override + final UserChannelId userChannelId; + + /// The `temporaryChannelId` this channel used to be known by during channel establishment. + @override + final ChannelId formerTemporaryChannelId; + + /// The `nodeId` 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(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline) + paymentClaimable, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat) + paymentSuccessful, + required TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason) + paymentFailed, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult? Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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_PaymentClaimable value) paymentClaimable, + 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_PaymentClaimable value)? paymentClaimable, + 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_PaymentClaimable value)? paymentClaimable, + 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 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 `channelId` of the channel. + ChannelId get channelId; + + /// The `userChannelId` of the channel. + UserChannelId get userChannelId; + + /// The `temporaryChannelId` this channel used to be known by during channel establishment. + ChannelId get formerTemporaryChannelId; + + /// The `nodeId` 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 extends Event_ChannelReady { + const _$Event_ChannelReadyImpl( + {required this.channelId, + required this.userChannelId, + this.counterpartyNodeId}) + : super._(); + + /// The `channelId` of the channel. + @override + final ChannelId channelId; + + /// The `userChannelId` of the channel. + @override + final UserChannelId userChannelId; + + /// The `nodeId` 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(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline) + paymentClaimable, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat) + paymentSuccessful, + required TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason) + paymentFailed, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult? Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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_PaymentClaimable value) paymentClaimable, + 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_PaymentClaimable value)? paymentClaimable, + 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_PaymentClaimable value)? paymentClaimable, + 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 extends Event { + const factory Event_ChannelReady( + {required final ChannelId channelId, + required final UserChannelId userChannelId, + final PublicKey? counterpartyNodeId}) = _$Event_ChannelReadyImpl; + const Event_ChannelReady._() : super._(); + + /// The `channelId` of the channel. + ChannelId get channelId; + + /// The `userChannelId` of the channel. + UserChannelId get userChannelId; + + /// The `nodeId` 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 extends Event_ChannelClosed { + const _$Event_ChannelClosedImpl( + {required this.channelId, + required this.userChannelId, + this.counterpartyNodeId, + this.reason}) + : super._(); + + /// The `channelId` of the channel. + @override + final ChannelId channelId; + + /// The `userChannelId` of the channel. + @override + final UserChannelId userChannelId; + + /// The `nodeId` 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(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline) + paymentClaimable, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat) + paymentSuccessful, + required TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason) + paymentFailed, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult? Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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_PaymentClaimable value) paymentClaimable, + 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_PaymentClaimable value)? paymentClaimable, + 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_PaymentClaimable value)? paymentClaimable, + 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 extends Event { + const factory Event_ChannelClosed( + {required final ChannelId channelId, + required final UserChannelId userChannelId, + final PublicKey? counterpartyNodeId, + final ClosureReason? reason}) = _$Event_ChannelClosedImpl; + const Event_ChannelClosed._() : super._(); + + /// The `channelId` of the channel. + ChannelId get channelId; + + /// The `userChannelId` of the channel. + UserChannelId get userChannelId; + + /// The `nodeId` 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 + extends GossipSourceConfig_P2PNetwork { + const _$GossipSourceConfig_P2PNetworkImpl() : super._(); + + @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 extends GossipSourceConfig { + const factory GossipSourceConfig_P2PNetwork() = + _$GossipSourceConfig_P2PNetworkImpl; + const GossipSourceConfig_P2PNetwork._() : super._(); +} + +/// @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 + extends GossipSourceConfig_RapidGossipSync { + const _$GossipSourceConfig_RapidGossipSyncImpl(this.field0) : super._(); + + @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 extends GossipSourceConfig { + const factory GossipSourceConfig_RapidGossipSync(final String field0) = + _$GossipSourceConfig_RapidGossipSyncImpl; + const GossipSourceConfig_RapidGossipSync._() : super._(); + + 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. + BigInt get amountSatoshis => throw _privateConstructorUsedError; + @optionalTypeArgs + TResult when({ + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis) + claimableOnChannelClose, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight) + claimableAwaitingConfirmations, + required TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage) + contentiousClaimable, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int claimableHeight, PaymentHash paymentHash) + maybeTimeoutClaimableHtlc, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash) + maybePreimageClaimableHtlc, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis) + counterpartyRevokedOutputClaimable, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + claimableOnChannelClose, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight)? + claimableAwaitingConfirmations, + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage)? + contentiousClaimable, + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? + maybeTimeoutClaimableHtlc, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + maybePreimageClaimableHtlc, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + counterpartyRevokedOutputClaimable, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + claimableOnChannelClose, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight)? + claimableAwaitingConfirmations, + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage)? + contentiousClaimable, + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? + maybeTimeoutClaimableHtlc, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + maybePreimageClaimableHtlc, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + counterpartyRevokedOutputClaimable, + 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, + }) => + 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, + }) => + 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, + 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, + BigInt amountSatoshis}); +} + +/// @nodoc +class _$LightningBalanceCopyWithImpl<$Res, $Val extends LightningBalance> + implements $LightningBalanceCopyWith<$Res> { + _$LightningBalanceCopyWithImpl(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 BigInt, + ) 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 + @useResult + $Res call( + {ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis}); +} + +/// @nodoc +class __$$LightningBalance_ClaimableOnChannelCloseImplCopyWithImpl<$Res> + extends _$LightningBalanceCopyWithImpl<$Res, + _$LightningBalance_ClaimableOnChannelCloseImpl> + implements _$$LightningBalance_ClaimableOnChannelCloseImplCopyWith<$Res> { + __$$LightningBalance_ClaimableOnChannelCloseImplCopyWithImpl( + _$LightningBalance_ClaimableOnChannelCloseImpl _value, + $Res Function(_$LightningBalance_ClaimableOnChannelCloseImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? channelId = null, + Object? counterpartyNodeId = null, + Object? amountSatoshis = 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 BigInt, + )); + } +} + +/// @nodoc + +class _$LightningBalance_ClaimableOnChannelCloseImpl + extends LightningBalance_ClaimableOnChannelClose { + const _$LightningBalance_ClaimableOnChannelCloseImpl( + {required this.channelId, + required this.counterpartyNodeId, + required this.amountSatoshis}) + : super._(); + + /// 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 BigInt amountSatoshis; + + @override + String toString() { + return 'LightningBalance.claimableOnChannelClose(channelId: $channelId, counterpartyNodeId: $counterpartyNodeId, amountSatoshis: $amountSatoshis)'; + } + + @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)); + } + + @override + int get hashCode => + Object.hash(runtimeType, channelId, counterpartyNodeId, amountSatoshis); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$LightningBalance_ClaimableOnChannelCloseImplCopyWith< + _$LightningBalance_ClaimableOnChannelCloseImpl> + get copyWith => + __$$LightningBalance_ClaimableOnChannelCloseImplCopyWithImpl< + _$LightningBalance_ClaimableOnChannelCloseImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis) + claimableOnChannelClose, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight) + claimableAwaitingConfirmations, + required TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage) + contentiousClaimable, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int claimableHeight, PaymentHash paymentHash) + maybeTimeoutClaimableHtlc, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash) + maybePreimageClaimableHtlc, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis) + counterpartyRevokedOutputClaimable, + }) { + return claimableOnChannelClose( + channelId, counterpartyNodeId, amountSatoshis); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + claimableOnChannelClose, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight)? + claimableAwaitingConfirmations, + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage)? + contentiousClaimable, + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? + maybeTimeoutClaimableHtlc, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + maybePreimageClaimableHtlc, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + counterpartyRevokedOutputClaimable, + }) { + return claimableOnChannelClose?.call( + channelId, counterpartyNodeId, amountSatoshis); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + claimableOnChannelClose, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight)? + claimableAwaitingConfirmations, + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage)? + contentiousClaimable, + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? + maybeTimeoutClaimableHtlc, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + maybePreimageClaimableHtlc, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + counterpartyRevokedOutputClaimable, + required TResult orElse(), + }) { + if (claimableOnChannelClose != null) { + return claimableOnChannelClose( + channelId, counterpartyNodeId, amountSatoshis); + } + return orElse(); + } + + @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, + }) { + return claimableOnChannelClose(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, + }) { + return claimableOnChannelClose?.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, + required TResult orElse(), + }) { + if (claimableOnChannelClose != null) { + return claimableOnChannelClose(this); + } + return orElse(); + } +} + +abstract class LightningBalance_ClaimableOnChannelClose + extends LightningBalance { + const factory LightningBalance_ClaimableOnChannelClose( + {required final ChannelId channelId, + required final PublicKey counterpartyNodeId, + required final BigInt amountSatoshis}) = + _$LightningBalance_ClaimableOnChannelCloseImpl; + const LightningBalance_ClaimableOnChannelClose._() : super._(); + + @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. + BigInt get amountSatoshis; + @override + @JsonKey(ignore: true) + _$$LightningBalance_ClaimableOnChannelCloseImplCopyWith< + _$LightningBalance_ClaimableOnChannelCloseImpl> + 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 + @useResult + $Res call( + {ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int confirmationHeight}); +} + +/// @nodoc +class __$$LightningBalance_ClaimableAwaitingConfirmationsImplCopyWithImpl<$Res> + extends _$LightningBalanceCopyWithImpl<$Res, + _$LightningBalance_ClaimableAwaitingConfirmationsImpl> + implements + _$$LightningBalance_ClaimableAwaitingConfirmationsImplCopyWith<$Res> { + __$$LightningBalance_ClaimableAwaitingConfirmationsImplCopyWithImpl( + _$LightningBalance_ClaimableAwaitingConfirmationsImpl _value, + $Res Function(_$LightningBalance_ClaimableAwaitingConfirmationsImpl) + _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? channelId = null, + Object? counterpartyNodeId = null, + Object? amountSatoshis = null, + Object? confirmationHeight = 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 BigInt, + confirmationHeight: null == confirmationHeight + ? _value.confirmationHeight + : confirmationHeight // ignore: cast_nullable_to_non_nullable + as int, + )); + } +} + +/// @nodoc + +class _$LightningBalance_ClaimableAwaitingConfirmationsImpl + extends LightningBalance_ClaimableAwaitingConfirmations { + const _$LightningBalance_ClaimableAwaitingConfirmationsImpl( + {required this.channelId, + required this.counterpartyNodeId, + required this.amountSatoshis, + required this.confirmationHeight}) + : super._(); + + /// 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 BigInt amountSatoshis; + + /// The height at which an [`Event::SpendableOutputs`] event will be generated for this + /// amount. + /// + /// [`Event::SpendableOutputs`]: lightning::events::Event::SpendableOutputs + @override + final int confirmationHeight; + + @override + String toString() { + return 'LightningBalance.claimableAwaitingConfirmations(channelId: $channelId, counterpartyNodeId: $counterpartyNodeId, amountSatoshis: $amountSatoshis, confirmationHeight: $confirmationHeight)'; + } + + @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)); + } + + @override + int get hashCode => Object.hash(runtimeType, channelId, counterpartyNodeId, + amountSatoshis, confirmationHeight); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$LightningBalance_ClaimableAwaitingConfirmationsImplCopyWith< + _$LightningBalance_ClaimableAwaitingConfirmationsImpl> + get copyWith => + __$$LightningBalance_ClaimableAwaitingConfirmationsImplCopyWithImpl< + _$LightningBalance_ClaimableAwaitingConfirmationsImpl>( + this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis) + claimableOnChannelClose, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight) + claimableAwaitingConfirmations, + required TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage) + contentiousClaimable, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int claimableHeight, PaymentHash paymentHash) + maybeTimeoutClaimableHtlc, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash) + maybePreimageClaimableHtlc, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis) + counterpartyRevokedOutputClaimable, + }) { + return claimableAwaitingConfirmations( + channelId, counterpartyNodeId, amountSatoshis, confirmationHeight); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + claimableOnChannelClose, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight)? + claimableAwaitingConfirmations, + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage)? + contentiousClaimable, + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? + maybeTimeoutClaimableHtlc, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + maybePreimageClaimableHtlc, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + counterpartyRevokedOutputClaimable, + }) { + return claimableAwaitingConfirmations?.call( + channelId, counterpartyNodeId, amountSatoshis, confirmationHeight); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + claimableOnChannelClose, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight)? + claimableAwaitingConfirmations, + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage)? + contentiousClaimable, + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? + maybeTimeoutClaimableHtlc, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + maybePreimageClaimableHtlc, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + counterpartyRevokedOutputClaimable, + required TResult orElse(), + }) { + if (claimableAwaitingConfirmations != null) { + return claimableAwaitingConfirmations( + channelId, counterpartyNodeId, amountSatoshis, confirmationHeight); + } + return orElse(); + } + + @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, + }) { + return claimableAwaitingConfirmations(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, + }) { + return claimableAwaitingConfirmations?.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, + required TResult orElse(), + }) { + if (claimableAwaitingConfirmations != null) { + return claimableAwaitingConfirmations(this); + } + return orElse(); + } +} + +abstract class LightningBalance_ClaimableAwaitingConfirmations + extends LightningBalance { + const factory LightningBalance_ClaimableAwaitingConfirmations( + {required final ChannelId channelId, + required final PublicKey counterpartyNodeId, + required final BigInt amountSatoshis, + required final int confirmationHeight}) = + _$LightningBalance_ClaimableAwaitingConfirmationsImpl; + const LightningBalance_ClaimableAwaitingConfirmations._() : super._(); + + @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, possibly excluding the on-chain fees which + /// were spent in broadcasting the transaction. + BigInt 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 + @JsonKey(ignore: true) + _$$LightningBalance_ClaimableAwaitingConfirmationsImplCopyWith< + _$LightningBalance_ClaimableAwaitingConfirmationsImpl> + 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 + @useResult + $Res call( + {ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage}); +} + +/// @nodoc +class __$$LightningBalance_ContentiousClaimableImplCopyWithImpl<$Res> + extends _$LightningBalanceCopyWithImpl<$Res, + _$LightningBalance_ContentiousClaimableImpl> + implements _$$LightningBalance_ContentiousClaimableImplCopyWith<$Res> { + __$$LightningBalance_ContentiousClaimableImplCopyWithImpl( + _$LightningBalance_ContentiousClaimableImpl _value, + $Res Function(_$LightningBalance_ContentiousClaimableImpl) _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, + }) { + 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 BigInt, + timeoutHeight: null == timeoutHeight + ? _value.timeoutHeight + : timeoutHeight // ignore: cast_nullable_to_non_nullable + as int, + 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, + )); + } +} + +/// @nodoc + +class _$LightningBalance_ContentiousClaimableImpl + extends LightningBalance_ContentiousClaimable { + const _$LightningBalance_ContentiousClaimableImpl( + {required this.channelId, + required this.counterpartyNodeId, + required this.amountSatoshis, + required this.timeoutHeight, + required this.paymentHash, + required this.paymentPreimage}) + : super._(); + + /// 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 BigInt amountSatoshis; + + /// The height at which the counterparty may be able to claim the balance if we have not + /// done so. + @override + final int timeoutHeight; + + /// The payment hash that locks this HTLC. + @override + final PaymentHash paymentHash; + + /// The preimage that can be used to claim this HTLC. + @override + final PaymentPreimage paymentPreimage; + + @override + String toString() { + return 'LightningBalance.contentiousClaimable(channelId: $channelId, counterpartyNodeId: $counterpartyNodeId, amountSatoshis: $amountSatoshis, timeoutHeight: $timeoutHeight, paymentHash: $paymentHash, paymentPreimage: $paymentPreimage)'; + } + + @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) && + (identical(other.paymentHash, paymentHash) || + other.paymentHash == paymentHash) && + (identical(other.paymentPreimage, paymentPreimage) || + other.paymentPreimage == paymentPreimage)); + } + + @override + int get hashCode => Object.hash(runtimeType, channelId, counterpartyNodeId, + amountSatoshis, timeoutHeight, paymentHash, paymentPreimage); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$LightningBalance_ContentiousClaimableImplCopyWith< + _$LightningBalance_ContentiousClaimableImpl> + get copyWith => __$$LightningBalance_ContentiousClaimableImplCopyWithImpl< + _$LightningBalance_ContentiousClaimableImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis) + claimableOnChannelClose, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight) + claimableAwaitingConfirmations, + required TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage) + contentiousClaimable, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int claimableHeight, PaymentHash paymentHash) + maybeTimeoutClaimableHtlc, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash) + maybePreimageClaimableHtlc, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis) + counterpartyRevokedOutputClaimable, + }) { + return contentiousClaimable(channelId, counterpartyNodeId, amountSatoshis, + timeoutHeight, paymentHash, paymentPreimage); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + claimableOnChannelClose, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight)? + claimableAwaitingConfirmations, + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage)? + contentiousClaimable, + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? + maybeTimeoutClaimableHtlc, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + maybePreimageClaimableHtlc, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + counterpartyRevokedOutputClaimable, + }) { + return contentiousClaimable?.call(channelId, counterpartyNodeId, + amountSatoshis, timeoutHeight, paymentHash, paymentPreimage); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + claimableOnChannelClose, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight)? + claimableAwaitingConfirmations, + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage)? + contentiousClaimable, + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? + maybeTimeoutClaimableHtlc, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + maybePreimageClaimableHtlc, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + counterpartyRevokedOutputClaimable, + required TResult orElse(), + }) { + if (contentiousClaimable != null) { + return contentiousClaimable(channelId, counterpartyNodeId, amountSatoshis, + timeoutHeight, paymentHash, paymentPreimage); + } + return orElse(); + } + + @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, + }) { + return contentiousClaimable(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, + }) { + return contentiousClaimable?.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, + required TResult orElse(), + }) { + if (contentiousClaimable != null) { + return contentiousClaimable(this); + } + return orElse(); + } +} + +abstract class LightningBalance_ContentiousClaimable extends LightningBalance { + const factory LightningBalance_ContentiousClaimable( + {required final ChannelId channelId, + required final PublicKey counterpartyNodeId, + required final BigInt amountSatoshis, + required final int timeoutHeight, + required final PaymentHash paymentHash, + required final PaymentPreimage paymentPreimage}) = + _$LightningBalance_ContentiousClaimableImpl; + const LightningBalance_ContentiousClaimable._() : super._(); + + @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. + BigInt get amountSatoshis; + + /// The height at which the counterparty may be able to claim the balance if we have not + /// done so. + int get timeoutHeight; + + /// The payment hash that locks this HTLC. + PaymentHash get paymentHash; + + /// The preimage that can be used to claim this HTLC. + PaymentPreimage get paymentPreimage; + @override + @JsonKey(ignore: true) + _$$LightningBalance_ContentiousClaimableImplCopyWith< + _$LightningBalance_ContentiousClaimableImpl> + 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 + @useResult + $Res call( + {ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash}); +} + +/// @nodoc +class __$$LightningBalance_MaybeTimeoutClaimableHTLCImplCopyWithImpl<$Res> + extends _$LightningBalanceCopyWithImpl<$Res, + _$LightningBalance_MaybeTimeoutClaimableHTLCImpl> + implements _$$LightningBalance_MaybeTimeoutClaimableHTLCImplCopyWith<$Res> { + __$$LightningBalance_MaybeTimeoutClaimableHTLCImplCopyWithImpl( + _$LightningBalance_MaybeTimeoutClaimableHTLCImpl _value, + $Res Function(_$LightningBalance_MaybeTimeoutClaimableHTLCImpl) _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, + }) { + return _then(_$LightningBalance_MaybeTimeoutClaimableHTLCImpl( + 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 BigInt, + 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, + )); + } +} + +/// @nodoc + +class _$LightningBalance_MaybeTimeoutClaimableHTLCImpl + extends LightningBalance_MaybeTimeoutClaimableHTLC { + const _$LightningBalance_MaybeTimeoutClaimableHTLCImpl( + {required this.channelId, + required this.counterpartyNodeId, + required this.amountSatoshis, + required this.claimableHeight, + required this.paymentHash}) + : super._(); + + /// 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 potentially available to claim, in satoshis, excluding the on-chain fees + /// which will be required to do so. + @override + final BigInt amountSatoshis; + + /// The height at which we will be able to claim the balance if our counterparty has not + /// done so. + @override + final int claimableHeight; + + /// The payment hash whose preimage our counterparty needs to claim this HTLC. + @override + final PaymentHash paymentHash; + + @override + String toString() { + return 'LightningBalance.maybeTimeoutClaimableHtlc(channelId: $channelId, counterpartyNodeId: $counterpartyNodeId, amountSatoshis: $amountSatoshis, claimableHeight: $claimableHeight, paymentHash: $paymentHash)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LightningBalance_MaybeTimeoutClaimableHTLCImpl && + (identical(other.channelId, channelId) || + other.channelId == channelId) && + (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)); + } + + @override + int get hashCode => Object.hash(runtimeType, channelId, counterpartyNodeId, + amountSatoshis, claimableHeight, paymentHash); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$LightningBalance_MaybeTimeoutClaimableHTLCImplCopyWith< + _$LightningBalance_MaybeTimeoutClaimableHTLCImpl> + get copyWith => + __$$LightningBalance_MaybeTimeoutClaimableHTLCImplCopyWithImpl< + _$LightningBalance_MaybeTimeoutClaimableHTLCImpl>( + this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis) + claimableOnChannelClose, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight) + claimableAwaitingConfirmations, + required TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage) + contentiousClaimable, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int claimableHeight, PaymentHash paymentHash) + maybeTimeoutClaimableHtlc, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash) + maybePreimageClaimableHtlc, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis) + counterpartyRevokedOutputClaimable, + }) { + return maybeTimeoutClaimableHtlc(channelId, counterpartyNodeId, + amountSatoshis, claimableHeight, paymentHash); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + claimableOnChannelClose, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight)? + claimableAwaitingConfirmations, + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage)? + contentiousClaimable, + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? + maybeTimeoutClaimableHtlc, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + maybePreimageClaimableHtlc, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + counterpartyRevokedOutputClaimable, + }) { + return maybeTimeoutClaimableHtlc?.call(channelId, counterpartyNodeId, + amountSatoshis, claimableHeight, paymentHash); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + claimableOnChannelClose, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight)? + claimableAwaitingConfirmations, + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage)? + contentiousClaimable, + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? + maybeTimeoutClaimableHtlc, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + maybePreimageClaimableHtlc, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + counterpartyRevokedOutputClaimable, + required TResult orElse(), + }) { + if (maybeTimeoutClaimableHtlc != null) { + return maybeTimeoutClaimableHtlc(channelId, counterpartyNodeId, + amountSatoshis, claimableHeight, paymentHash); + } + return orElse(); + } + + @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, + }) { + return maybeTimeoutClaimableHtlc(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, + }) { + return maybeTimeoutClaimableHtlc?.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, + required TResult orElse(), + }) { + if (maybeTimeoutClaimableHtlc != null) { + return maybeTimeoutClaimableHtlc(this); + } + return orElse(); + } +} + +abstract class LightningBalance_MaybeTimeoutClaimableHTLC + extends LightningBalance { + const factory LightningBalance_MaybeTimeoutClaimableHTLC( + {required final ChannelId channelId, + required final PublicKey counterpartyNodeId, + required final BigInt amountSatoshis, + required final int claimableHeight, + required final PaymentHash paymentHash}) = + _$LightningBalance_MaybeTimeoutClaimableHTLCImpl; + const LightningBalance_MaybeTimeoutClaimableHTLC._() : super._(); + + @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 potentially available to claim, in satoshis, excluding the on-chain fees + /// which will be required to do so. + BigInt 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 + @JsonKey(ignore: true) + _$$LightningBalance_MaybeTimeoutClaimableHTLCImplCopyWith< + _$LightningBalance_MaybeTimeoutClaimableHTLCImpl> + 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 + @useResult + $Res call( + {ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int expiryHeight, + PaymentHash paymentHash}); +} + +/// @nodoc +class __$$LightningBalance_MaybePreimageClaimableHTLCImplCopyWithImpl<$Res> + extends _$LightningBalanceCopyWithImpl<$Res, + _$LightningBalance_MaybePreimageClaimableHTLCImpl> + implements + _$$LightningBalance_MaybePreimageClaimableHTLCImplCopyWith<$Res> { + __$$LightningBalance_MaybePreimageClaimableHTLCImplCopyWithImpl( + _$LightningBalance_MaybePreimageClaimableHTLCImpl _value, + $Res Function(_$LightningBalance_MaybePreimageClaimableHTLCImpl) _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, + }) { + return _then(_$LightningBalance_MaybePreimageClaimableHTLCImpl( + 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 BigInt, + 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, + )); + } +} + +/// @nodoc + +class _$LightningBalance_MaybePreimageClaimableHTLCImpl + extends LightningBalance_MaybePreimageClaimableHTLC { + const _$LightningBalance_MaybePreimageClaimableHTLCImpl( + {required this.channelId, + required this.counterpartyNodeId, + required this.amountSatoshis, + required this.expiryHeight, + required this.paymentHash}) + : super._(); + + /// 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 potentially available to claim, in satoshis, excluding the on-chain fees + /// which will be required to do so. + @override + final BigInt 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. + @override + final int expiryHeight; + + /// The payment hash whose preimage we need to claim this HTLC. + @override + final PaymentHash paymentHash; + + @override + String toString() { + return 'LightningBalance.maybePreimageClaimableHtlc(channelId: $channelId, counterpartyNodeId: $counterpartyNodeId, amountSatoshis: $amountSatoshis, expiryHeight: $expiryHeight, paymentHash: $paymentHash)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LightningBalance_MaybePreimageClaimableHTLCImpl && + (identical(other.channelId, channelId) || + other.channelId == channelId) && + (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)); + } + + @override + int get hashCode => Object.hash(runtimeType, channelId, counterpartyNodeId, + amountSatoshis, expiryHeight, paymentHash); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$LightningBalance_MaybePreimageClaimableHTLCImplCopyWith< + _$LightningBalance_MaybePreimageClaimableHTLCImpl> + get copyWith => + __$$LightningBalance_MaybePreimageClaimableHTLCImplCopyWithImpl< + _$LightningBalance_MaybePreimageClaimableHTLCImpl>( + this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis) + claimableOnChannelClose, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight) + claimableAwaitingConfirmations, + required TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage) + contentiousClaimable, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int claimableHeight, PaymentHash paymentHash) + maybeTimeoutClaimableHtlc, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash) + maybePreimageClaimableHtlc, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis) + counterpartyRevokedOutputClaimable, + }) { + return maybePreimageClaimableHtlc(channelId, counterpartyNodeId, + amountSatoshis, expiryHeight, paymentHash); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + claimableOnChannelClose, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight)? + claimableAwaitingConfirmations, + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage)? + contentiousClaimable, + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? + maybeTimeoutClaimableHtlc, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + maybePreimageClaimableHtlc, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + counterpartyRevokedOutputClaimable, + }) { + return maybePreimageClaimableHtlc?.call(channelId, counterpartyNodeId, + amountSatoshis, expiryHeight, paymentHash); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + claimableOnChannelClose, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight)? + claimableAwaitingConfirmations, + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage)? + contentiousClaimable, + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? + maybeTimeoutClaimableHtlc, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + maybePreimageClaimableHtlc, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + counterpartyRevokedOutputClaimable, + required TResult orElse(), + }) { + if (maybePreimageClaimableHtlc != null) { + return maybePreimageClaimableHtlc(channelId, counterpartyNodeId, + amountSatoshis, expiryHeight, paymentHash); + } + return orElse(); + } + + @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, + }) { + return maybePreimageClaimableHtlc(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, + }) { + return maybePreimageClaimableHtlc?.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, + required TResult orElse(), + }) { + if (maybePreimageClaimableHtlc != null) { + return maybePreimageClaimableHtlc(this); + } + return orElse(); + } +} + +abstract class LightningBalance_MaybePreimageClaimableHTLC + extends LightningBalance { + const factory LightningBalance_MaybePreimageClaimableHTLC( + {required final ChannelId channelId, + required final PublicKey counterpartyNodeId, + required final BigInt amountSatoshis, + required final int expiryHeight, + required final PaymentHash paymentHash}) = + _$LightningBalance_MaybePreimageClaimableHTLCImpl; + const LightningBalance_MaybePreimageClaimableHTLC._() : super._(); + + @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 potentially available to claim, in satoshis, excluding the on-chain fees + /// which will be required to do so. + BigInt 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 + @JsonKey(ignore: true) + _$$LightningBalance_MaybePreimageClaimableHTLCImplCopyWith< + _$LightningBalance_MaybePreimageClaimableHTLCImpl> + 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 + @useResult + $Res call( + {ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis}); +} + +/// @nodoc +class __$$LightningBalance_CounterpartyRevokedOutputClaimableImplCopyWithImpl< + $Res> + extends _$LightningBalanceCopyWithImpl<$Res, + _$LightningBalance_CounterpartyRevokedOutputClaimableImpl> + implements + _$$LightningBalance_CounterpartyRevokedOutputClaimableImplCopyWith< + $Res> { + __$$LightningBalance_CounterpartyRevokedOutputClaimableImplCopyWithImpl( + _$LightningBalance_CounterpartyRevokedOutputClaimableImpl _value, + $Res Function(_$LightningBalance_CounterpartyRevokedOutputClaimableImpl) + _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? channelId = null, + Object? counterpartyNodeId = null, + Object? amountSatoshis = null, + }) { + return _then(_$LightningBalance_CounterpartyRevokedOutputClaimableImpl( + 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 BigInt, + )); + } +} + +/// @nodoc + +class _$LightningBalance_CounterpartyRevokedOutputClaimableImpl + extends LightningBalance_CounterpartyRevokedOutputClaimable { + const _$LightningBalance_CounterpartyRevokedOutputClaimableImpl( + {required this.channelId, + required this.counterpartyNodeId, + required this.amountSatoshis}) + : super._(); + + /// 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, in satoshis, of the output which we can claim. + @override + final BigInt amountSatoshis; + + @override + String toString() { + return 'LightningBalance.counterpartyRevokedOutputClaimable(channelId: $channelId, counterpartyNodeId: $counterpartyNodeId, amountSatoshis: $amountSatoshis)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other + is _$LightningBalance_CounterpartyRevokedOutputClaimableImpl && + (identical(other.channelId, channelId) || + other.channelId == channelId) && + (identical(other.counterpartyNodeId, counterpartyNodeId) || + other.counterpartyNodeId == counterpartyNodeId) && + (identical(other.amountSatoshis, amountSatoshis) || + other.amountSatoshis == amountSatoshis)); + } + + @override + int get hashCode => + Object.hash(runtimeType, channelId, counterpartyNodeId, amountSatoshis); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$LightningBalance_CounterpartyRevokedOutputClaimableImplCopyWith< + _$LightningBalance_CounterpartyRevokedOutputClaimableImpl> + get copyWith => + __$$LightningBalance_CounterpartyRevokedOutputClaimableImplCopyWithImpl< + _$LightningBalance_CounterpartyRevokedOutputClaimableImpl>( + this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis) + claimableOnChannelClose, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight) + claimableAwaitingConfirmations, + required TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage) + contentiousClaimable, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int claimableHeight, PaymentHash paymentHash) + maybeTimeoutClaimableHtlc, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash) + maybePreimageClaimableHtlc, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis) + counterpartyRevokedOutputClaimable, + }) { + return counterpartyRevokedOutputClaimable( + channelId, counterpartyNodeId, amountSatoshis); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + claimableOnChannelClose, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight)? + claimableAwaitingConfirmations, + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage)? + contentiousClaimable, + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? + maybeTimeoutClaimableHtlc, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + maybePreimageClaimableHtlc, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + counterpartyRevokedOutputClaimable, + }) { + return counterpartyRevokedOutputClaimable?.call( + channelId, counterpartyNodeId, amountSatoshis); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + claimableOnChannelClose, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight)? + claimableAwaitingConfirmations, + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage)? + contentiousClaimable, + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? + maybeTimeoutClaimableHtlc, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + maybePreimageClaimableHtlc, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + counterpartyRevokedOutputClaimable, + required TResult orElse(), + }) { + if (counterpartyRevokedOutputClaimable != null) { + return counterpartyRevokedOutputClaimable( + channelId, counterpartyNodeId, amountSatoshis); + } + return orElse(); + } + + @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, + }) { + return counterpartyRevokedOutputClaimable(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, + }) { + return counterpartyRevokedOutputClaimable?.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, + required TResult orElse(), + }) { + if (counterpartyRevokedOutputClaimable != null) { + return counterpartyRevokedOutputClaimable(this); + } + return orElse(); + } +} + +abstract class LightningBalance_CounterpartyRevokedOutputClaimable + extends LightningBalance { + const factory LightningBalance_CounterpartyRevokedOutputClaimable( + {required final ChannelId channelId, + required final PublicKey counterpartyNodeId, + required final BigInt amountSatoshis}) = + _$LightningBalance_CounterpartyRevokedOutputClaimableImpl; + const LightningBalance_CounterpartyRevokedOutputClaimable._() : super._(); + + @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, in satoshis, of the output which we can claim. + BigInt get amountSatoshis; + @override + @JsonKey(ignore: true) + _$$LightningBalance_CounterpartyRevokedOutputClaimableImplCopyWith< + _$LightningBalance_CounterpartyRevokedOutputClaimableImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +mixin _$MaxDustHTLCExposure { + BigInt get field0 => throw _privateConstructorUsedError; + @optionalTypeArgs + TResult when({ + required TResult Function(BigInt field0) fixedLimitMsat, + required TResult Function(BigInt field0) feeRateMultiplier, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(BigInt field0)? fixedLimitMsat, + TResult? Function(BigInt field0)? feeRateMultiplier, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(BigInt field0)? fixedLimitMsat, + TResult Function(BigInt field0)? feeRateMultiplier, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map({ + required TResult Function(MaxDustHTLCExposure_FixedLimitMsat value) + fixedLimitMsat, + required TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value) + feeRateMultiplier, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, + TResult? Function(MaxDustHTLCExposure_FeeRateMultiplier value)? + feeRateMultiplier, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap({ + TResult Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, + TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value)? + feeRateMultiplier, + 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({BigInt field0}); +} + +/// @nodoc +class _$MaxDustHTLCExposureCopyWithImpl<$Res, $Val extends MaxDustHTLCExposure> + implements $MaxDustHTLCExposureCopyWith<$Res> { + _$MaxDustHTLCExposureCopyWithImpl(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 BigInt, + ) 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({BigInt field0}); +} + +/// @nodoc +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? field0 = null, + }) { + return _then(_$MaxDustHTLCExposure_FixedLimitMsatImpl( + null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as BigInt, + )); + } +} + +/// @nodoc + +class _$MaxDustHTLCExposure_FixedLimitMsatImpl + extends MaxDustHTLCExposure_FixedLimitMsat { + const _$MaxDustHTLCExposure_FixedLimitMsatImpl(this.field0) : super._(); + + @override + final BigInt field0; + + @override + String toString() { + return 'MaxDustHTLCExposure.fixedLimitMsat(field0: $field0)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$MaxDustHTLCExposure_FixedLimitMsatImpl && + (identical(other.field0, field0) || other.field0 == field0)); + } + + @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); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(BigInt field0) fixedLimitMsat, + required TResult Function(BigInt field0) feeRateMultiplier, + }) { + return fixedLimitMsat(field0); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(String field0)? seedFile, - TResult? Function(U8Array64 field0)? seedBytes, - TResult? Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + TResult? Function(BigInt field0)? fixedLimitMsat, + TResult? Function(BigInt field0)? feeRateMultiplier, }) { - return bip39Mnemonic?.call(mnemonic, passphrase); + return fixedLimitMsat?.call(field0); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(String field0)? seedFile, - TResult Function(U8Array64 field0)? seedBytes, - TResult Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + TResult Function(BigInt field0)? fixedLimitMsat, + TResult Function(BigInt field0)? feeRateMultiplier, required TResult orElse(), }) { - if (bip39Mnemonic != null) { - return bip39Mnemonic(mnemonic, passphrase); + if (fixedLimitMsat != null) { + return fixedLimitMsat(field0); } return orElse(); } @@ -714,160 +8508,306 @@ class _$EntropySourceConfig_Bip39MnemonicImpl @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, + required TResult Function(MaxDustHTLCExposure_FixedLimitMsat value) + fixedLimitMsat, + required TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value) + feeRateMultiplier, }) { - return bip39Mnemonic(this); + return fixedLimitMsat(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(EntropySourceConfig_SeedFile value)? seedFile, - TResult? Function(EntropySourceConfig_SeedBytes value)? seedBytes, - TResult? Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, + TResult? Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, + TResult? Function(MaxDustHTLCExposure_FeeRateMultiplier value)? + feeRateMultiplier, }) { - return bip39Mnemonic?.call(this); + return fixedLimitMsat?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(EntropySourceConfig_SeedFile value)? seedFile, - TResult Function(EntropySourceConfig_SeedBytes value)? seedBytes, - TResult Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, + TResult Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, + TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value)? + feeRateMultiplier, required TResult orElse(), }) { - if (bip39Mnemonic != null) { - return bip39Mnemonic(this); + if (fixedLimitMsat != null) { + return fixedLimitMsat(this); + } + return orElse(); + } +} + +abstract class MaxDustHTLCExposure_FixedLimitMsat extends MaxDustHTLCExposure { + const factory MaxDustHTLCExposure_FixedLimitMsat(final BigInt field0) = + _$MaxDustHTLCExposure_FixedLimitMsatImpl; + const MaxDustHTLCExposure_FixedLimitMsat._() : super._(); + + @override + BigInt get field0; + @override + @JsonKey(ignore: true) + _$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWith< + _$MaxDustHTLCExposure_FixedLimitMsatImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +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({BigInt 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) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? field0 = null, + }) { + return _then(_$MaxDustHTLCExposure_FeeRateMultiplierImpl( + null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as BigInt, + )); + } +} + +/// @nodoc + +class _$MaxDustHTLCExposure_FeeRateMultiplierImpl + extends MaxDustHTLCExposure_FeeRateMultiplier { + const _$MaxDustHTLCExposure_FeeRateMultiplierImpl(this.field0) : super._(); + + @override + final BigInt field0; + + @override + String toString() { + return 'MaxDustHTLCExposure.feeRateMultiplier(field0: $field0)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$MaxDustHTLCExposure_FeeRateMultiplierImpl && + (identical(other.field0, field0) || other.field0 == field0)); + } + + @override + int get hashCode => Object.hash(runtimeType, field0); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWith< + _$MaxDustHTLCExposure_FeeRateMultiplierImpl> + get copyWith => __$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWithImpl< + _$MaxDustHTLCExposure_FeeRateMultiplierImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(BigInt field0) fixedLimitMsat, + required TResult Function(BigInt field0) feeRateMultiplier, + }) { + return feeRateMultiplier(field0); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(BigInt field0)? fixedLimitMsat, + TResult? Function(BigInt field0)? feeRateMultiplier, + }) { + return feeRateMultiplier?.call(field0); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(BigInt field0)? fixedLimitMsat, + TResult Function(BigInt field0)? feeRateMultiplier, + required TResult orElse(), + }) { + if (feeRateMultiplier != null) { + return feeRateMultiplier(field0); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(MaxDustHTLCExposure_FixedLimitMsat value) + fixedLimitMsat, + required TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value) + feeRateMultiplier, + }) { + return feeRateMultiplier(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, + TResult? Function(MaxDustHTLCExposure_FeeRateMultiplier value)? + feeRateMultiplier, + }) { + return feeRateMultiplier?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, + TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value)? + feeRateMultiplier, + required TResult orElse(), + }) { + if (feeRateMultiplier != null) { + return feeRateMultiplier(this); } return orElse(); } } -abstract class EntropySourceConfig_Bip39Mnemonic extends EntropySourceConfig { - const factory EntropySourceConfig_Bip39Mnemonic( - {required final LdkMnemonic mnemonic, - final String? passphrase}) = _$EntropySourceConfig_Bip39MnemonicImpl; - const EntropySourceConfig_Bip39Mnemonic._() : super._(); +abstract class MaxDustHTLCExposure_FeeRateMultiplier + extends MaxDustHTLCExposure { + const factory MaxDustHTLCExposure_FeeRateMultiplier(final BigInt field0) = + _$MaxDustHTLCExposure_FeeRateMultiplierImpl; + const MaxDustHTLCExposure_FeeRateMultiplier._() : super._(); - LdkMnemonic get mnemonic; - String? get passphrase; + @override + BigInt get field0; + @override @JsonKey(ignore: true) - _$$EntropySourceConfig_Bip39MnemonicImplCopyWith< - _$EntropySourceConfig_Bip39MnemonicImpl> + _$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWith< + _$MaxDustHTLCExposure_FeeRateMultiplierImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -mixin _$Event { +mixin _$PaymentKind { @optionalTypeArgs TResult when({ - 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() onchain, required TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo) - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt11, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits) + bolt11Jit, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage) + spontaneous, + required TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId) + bolt12Offer, + required TResult Function( + PaymentHash? hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt12Refund, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult? whenOrNull({ - 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()? onchain, TResult? Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult maybeWhen({ - 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()? onchain, TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, 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_ChannelReady value) channelReady, - required TResult Function(Event_ChannelClosed value) channelClosed, - required TResult Function(Event_ChannelPending value) channelPending, + required TResult Function(PaymentKind_Onchain value) onchain, + required TResult Function(PaymentKind_Bolt11 value) bolt11, + required TResult Function(PaymentKind_Bolt11Jit value) bolt11Jit, + required TResult Function(PaymentKind_Spontaneous value) spontaneous, + required TResult Function(PaymentKind_Bolt12Offer value) bolt12Offer, + required TResult Function(PaymentKind_Bolt12Refund value) bolt12Refund, }) => 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_ChannelReady value)? channelReady, - TResult? Function(Event_ChannelClosed value)? channelClosed, - TResult? Function(Event_ChannelPending value)? channelPending, + TResult? Function(PaymentKind_Onchain value)? onchain, + TResult? Function(PaymentKind_Bolt11 value)? bolt11, + TResult? Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult? Function(PaymentKind_Spontaneous value)? spontaneous, + TResult? Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult? Function(PaymentKind_Bolt12Refund value)? bolt12Refund, }) => 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_ChannelReady value)? channelReady, - TResult Function(Event_ChannelClosed value)? channelClosed, - TResult Function(Event_ChannelPending value)? channelPending, + TResult Function(PaymentKind_Onchain value)? onchain, + TResult Function(PaymentKind_Bolt11 value)? bolt11, + TResult Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult Function(PaymentKind_Spontaneous value)? spontaneous, + TResult Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult Function(PaymentKind_Bolt12Refund value)? bolt12Refund, required TResult orElse(), }) => throw _privateConstructorUsedError; } /// @nodoc -abstract class $EventCopyWith<$Res> { - factory $EventCopyWith(Event value, $Res Function(Event) then) = - _$EventCopyWithImpl<$Res, Event>; +abstract class $PaymentKindCopyWith<$Res> { + factory $PaymentKindCopyWith( + PaymentKind value, $Res Function(PaymentKind) then) = + _$PaymentKindCopyWithImpl<$Res, PaymentKind>; } /// @nodoc -class _$EventCopyWithImpl<$Res, $Val extends Event> - implements $EventCopyWith<$Res> { - _$EventCopyWithImpl(this._value, this._then); +class _$PaymentKindCopyWithImpl<$Res, $Val extends PaymentKind> + implements $PaymentKindCopyWith<$Res> { + _$PaymentKindCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; @@ -876,141 +8816,105 @@ class _$EventCopyWithImpl<$Res, $Val extends Event> } /// @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}); +abstract class _$$PaymentKind_OnchainImplCopyWith<$Res> { + factory _$$PaymentKind_OnchainImplCopyWith(_$PaymentKind_OnchainImpl value, + $Res Function(_$PaymentKind_OnchainImpl) then) = + __$$PaymentKind_OnchainImplCopyWithImpl<$Res>; } /// @nodoc -class __$$Event_PaymentSuccessfulImplCopyWithImpl<$Res> - extends _$EventCopyWithImpl<$Res, _$Event_PaymentSuccessfulImpl> - implements _$$Event_PaymentSuccessfulImplCopyWith<$Res> { - __$$Event_PaymentSuccessfulImplCopyWithImpl( - _$Event_PaymentSuccessfulImpl _value, - $Res Function(_$Event_PaymentSuccessfulImpl) _then) +class __$$PaymentKind_OnchainImplCopyWithImpl<$Res> + extends _$PaymentKindCopyWithImpl<$Res, _$PaymentKind_OnchainImpl> + implements _$$PaymentKind_OnchainImplCopyWith<$Res> { + __$$PaymentKind_OnchainImplCopyWithImpl(_$PaymentKind_OnchainImpl _value, + $Res Function(_$PaymentKind_OnchainImpl) _then) : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentHash = null, - }) { - return _then(_$Event_PaymentSuccessfulImpl( - paymentHash: null == paymentHash - ? _value.paymentHash - : paymentHash // ignore: cast_nullable_to_non_nullable - as PaymentHash, - )); - } } /// @nodoc -class _$Event_PaymentSuccessfulImpl extends Event_PaymentSuccessful { - const _$Event_PaymentSuccessfulImpl({required this.paymentHash}) : super._(); - - /// The hash of the payment. - @override - final PaymentHash paymentHash; +class _$PaymentKind_OnchainImpl extends PaymentKind_Onchain { + const _$PaymentKind_OnchainImpl() : super._(); @override String toString() { - return 'Event.paymentSuccessful(paymentHash: $paymentHash)'; + return 'PaymentKind.onchain()'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$Event_PaymentSuccessfulImpl && - (identical(other.paymentHash, paymentHash) || - other.paymentHash == paymentHash)); + other is _$PaymentKind_OnchainImpl); } @override - int get hashCode => Object.hash(runtimeType, paymentHash); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$Event_PaymentSuccessfulImplCopyWith<_$Event_PaymentSuccessfulImpl> - get copyWith => __$$Event_PaymentSuccessfulImplCopyWithImpl< - _$Event_PaymentSuccessfulImpl>(this, _$identity); + int get hashCode => runtimeType.hashCode; @override @optionalTypeArgs TResult when({ - 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() onchain, required TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo) - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt11, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits) + bolt11Jit, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage) + spontaneous, + required TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId) + bolt12Offer, + required TResult Function( + PaymentHash? hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt12Refund, }) { - return paymentSuccessful(paymentHash); + return onchain(); } @override @optionalTypeArgs TResult? whenOrNull({ - 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()? onchain, TResult? Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, }) { - return paymentSuccessful?.call(paymentHash); + return onchain?.call(); } @override @optionalTypeArgs TResult maybeWhen({ - 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()? onchain, TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, required TResult orElse(), }) { - if (paymentSuccessful != null) { - return paymentSuccessful(paymentHash); + if (onchain != null) { + return onchain(); } return orElse(); } @@ -1018,193 +8922,203 @@ class _$Event_PaymentSuccessfulImpl extends Event_PaymentSuccessful { @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_ChannelReady value) channelReady, - required TResult Function(Event_ChannelClosed value) channelClosed, - required TResult Function(Event_ChannelPending value) channelPending, + required TResult Function(PaymentKind_Onchain value) onchain, + required TResult Function(PaymentKind_Bolt11 value) bolt11, + required TResult Function(PaymentKind_Bolt11Jit value) bolt11Jit, + required TResult Function(PaymentKind_Spontaneous value) spontaneous, + required TResult Function(PaymentKind_Bolt12Offer value) bolt12Offer, + required TResult Function(PaymentKind_Bolt12Refund value) bolt12Refund, }) { - return paymentSuccessful(this); + return onchain(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_ChannelReady value)? channelReady, - TResult? Function(Event_ChannelClosed value)? channelClosed, - TResult? Function(Event_ChannelPending value)? channelPending, + TResult? Function(PaymentKind_Onchain value)? onchain, + TResult? Function(PaymentKind_Bolt11 value)? bolt11, + TResult? Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult? Function(PaymentKind_Spontaneous value)? spontaneous, + TResult? Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult? Function(PaymentKind_Bolt12Refund value)? bolt12Refund, }) { - return paymentSuccessful?.call(this); + return onchain?.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_ChannelReady value)? channelReady, - TResult Function(Event_ChannelClosed value)? channelClosed, - TResult Function(Event_ChannelPending value)? channelPending, + TResult Function(PaymentKind_Onchain value)? onchain, + TResult Function(PaymentKind_Bolt11 value)? bolt11, + TResult Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult Function(PaymentKind_Spontaneous value)? spontaneous, + TResult Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult Function(PaymentKind_Bolt12Refund value)? bolt12Refund, required TResult orElse(), }) { - if (paymentSuccessful != null) { - return paymentSuccessful(this); + if (onchain != null) { + return onchain(this); } return orElse(); } } -abstract class Event_PaymentSuccessful extends Event { - const factory Event_PaymentSuccessful( - {required final PaymentHash paymentHash}) = _$Event_PaymentSuccessfulImpl; - const Event_PaymentSuccessful._() : super._(); - - /// The hash of the payment. - PaymentHash get paymentHash; - @JsonKey(ignore: true) - _$$Event_PaymentSuccessfulImplCopyWith<_$Event_PaymentSuccessfulImpl> - get copyWith => throw _privateConstructorUsedError; +abstract class PaymentKind_Onchain extends PaymentKind { + const factory PaymentKind_Onchain() = _$PaymentKind_OnchainImpl; + const PaymentKind_Onchain._() : super._(); } /// @nodoc -abstract class _$$Event_PaymentFailedImplCopyWith<$Res> { - factory _$$Event_PaymentFailedImplCopyWith(_$Event_PaymentFailedImpl value, - $Res Function(_$Event_PaymentFailedImpl) then) = - __$$Event_PaymentFailedImplCopyWithImpl<$Res>; +abstract class _$$PaymentKind_Bolt11ImplCopyWith<$Res> { + factory _$$PaymentKind_Bolt11ImplCopyWith(_$PaymentKind_Bolt11Impl value, + $Res Function(_$PaymentKind_Bolt11Impl) then) = + __$$PaymentKind_Bolt11ImplCopyWithImpl<$Res>; @useResult - $Res call({PaymentHash paymentHash}); + $Res call( + {PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret}); } /// @nodoc -class __$$Event_PaymentFailedImplCopyWithImpl<$Res> - extends _$EventCopyWithImpl<$Res, _$Event_PaymentFailedImpl> - implements _$$Event_PaymentFailedImplCopyWith<$Res> { - __$$Event_PaymentFailedImplCopyWithImpl(_$Event_PaymentFailedImpl _value, - $Res Function(_$Event_PaymentFailedImpl) _then) +class __$$PaymentKind_Bolt11ImplCopyWithImpl<$Res> + extends _$PaymentKindCopyWithImpl<$Res, _$PaymentKind_Bolt11Impl> + implements _$$PaymentKind_Bolt11ImplCopyWith<$Res> { + __$$PaymentKind_Bolt11ImplCopyWithImpl(_$PaymentKind_Bolt11Impl _value, + $Res Function(_$PaymentKind_Bolt11Impl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override $Res call({ - Object? paymentHash = null, - }) { - return _then(_$Event_PaymentFailedImpl( - paymentHash: null == paymentHash - ? _value.paymentHash - : paymentHash // ignore: cast_nullable_to_non_nullable + Object? hash = null, + Object? preimage = freezed, + Object? secret = freezed, + }) { + return _then(_$PaymentKind_Bolt11Impl( + hash: null == hash + ? _value.hash + : hash // ignore: cast_nullable_to_non_nullable as PaymentHash, + preimage: freezed == preimage + ? _value.preimage + : preimage // ignore: cast_nullable_to_non_nullable + as PaymentPreimage?, + secret: freezed == secret + ? _value.secret + : secret // ignore: cast_nullable_to_non_nullable + as PaymentSecret?, )); } } /// @nodoc -class _$Event_PaymentFailedImpl extends Event_PaymentFailed { - const _$Event_PaymentFailedImpl({required this.paymentHash}) : super._(); +class _$PaymentKind_Bolt11Impl extends PaymentKind_Bolt11 { + const _$PaymentKind_Bolt11Impl( + {required this.hash, this.preimage, this.secret}) + : super._(); - /// The hash of the payment. + /// The payment hash, i.e., the hash of the `preimage`. @override - final PaymentHash paymentHash; + final PaymentHash hash; + + /// The pre-image used by the payment. + @override + final PaymentPreimage? preimage; + + /// The secret used by the payment. + @override + final PaymentSecret? secret; @override String toString() { - return 'Event.paymentFailed(paymentHash: $paymentHash)'; + return 'PaymentKind.bolt11(hash: $hash, preimage: $preimage, secret: $secret)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$Event_PaymentFailedImpl && - (identical(other.paymentHash, paymentHash) || - other.paymentHash == paymentHash)); + other is _$PaymentKind_Bolt11Impl && + (identical(other.hash, hash) || other.hash == hash) && + (identical(other.preimage, preimage) || + other.preimage == preimage) && + (identical(other.secret, secret) || other.secret == secret)); } @override - int get hashCode => Object.hash(runtimeType, paymentHash); + int get hashCode => Object.hash(runtimeType, hash, preimage, secret); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$Event_PaymentFailedImplCopyWith<_$Event_PaymentFailedImpl> get copyWith => - __$$Event_PaymentFailedImplCopyWithImpl<_$Event_PaymentFailedImpl>( + _$$PaymentKind_Bolt11ImplCopyWith<_$PaymentKind_Bolt11Impl> get copyWith => + __$$PaymentKind_Bolt11ImplCopyWithImpl<_$PaymentKind_Bolt11Impl>( this, _$identity); @override @optionalTypeArgs TResult when({ - 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() onchain, required TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo) - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt11, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits) + bolt11Jit, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage) + spontaneous, + required TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId) + bolt12Offer, + required TResult Function( + PaymentHash? hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt12Refund, }) { - return paymentFailed(paymentHash); + return bolt11(hash, preimage, secret); } @override @optionalTypeArgs TResult? whenOrNull({ - 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()? onchain, TResult? Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, }) { - return paymentFailed?.call(paymentHash); + return bolt11?.call(hash, preimage, secret); } @override - @optionalTypeArgs - TResult maybeWhen({ - 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, + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? onchain, TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, required TResult orElse(), }) { - if (paymentFailed != null) { - return paymentFailed(paymentHash); + if (bolt11 != null) { + return bolt11(hash, preimage, secret); } return orElse(); } @@ -1212,207 +9126,241 @@ class _$Event_PaymentFailedImpl extends Event_PaymentFailed { @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_ChannelReady value) channelReady, - required TResult Function(Event_ChannelClosed value) channelClosed, - required TResult Function(Event_ChannelPending value) channelPending, + required TResult Function(PaymentKind_Onchain value) onchain, + required TResult Function(PaymentKind_Bolt11 value) bolt11, + required TResult Function(PaymentKind_Bolt11Jit value) bolt11Jit, + required TResult Function(PaymentKind_Spontaneous value) spontaneous, + required TResult Function(PaymentKind_Bolt12Offer value) bolt12Offer, + required TResult Function(PaymentKind_Bolt12Refund value) bolt12Refund, }) { - return paymentFailed(this); + return bolt11(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_ChannelReady value)? channelReady, - TResult? Function(Event_ChannelClosed value)? channelClosed, - TResult? Function(Event_ChannelPending value)? channelPending, + TResult? Function(PaymentKind_Onchain value)? onchain, + TResult? Function(PaymentKind_Bolt11 value)? bolt11, + TResult? Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult? Function(PaymentKind_Spontaneous value)? spontaneous, + TResult? Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult? Function(PaymentKind_Bolt12Refund value)? bolt12Refund, }) { - return paymentFailed?.call(this); + return bolt11?.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_ChannelReady value)? channelReady, - TResult Function(Event_ChannelClosed value)? channelClosed, - TResult Function(Event_ChannelPending value)? channelPending, + TResult Function(PaymentKind_Onchain value)? onchain, + TResult Function(PaymentKind_Bolt11 value)? bolt11, + TResult Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult Function(PaymentKind_Spontaneous value)? spontaneous, + TResult Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult Function(PaymentKind_Bolt12Refund value)? bolt12Refund, required TResult orElse(), }) { - if (paymentFailed != null) { - return paymentFailed(this); + if (bolt11 != null) { + return bolt11(this); } return orElse(); } } -abstract class Event_PaymentFailed extends Event { - const factory Event_PaymentFailed({required final PaymentHash paymentHash}) = - _$Event_PaymentFailedImpl; - const Event_PaymentFailed._() : super._(); +abstract class PaymentKind_Bolt11 extends PaymentKind { + const factory PaymentKind_Bolt11( + {required final PaymentHash hash, + final PaymentPreimage? preimage, + final PaymentSecret? secret}) = _$PaymentKind_Bolt11Impl; + const PaymentKind_Bolt11._() : super._(); - /// The hash of the payment. - PaymentHash get paymentHash; + /// The payment hash, i.e., the hash of the `preimage`. + PaymentHash get hash; + + /// The pre-image used by the payment. + PaymentPreimage? get preimage; + + /// The secret used by the payment. + PaymentSecret? get secret; @JsonKey(ignore: true) - _$$Event_PaymentFailedImplCopyWith<_$Event_PaymentFailedImpl> get copyWith => + _$$PaymentKind_Bolt11ImplCopyWith<_$PaymentKind_Bolt11Impl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$Event_PaymentReceivedImplCopyWith<$Res> { - factory _$$Event_PaymentReceivedImplCopyWith( - _$Event_PaymentReceivedImpl value, - $Res Function(_$Event_PaymentReceivedImpl) then) = - __$$Event_PaymentReceivedImplCopyWithImpl<$Res>; +abstract class _$$PaymentKind_Bolt11JitImplCopyWith<$Res> { + factory _$$PaymentKind_Bolt11JitImplCopyWith( + _$PaymentKind_Bolt11JitImpl value, + $Res Function(_$PaymentKind_Bolt11JitImpl) then) = + __$$PaymentKind_Bolt11JitImplCopyWithImpl<$Res>; @useResult - $Res call({PaymentHash paymentHash, int amountMsat}); + $Res call( + {PaymentHash hash, + PaymentPreimage? preimage, + PaymentSecret? secret, + LSPFeeLimits lspFeeLimits}); } /// @nodoc -class __$$Event_PaymentReceivedImplCopyWithImpl<$Res> - extends _$EventCopyWithImpl<$Res, _$Event_PaymentReceivedImpl> - implements _$$Event_PaymentReceivedImplCopyWith<$Res> { - __$$Event_PaymentReceivedImplCopyWithImpl(_$Event_PaymentReceivedImpl _value, - $Res Function(_$Event_PaymentReceivedImpl) _then) +class __$$PaymentKind_Bolt11JitImplCopyWithImpl<$Res> + extends _$PaymentKindCopyWithImpl<$Res, _$PaymentKind_Bolt11JitImpl> + implements _$$PaymentKind_Bolt11JitImplCopyWith<$Res> { + __$$PaymentKind_Bolt11JitImplCopyWithImpl(_$PaymentKind_Bolt11JitImpl _value, + $Res Function(_$PaymentKind_Bolt11JitImpl) _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 + Object? hash = null, + Object? preimage = freezed, + Object? secret = freezed, + Object? lspFeeLimits = null, + }) { + return _then(_$PaymentKind_Bolt11JitImpl( + hash: null == hash + ? _value.hash + : hash // ignore: cast_nullable_to_non_nullable as PaymentHash, - amountMsat: null == amountMsat - ? _value.amountMsat - : amountMsat // ignore: cast_nullable_to_non_nullable - as int, + preimage: freezed == preimage + ? _value.preimage + : preimage // ignore: cast_nullable_to_non_nullable + as PaymentPreimage?, + secret: freezed == secret + ? _value.secret + : secret // ignore: cast_nullable_to_non_nullable + as PaymentSecret?, + lspFeeLimits: null == lspFeeLimits + ? _value.lspFeeLimits + : lspFeeLimits // ignore: cast_nullable_to_non_nullable + as LSPFeeLimits, )); } } /// @nodoc -class _$Event_PaymentReceivedImpl extends Event_PaymentReceived { - const _$Event_PaymentReceivedImpl( - {required this.paymentHash, required this.amountMsat}) +class _$PaymentKind_Bolt11JitImpl extends PaymentKind_Bolt11Jit { + const _$PaymentKind_Bolt11JitImpl( + {required this.hash, + this.preimage, + this.secret, + required this.lspFeeLimits}) : super._(); - /// The hash of the payment. + /// The payment hash, i.e., the hash of the `preimage`. @override - final PaymentHash paymentHash; + final PaymentHash hash; - /// The value, in thousandths of a satoshi, that has been received. + /// The pre-image used by the payment. + @override + final PaymentPreimage? preimage; + + /// The secret used by the payment. + @override + final PaymentSecret? secret; + + /// Limits applying to how much fee we allow an LSP to deduct from the payment amount. + /// + /// Allowing them to deduct this fee from the first inbound payment will pay for the LSP's + /// channel opening fees. + /// @override - final int amountMsat; + final LSPFeeLimits lspFeeLimits; @override String toString() { - return 'Event.paymentReceived(paymentHash: $paymentHash, amountMsat: $amountMsat)'; + return 'PaymentKind.bolt11Jit(hash: $hash, preimage: $preimage, secret: $secret, lspFeeLimits: $lspFeeLimits)'; } @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)); + other is _$PaymentKind_Bolt11JitImpl && + (identical(other.hash, hash) || other.hash == hash) && + (identical(other.preimage, preimage) || + other.preimage == preimage) && + (identical(other.secret, secret) || other.secret == secret) && + (identical(other.lspFeeLimits, lspFeeLimits) || + other.lspFeeLimits == lspFeeLimits)); } @override - int get hashCode => Object.hash(runtimeType, paymentHash, amountMsat); + int get hashCode => + Object.hash(runtimeType, hash, preimage, secret, lspFeeLimits); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$Event_PaymentReceivedImplCopyWith<_$Event_PaymentReceivedImpl> - get copyWith => __$$Event_PaymentReceivedImplCopyWithImpl< - _$Event_PaymentReceivedImpl>(this, _$identity); + _$$PaymentKind_Bolt11JitImplCopyWith<_$PaymentKind_Bolt11JitImpl> + get copyWith => __$$PaymentKind_Bolt11JitImplCopyWithImpl< + _$PaymentKind_Bolt11JitImpl>(this, _$identity); @override @optionalTypeArgs TResult when({ - 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() onchain, required TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo) - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt11, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits) + bolt11Jit, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage) + spontaneous, + required TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId) + bolt12Offer, + required TResult Function( + PaymentHash? hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt12Refund, }) { - return paymentReceived(paymentHash, amountMsat); + return bolt11Jit(hash, preimage, secret, lspFeeLimits); } @override @optionalTypeArgs TResult? whenOrNull({ - 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()? onchain, TResult? Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, }) { - return paymentReceived?.call(paymentHash, amountMsat); + return bolt11Jit?.call(hash, preimage, secret, lspFeeLimits); } @override @optionalTypeArgs TResult maybeWhen({ - 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()? onchain, TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, required TResult orElse(), }) { - if (paymentReceived != null) { - return paymentReceived(paymentHash, amountMsat); + if (bolt11Jit != null) { + return bolt11Jit(hash, preimage, secret, lspFeeLimits); } return orElse(); } @@ -1420,225 +9368,216 @@ class _$Event_PaymentReceivedImpl extends Event_PaymentReceived { @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_ChannelReady value) channelReady, - required TResult Function(Event_ChannelClosed value) channelClosed, - required TResult Function(Event_ChannelPending value) channelPending, + required TResult Function(PaymentKind_Onchain value) onchain, + required TResult Function(PaymentKind_Bolt11 value) bolt11, + required TResult Function(PaymentKind_Bolt11Jit value) bolt11Jit, + required TResult Function(PaymentKind_Spontaneous value) spontaneous, + required TResult Function(PaymentKind_Bolt12Offer value) bolt12Offer, + required TResult Function(PaymentKind_Bolt12Refund value) bolt12Refund, }) { - return paymentReceived(this); + return bolt11Jit(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_ChannelReady value)? channelReady, - TResult? Function(Event_ChannelClosed value)? channelClosed, - TResult? Function(Event_ChannelPending value)? channelPending, + TResult? Function(PaymentKind_Onchain value)? onchain, + TResult? Function(PaymentKind_Bolt11 value)? bolt11, + TResult? Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult? Function(PaymentKind_Spontaneous value)? spontaneous, + TResult? Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult? Function(PaymentKind_Bolt12Refund value)? bolt12Refund, }) { - return paymentReceived?.call(this); + return bolt11Jit?.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_ChannelReady value)? channelReady, - TResult Function(Event_ChannelClosed value)? channelClosed, - TResult Function(Event_ChannelPending value)? channelPending, + TResult Function(PaymentKind_Onchain value)? onchain, + TResult Function(PaymentKind_Bolt11 value)? bolt11, + TResult Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult Function(PaymentKind_Spontaneous value)? spontaneous, + TResult Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult Function(PaymentKind_Bolt12Refund value)? bolt12Refund, required TResult orElse(), }) { - if (paymentReceived != null) { - return paymentReceived(this); + if (bolt11Jit != null) { + return bolt11Jit(this); } return orElse(); } } -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 hash of the payment. - PaymentHash get paymentHash; - - /// The value, in thousandths of a satoshi, that has been received. - int get amountMsat; +abstract class PaymentKind_Bolt11Jit extends PaymentKind { + const factory PaymentKind_Bolt11Jit( + {required final PaymentHash hash, + final PaymentPreimage? preimage, + final PaymentSecret? secret, + required final LSPFeeLimits lspFeeLimits}) = _$PaymentKind_Bolt11JitImpl; + const PaymentKind_Bolt11Jit._() : super._(); + + /// The payment hash, i.e., the hash of the `preimage`. + PaymentHash get hash; + + /// The pre-image used by the payment. + PaymentPreimage? get preimage; + + /// The secret used by the payment. + PaymentSecret? get secret; + + /// Limits applying to how much fee we allow an LSP to deduct from the payment amount. + /// + /// Allowing them to deduct this fee from the first inbound payment will pay for the LSP's + /// channel opening fees. + /// + LSPFeeLimits get lspFeeLimits; @JsonKey(ignore: true) - _$$Event_PaymentReceivedImplCopyWith<_$Event_PaymentReceivedImpl> + _$$PaymentKind_Bolt11JitImplCopyWith<_$PaymentKind_Bolt11JitImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$Event_ChannelReadyImplCopyWith<$Res> { - factory _$$Event_ChannelReadyImplCopyWith(_$Event_ChannelReadyImpl value, - $Res Function(_$Event_ChannelReadyImpl) then) = - __$$Event_ChannelReadyImplCopyWithImpl<$Res>; +abstract class _$$PaymentKind_SpontaneousImplCopyWith<$Res> { + factory _$$PaymentKind_SpontaneousImplCopyWith( + _$PaymentKind_SpontaneousImpl value, + $Res Function(_$PaymentKind_SpontaneousImpl) then) = + __$$PaymentKind_SpontaneousImplCopyWithImpl<$Res>; @useResult - $Res call( - {ChannelId channelId, - UserChannelId userChannelId, - PublicKey? counterpartyNodeId}); + $Res call({PaymentHash hash, PaymentPreimage? preimage}); } /// @nodoc -class __$$Event_ChannelReadyImplCopyWithImpl<$Res> - extends _$EventCopyWithImpl<$Res, _$Event_ChannelReadyImpl> - implements _$$Event_ChannelReadyImplCopyWith<$Res> { - __$$Event_ChannelReadyImplCopyWithImpl(_$Event_ChannelReadyImpl _value, - $Res Function(_$Event_ChannelReadyImpl) _then) +class __$$PaymentKind_SpontaneousImplCopyWithImpl<$Res> + extends _$PaymentKindCopyWithImpl<$Res, _$PaymentKind_SpontaneousImpl> + implements _$$PaymentKind_SpontaneousImplCopyWith<$Res> { + __$$PaymentKind_SpontaneousImplCopyWithImpl( + _$PaymentKind_SpontaneousImpl _value, + $Res Function(_$PaymentKind_SpontaneousImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override $Res call({ - Object? channelId = null, - Object? userChannelId = null, - Object? counterpartyNodeId = freezed, + Object? hash = null, + Object? preimage = 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?, + return _then(_$PaymentKind_SpontaneousImpl( + hash: null == hash + ? _value.hash + : hash // ignore: cast_nullable_to_non_nullable + as PaymentHash, + preimage: freezed == preimage + ? _value.preimage + : preimage // ignore: cast_nullable_to_non_nullable + as PaymentPreimage?, )); } } /// @nodoc -class _$Event_ChannelReadyImpl extends Event_ChannelReady { - const _$Event_ChannelReadyImpl( - {required this.channelId, - required this.userChannelId, - this.counterpartyNodeId}) +class _$PaymentKind_SpontaneousImpl extends PaymentKind_Spontaneous { + const _$PaymentKind_SpontaneousImpl({required this.hash, this.preimage}) : super._(); - /// The channel_id of the channel. + /// The payment hash, i.e., the hash of the `preimage`. @override - final ChannelId channelId; + final PaymentHash hash; - /// The user_channel_id of the channel. + /// The pre-image used by the payment. @override - final UserChannelId userChannelId; - @override - final PublicKey? counterpartyNodeId; + final PaymentPreimage? preimage; @override String toString() { - return 'Event.channelReady(channelId: $channelId, userChannelId: $userChannelId, counterpartyNodeId: $counterpartyNodeId)'; + return 'PaymentKind.spontaneous(hash: $hash, preimage: $preimage)'; } @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)); + other is _$PaymentKind_SpontaneousImpl && + (identical(other.hash, hash) || other.hash == hash) && + (identical(other.preimage, preimage) || + other.preimage == preimage)); } @override - int get hashCode => - Object.hash(runtimeType, channelId, userChannelId, counterpartyNodeId); + int get hashCode => Object.hash(runtimeType, hash, preimage); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$Event_ChannelReadyImplCopyWith<_$Event_ChannelReadyImpl> get copyWith => - __$$Event_ChannelReadyImplCopyWithImpl<_$Event_ChannelReadyImpl>( - this, _$identity); + _$$PaymentKind_SpontaneousImplCopyWith<_$PaymentKind_SpontaneousImpl> + get copyWith => __$$PaymentKind_SpontaneousImplCopyWithImpl< + _$PaymentKind_SpontaneousImpl>(this, _$identity); @override @optionalTypeArgs TResult when({ - 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() onchain, required TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo) - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt11, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits) + bolt11Jit, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage) + spontaneous, + required TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId) + bolt12Offer, + required TResult Function( + PaymentHash? hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt12Refund, }) { - return channelReady(channelId, userChannelId, counterpartyNodeId); + return spontaneous(hash, preimage); } @override @optionalTypeArgs TResult? whenOrNull({ - 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()? onchain, TResult? Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, }) { - return channelReady?.call(channelId, userChannelId, counterpartyNodeId); + return spontaneous?.call(hash, preimage); } @override @optionalTypeArgs TResult maybeWhen({ - 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()? onchain, TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, required TResult orElse(), }) { - if (channelReady != null) { - return channelReady(channelId, userChannelId, counterpartyNodeId); + if (spontaneous != null) { + return spontaneous(hash, preimage); } return orElse(); } @@ -1646,227 +9585,229 @@ class _$Event_ChannelReadyImpl extends Event_ChannelReady { @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_ChannelReady value) channelReady, - required TResult Function(Event_ChannelClosed value) channelClosed, - required TResult Function(Event_ChannelPending value) channelPending, + required TResult Function(PaymentKind_Onchain value) onchain, + required TResult Function(PaymentKind_Bolt11 value) bolt11, + required TResult Function(PaymentKind_Bolt11Jit value) bolt11Jit, + required TResult Function(PaymentKind_Spontaneous value) spontaneous, + required TResult Function(PaymentKind_Bolt12Offer value) bolt12Offer, + required TResult Function(PaymentKind_Bolt12Refund value) bolt12Refund, }) { - return channelReady(this); + return spontaneous(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_ChannelReady value)? channelReady, - TResult? Function(Event_ChannelClosed value)? channelClosed, - TResult? Function(Event_ChannelPending value)? channelPending, + TResult? mapOrNull({ + TResult? Function(PaymentKind_Onchain value)? onchain, + TResult? Function(PaymentKind_Bolt11 value)? bolt11, + TResult? Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult? Function(PaymentKind_Spontaneous value)? spontaneous, + TResult? Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult? Function(PaymentKind_Bolt12Refund value)? bolt12Refund, }) { - return channelReady?.call(this); + return spontaneous?.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_ChannelReady value)? channelReady, - TResult Function(Event_ChannelClosed value)? channelClosed, - TResult Function(Event_ChannelPending value)? channelPending, + TResult Function(PaymentKind_Onchain value)? onchain, + TResult Function(PaymentKind_Bolt11 value)? bolt11, + TResult Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult Function(PaymentKind_Spontaneous value)? spontaneous, + TResult Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult Function(PaymentKind_Bolt12Refund value)? bolt12Refund, required TResult orElse(), }) { - if (channelReady != null) { - return channelReady(this); + if (spontaneous != null) { + return spontaneous(this); } return orElse(); } } -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._(); +abstract class PaymentKind_Spontaneous extends PaymentKind { + const factory PaymentKind_Spontaneous( + {required final PaymentHash hash, + final PaymentPreimage? preimage}) = _$PaymentKind_SpontaneousImpl; + const PaymentKind_Spontaneous._() : super._(); - /// The channel_id of the channel. - ChannelId get channelId; + /// The payment hash, i.e., the hash of the `preimage`. + PaymentHash get hash; - /// The user_channel_id of the channel. - UserChannelId get userChannelId; - PublicKey? get counterpartyNodeId; + /// The pre-image used by the payment. + PaymentPreimage? get preimage; @JsonKey(ignore: true) - _$$Event_ChannelReadyImplCopyWith<_$Event_ChannelReadyImpl> get copyWith => - throw _privateConstructorUsedError; + _$$PaymentKind_SpontaneousImplCopyWith<_$PaymentKind_SpontaneousImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$Event_ChannelClosedImplCopyWith<$Res> { - factory _$$Event_ChannelClosedImplCopyWith(_$Event_ChannelClosedImpl value, - $Res Function(_$Event_ChannelClosedImpl) then) = - __$$Event_ChannelClosedImplCopyWithImpl<$Res>; +abstract class _$$PaymentKind_Bolt12OfferImplCopyWith<$Res> { + factory _$$PaymentKind_Bolt12OfferImplCopyWith( + _$PaymentKind_Bolt12OfferImpl value, + $Res Function(_$PaymentKind_Bolt12OfferImpl) then) = + __$$PaymentKind_Bolt12OfferImplCopyWithImpl<$Res>; @useResult $Res call( - {ChannelId channelId, - UserChannelId userChannelId, - PublicKey? counterpartyNodeId}); + {PaymentHash? hash, + PaymentPreimage? preimage, + PaymentSecret? secret, + OfferId offerId}); } /// @nodoc -class __$$Event_ChannelClosedImplCopyWithImpl<$Res> - extends _$EventCopyWithImpl<$Res, _$Event_ChannelClosedImpl> - implements _$$Event_ChannelClosedImplCopyWith<$Res> { - __$$Event_ChannelClosedImplCopyWithImpl(_$Event_ChannelClosedImpl _value, - $Res Function(_$Event_ChannelClosedImpl) _then) +class __$$PaymentKind_Bolt12OfferImplCopyWithImpl<$Res> + extends _$PaymentKindCopyWithImpl<$Res, _$PaymentKind_Bolt12OfferImpl> + implements _$$PaymentKind_Bolt12OfferImplCopyWith<$Res> { + __$$PaymentKind_Bolt12OfferImplCopyWithImpl( + _$PaymentKind_Bolt12OfferImpl _value, + $Res Function(_$PaymentKind_Bolt12OfferImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override $Res call({ - Object? channelId = null, - Object? userChannelId = null, - Object? counterpartyNodeId = 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?, + Object? hash = freezed, + Object? preimage = freezed, + Object? secret = freezed, + Object? offerId = null, + }) { + return _then(_$PaymentKind_Bolt12OfferImpl( + hash: freezed == hash + ? _value.hash + : hash // ignore: cast_nullable_to_non_nullable + as PaymentHash?, + preimage: freezed == preimage + ? _value.preimage + : preimage // ignore: cast_nullable_to_non_nullable + as PaymentPreimage?, + secret: freezed == secret + ? _value.secret + : secret // ignore: cast_nullable_to_non_nullable + as PaymentSecret?, + offerId: null == offerId + ? _value.offerId + : offerId // ignore: cast_nullable_to_non_nullable + as OfferId, )); } } /// @nodoc -class _$Event_ChannelClosedImpl extends Event_ChannelClosed { - const _$Event_ChannelClosedImpl( - {required this.channelId, - required this.userChannelId, - this.counterpartyNodeId}) +class _$PaymentKind_Bolt12OfferImpl extends PaymentKind_Bolt12Offer { + const _$PaymentKind_Bolt12OfferImpl( + {this.hash, this.preimage, this.secret, required this.offerId}) : super._(); - /// The channel_id of the channel. + /// The payment hash, i.e., the hash of the `preimage`. @override - final ChannelId channelId; + final PaymentHash? hash; - /// The user_channel_id of the channel. + /// The pre-image used by the payment. @override - final UserChannelId userChannelId; + final PaymentPreimage? preimage; + + /// The secret used by the payment. @override - final PublicKey? counterpartyNodeId; + final PaymentSecret? secret; + + /// The ID of the offer this payment is for. + @override + final OfferId offerId; @override String toString() { - return 'Event.channelClosed(channelId: $channelId, userChannelId: $userChannelId, counterpartyNodeId: $counterpartyNodeId)'; + return 'PaymentKind.bolt12Offer(hash: $hash, preimage: $preimage, secret: $secret, offerId: $offerId)'; } @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)); + other is _$PaymentKind_Bolt12OfferImpl && + (identical(other.hash, hash) || other.hash == hash) && + (identical(other.preimage, preimage) || + other.preimage == preimage) && + (identical(other.secret, secret) || other.secret == secret) && + (identical(other.offerId, offerId) || other.offerId == offerId)); } @override - int get hashCode => - Object.hash(runtimeType, channelId, userChannelId, counterpartyNodeId); + int get hashCode => Object.hash(runtimeType, hash, preimage, secret, offerId); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$Event_ChannelClosedImplCopyWith<_$Event_ChannelClosedImpl> get copyWith => - __$$Event_ChannelClosedImplCopyWithImpl<_$Event_ChannelClosedImpl>( - this, _$identity); + _$$PaymentKind_Bolt12OfferImplCopyWith<_$PaymentKind_Bolt12OfferImpl> + get copyWith => __$$PaymentKind_Bolt12OfferImplCopyWithImpl< + _$PaymentKind_Bolt12OfferImpl>(this, _$identity); @override @optionalTypeArgs TResult when({ - 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() onchain, required TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo) - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt11, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits) + bolt11Jit, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage) + spontaneous, + required TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId) + bolt12Offer, + required TResult Function( + PaymentHash? hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt12Refund, }) { - return channelClosed(channelId, userChannelId, counterpartyNodeId); + return bolt12Offer(hash, preimage, secret, offerId); } @override @optionalTypeArgs TResult? whenOrNull({ - 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()? onchain, TResult? Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, }) { - return channelClosed?.call(channelId, userChannelId, counterpartyNodeId); + return bolt12Offer?.call(hash, preimage, secret, offerId); } @override @optionalTypeArgs TResult maybeWhen({ - 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()? onchain, TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, required TResult orElse(), }) { - if (channelClosed != null) { - return channelClosed(channelId, userChannelId, counterpartyNodeId); + if (bolt12Offer != null) { + return bolt12Offer(hash, preimage, secret, offerId); } return orElse(); } @@ -1874,260 +9815,223 @@ class _$Event_ChannelClosedImpl extends Event_ChannelClosed { @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_ChannelReady value) channelReady, - required TResult Function(Event_ChannelClosed value) channelClosed, - required TResult Function(Event_ChannelPending value) channelPending, + required TResult Function(PaymentKind_Onchain value) onchain, + required TResult Function(PaymentKind_Bolt11 value) bolt11, + required TResult Function(PaymentKind_Bolt11Jit value) bolt11Jit, + required TResult Function(PaymentKind_Spontaneous value) spontaneous, + required TResult Function(PaymentKind_Bolt12Offer value) bolt12Offer, + required TResult Function(PaymentKind_Bolt12Refund value) bolt12Refund, }) { - return channelClosed(this); + return bolt12Offer(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_ChannelReady value)? channelReady, - TResult? Function(Event_ChannelClosed value)? channelClosed, - TResult? Function(Event_ChannelPending value)? channelPending, + TResult? Function(PaymentKind_Onchain value)? onchain, + TResult? Function(PaymentKind_Bolt11 value)? bolt11, + TResult? Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult? Function(PaymentKind_Spontaneous value)? spontaneous, + TResult? Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult? Function(PaymentKind_Bolt12Refund value)? bolt12Refund, }) { - return channelClosed?.call(this); + return bolt12Offer?.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_ChannelReady value)? channelReady, - TResult Function(Event_ChannelClosed value)? channelClosed, - TResult Function(Event_ChannelPending value)? channelPending, + TResult Function(PaymentKind_Onchain value)? onchain, + TResult Function(PaymentKind_Bolt11 value)? bolt11, + TResult Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult Function(PaymentKind_Spontaneous value)? spontaneous, + TResult Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult Function(PaymentKind_Bolt12Refund value)? bolt12Refund, required TResult orElse(), }) { - if (channelClosed != null) { - return channelClosed(this); + if (bolt12Offer != null) { + return bolt12Offer(this); } return orElse(); } } -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._(); +abstract class PaymentKind_Bolt12Offer extends PaymentKind { + const factory PaymentKind_Bolt12Offer( + {final PaymentHash? hash, + final PaymentPreimage? preimage, + final PaymentSecret? secret, + required final OfferId offerId}) = _$PaymentKind_Bolt12OfferImpl; + const PaymentKind_Bolt12Offer._() : super._(); - /// The channel_id of the channel. - ChannelId get channelId; + /// The payment hash, i.e., the hash of the `preimage`. + PaymentHash? get hash; - /// The user_channel_id of the channel. - UserChannelId get userChannelId; - PublicKey? get counterpartyNodeId; + /// The pre-image used by the payment. + PaymentPreimage? get preimage; + + /// The secret used by the payment. + PaymentSecret? get secret; + + /// The ID of the offer this payment is for. + OfferId get offerId; @JsonKey(ignore: true) - _$$Event_ChannelClosedImplCopyWith<_$Event_ChannelClosedImpl> get copyWith => - throw _privateConstructorUsedError; + _$$PaymentKind_Bolt12OfferImplCopyWith<_$PaymentKind_Bolt12OfferImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$Event_ChannelPendingImplCopyWith<$Res> { - factory _$$Event_ChannelPendingImplCopyWith(_$Event_ChannelPendingImpl value, - $Res Function(_$Event_ChannelPendingImpl) then) = - __$$Event_ChannelPendingImplCopyWithImpl<$Res>; +abstract class _$$PaymentKind_Bolt12RefundImplCopyWith<$Res> { + factory _$$PaymentKind_Bolt12RefundImplCopyWith( + _$PaymentKind_Bolt12RefundImpl value, + $Res Function(_$PaymentKind_Bolt12RefundImpl) then) = + __$$PaymentKind_Bolt12RefundImplCopyWithImpl<$Res>; @useResult $Res call( - {ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo}); + {PaymentHash? hash, PaymentPreimage? preimage, PaymentSecret? secret}); } /// @nodoc -class __$$Event_ChannelPendingImplCopyWithImpl<$Res> - extends _$EventCopyWithImpl<$Res, _$Event_ChannelPendingImpl> - implements _$$Event_ChannelPendingImplCopyWith<$Res> { - __$$Event_ChannelPendingImplCopyWithImpl(_$Event_ChannelPendingImpl _value, - $Res Function(_$Event_ChannelPendingImpl) _then) +class __$$PaymentKind_Bolt12RefundImplCopyWithImpl<$Res> + extends _$PaymentKindCopyWithImpl<$Res, _$PaymentKind_Bolt12RefundImpl> + implements _$$PaymentKind_Bolt12RefundImplCopyWith<$Res> { + __$$PaymentKind_Bolt12RefundImplCopyWithImpl( + _$PaymentKind_Bolt12RefundImpl _value, + $Res Function(_$PaymentKind_Bolt12RefundImpl) _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, + Object? hash = freezed, + Object? preimage = freezed, + Object? secret = freezed, + }) { + return _then(_$PaymentKind_Bolt12RefundImpl( + hash: freezed == hash + ? _value.hash + : hash // ignore: cast_nullable_to_non_nullable + as PaymentHash?, + preimage: freezed == preimage + ? _value.preimage + : preimage // ignore: cast_nullable_to_non_nullable + as PaymentPreimage?, + secret: freezed == secret + ? _value.secret + : secret // ignore: cast_nullable_to_non_nullable + as PaymentSecret?, )); } } /// @nodoc -class _$Event_ChannelPendingImpl extends Event_ChannelPending { - const _$Event_ChannelPendingImpl( - {required this.channelId, - required this.userChannelId, - required this.formerTemporaryChannelId, - required this.counterpartyNodeId, - required this.fundingTxo}) +class _$PaymentKind_Bolt12RefundImpl extends PaymentKind_Bolt12Refund { + const _$PaymentKind_Bolt12RefundImpl({this.hash, this.preimage, this.secret}) : super._(); - /// 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. + /// The payment hash, i.e., the hash of the `preimage`. @override - final ChannelId formerTemporaryChannelId; + final PaymentHash? hash; - /// The node_id of the channel counterparty. + /// The pre-image used by the payment. @override - final PublicKey counterpartyNodeId; + final PaymentPreimage? preimage; - /// The outpoint of the channel's funding transaction. + /// The secret used by the payment. @override - final OutPoint fundingTxo; + final PaymentSecret? secret; @override String toString() { - return 'Event.channelPending(channelId: $channelId, userChannelId: $userChannelId, formerTemporaryChannelId: $formerTemporaryChannelId, counterpartyNodeId: $counterpartyNodeId, fundingTxo: $fundingTxo)'; + return 'PaymentKind.bolt12Refund(hash: $hash, preimage: $preimage, secret: $secret)'; } @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)); + other is _$PaymentKind_Bolt12RefundImpl && + (identical(other.hash, hash) || other.hash == hash) && + (identical(other.preimage, preimage) || + other.preimage == preimage) && + (identical(other.secret, secret) || other.secret == secret)); } @override - int get hashCode => Object.hash(runtimeType, channelId, userChannelId, - formerTemporaryChannelId, counterpartyNodeId, fundingTxo); + int get hashCode => Object.hash(runtimeType, hash, preimage, secret); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$Event_ChannelPendingImplCopyWith<_$Event_ChannelPendingImpl> - get copyWith => - __$$Event_ChannelPendingImplCopyWithImpl<_$Event_ChannelPendingImpl>( - this, _$identity); + _$$PaymentKind_Bolt12RefundImplCopyWith<_$PaymentKind_Bolt12RefundImpl> + get copyWith => __$$PaymentKind_Bolt12RefundImplCopyWithImpl< + _$PaymentKind_Bolt12RefundImpl>(this, _$identity); @override @optionalTypeArgs TResult when({ - 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() onchain, required TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo) - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt11, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits) + bolt11Jit, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage) + spontaneous, + required TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId) + bolt12Offer, + required TResult Function( + PaymentHash? hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt12Refund, }) { - return channelPending(channelId, userChannelId, formerTemporaryChannelId, - counterpartyNodeId, fundingTxo); + return bolt12Refund(hash, preimage, secret); } @override - @optionalTypeArgs - TResult? whenOrNull({ - 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, - OutPoint fundingTxo)? - channelPending, + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? onchain, + TResult? Function( + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, }) { - return channelPending?.call(channelId, userChannelId, - formerTemporaryChannelId, counterpartyNodeId, fundingTxo); + return bolt12Refund?.call(hash, preimage, secret); } @override @optionalTypeArgs TResult maybeWhen({ - 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()? onchain, TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, required TResult orElse(), }) { - if (channelPending != null) { - return channelPending(channelId, userChannelId, formerTemporaryChannelId, - counterpartyNodeId, fundingTxo); + if (bolt12Refund != null) { + return bolt12Refund(hash, preimage, secret); } return orElse(); } @@ -2135,342 +10039,341 @@ class _$Event_ChannelPendingImpl extends Event_ChannelPending { @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_ChannelReady value) channelReady, - required TResult Function(Event_ChannelClosed value) channelClosed, - required TResult Function(Event_ChannelPending value) channelPending, + required TResult Function(PaymentKind_Onchain value) onchain, + required TResult Function(PaymentKind_Bolt11 value) bolt11, + required TResult Function(PaymentKind_Bolt11Jit value) bolt11Jit, + required TResult Function(PaymentKind_Spontaneous value) spontaneous, + required TResult Function(PaymentKind_Bolt12Offer value) bolt12Offer, + required TResult Function(PaymentKind_Bolt12Refund value) bolt12Refund, }) { - return channelPending(this); + return bolt12Refund(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_ChannelReady value)? channelReady, - TResult? Function(Event_ChannelClosed value)? channelClosed, - TResult? Function(Event_ChannelPending value)? channelPending, + TResult? Function(PaymentKind_Onchain value)? onchain, + TResult? Function(PaymentKind_Bolt11 value)? bolt11, + TResult? Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult? Function(PaymentKind_Spontaneous value)? spontaneous, + TResult? Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult? Function(PaymentKind_Bolt12Refund value)? bolt12Refund, }) { - return channelPending?.call(this); + return bolt12Refund?.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_ChannelReady value)? channelReady, - TResult Function(Event_ChannelClosed value)? channelClosed, - TResult Function(Event_ChannelPending value)? channelPending, + TResult Function(PaymentKind_Onchain value)? onchain, + TResult Function(PaymentKind_Bolt11 value)? bolt11, + TResult Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult Function(PaymentKind_Spontaneous value)? spontaneous, + TResult Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult Function(PaymentKind_Bolt12Refund value)? bolt12Refund, required TResult orElse(), }) { - if (channelPending != null) { - return channelPending(this); + if (bolt12Refund != null) { + return bolt12Refund(this); } return orElse(); } } -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 channel_id of the channel. - ChannelId get channelId; - - /// The user_channel_id of the channel. - UserChannelId get userChannelId; +abstract class PaymentKind_Bolt12Refund extends PaymentKind { + const factory PaymentKind_Bolt12Refund( + {final PaymentHash? hash, + final PaymentPreimage? preimage, + final PaymentSecret? secret}) = _$PaymentKind_Bolt12RefundImpl; + const PaymentKind_Bolt12Refund._() : super._(); - /// The temporary_channel_id this channel used to be known by during channel establishment. - ChannelId get formerTemporaryChannelId; + /// The payment hash, i.e., the hash of the `preimage`. + PaymentHash? get hash; - /// The node_id of the channel counterparty. - PublicKey get counterpartyNodeId; + /// The pre-image used by the payment. + PaymentPreimage? get preimage; - /// The outpoint of the channel's funding transaction. - OutPoint get fundingTxo; + /// The secret used by the payment. + PaymentSecret? get secret; @JsonKey(ignore: true) - _$$Event_ChannelPendingImplCopyWith<_$Event_ChannelPendingImpl> + _$$PaymentKind_Bolt12RefundImplCopyWith<_$PaymentKind_Bolt12RefundImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -mixin _$GossipSourceConfig { +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. + BigInt get amountSatoshis => throw _privateConstructorUsedError; @optionalTypeArgs TResult when({ - required TResult Function() p2PNetwork, - required TResult Function(String field0) rapidGossipSync, + required TResult Function(ChannelId? channelId, BigInt amountSatoshis) + pendingBroadcast, + required TResult Function(ChannelId? channelId, int latestBroadcastHeight, + Txid latestSpendingTxid, BigInt amountSatoshis) + broadcastAwaitingConfirmation, + required TResult Function( + ChannelId? channelId, + Txid latestSpendingTxid, + String confirmationHash, + int confirmationHeight, + BigInt amountSatoshis) + awaitingThresholdConfirmations, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult? whenOrNull({ - TResult? Function()? p2PNetwork, - TResult? Function(String field0)? rapidGossipSync, + TResult? Function(ChannelId? channelId, BigInt amountSatoshis)? + pendingBroadcast, + TResult? Function(ChannelId? channelId, int latestBroadcastHeight, + Txid latestSpendingTxid, BigInt amountSatoshis)? + broadcastAwaitingConfirmation, + TResult? Function( + ChannelId? channelId, + Txid latestSpendingTxid, + String confirmationHash, + int confirmationHeight, + BigInt amountSatoshis)? + awaitingThresholdConfirmations, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult maybeWhen({ - TResult Function()? p2PNetwork, - TResult Function(String field0)? rapidGossipSync, + TResult Function(ChannelId? channelId, BigInt amountSatoshis)? + pendingBroadcast, + TResult Function(ChannelId? channelId, int latestBroadcastHeight, + Txid latestSpendingTxid, BigInt amountSatoshis)? + broadcastAwaitingConfirmation, + TResult Function( + ChannelId? channelId, + Txid latestSpendingTxid, + String confirmationHash, + int confirmationHeight, + BigInt amountSatoshis)? + awaitingThresholdConfirmations, required TResult orElse(), }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult map({ - required TResult Function(GossipSourceConfig_P2PNetwork value) p2PNetwork, - required TResult Function(GossipSourceConfig_RapidGossipSync value) - rapidGossipSync, + 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(GossipSourceConfig_P2PNetwork value)? p2PNetwork, - TResult? Function(GossipSourceConfig_RapidGossipSync value)? - rapidGossipSync, + 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(GossipSourceConfig_P2PNetwork value)? p2PNetwork, - TResult Function(GossipSourceConfig_RapidGossipSync value)? rapidGossipSync, + 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 $GossipSourceConfigCopyWith<$Res> { - factory $GossipSourceConfigCopyWith( - GossipSourceConfig value, $Res Function(GossipSourceConfig) then) = - _$GossipSourceConfigCopyWithImpl<$Res, GossipSourceConfig>; +abstract class $PendingSweepBalanceCopyWith<$Res> { + factory $PendingSweepBalanceCopyWith( + PendingSweepBalance value, $Res Function(PendingSweepBalance) then) = + _$PendingSweepBalanceCopyWithImpl<$Res, PendingSweepBalance>; + @useResult + $Res call({ChannelId? channelId, BigInt amountSatoshis}); } /// @nodoc -class _$GossipSourceConfigCopyWithImpl<$Res, $Val extends GossipSourceConfig> - implements $GossipSourceConfigCopyWith<$Res> { - _$GossipSourceConfigCopyWithImpl(this._value, this._then); +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; -} - -/// @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 - extends GossipSourceConfig_P2PNetwork { - const _$GossipSourceConfig_P2PNetworkImpl() : super._(); - - @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); - } + @pragma('vm:prefer-inline') @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(GossipSourceConfig_P2PNetwork value)? p2PNetwork, - TResult Function(GossipSourceConfig_RapidGossipSync value)? rapidGossipSync, - required TResult orElse(), + $Res call({ + Object? channelId = freezed, + Object? amountSatoshis = null, }) { - if (p2PNetwork != null) { - return p2PNetwork(this); - } - return orElse(); + 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 BigInt, + ) as $Val); } } -abstract class GossipSourceConfig_P2PNetwork extends GossipSourceConfig { - const factory GossipSourceConfig_P2PNetwork() = - _$GossipSourceConfig_P2PNetworkImpl; - const GossipSourceConfig_P2PNetwork._() : super._(); -} - /// @nodoc -abstract class _$$GossipSourceConfig_RapidGossipSyncImplCopyWith<$Res> { - factory _$$GossipSourceConfig_RapidGossipSyncImplCopyWith( - _$GossipSourceConfig_RapidGossipSyncImpl value, - $Res Function(_$GossipSourceConfig_RapidGossipSyncImpl) then) = - __$$GossipSourceConfig_RapidGossipSyncImplCopyWithImpl<$Res>; +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({String field0}); + $Res call({ChannelId? channelId, BigInt amountSatoshis}); } /// @nodoc -class __$$GossipSourceConfig_RapidGossipSyncImplCopyWithImpl<$Res> - extends _$GossipSourceConfigCopyWithImpl<$Res, - _$GossipSourceConfig_RapidGossipSyncImpl> - implements _$$GossipSourceConfig_RapidGossipSyncImplCopyWith<$Res> { - __$$GossipSourceConfig_RapidGossipSyncImplCopyWithImpl( - _$GossipSourceConfig_RapidGossipSyncImpl _value, - $Res Function(_$GossipSourceConfig_RapidGossipSyncImpl) _then) +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? field0 = null, + Object? channelId = freezed, + Object? amountSatoshis = null, }) { - return _then(_$GossipSourceConfig_RapidGossipSyncImpl( - null == field0 - ? _value.field0 - : field0 // ignore: cast_nullable_to_non_nullable - as String, + 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 BigInt, )); } } /// @nodoc -class _$GossipSourceConfig_RapidGossipSyncImpl - extends GossipSourceConfig_RapidGossipSync { - const _$GossipSourceConfig_RapidGossipSyncImpl(this.field0) : super._(); +class _$PendingSweepBalance_PendingBroadcastImpl + extends PendingSweepBalance_PendingBroadcast { + const _$PendingSweepBalance_PendingBroadcastImpl( + {this.channelId, required this.amountSatoshis}) + : super._(); + /// The identifier of the channel this balance belongs to. @override - final String field0; + final ChannelId? channelId; + + /// The amount, in satoshis, of the output being swept. + @override + final BigInt amountSatoshis; @override String toString() { - return 'GossipSourceConfig.rapidGossipSync(field0: $field0)'; + return 'PendingSweepBalance.pendingBroadcast(channelId: $channelId, amountSatoshis: $amountSatoshis)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$GossipSourceConfig_RapidGossipSyncImpl && - (identical(other.field0, field0) || other.field0 == field0)); + 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, field0); + int get hashCode => Object.hash(runtimeType, channelId, amountSatoshis); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$GossipSourceConfig_RapidGossipSyncImplCopyWith< - _$GossipSourceConfig_RapidGossipSyncImpl> - get copyWith => __$$GossipSourceConfig_RapidGossipSyncImplCopyWithImpl< - _$GossipSourceConfig_RapidGossipSyncImpl>(this, _$identity); + _$$PendingSweepBalance_PendingBroadcastImplCopyWith< + _$PendingSweepBalance_PendingBroadcastImpl> + get copyWith => __$$PendingSweepBalance_PendingBroadcastImplCopyWithImpl< + _$PendingSweepBalance_PendingBroadcastImpl>(this, _$identity); @override @optionalTypeArgs TResult when({ - required TResult Function() p2PNetwork, - required TResult Function(String field0) rapidGossipSync, + required TResult Function(ChannelId? channelId, BigInt amountSatoshis) + pendingBroadcast, + required TResult Function(ChannelId? channelId, int latestBroadcastHeight, + Txid latestSpendingTxid, BigInt amountSatoshis) + broadcastAwaitingConfirmation, + required TResult Function( + ChannelId? channelId, + Txid latestSpendingTxid, + String confirmationHash, + int confirmationHeight, + BigInt amountSatoshis) + awaitingThresholdConfirmations, }) { - return rapidGossipSync(field0); + return pendingBroadcast(channelId, amountSatoshis); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function()? p2PNetwork, - TResult? Function(String field0)? rapidGossipSync, + TResult? Function(ChannelId? channelId, BigInt amountSatoshis)? + pendingBroadcast, + TResult? Function(ChannelId? channelId, int latestBroadcastHeight, + Txid latestSpendingTxid, BigInt amountSatoshis)? + broadcastAwaitingConfirmation, + TResult? Function( + ChannelId? channelId, + Txid latestSpendingTxid, + String confirmationHash, + int confirmationHeight, + BigInt amountSatoshis)? + awaitingThresholdConfirmations, }) { - return rapidGossipSync?.call(field0); + return pendingBroadcast?.call(channelId, amountSatoshis); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function()? p2PNetwork, - TResult Function(String field0)? rapidGossipSync, + TResult Function(ChannelId? channelId, BigInt amountSatoshis)? + pendingBroadcast, + TResult Function(ChannelId? channelId, int latestBroadcastHeight, + Txid latestSpendingTxid, BigInt amountSatoshis)? + broadcastAwaitingConfirmation, + TResult Function( + ChannelId? channelId, + Txid latestSpendingTxid, + String confirmationHash, + int confirmationHeight, + BigInt amountSatoshis)? + awaitingThresholdConfirmations, required TResult orElse(), }) { - if (rapidGossipSync != null) { - return rapidGossipSync(field0); + if (pendingBroadcast != null) { + return pendingBroadcast(channelId, amountSatoshis); } return orElse(); } @@ -2478,229 +10381,252 @@ class _$GossipSourceConfig_RapidGossipSyncImpl @override @optionalTypeArgs TResult map({ - required TResult Function(GossipSourceConfig_P2PNetwork value) p2PNetwork, - required TResult Function(GossipSourceConfig_RapidGossipSync value) - rapidGossipSync, + required TResult Function(PendingSweepBalance_PendingBroadcast value) + pendingBroadcast, + required TResult Function( + PendingSweepBalance_BroadcastAwaitingConfirmation value) + broadcastAwaitingConfirmation, + required TResult Function( + PendingSweepBalance_AwaitingThresholdConfirmations value) + awaitingThresholdConfirmations, }) { - return rapidGossipSync(this); + return pendingBroadcast(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(GossipSourceConfig_P2PNetwork value)? p2PNetwork, - TResult? Function(GossipSourceConfig_RapidGossipSync value)? - rapidGossipSync, + TResult? Function(PendingSweepBalance_PendingBroadcast value)? + pendingBroadcast, + TResult? Function(PendingSweepBalance_BroadcastAwaitingConfirmation value)? + broadcastAwaitingConfirmation, + TResult? Function(PendingSweepBalance_AwaitingThresholdConfirmations value)? + awaitingThresholdConfirmations, }) { - return rapidGossipSync?.call(this); + return pendingBroadcast?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(GossipSourceConfig_P2PNetwork value)? p2PNetwork, - TResult Function(GossipSourceConfig_RapidGossipSync value)? rapidGossipSync, + TResult Function(PendingSweepBalance_PendingBroadcast value)? + pendingBroadcast, + TResult Function(PendingSweepBalance_BroadcastAwaitingConfirmation value)? + broadcastAwaitingConfirmation, + TResult Function(PendingSweepBalance_AwaitingThresholdConfirmations value)? + awaitingThresholdConfirmations, required TResult orElse(), }) { - if (rapidGossipSync != null) { - return rapidGossipSync(this); + if (pendingBroadcast != null) { + return pendingBroadcast(this); } return orElse(); } } -abstract class GossipSourceConfig_RapidGossipSync extends GossipSourceConfig { - const factory GossipSourceConfig_RapidGossipSync(final String field0) = - _$GossipSourceConfig_RapidGossipSyncImpl; - const GossipSourceConfig_RapidGossipSync._() : super._(); +abstract class PendingSweepBalance_PendingBroadcast + extends PendingSweepBalance { + const factory PendingSweepBalance_PendingBroadcast( + {final ChannelId? channelId, required final BigInt amountSatoshis}) = + _$PendingSweepBalance_PendingBroadcastImpl; + const PendingSweepBalance_PendingBroadcast._() : super._(); - String get field0; - @JsonKey(ignore: true) - _$$GossipSourceConfig_RapidGossipSyncImplCopyWith< - _$GossipSourceConfig_RapidGossipSyncImpl> - get copyWith => throw _privateConstructorUsedError; -} + @override -/// @nodoc -mixin _$MaxDustHTLCExposure { - int get field0 => throw _privateConstructorUsedError; - @optionalTypeArgs - TResult when({ - required TResult Function(int field0) fixedLimitMsat, - required TResult Function(int field0) feeRateMultiplier, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(int field0)? fixedLimitMsat, - TResult? Function(int field0)? feeRateMultiplier, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(int field0)? fixedLimitMsat, - TResult Function(int field0)? feeRateMultiplier, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(MaxDustHTLCExposure_FixedLimitMsat value) - fixedLimitMsat, - required TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value) - feeRateMultiplier, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, - TResult? Function(MaxDustHTLCExposure_FeeRateMultiplier value)? - feeRateMultiplier, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - TResult Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, - TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value)? - feeRateMultiplier, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; + /// The identifier of the channel this balance belongs to. + ChannelId? get channelId; + @override + /// The amount, in satoshis, of the output being swept. + BigInt get amountSatoshis; + @override @JsonKey(ignore: true) - $MaxDustHTLCExposureCopyWith get copyWith => - throw _privateConstructorUsedError; + _$$PendingSweepBalance_PendingBroadcastImplCopyWith< + _$PendingSweepBalance_PendingBroadcastImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $MaxDustHTLCExposureCopyWith<$Res> { - factory $MaxDustHTLCExposureCopyWith( - MaxDustHTLCExposure value, $Res Function(MaxDustHTLCExposure) then) = - _$MaxDustHTLCExposureCopyWithImpl<$Res, MaxDustHTLCExposure>; +abstract class _$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWith< + $Res> implements $PendingSweepBalanceCopyWith<$Res> { + factory _$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWith( + _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl value, + $Res Function(_$PendingSweepBalance_BroadcastAwaitingConfirmationImpl) + then) = + __$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWithImpl< + $Res>; + @override @useResult - $Res call({int field0}); + $Res call( + {ChannelId? channelId, + int latestBroadcastHeight, + Txid latestSpendingTxid, + BigInt amountSatoshis}); } /// @nodoc -class _$MaxDustHTLCExposureCopyWithImpl<$Res, $Val extends MaxDustHTLCExposure> - implements $MaxDustHTLCExposureCopyWith<$Res> { - _$MaxDustHTLCExposureCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; +class __$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWithImpl< + $Res> + extends _$PendingSweepBalanceCopyWithImpl<$Res, + _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl> + implements + _$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWith<$Res> { + __$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWithImpl( + _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl _value, + $Res Function(_$PendingSweepBalance_BroadcastAwaitingConfirmationImpl) + _then) + : super(_value, _then); @pragma('vm:prefer-inline') @override $Res call({ - Object? field0 = null, + Object? channelId = freezed, + Object? latestBroadcastHeight = null, + Object? latestSpendingTxid = null, + Object? amountSatoshis = null, }) { - return _then(_value.copyWith( - field0: null == field0 - ? _value.field0 - : field0 // ignore: cast_nullable_to_non_nullable + 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, - ) as $Val); + 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 + as BigInt, + )); } } /// @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}); -} -/// @nodoc -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); +class _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl + extends PendingSweepBalance_BroadcastAwaitingConfirmation { + const _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl( + {this.channelId, + required this.latestBroadcastHeight, + required this.latestSpendingTxid, + required this.amountSatoshis}) + : super._(); - @pragma('vm:prefer-inline') + /// The identifier of the channel this balance belongs to. @override - $Res call({ - Object? field0 = null, - }) { - return _then(_$MaxDustHTLCExposure_FixedLimitMsatImpl( - null == field0 - ? _value.field0 - : field0 // ignore: cast_nullable_to_non_nullable - as int, - )); - } -} + final ChannelId? channelId; -/// @nodoc + /// The best height when we last broadcast a transaction spending the output being swept. + @override + final int latestBroadcastHeight; -class _$MaxDustHTLCExposure_FixedLimitMsatImpl - extends MaxDustHTLCExposure_FixedLimitMsat { - const _$MaxDustHTLCExposure_FixedLimitMsatImpl(this.field0) : super._(); + /// The identifier of the transaction spending the swept output we last broadcast. + @override + final Txid latestSpendingTxid; + /// The amount, in satoshis, of the output being swept. @override - final int field0; + final BigInt amountSatoshis; @override String toString() { - return 'MaxDustHTLCExposure.fixedLimitMsat(field0: $field0)'; + return 'PendingSweepBalance.broadcastAwaitingConfirmation(channelId: $channelId, latestBroadcastHeight: $latestBroadcastHeight, latestSpendingTxid: $latestSpendingTxid, amountSatoshis: $amountSatoshis)'; } @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 _$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)); } @override - int get hashCode => Object.hash(runtimeType, field0); + int get hashCode => Object.hash(runtimeType, channelId, latestBroadcastHeight, + latestSpendingTxid, amountSatoshis); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWith< - _$MaxDustHTLCExposure_FixedLimitMsatImpl> - get copyWith => __$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWithImpl< - _$MaxDustHTLCExposure_FixedLimitMsatImpl>(this, _$identity); + _$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWith< + _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl> + get copyWith => + __$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWithImpl< + _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl>( + this, _$identity); @override @optionalTypeArgs TResult when({ - required TResult Function(int field0) fixedLimitMsat, - required TResult Function(int field0) feeRateMultiplier, + required TResult Function(ChannelId? channelId, BigInt amountSatoshis) + pendingBroadcast, + required TResult Function(ChannelId? channelId, int latestBroadcastHeight, + Txid latestSpendingTxid, BigInt amountSatoshis) + broadcastAwaitingConfirmation, + required TResult Function( + ChannelId? channelId, + Txid latestSpendingTxid, + String confirmationHash, + int confirmationHeight, + BigInt amountSatoshis) + awaitingThresholdConfirmations, }) { - return fixedLimitMsat(field0); + return broadcastAwaitingConfirmation( + channelId, latestBroadcastHeight, latestSpendingTxid, amountSatoshis); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(int field0)? fixedLimitMsat, - TResult? Function(int field0)? feeRateMultiplier, + TResult? Function(ChannelId? channelId, BigInt amountSatoshis)? + pendingBroadcast, + TResult? Function(ChannelId? channelId, int latestBroadcastHeight, + Txid latestSpendingTxid, BigInt amountSatoshis)? + broadcastAwaitingConfirmation, + TResult? Function( + ChannelId? channelId, + Txid latestSpendingTxid, + String confirmationHash, + int confirmationHeight, + BigInt amountSatoshis)? + awaitingThresholdConfirmations, }) { - return fixedLimitMsat?.call(field0); + return broadcastAwaitingConfirmation?.call( + channelId, latestBroadcastHeight, latestSpendingTxid, amountSatoshis); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(int field0)? fixedLimitMsat, - TResult Function(int field0)? feeRateMultiplier, + TResult Function(ChannelId? channelId, BigInt amountSatoshis)? + pendingBroadcast, + TResult Function(ChannelId? channelId, int latestBroadcastHeight, + Txid latestSpendingTxid, BigInt amountSatoshis)? + broadcastAwaitingConfirmation, + TResult Function( + ChannelId? channelId, + Txid latestSpendingTxid, + String confirmationHash, + int confirmationHeight, + BigInt amountSatoshis)? + awaitingThresholdConfirmations, required TResult orElse(), }) { - if (fixedLimitMsat != null) { - return fixedLimitMsat(field0); + if (broadcastAwaitingConfirmation != null) { + return broadcastAwaitingConfirmation( + channelId, latestBroadcastHeight, latestSpendingTxid, amountSatoshis); } return orElse(); } @@ -2708,149 +10634,276 @@ class _$MaxDustHTLCExposure_FixedLimitMsatImpl @override @optionalTypeArgs TResult map({ - required TResult Function(MaxDustHTLCExposure_FixedLimitMsat value) - fixedLimitMsat, - required TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value) - feeRateMultiplier, + required TResult Function(PendingSweepBalance_PendingBroadcast value) + pendingBroadcast, + required TResult Function( + PendingSweepBalance_BroadcastAwaitingConfirmation value) + broadcastAwaitingConfirmation, + required TResult Function( + PendingSweepBalance_AwaitingThresholdConfirmations value) + awaitingThresholdConfirmations, }) { - return fixedLimitMsat(this); + return broadcastAwaitingConfirmation(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, - TResult? Function(MaxDustHTLCExposure_FeeRateMultiplier value)? - feeRateMultiplier, + TResult? Function(PendingSweepBalance_PendingBroadcast value)? + pendingBroadcast, + TResult? Function(PendingSweepBalance_BroadcastAwaitingConfirmation value)? + broadcastAwaitingConfirmation, + TResult? Function(PendingSweepBalance_AwaitingThresholdConfirmations value)? + awaitingThresholdConfirmations, }) { - return fixedLimitMsat?.call(this); + return broadcastAwaitingConfirmation?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, - TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value)? - feeRateMultiplier, + TResult Function(PendingSweepBalance_PendingBroadcast value)? + pendingBroadcast, + TResult Function(PendingSweepBalance_BroadcastAwaitingConfirmation value)? + broadcastAwaitingConfirmation, + TResult Function(PendingSweepBalance_AwaitingThresholdConfirmations value)? + awaitingThresholdConfirmations, required TResult orElse(), }) { - if (fixedLimitMsat != null) { - return fixedLimitMsat(this); + if (broadcastAwaitingConfirmation != null) { + return broadcastAwaitingConfirmation(this); } return orElse(); } } -abstract class MaxDustHTLCExposure_FixedLimitMsat extends MaxDustHTLCExposure { - const factory MaxDustHTLCExposure_FixedLimitMsat(final int field0) = - _$MaxDustHTLCExposure_FixedLimitMsatImpl; - const MaxDustHTLCExposure_FixedLimitMsat._() : super._(); +abstract class PendingSweepBalance_BroadcastAwaitingConfirmation + extends PendingSweepBalance { + const factory PendingSweepBalance_BroadcastAwaitingConfirmation( + {final ChannelId? channelId, + required final int latestBroadcastHeight, + required final Txid latestSpendingTxid, + required final BigInt amountSatoshis}) = + _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl; + const PendingSweepBalance_BroadcastAwaitingConfirmation._() : super._(); + + @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; + + /// The identifier of the transaction spending the swept output we last broadcast. + Txid get latestSpendingTxid; @override - int get field0; + + /// The amount, in satoshis, of the output being swept. + BigInt get amountSatoshis; @override @JsonKey(ignore: true) - _$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWith< - _$MaxDustHTLCExposure_FixedLimitMsatImpl> + _$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWith< + _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWith<$Res> - implements $MaxDustHTLCExposureCopyWith<$Res> { - factory _$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWith( - _$MaxDustHTLCExposure_FeeRateMultiplierImpl value, - $Res Function(_$MaxDustHTLCExposure_FeeRateMultiplierImpl) then) = - __$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWithImpl<$Res>; +abstract class _$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWith< + $Res> implements $PendingSweepBalanceCopyWith<$Res> { + factory _$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWith( + _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl value, + $Res Function( + _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl) + then) = + __$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWithImpl< + $Res>; @override @useResult - $Res call({int field0}); + $Res call( + {ChannelId? channelId, + Txid latestSpendingTxid, + String confirmationHash, + int confirmationHeight, + BigInt amountSatoshis}); } /// @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 __$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWithImpl< + $Res> + extends _$PendingSweepBalanceCopyWithImpl<$Res, + _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl> + implements + _$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWith< + $Res> { + __$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWithImpl( + _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl _value, + $Res Function(_$PendingSweepBalance_AwaitingThresholdConfirmationsImpl) + _then) : super(_value, _then); @pragma('vm:prefer-inline') @override $Res call({ - Object? field0 = null, - }) { - return _then(_$MaxDustHTLCExposure_FeeRateMultiplierImpl( - null == field0 - ? _value.field0 - : field0 // ignore: cast_nullable_to_non_nullable + 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 + as BigInt, )); } } /// @nodoc -class _$MaxDustHTLCExposure_FeeRateMultiplierImpl - extends MaxDustHTLCExposure_FeeRateMultiplier { - const _$MaxDustHTLCExposure_FeeRateMultiplierImpl(this.field0) : super._(); +class _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl + extends PendingSweepBalance_AwaitingThresholdConfirmations { + const _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl( + {this.channelId, + required this.latestSpendingTxid, + required this.confirmationHash, + required this.confirmationHeight, + required this.amountSatoshis}) + : super._(); + + /// 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; + /// The amount, in satoshis, of the output being swept. @override - final int field0; + final BigInt amountSatoshis; @override String toString() { - return 'MaxDustHTLCExposure.feeRateMultiplier(field0: $field0)'; + return 'PendingSweepBalance.awaitingThresholdConfirmations(channelId: $channelId, latestSpendingTxid: $latestSpendingTxid, confirmationHash: $confirmationHash, confirmationHeight: $confirmationHeight, amountSatoshis: $amountSatoshis)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$MaxDustHTLCExposure_FeeRateMultiplierImpl && - (identical(other.field0, field0) || other.field0 == field0)); + 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)); } @override - int get hashCode => Object.hash(runtimeType, field0); + int get hashCode => Object.hash(runtimeType, channelId, latestSpendingTxid, + confirmationHash, confirmationHeight, amountSatoshis); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWith< - _$MaxDustHTLCExposure_FeeRateMultiplierImpl> - get copyWith => __$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWithImpl< - _$MaxDustHTLCExposure_FeeRateMultiplierImpl>(this, _$identity); + _$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWith< + _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl> + get copyWith => + __$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWithImpl< + _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl>( + this, _$identity); @override @optionalTypeArgs TResult when({ - required TResult Function(int field0) fixedLimitMsat, - required TResult Function(int field0) feeRateMultiplier, + required TResult Function(ChannelId? channelId, BigInt amountSatoshis) + pendingBroadcast, + required TResult Function(ChannelId? channelId, int latestBroadcastHeight, + Txid latestSpendingTxid, BigInt amountSatoshis) + broadcastAwaitingConfirmation, + required TResult Function( + ChannelId? channelId, + Txid latestSpendingTxid, + String confirmationHash, + int confirmationHeight, + BigInt amountSatoshis) + awaitingThresholdConfirmations, }) { - return feeRateMultiplier(field0); + return awaitingThresholdConfirmations(channelId, latestSpendingTxid, + confirmationHash, confirmationHeight, amountSatoshis); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(int field0)? fixedLimitMsat, - TResult? Function(int field0)? feeRateMultiplier, + TResult? Function(ChannelId? channelId, BigInt amountSatoshis)? + pendingBroadcast, + TResult? Function(ChannelId? channelId, int latestBroadcastHeight, + Txid latestSpendingTxid, BigInt amountSatoshis)? + broadcastAwaitingConfirmation, + TResult? Function( + ChannelId? channelId, + Txid latestSpendingTxid, + String confirmationHash, + int confirmationHeight, + BigInt amountSatoshis)? + awaitingThresholdConfirmations, }) { - return feeRateMultiplier?.call(field0); + return awaitingThresholdConfirmations?.call(channelId, latestSpendingTxid, + confirmationHash, confirmationHeight, amountSatoshis); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(int field0)? fixedLimitMsat, - TResult Function(int field0)? feeRateMultiplier, + TResult Function(ChannelId? channelId, BigInt amountSatoshis)? + pendingBroadcast, + TResult Function(ChannelId? channelId, int latestBroadcastHeight, + Txid latestSpendingTxid, BigInt amountSatoshis)? + broadcastAwaitingConfirmation, + TResult Function( + ChannelId? channelId, + Txid latestSpendingTxid, + String confirmationHash, + int confirmationHeight, + BigInt amountSatoshis)? + awaitingThresholdConfirmations, required TResult orElse(), }) { - if (feeRateMultiplier != null) { - return feeRateMultiplier(field0); + if (awaitingThresholdConfirmations != null) { + return awaitingThresholdConfirmations(channelId, latestSpendingTxid, + confirmationHash, confirmationHeight, amountSatoshis); } return orElse(); } @@ -2858,51 +10911,81 @@ class _$MaxDustHTLCExposure_FeeRateMultiplierImpl @override @optionalTypeArgs TResult map({ - required TResult Function(MaxDustHTLCExposure_FixedLimitMsat value) - fixedLimitMsat, - required TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value) - feeRateMultiplier, + required TResult Function(PendingSweepBalance_PendingBroadcast value) + pendingBroadcast, + required TResult Function( + PendingSweepBalance_BroadcastAwaitingConfirmation value) + broadcastAwaitingConfirmation, + required TResult Function( + PendingSweepBalance_AwaitingThresholdConfirmations value) + awaitingThresholdConfirmations, }) { - return feeRateMultiplier(this); + return awaitingThresholdConfirmations(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, - TResult? Function(MaxDustHTLCExposure_FeeRateMultiplier value)? - feeRateMultiplier, + TResult? Function(PendingSweepBalance_PendingBroadcast value)? + pendingBroadcast, + TResult? Function(PendingSweepBalance_BroadcastAwaitingConfirmation value)? + broadcastAwaitingConfirmation, + TResult? Function(PendingSweepBalance_AwaitingThresholdConfirmations value)? + awaitingThresholdConfirmations, }) { - return feeRateMultiplier?.call(this); + return awaitingThresholdConfirmations?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, - TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value)? - feeRateMultiplier, + TResult Function(PendingSweepBalance_PendingBroadcast value)? + pendingBroadcast, + TResult Function(PendingSweepBalance_BroadcastAwaitingConfirmation value)? + broadcastAwaitingConfirmation, + TResult Function(PendingSweepBalance_AwaitingThresholdConfirmations value)? + awaitingThresholdConfirmations, required TResult orElse(), }) { - if (feeRateMultiplier != null) { - return feeRateMultiplier(this); + if (awaitingThresholdConfirmations != null) { + return awaitingThresholdConfirmations(this); } return orElse(); } } -abstract class MaxDustHTLCExposure_FeeRateMultiplier - extends MaxDustHTLCExposure { - const factory MaxDustHTLCExposure_FeeRateMultiplier(final int field0) = - _$MaxDustHTLCExposure_FeeRateMultiplierImpl; - const MaxDustHTLCExposure_FeeRateMultiplier._() : super._(); +abstract class PendingSweepBalance_AwaitingThresholdConfirmations + extends PendingSweepBalance { + const factory PendingSweepBalance_AwaitingThresholdConfirmations( + {final ChannelId? channelId, + required final Txid latestSpendingTxid, + required final String confirmationHash, + required final int confirmationHeight, + required final BigInt amountSatoshis}) = + _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl; + const PendingSweepBalance_AwaitingThresholdConfirmations._() : super._(); @override - int get field0; + + /// 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; + + /// The height at which the spending transaction was confirmed. + int get confirmationHeight; + @override + + /// The amount, in satoshis, of the output being swept. + BigInt get amountSatoshis; @override @JsonKey(ignore: true) - _$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWith< - _$MaxDustHTLCExposure_FeeRateMultiplierImpl> + _$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWith< + _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/generated/frb_generated.dart b/lib/src/generated/frb_generated.dart index 4e2953e..e65c14f 100644 --- a/lib/src/generated/frb_generated.dart +++ b/lib/src/generated/frb_generated.dart @@ -1,26 +1,35 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. +// Generated by `flutter_rust_bridge`@ 2.0.0. // 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 -import 'api/error.dart'; +import 'api/bolt11.dart'; +import 'api/bolt12.dart'; +import 'api/builder.dart'; +import 'api/graph.dart'; import 'api/node.dart'; +import 'api/on_chain.dart'; +import 'api/spontaneous.dart'; import 'api/types.dart'; import 'dart:async'; import 'dart:convert'; -import 'frb_generated.io.dart' if (dart.library.html) 'frb_generated.web.dart'; +import 'frb_generated.dart'; +import 'frb_generated.io.dart' + if (dart.library.js_interop) 'frb_generated.web.dart'; +import 'lib.dart'; import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; +import 'utils/error.dart'; /// Main entrypoint of the Rust API -class LdkCore extends BaseEntrypoint { +class core extends BaseEntrypoint { @internal - static final instance = LdkCore._(); + static final instance = core._(); - LdkCore._(); + core._(); /// Initialize flutter_rust_bridge static Future init({ - LdkCoreApi? api, + coreApi? api, BaseHandler? handler, ExternalLibrary? externalLibrary, }) async { @@ -38,12 +47,11 @@ class LdkCore extends BaseEntrypoint { static void dispose() => instance.disposeImpl(); @override - ApiImplConstructor get apiImplConstructor => - LdkCoreApiImpl.new; + ApiImplConstructor get apiImplConstructor => + coreApiImpl.new; @override - WireConstructor get wireConstructor => - LdkCoreWire.fromExternalLibrary; + WireConstructor get wireConstructor => coreWire.fromExternalLibrary; @override Future executeRustInitializers() async {} @@ -53,7 +61,10 @@ class LdkCore extends BaseEntrypoint { kDefaultExternalLibraryLoaderConfig; @override - String get codegenVersion => '2.0.0-dev.31'; + String get codegenVersion => '2.0.0'; + + @override + int get rustContentHash => 1761952349; static const kDefaultExternalLibraryLoaderConfig = ExternalLibraryLoaderConfig( @@ -63,179 +74,320 @@ class LdkCore extends BaseEntrypoint { ); } -abstract class LdkCoreApi extends BaseApi { - Future buildWithSqliteStore( +abstract class coreApi extends BaseApi { + Future crateApiBolt11LdkBolt11PaymentClaimForHash( + {required LdkBolt11Payment that, + required PaymentHash paymentHash, + required BigInt claimableAmountMsat, + required PaymentPreimage preimage}); + + Future crateApiBolt11LdkBolt11PaymentFailForHash( + {required LdkBolt11Payment that, required PaymentHash paymentHash}); + + Future crateApiBolt11LdkBolt11PaymentReceive( + {required LdkBolt11Payment that, + required BigInt amountMsat, + required String description, + required int expirySecs}); + + Future crateApiBolt11LdkBolt11PaymentReceiveForHash( + {required LdkBolt11Payment that, + required PaymentHash paymentHash, + required BigInt amountMsat, + required String description, + required int expirySecs}); + + Future crateApiBolt11LdkBolt11PaymentReceiveVariableAmount( + {required LdkBolt11Payment that, + required String description, + required int expirySecs}); + + Future + crateApiBolt11LdkBolt11PaymentReceiveVariableAmountForHash( + {required LdkBolt11Payment that, + required String description, + required int expirySecs, + required PaymentHash paymentHash}); + + Future + crateApiBolt11LdkBolt11PaymentReceiveVariableAmountViaJitChannel( + {required LdkBolt11Payment that, + required String description, + required int expirySecs, + BigInt? maxProportionalLspFeeLimitPpmMsat}); + + Future crateApiBolt11LdkBolt11PaymentReceiveViaJitChannel( + {required LdkBolt11Payment that, + required BigInt amountMsat, + required String description, + required int expirySecs, + BigInt? maxTotalLspFeeLimitMsat}); + + Future crateApiBolt11LdkBolt11PaymentSend( + {required LdkBolt11Payment that, required Bolt11Invoice invoice}); + + Future crateApiBolt11LdkBolt11PaymentSendProbes( + {required LdkBolt11Payment that, required Bolt11Invoice invoice}); + + Future crateApiBolt11LdkBolt11PaymentSendProbesUsingAmount( + {required LdkBolt11Payment that, + required Bolt11Invoice invoice, + required BigInt amountMsat}); + + Future crateApiBolt11LdkBolt11PaymentSendUsingAmount( + {required LdkBolt11Payment that, + required Bolt11Invoice invoice, + required BigInt amountMsat}); + + Future crateApiBolt12LdkBolt12PaymentInitiateRefund( + {required LdkBolt12Payment that, + required BigInt amountMsat, + required int expirySecs}); + + Future crateApiBolt12LdkBolt12PaymentReceive( + {required LdkBolt12Payment that, + required BigInt amountMsat, + required String description}); + + Future crateApiBolt12LdkBolt12PaymentReceiveVariableAmount( + {required LdkBolt12Payment that, required String description}); + + Future crateApiBolt12LdkBolt12PaymentRequestRefundPayment( + {required LdkBolt12Payment that, required Refund refund}); + + Future crateApiBolt12LdkBolt12PaymentSend( + {required LdkBolt12Payment that, + required Offer offer, + String? payerNote}); + + Future crateApiBolt12LdkBolt12PaymentSendUsingAmount( + {required LdkBolt12Payment that, + required Offer offer, + String? payerNote, + required BigInt amountMsat}); + + Builder crateApiBuilderNodeBuilderAutoAccessorGetBuilder( + {required NodeBuilder that}); + + void crateApiBuilderNodeBuilderAutoAccessorSetBuilder( + {required NodeBuilder that, required Builder builder}); + + Future crateApiBuilderNodeBuilderBuild({required NodeBuilder that}); + + Future crateApiBuilderNodeBuilderBuildWithFsStore( + {required NodeBuilder that}); + + Future crateApiBuilderNodeBuilderCreateBuilder( {required Config config, ChainDataSourceConfig? chainDataSourceConfig, EntropySourceConfig? entropySourceConfig, GossipSourceConfig? gossipSourceConfig, - dynamic hint}); + LiquiditySourceConfig? liquiditySourceConfig}); + + Future crateApiBuilderLdkMnemonicGenerate(); + + Future crateApiGraphLdkNetworkGraphChannel( + {required LdkNetworkGraph that, required BigInt shortChannelId}); + + Future crateApiGraphLdkNetworkGraphListChannels( + {required LdkNetworkGraph that}); + + Future> crateApiGraphLdkNetworkGraphListNodes( + {required LdkNetworkGraph that}); - Future ldkMnemonicGenerate({dynamic hint}); + Future crateApiGraphLdkNetworkGraphNode( + {required LdkNetworkGraph that, required NodeId nodeId}); - Future ldkNodeCloseChannel( + Future crateApiNodeLdkNodeBolt11Payment( + {required LdkNode ptr}); + + Future crateApiNodeLdkNodeBolt12Payment( + {required LdkNode ptr}); + + Future crateApiNodeLdkNodeCloseChannel( {required LdkNode that, - required ChannelId channelId, - required PublicKey counterpartyNodeId, - dynamic hint}); + required UserChannelId userChannelId, + required PublicKey counterpartyNodeId}); + + Future crateApiNodeLdkNodeConfig({required LdkNode that}); - Future ldkNodeConnect( + Future crateApiNodeLdkNodeConnect( {required LdkNode that, required PublicKey nodeId, required SocketAddress address, - required bool persist, - dynamic hint}); + required bool persist}); - Future ldkNodeConnectOpenChannel( + Future crateApiNodeLdkNodeConnectOpenChannel( {required LdkNode that, required SocketAddress socketAddress, required PublicKey nodeId, - required int channelAmountSats, - int? pushToCounterpartyMsat, + required BigInt channelAmountSats, + BigInt? pushToCounterpartyMsat, required bool announceChannel, - ChannelConfig? channelConfig, - dynamic hint}); + ChannelConfig? channelConfig}); - Future ldkNodeDisconnect( + Future crateApiNodeLdkNodeDisconnect( + {required LdkNode that, required PublicKey counterpartyNodeId}); + + Future crateApiNodeLdkNodeEventHandled({required LdkNode that}); + + Future crateApiNodeLdkNodeForceCloseChannel( {required LdkNode that, - required PublicKey counterpartyNodeId, - dynamic hint}); + required UserChannelId userChannelId, + required PublicKey counterpartyNodeId}); - Future ldkNodeEventHandled({required LdkNode that, dynamic hint}); + Future crateApiNodeLdkNodeListBalances( + {required LdkNode that}); - Future ldkNodeIsRunning({required LdkNode that, dynamic hint}); + Future> crateApiNodeLdkNodeListChannels( + {required LdkNode that}); - Future> ldkNodeListChannels( - {required LdkNode that, dynamic hint}); + Future> crateApiNodeLdkNodeListPayments( + {required LdkNode that}); - Future> ldkNodeListPayments( - {required LdkNode that, dynamic hint}); + Future> crateApiNodeLdkNodeListPaymentsWithFilter( + {required LdkNode that, required PaymentDirection paymentDirection}); - Future> ldkNodeListPaymentsWithFilter( - {required LdkNode that, - required PaymentDirection paymentDirection, - dynamic hint}); + Future> crateApiNodeLdkNodeListPeers( + {required LdkNode that}); - Future> ldkNodeListPeers( - {required LdkNode that, dynamic hint}); + Future?> crateApiNodeLdkNodeListeningAddresses( + {required LdkNode that}); - Future?> ldkNodeListeningAddresses( - {required LdkNode that, dynamic hint}); + Future crateApiNodeLdkNodeNetworkGraph( + {required LdkNode ptr}); - Future
ldkNodeNewOnchainAddress( - {required LdkNode that, dynamic hint}); + Future crateApiNodeLdkNodeNextEvent({required LdkNode that}); - Future ldkNodeNextEvent({required LdkNode that, dynamic hint}); + Future crateApiNodeLdkNodeNextEventAsync({required LdkNode that}); - Future ldkNodeNodeId({required LdkNode that, dynamic hint}); + Future crateApiNodeLdkNodeNodeId({required LdkNode that}); - Future ldkNodePayment( - {required LdkNode that, required PaymentHash paymentHash, dynamic hint}); + Future crateApiNodeLdkNodeOnChainPayment( + {required LdkNode ptr}); - Future ldkNodeReceivePayment( - {required LdkNode that, - required int amountMsat, - required String description, - required int expirySecs, - dynamic hint}); + Future crateApiNodeLdkNodePayment( + {required LdkNode that, required PaymentId paymentId}); - Future ldkNodeReceiveVariableAmountPayment( - {required LdkNode that, - required String description, - required int expirySecs, - dynamic hint}); + Future crateApiNodeLdkNodeRemovePayment( + {required LdkNode that, required PaymentId paymentId}); - Future ldkNodeRemovePayment( - {required LdkNode that, required PaymentHash paymentHash, dynamic hint}); + Future crateApiNodeLdkNodeSignMessage( + {required LdkNode that, required List msg}); - Future ldkNodeSendAllToOnchainAddress( - {required LdkNode that, required Address address, dynamic hint}); + Future crateApiNodeLdkNodeSpontaneousPayment( + {required LdkNode ptr}); - Future ldkNodeSendPayment( - {required LdkNode that, required Bolt11Invoice invoice, dynamic hint}); + Future crateApiNodeLdkNodeStart({required LdkNode that}); - Future ldkNodeSendPaymentProbes( - {required LdkNode that, required Bolt11Invoice invoice, dynamic hint}); + Future crateApiNodeLdkNodeStatus({required LdkNode that}); - Future ldkNodeSendPaymentProbesUsingAmount( - {required LdkNode that, - required Bolt11Invoice invoice, - required int amountMsat, - dynamic hint}); + Future crateApiNodeLdkNodeStop({required LdkNode that}); - Future ldkNodeSendPaymentUsingAmount( - {required LdkNode that, - required Bolt11Invoice invoice, - required int amountMsat, - dynamic hint}); + Future crateApiNodeLdkNodeSyncWallets({required LdkNode that}); - Future ldkNodeSendSpontaneousPayment( + Future crateApiNodeLdkNodeUpdateChannelConfig( {required LdkNode that, - required int amountMsat, - required PublicKey nodeId, - dynamic hint}); + required UserChannelId userChannelId, + required PublicKey counterpartyNodeId, + required ChannelConfig channelConfig}); - Future ldkNodeSendSpontaneousPaymentProbes( + Future crateApiNodeLdkNodeVerifySignature( {required LdkNode that, - required int amountMsat, - required PublicKey nodeId, - dynamic hint}); + required List msg, + required String sig, + required PublicKey publicKey}); - Future ldkNodeSendToOnchainAddress( - {required LdkNode that, + Future crateApiNodeLdkNodeWaitNextEvent({required LdkNode that}); + + Future
crateApiOnChainLdkOnChainPaymentNewAddress( + {required LdkOnChainPayment that}); + + Future crateApiOnChainLdkOnChainPaymentSendAllToAddress( + {required LdkOnChainPayment that, required Address address}); + + Future crateApiOnChainLdkOnChainPaymentSendToAddress( + {required LdkOnChainPayment that, required Address address, - required int amountSats, - dynamic hint}); + required BigInt amountSats}); - Future ldkNodeSignMessage( - {required LdkNode that, required List msg, dynamic hint}); + Future crateApiSpontaneousLdkSpontaneousPaymentSend( + {required LdkSpontaneousPayment that, + required BigInt amountMsat, + required PublicKey nodeId}); - Future ldkNodeSpendableOnchainBalanceSats( - {required LdkNode that, dynamic hint}); + Future crateApiSpontaneousLdkSpontaneousPaymentSendProbes( + {required LdkSpontaneousPayment that, + required BigInt amountMsat, + required PublicKey nodeId}); - Future ldkNodeStart({required LdkNode that, dynamic hint}); + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_ArcBolt12Payment; - Future ldkNodeStop({required LdkNode that, dynamic hint}); + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_ArcBolt12Payment; - Future ldkNodeSyncWallets({required LdkNode that, dynamic hint}); + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_ArcBolt12PaymentPtr; - Future ldkNodeTotalOnchainBalanceSats( - {required LdkNode that, dynamic hint}); + RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_Node; - Future ldkNodeUpdateChannelConfig( - {required LdkNode that, - required ChannelId channelId, - required PublicKey counterpartyNodeId, - required ChannelConfig channelConfig, - dynamic hint}); + RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_Node; - Future ldkNodeVerifySignature( - {required LdkNode that, - required List msg, - required String sig, - required PublicKey pkey, - dynamic hint}); + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_NodePtr; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_NodeBuilder; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_NodeBuilder; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_NodeBuilderPtr; + + RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_Builder; + + RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_Builder; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_BuilderPtr; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_NetworkGraph; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_NetworkGraph; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_NetworkGraphPtr; - Future ldkNodeWaitNextEvent({required LdkNode that, dynamic hint}); + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_Bolt11Payment; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_Bolt11Payment; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_Bolt11PaymentPtr; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_OnchainPayment; - Future socketAddressAsString( - {required SocketAddress that, dynamic hint}); + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_OnchainPayment; - Future socketAddressFromStr( - {required String address, dynamic hint}); + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_OnchainPaymentPtr; RustArcIncrementStrongCountFnType - get rust_arc_increment_strong_count_NodeSqliteStore; + get rust_arc_increment_strong_count_SpontaneousPayment; RustArcDecrementStrongCountFnType - get rust_arc_decrement_strong_count_NodeSqliteStore; + get rust_arc_decrement_strong_count_SpontaneousPayment; CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_NodeSqliteStorePtr; + get rust_arc_decrement_strong_count_SpontaneousPaymentPtr; } -class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { - LdkCoreApiImpl({ +class coreApiImpl extends coreApiImplPlatform implements coreApi { + coreApiImpl({ required super.handler, required super.wire, required super.generalizedFrbRustBinding, @@ -243,1190 +395,2259 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { }); @override - Future buildWithSqliteStore( - {required Config config, - ChainDataSourceConfig? chainDataSourceConfig, - EntropySourceConfig? entropySourceConfig, - GossipSourceConfig? gossipSourceConfig, - dynamic hint}) { + Future crateApiBolt11LdkBolt11PaymentClaimForHash( + {required LdkBolt11Payment that, + required PaymentHash paymentHash, + required BigInt claimableAmountMsat, + required PaymentPreimage preimage}) { 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); - return wire.wire_build_with_sqlite_store(port_, arg0, arg1, arg2, arg3); + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); + var arg1 = cst_encode_box_autoadd_payment_hash(paymentHash); + var arg2 = cst_encode_u_64(claimableAmountMsat); + var arg3 = cst_encode_box_autoadd_payment_preimage(preimage); + return wire + .wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hash( + port_, arg0, arg1, arg2, arg3); }, codec: DcoCodec( - decodeSuccessData: dco_decode_ldk_node, - decodeErrorData: dco_decode_builder_exception, + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kBuildWithSqliteStoreConstMeta, - argValues: [ - config, - chainDataSourceConfig, - entropySourceConfig, - gossipSourceConfig - ], + constMeta: kCrateApiBolt11LdkBolt11PaymentClaimForHashConstMeta, + argValues: [that, paymentHash, claimableAmountMsat, preimage], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kBuildWithSqliteStoreConstMeta => const TaskConstMeta( - debugName: "build_with_sqlite_store", - argNames: [ - "config", - "chainDataSourceConfig", - "entropySourceConfig", - "gossipSourceConfig" - ], + TaskConstMeta get kCrateApiBolt11LdkBolt11PaymentClaimForHashConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_claim_for_hash", + argNames: ["that", "paymentHash", "claimableAmountMsat", "preimage"], ); @override - Future ldkMnemonicGenerate({dynamic hint}) { + Future crateApiBolt11LdkBolt11PaymentFailForHash( + {required LdkBolt11Payment that, required PaymentHash paymentHash}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - return wire.wire_ldk_mnemonic_generate(port_); + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); + var arg1 = cst_encode_box_autoadd_payment_hash(paymentHash); + return wire.wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hash( + port_, arg0, arg1); }, codec: DcoCodec( - decodeSuccessData: dco_decode_ldk_mnemonic, - decodeErrorData: null, + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkMnemonicGenerateConstMeta, - argValues: [], + constMeta: kCrateApiBolt11LdkBolt11PaymentFailForHashConstMeta, + argValues: [that, paymentHash], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkMnemonicGenerateConstMeta => const TaskConstMeta( - debugName: "ldk_mnemonic_generate", - argNames: [], + TaskConstMeta get kCrateApiBolt11LdkBolt11PaymentFailForHashConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_fail_for_hash", + argNames: ["that", "paymentHash"], ); @override - Future ldkNodeCloseChannel( - {required LdkNode that, - required ChannelId channelId, - required PublicKey counterpartyNodeId, - dynamic hint}) { + Future crateApiBolt11LdkBolt11PaymentReceive( + {required LdkBolt11Payment that, + required BigInt amountMsat, + required String description, + required int expirySecs}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - 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); + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); + var arg1 = cst_encode_u_64(amountMsat); + var arg2 = cst_encode_String(description); + var arg3 = cst_encode_u_32(expirySecs); + return wire.wire__crate__api__bolt11__ldk_bolt_11_payment_receive( + port_, arg0, arg1, arg2, arg3); }, codec: DcoCodec( - decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_bolt_11_invoice, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeCloseChannelConstMeta, - argValues: [that, channelId, counterpartyNodeId], + constMeta: kCrateApiBolt11LdkBolt11PaymentReceiveConstMeta, + argValues: [that, amountMsat, description, expirySecs], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeCloseChannelConstMeta => const TaskConstMeta( - debugName: "ldk_node_close_channel", - argNames: ["that", "channelId", "counterpartyNodeId"], + TaskConstMeta get kCrateApiBolt11LdkBolt11PaymentReceiveConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_receive", + argNames: ["that", "amountMsat", "description", "expirySecs"], ); @override - Future ldkNodeConnect( - {required LdkNode that, - required PublicKey nodeId, - required SocketAddress address, - required bool persist, - dynamic hint}) { + Future crateApiBolt11LdkBolt11PaymentReceiveForHash( + {required LdkBolt11Payment that, + required PaymentHash paymentHash, + required BigInt amountMsat, + required String description, + required int expirySecs}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - 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_ldk_node_connect(port_, arg0, arg1, arg2, arg3); + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); + var arg1 = cst_encode_box_autoadd_payment_hash(paymentHash); + var arg2 = cst_encode_u_64(amountMsat); + var arg3 = cst_encode_String(description); + var arg4 = cst_encode_u_32(expirySecs); + return wire + .wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hash( + port_, arg0, arg1, arg2, arg3, arg4); }, codec: DcoCodec( - decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_bolt_11_invoice, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeConnectConstMeta, - argValues: [that, nodeId, address, persist], + constMeta: kCrateApiBolt11LdkBolt11PaymentReceiveForHashConstMeta, + argValues: [that, paymentHash, amountMsat, description, expirySecs], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeConnectConstMeta => const TaskConstMeta( - debugName: "ldk_node_connect", - argNames: ["that", "nodeId", "address", "persist"], + TaskConstMeta get kCrateApiBolt11LdkBolt11PaymentReceiveForHashConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_receive_for_hash", + argNames: [ + "that", + "paymentHash", + "amountMsat", + "description", + "expirySecs" + ], ); @override - Future ldkNodeConnectOpenChannel( - {required LdkNode that, - required SocketAddress socketAddress, - required PublicKey nodeId, - required int channelAmountSats, - int? pushToCounterpartyMsat, - required bool announceChannel, - ChannelConfig? channelConfig, - dynamic hint}) { + Future crateApiBolt11LdkBolt11PaymentReceiveVariableAmount( + {required LdkBolt11Payment that, + required String description, + required int expirySecs}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - 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_ldk_node_connect_open_channel( - port_, arg0, arg1, arg2, arg3, arg4, arg5, arg6); + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); + var arg1 = cst_encode_String(description); + var arg2 = cst_encode_u_32(expirySecs); + return wire + .wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount( + port_, arg0, arg1, arg2); }, codec: DcoCodec( - decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_bolt_11_invoice, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeConnectOpenChannelConstMeta, - argValues: [ - that, - socketAddress, - nodeId, - channelAmountSats, - pushToCounterpartyMsat, - announceChannel, - channelConfig - ], + constMeta: kCrateApiBolt11LdkBolt11PaymentReceiveVariableAmountConstMeta, + argValues: [that, description, expirySecs], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeConnectOpenChannelConstMeta => const TaskConstMeta( - debugName: "ldk_node_connect_open_channel", - argNames: [ - "that", - "socketAddress", - "nodeId", - "channelAmountSats", - "pushToCounterpartyMsat", - "announceChannel", - "channelConfig" - ], - ); + TaskConstMeta + get kCrateApiBolt11LdkBolt11PaymentReceiveVariableAmountConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_receive_variable_amount", + argNames: ["that", "description", "expirySecs"], + ); @override - Future ldkNodeDisconnect( - {required LdkNode that, - required PublicKey counterpartyNodeId, - dynamic hint}) { + Future + crateApiBolt11LdkBolt11PaymentReceiveVariableAmountForHash( + {required LdkBolt11Payment that, + required String description, + required int expirySecs, + required PaymentHash paymentHash}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - var arg1 = cst_encode_box_autoadd_public_key(counterpartyNodeId); - return wire.wire_ldk_node_disconnect(port_, arg0, arg1); + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); + var arg1 = cst_encode_String(description); + var arg2 = cst_encode_u_32(expirySecs); + var arg3 = cst_encode_box_autoadd_payment_hash(paymentHash); + return wire + .wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hash( + port_, arg0, arg1, arg2, arg3); }, codec: DcoCodec( - decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_bolt_11_invoice, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeDisconnectConstMeta, - argValues: [that, counterpartyNodeId], + constMeta: + kCrateApiBolt11LdkBolt11PaymentReceiveVariableAmountForHashConstMeta, + argValues: [that, description, expirySecs, paymentHash], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeDisconnectConstMeta => const TaskConstMeta( - debugName: "ldk_node_disconnect", - argNames: ["that", "counterpartyNodeId"], - ); + TaskConstMeta + get kCrateApiBolt11LdkBolt11PaymentReceiveVariableAmountForHashConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_receive_variable_amount_for_hash", + argNames: ["that", "description", "expirySecs", "paymentHash"], + ); @override - Future ldkNodeEventHandled({required LdkNode that, dynamic hint}) { + Future + crateApiBolt11LdkBolt11PaymentReceiveVariableAmountViaJitChannel( + {required LdkBolt11Payment that, + required String description, + required int expirySecs, + BigInt? maxProportionalLspFeeLimitPpmMsat}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_event_handled(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(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__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel( + port_, arg0, arg1, arg2, arg3); }, codec: DcoCodec( - decodeSuccessData: dco_decode_unit, - decodeErrorData: null, + decodeSuccessData: dco_decode_bolt_11_invoice, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeEventHandledConstMeta, - argValues: [that], + constMeta: + kCrateApiBolt11LdkBolt11PaymentReceiveVariableAmountViaJitChannelConstMeta, + argValues: [ + that, + description, + expirySecs, + maxProportionalLspFeeLimitPpmMsat + ], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeEventHandledConstMeta => const TaskConstMeta( - debugName: "ldk_node_event_handled", - argNames: ["that"], - ); + TaskConstMeta + get kCrateApiBolt11LdkBolt11PaymentReceiveVariableAmountViaJitChannelConstMeta => + const TaskConstMeta( + debugName: + "ldk_bolt_11_payment_receive_variable_amount_via_jit_channel", + argNames: [ + "that", + "description", + "expirySecs", + "maxProportionalLspFeeLimitPpmMsat" + ], + ); @override - Future ldkNodeIsRunning({required LdkNode that, dynamic hint}) { + Future crateApiBolt11LdkBolt11PaymentReceiveViaJitChannel( + {required LdkBolt11Payment that, + required BigInt amountMsat, + required String description, + required int expirySecs, + BigInt? maxTotalLspFeeLimitMsat}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_is_running(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(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__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel( + port_, arg0, arg1, arg2, arg3, arg4); }, codec: DcoCodec( - decodeSuccessData: dco_decode_bool, - decodeErrorData: null, + decodeSuccessData: dco_decode_bolt_11_invoice, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeIsRunningConstMeta, - argValues: [that], + constMeta: kCrateApiBolt11LdkBolt11PaymentReceiveViaJitChannelConstMeta, + argValues: [ + that, + amountMsat, + description, + expirySecs, + maxTotalLspFeeLimitMsat + ], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeIsRunningConstMeta => const TaskConstMeta( - debugName: "ldk_node_is_running", - argNames: ["that"], - ); + TaskConstMeta + get kCrateApiBolt11LdkBolt11PaymentReceiveViaJitChannelConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_receive_via_jit_channel", + argNames: [ + "that", + "amountMsat", + "description", + "expirySecs", + "maxTotalLspFeeLimitMsat" + ], + ); @override - Future> ldkNodeListChannels( - {required LdkNode that, dynamic hint}) { + Future crateApiBolt11LdkBolt11PaymentSend( + {required LdkBolt11Payment that, required Bolt11Invoice invoice}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_list_channels(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); + var arg1 = cst_encode_box_autoadd_bolt_11_invoice(invoice); + return wire.wire__crate__api__bolt11__ldk_bolt_11_payment_send( + port_, arg0, arg1); }, codec: DcoCodec( - decodeSuccessData: dco_decode_list_channel_details, - decodeErrorData: null, + decodeSuccessData: dco_decode_payment_id, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeListChannelsConstMeta, - argValues: [that], + constMeta: kCrateApiBolt11LdkBolt11PaymentSendConstMeta, + argValues: [that, invoice], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeListChannelsConstMeta => const TaskConstMeta( - debugName: "ldk_node_list_channels", - argNames: ["that"], + TaskConstMeta get kCrateApiBolt11LdkBolt11PaymentSendConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_send", + argNames: ["that", "invoice"], ); @override - Future> ldkNodeListPayments( - {required LdkNode that, dynamic hint}) { + Future crateApiBolt11LdkBolt11PaymentSendProbes( + {required LdkBolt11Payment that, required Bolt11Invoice invoice}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_list_payments(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); + var arg1 = cst_encode_box_autoadd_bolt_11_invoice(invoice); + return wire.wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes( + port_, arg0, arg1); }, codec: DcoCodec( - decodeSuccessData: dco_decode_list_payment_details, - decodeErrorData: null, + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeListPaymentsConstMeta, - argValues: [that], + constMeta: kCrateApiBolt11LdkBolt11PaymentSendProbesConstMeta, + argValues: [that, invoice], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeListPaymentsConstMeta => const TaskConstMeta( - debugName: "ldk_node_list_payments", - argNames: ["that"], + TaskConstMeta get kCrateApiBolt11LdkBolt11PaymentSendProbesConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_send_probes", + argNames: ["that", "invoice"], ); @override - Future> ldkNodeListPaymentsWithFilter( - {required LdkNode that, - required PaymentDirection paymentDirection, - dynamic hint}) { + Future crateApiBolt11LdkBolt11PaymentSendProbesUsingAmount( + {required LdkBolt11Payment that, + required Bolt11Invoice invoice, + required BigInt amountMsat}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - var arg1 = cst_encode_payment_direction(paymentDirection); - return wire.wire_ldk_node_list_payments_with_filter(port_, arg0, arg1); + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); + var arg1 = cst_encode_box_autoadd_bolt_11_invoice(invoice); + var arg2 = cst_encode_u_64(amountMsat); + return wire + .wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount( + port_, arg0, arg1, arg2); }, codec: DcoCodec( - decodeSuccessData: dco_decode_list_payment_details, - decodeErrorData: null, + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeListPaymentsWithFilterConstMeta, - argValues: [that, paymentDirection], + constMeta: kCrateApiBolt11LdkBolt11PaymentSendProbesUsingAmountConstMeta, + argValues: [that, invoice, amountMsat], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeListPaymentsWithFilterConstMeta => - const TaskConstMeta( - debugName: "ldk_node_list_payments_with_filter", - argNames: ["that", "paymentDirection"], - ); + TaskConstMeta + get kCrateApiBolt11LdkBolt11PaymentSendProbesUsingAmountConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_send_probes_using_amount", + argNames: ["that", "invoice", "amountMsat"], + ); @override - Future> ldkNodeListPeers( - {required LdkNode that, dynamic hint}) { + Future crateApiBolt11LdkBolt11PaymentSendUsingAmount( + {required LdkBolt11Payment that, + required Bolt11Invoice invoice, + required BigInt amountMsat}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_list_peers(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); + var arg1 = cst_encode_box_autoadd_bolt_11_invoice(invoice); + var arg2 = cst_encode_u_64(amountMsat); + return wire + .wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount( + port_, arg0, arg1, arg2); }, codec: DcoCodec( - decodeSuccessData: dco_decode_list_peer_details, - decodeErrorData: null, + decodeSuccessData: dco_decode_payment_id, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeListPeersConstMeta, - argValues: [that], + constMeta: kCrateApiBolt11LdkBolt11PaymentSendUsingAmountConstMeta, + argValues: [that, invoice, amountMsat], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeListPeersConstMeta => const TaskConstMeta( - debugName: "ldk_node_list_peers", - argNames: ["that"], + TaskConstMeta get kCrateApiBolt11LdkBolt11PaymentSendUsingAmountConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_send_using_amount", + argNames: ["that", "invoice", "amountMsat"], ); @override - Future?> ldkNodeListeningAddresses( - {required LdkNode that, dynamic hint}) { + Future crateApiBolt12LdkBolt12PaymentInitiateRefund( + {required LdkBolt12Payment that, + required BigInt amountMsat, + required int expirySecs}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_listening_addresses(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_bolt_12_payment(that); + var arg1 = cst_encode_u_64(amountMsat); + var arg2 = cst_encode_u_32(expirySecs); + return wire + .wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refund( + port_, arg0, arg1, arg2); }, codec: DcoCodec( - decodeSuccessData: dco_decode_opt_list_socket_address, - decodeErrorData: null, + decodeSuccessData: dco_decode_refund, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeListeningAddressesConstMeta, - argValues: [that], + constMeta: kCrateApiBolt12LdkBolt12PaymentInitiateRefundConstMeta, + argValues: [that, amountMsat, expirySecs], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeListeningAddressesConstMeta => const TaskConstMeta( - debugName: "ldk_node_listening_addresses", - argNames: ["that"], + TaskConstMeta get kCrateApiBolt12LdkBolt12PaymentInitiateRefundConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_12_payment_initiate_refund", + argNames: ["that", "amountMsat", "expirySecs"], ); @override - Future
ldkNodeNewOnchainAddress( - {required LdkNode that, dynamic hint}) { + Future crateApiBolt12LdkBolt12PaymentReceive( + {required LdkBolt12Payment that, + required BigInt amountMsat, + required String description}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_new_onchain_address(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_bolt_12_payment(that); + var arg1 = cst_encode_u_64(amountMsat); + var arg2 = cst_encode_String(description); + return wire.wire__crate__api__bolt12__ldk_bolt_12_payment_receive( + port_, arg0, arg1, arg2); }, codec: DcoCodec( - decodeSuccessData: dco_decode_address, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_offer, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeNewOnchainAddressConstMeta, - argValues: [that], + constMeta: kCrateApiBolt12LdkBolt12PaymentReceiveConstMeta, + argValues: [that, amountMsat, description], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeNewOnchainAddressConstMeta => const TaskConstMeta( - debugName: "ldk_node_new_onchain_address", - argNames: ["that"], + TaskConstMeta get kCrateApiBolt12LdkBolt12PaymentReceiveConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_12_payment_receive", + argNames: ["that", "amountMsat", "description"], ); @override - Future ldkNodeNextEvent({required LdkNode that, dynamic hint}) { + Future crateApiBolt12LdkBolt12PaymentReceiveVariableAmount( + {required LdkBolt12Payment that, required String description}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_next_event(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_bolt_12_payment(that); + var arg1 = cst_encode_String(description); + return wire + .wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amount( + port_, arg0, arg1); }, codec: DcoCodec( - decodeSuccessData: dco_decode_opt_box_autoadd_event, - decodeErrorData: null, + decodeSuccessData: dco_decode_offer, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeNextEventConstMeta, - argValues: [that], + constMeta: kCrateApiBolt12LdkBolt12PaymentReceiveVariableAmountConstMeta, + argValues: [that, description], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeNextEventConstMeta => const TaskConstMeta( - debugName: "ldk_node_next_event", - argNames: ["that"], - ); + TaskConstMeta + get kCrateApiBolt12LdkBolt12PaymentReceiveVariableAmountConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_12_payment_receive_variable_amount", + argNames: ["that", "description"], + ); @override - Future ldkNodeNodeId({required LdkNode that, dynamic hint}) { + Future crateApiBolt12LdkBolt12PaymentRequestRefundPayment( + {required LdkBolt12Payment that, required Refund refund}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_node_id(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_bolt_12_payment(that); + var arg1 = cst_encode_box_autoadd_refund(refund); + return wire + .wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_payment( + port_, arg0, arg1); }, codec: DcoCodec( - decodeSuccessData: dco_decode_public_key, - decodeErrorData: null, + decodeSuccessData: dco_decode_bolt_12_invoice, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeNodeIdConstMeta, - argValues: [that], + constMeta: kCrateApiBolt12LdkBolt12PaymentRequestRefundPaymentConstMeta, + argValues: [that, refund], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeNodeIdConstMeta => const TaskConstMeta( - debugName: "ldk_node_node_id", - argNames: ["that"], - ); + TaskConstMeta + get kCrateApiBolt12LdkBolt12PaymentRequestRefundPaymentConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_12_payment_request_refund_payment", + argNames: ["that", "refund"], + ); @override - Future ldkNodePayment( - {required LdkNode that, required PaymentHash paymentHash, dynamic hint}) { + Future crateApiBolt12LdkBolt12PaymentSend( + {required LdkBolt12Payment that, + required Offer offer, + String? payerNote}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - var arg1 = cst_encode_box_autoadd_payment_hash(paymentHash); - return wire.wire_ldk_node_payment(port_, arg0, arg1); + var arg0 = cst_encode_box_autoadd_ldk_bolt_12_payment(that); + var arg1 = cst_encode_box_autoadd_offer(offer); + var arg2 = cst_encode_opt_String(payerNote); + return wire.wire__crate__api__bolt12__ldk_bolt_12_payment_send( + port_, arg0, arg1, arg2); }, codec: DcoCodec( - decodeSuccessData: dco_decode_opt_box_autoadd_payment_details, - decodeErrorData: null, + decodeSuccessData: dco_decode_payment_id, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodePaymentConstMeta, - argValues: [that, paymentHash], + constMeta: kCrateApiBolt12LdkBolt12PaymentSendConstMeta, + argValues: [that, offer, payerNote], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodePaymentConstMeta => const TaskConstMeta( - debugName: "ldk_node_payment", - argNames: ["that", "paymentHash"], + TaskConstMeta get kCrateApiBolt12LdkBolt12PaymentSendConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_12_payment_send", + argNames: ["that", "offer", "payerNote"], ); @override - Future ldkNodeReceivePayment( - {required LdkNode that, - required int amountMsat, - required String description, - required int expirySecs, - dynamic hint}) { + Future crateApiBolt12LdkBolt12PaymentSendUsingAmount( + {required LdkBolt12Payment that, + required Offer offer, + String? payerNote, + required BigInt amountMsat}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - 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_ldk_node_receive_payment( - port_, arg0, arg1, arg2, arg3); + var arg0 = cst_encode_box_autoadd_ldk_bolt_12_payment(that); + var arg1 = cst_encode_box_autoadd_offer(offer); + var arg2 = cst_encode_opt_String(payerNote); + var arg3 = cst_encode_u_64(amountMsat); + return wire + .wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amount( + port_, arg0, arg1, arg2, arg3); }, codec: DcoCodec( - decodeSuccessData: dco_decode_bolt_11_invoice, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_payment_id, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeReceivePaymentConstMeta, - argValues: [that, amountMsat, description, expirySecs], + constMeta: kCrateApiBolt12LdkBolt12PaymentSendUsingAmountConstMeta, + argValues: [that, offer, payerNote, amountMsat], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeReceivePaymentConstMeta => const TaskConstMeta( - debugName: "ldk_node_receive_payment", - argNames: ["that", "amountMsat", "description", "expirySecs"], + TaskConstMeta get kCrateApiBolt12LdkBolt12PaymentSendUsingAmountConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_12_payment_send_using_amount", + argNames: ["that", "offer", "payerNote", "amountMsat"], ); @override - 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_ldk_node(that); - var arg1 = cst_encode_String(description); - var arg2 = cst_encode_u_32(expirySecs); - return wire.wire_ldk_node_receive_variable_amount_payment( - port_, arg0, arg1, arg2); + Builder crateApiBuilderNodeBuilderAutoAccessorGetBuilder( + {required NodeBuilder that}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + that); + return wire + .wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder( + arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_bolt_11_invoice, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_RustOpaque_ldk_nodeBuilder, + decodeErrorData: null, ), - constMeta: kLdkNodeReceiveVariableAmountPaymentConstMeta, - argValues: [that, description, expirySecs], + constMeta: kCrateApiBuilderNodeBuilderAutoAccessorGetBuilderConstMeta, + argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeReceiveVariableAmountPaymentConstMeta => - const TaskConstMeta( - debugName: "ldk_node_receive_variable_amount_payment", - argNames: ["that", "description", "expirySecs"], - ); + TaskConstMeta + get kCrateApiBuilderNodeBuilderAutoAccessorGetBuilderConstMeta => + const TaskConstMeta( + debugName: "NodeBuilder_auto_accessor_get_builder", + argNames: ["that"], + ); @override - Future ldkNodeRemovePayment( - {required LdkNode that, required PaymentHash paymentHash, dynamic hint}) { - return handler.executeNormal(NormalTask( - callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - var arg1 = cst_encode_box_autoadd_payment_hash(paymentHash); - return wire.wire_ldk_node_remove_payment(port_, arg0, arg1); + void crateApiBuilderNodeBuilderAutoAccessorSetBuilder( + {required NodeBuilder that, required Builder builder}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + that); + var arg1 = cst_encode_RustOpaque_ldk_nodeBuilder(builder); + return wire + .wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder( + arg0, arg1); }, codec: DcoCodec( decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeErrorData: null, ), - constMeta: kLdkNodeRemovePaymentConstMeta, - argValues: [that, paymentHash], + constMeta: kCrateApiBuilderNodeBuilderAutoAccessorSetBuilderConstMeta, + argValues: [that, builder], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeRemovePaymentConstMeta => const TaskConstMeta( - debugName: "ldk_node_remove_payment", - argNames: ["that", "paymentHash"], - ); + TaskConstMeta + get kCrateApiBuilderNodeBuilderAutoAccessorSetBuilderConstMeta => + const TaskConstMeta( + debugName: "NodeBuilder_auto_accessor_set_builder", + argNames: ["that", "builder"], + ); @override - Future ldkNodeSendAllToOnchainAddress( - {required LdkNode that, required Address address, dynamic hint}) { + Future crateApiBuilderNodeBuilderBuild({required NodeBuilder that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - var arg1 = cst_encode_box_autoadd_address(address); - return wire.wire_ldk_node_send_all_to_onchain_address( - port_, arg0, arg1); + var arg0 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + that); + return wire.wire__crate__api__builder__NodeBuilder_build(port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_txid, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_ldk_node, + decodeErrorData: dco_decode_ldk_builder_error, ), - constMeta: kLdkNodeSendAllToOnchainAddressConstMeta, - argValues: [that, address], + constMeta: kCrateApiBuilderNodeBuilderBuildConstMeta, + argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeSendAllToOnchainAddressConstMeta => + TaskConstMeta get kCrateApiBuilderNodeBuilderBuildConstMeta => const TaskConstMeta( - debugName: "ldk_node_send_all_to_onchain_address", - argNames: ["that", "address"], + debugName: "NodeBuilder_build", + argNames: ["that"], ); @override - Future ldkNodeSendPayment( - {required LdkNode that, required Bolt11Invoice invoice, dynamic hint}) { + Future crateApiBuilderNodeBuilderBuildWithFsStore( + {required NodeBuilder that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - var arg1 = cst_encode_box_autoadd_bolt_11_invoice(invoice); - return wire.wire_ldk_node_send_payment(port_, arg0, arg1); + var arg0 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + that); + return wire.wire__crate__api__builder__NodeBuilder_build_with_fs_store( + port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_payment_hash, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_ldk_node, + decodeErrorData: dco_decode_ldk_builder_error, ), - constMeta: kLdkNodeSendPaymentConstMeta, - argValues: [that, invoice], + constMeta: kCrateApiBuilderNodeBuilderBuildWithFsStoreConstMeta, + argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeSendPaymentConstMeta => const TaskConstMeta( - debugName: "ldk_node_send_payment", - argNames: ["that", "invoice"], + TaskConstMeta get kCrateApiBuilderNodeBuilderBuildWithFsStoreConstMeta => + const TaskConstMeta( + debugName: "NodeBuilder_build_with_fs_store", + argNames: ["that"], ); @override - Future ldkNodeSendPaymentProbes( - {required LdkNode that, required Bolt11Invoice invoice, dynamic hint}) { + Future crateApiBuilderNodeBuilderCreateBuilder( + {required Config config, + ChainDataSourceConfig? chainDataSourceConfig, + EntropySourceConfig? entropySourceConfig, + GossipSourceConfig? gossipSourceConfig, + LiquiditySourceConfig? liquiditySourceConfig}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - var arg1 = cst_encode_box_autoadd_bolt_11_invoice(invoice); - return wire.wire_ldk_node_send_payment_probes(port_, arg0, arg1); + 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__crate__api__builder__NodeBuilder_create_builder( + port_, arg0, arg1, arg2, arg3, arg4); }, codec: DcoCodec( - decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder, + decodeErrorData: dco_decode_ldk_builder_error, ), - constMeta: kLdkNodeSendPaymentProbesConstMeta, - argValues: [that, invoice], + constMeta: kCrateApiBuilderNodeBuilderCreateBuilderConstMeta, + argValues: [ + config, + chainDataSourceConfig, + entropySourceConfig, + gossipSourceConfig, + liquiditySourceConfig + ], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeSendPaymentProbesConstMeta => const TaskConstMeta( - debugName: "ldk_node_send_payment_probes", - argNames: ["that", "invoice"], + TaskConstMeta get kCrateApiBuilderNodeBuilderCreateBuilderConstMeta => + const TaskConstMeta( + debugName: "NodeBuilder_create_builder", + argNames: [ + "config", + "chainDataSourceConfig", + "entropySourceConfig", + "gossipSourceConfig", + "liquiditySourceConfig" + ], ); @override - Future ldkNodeSendPaymentProbesUsingAmount( - {required LdkNode that, - required Bolt11Invoice invoice, - required int amountMsat, - dynamic hint}) { + Future crateApiBuilderLdkMnemonicGenerate() { return handler.executeNormal(NormalTask( callFfi: (port_) { - 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_ldk_node_send_payment_probes_using_amount( - port_, arg0, arg1, arg2); + return wire.wire__crate__api__builder__ldk_mnemonic_generate(port_); }, codec: DcoCodec( - decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_ldk_mnemonic, + decodeErrorData: null, ), - constMeta: kLdkNodeSendPaymentProbesUsingAmountConstMeta, - argValues: [that, invoice, amountMsat], + constMeta: kCrateApiBuilderLdkMnemonicGenerateConstMeta, + argValues: [], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeSendPaymentProbesUsingAmountConstMeta => + TaskConstMeta get kCrateApiBuilderLdkMnemonicGenerateConstMeta => const TaskConstMeta( - debugName: "ldk_node_send_payment_probes_using_amount", - argNames: ["that", "invoice", "amountMsat"], + debugName: "ldk_mnemonic_generate", + argNames: [], ); @override - Future ldkNodeSendPaymentUsingAmount( - {required LdkNode that, - required Bolt11Invoice invoice, - required int amountMsat, - dynamic hint}) { + Future crateApiGraphLdkNetworkGraphChannel( + {required LdkNetworkGraph that, required BigInt shortChannelId}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - 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_ldk_node_send_payment_using_amount( - port_, arg0, arg1, arg2); + var arg0 = cst_encode_box_autoadd_ldk_network_graph(that); + var arg1 = cst_encode_u_64(shortChannelId); + return wire.wire__crate__api__graph__ldk_network_graph_channel( + port_, arg0, arg1); }, codec: DcoCodec( - decodeSuccessData: dco_decode_payment_hash, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_opt_box_autoadd_channel_info, + decodeErrorData: null, ), - constMeta: kLdkNodeSendPaymentUsingAmountConstMeta, - argValues: [that, invoice, amountMsat], + constMeta: kCrateApiGraphLdkNetworkGraphChannelConstMeta, + argValues: [that, shortChannelId], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeSendPaymentUsingAmountConstMeta => + TaskConstMeta get kCrateApiGraphLdkNetworkGraphChannelConstMeta => const TaskConstMeta( - debugName: "ldk_node_send_payment_using_amount", - argNames: ["that", "invoice", "amountMsat"], + debugName: "ldk_network_graph_channel", + argNames: ["that", "shortChannelId"], ); @override - Future ldkNodeSendSpontaneousPayment( - {required LdkNode that, - required int amountMsat, - required PublicKey nodeId, - dynamic hint}) { + Future crateApiGraphLdkNetworkGraphListChannels( + {required LdkNetworkGraph that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - 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_ldk_node_send_spontaneous_payment( - port_, arg0, arg1, arg2); + var arg0 = cst_encode_box_autoadd_ldk_network_graph(that); + return wire.wire__crate__api__graph__ldk_network_graph_list_channels( + port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_payment_hash, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_list_prim_u_64_strict, + decodeErrorData: null, ), - constMeta: kLdkNodeSendSpontaneousPaymentConstMeta, - argValues: [that, amountMsat, nodeId], + constMeta: kCrateApiGraphLdkNetworkGraphListChannelsConstMeta, + argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeSendSpontaneousPaymentConstMeta => + TaskConstMeta get kCrateApiGraphLdkNetworkGraphListChannelsConstMeta => const TaskConstMeta( - debugName: "ldk_node_send_spontaneous_payment", - argNames: ["that", "amountMsat", "nodeId"], + debugName: "ldk_network_graph_list_channels", + argNames: ["that"], ); @override - Future ldkNodeSendSpontaneousPaymentProbes( - {required LdkNode that, - required int amountMsat, - required PublicKey nodeId, - dynamic hint}) { + Future> crateApiGraphLdkNetworkGraphListNodes( + {required LdkNetworkGraph that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - 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_ldk_node_send_spontaneous_payment_probes( - port_, arg0, arg1, arg2); + var arg0 = cst_encode_box_autoadd_ldk_network_graph(that); + return wire.wire__crate__api__graph__ldk_network_graph_list_nodes( + port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_list_node_id, + decodeErrorData: null, ), - constMeta: kLdkNodeSendSpontaneousPaymentProbesConstMeta, - argValues: [that, amountMsat, nodeId], + constMeta: kCrateApiGraphLdkNetworkGraphListNodesConstMeta, + argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeSendSpontaneousPaymentProbesConstMeta => + TaskConstMeta get kCrateApiGraphLdkNetworkGraphListNodesConstMeta => const TaskConstMeta( - debugName: "ldk_node_send_spontaneous_payment_probes", - argNames: ["that", "amountMsat", "nodeId"], + debugName: "ldk_network_graph_list_nodes", + argNames: ["that"], ); @override - Future ldkNodeSendToOnchainAddress( - {required LdkNode that, - required Address address, - required int amountSats, - dynamic hint}) { + Future crateApiGraphLdkNetworkGraphNode( + {required LdkNetworkGraph that, required NodeId nodeId}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - 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_ldk_node_send_to_onchain_address( - port_, arg0, arg1, arg2); + var arg0 = cst_encode_box_autoadd_ldk_network_graph(that); + var arg1 = cst_encode_box_autoadd_node_id(nodeId); + return wire.wire__crate__api__graph__ldk_network_graph_node( + port_, arg0, arg1); }, codec: DcoCodec( - decodeSuccessData: dco_decode_txid, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_opt_box_autoadd_node_info, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeSendToOnchainAddressConstMeta, - argValues: [that, address, amountSats], + constMeta: kCrateApiGraphLdkNetworkGraphNodeConstMeta, + argValues: [that, nodeId], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeSendToOnchainAddressConstMeta => + TaskConstMeta get kCrateApiGraphLdkNetworkGraphNodeConstMeta => const TaskConstMeta( - debugName: "ldk_node_send_to_onchain_address", - argNames: ["that", "address", "amountSats"], + debugName: "ldk_network_graph_node", + argNames: ["that", "nodeId"], ); @override - Future ldkNodeSignMessage( - {required LdkNode that, required List msg, dynamic hint}) { + Future crateApiNodeLdkNodeBolt11Payment( + {required LdkNode ptr}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - var arg1 = cst_encode_list_prim_u_8_loose(msg); - return wire.wire_ldk_node_sign_message(port_, arg0, arg1); + var arg0 = cst_encode_box_autoadd_ldk_node(ptr); + return wire.wire__crate__api__node__ldk_node_bolt11_payment( + port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_String, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_ldk_bolt_11_payment, + decodeErrorData: null, ), - constMeta: kLdkNodeSignMessageConstMeta, - argValues: [that, msg], + constMeta: kCrateApiNodeLdkNodeBolt11PaymentConstMeta, + argValues: [ptr], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeSignMessageConstMeta => const TaskConstMeta( - debugName: "ldk_node_sign_message", - argNames: ["that", "msg"], + TaskConstMeta get kCrateApiNodeLdkNodeBolt11PaymentConstMeta => + const TaskConstMeta( + debugName: "ldk_node_bolt11_payment", + argNames: ["ptr"], ); @override - Future ldkNodeSpendableOnchainBalanceSats( - {required LdkNode that, dynamic hint}) { + Future crateApiNodeLdkNodeBolt12Payment( + {required LdkNode ptr}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_spendable_onchain_balance_sats(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_node(ptr); + return wire.wire__crate__api__node__ldk_node_bolt12_payment( + port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_u_64, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_ldk_bolt_12_payment, + decodeErrorData: null, ), - constMeta: kLdkNodeSpendableOnchainBalanceSatsConstMeta, - argValues: [that], + constMeta: kCrateApiNodeLdkNodeBolt12PaymentConstMeta, + argValues: [ptr], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeSpendableOnchainBalanceSatsConstMeta => + TaskConstMeta get kCrateApiNodeLdkNodeBolt12PaymentConstMeta => const TaskConstMeta( - debugName: "ldk_node_spendable_onchain_balance_sats", - argNames: ["that"], + debugName: "ldk_node_bolt12_payment", + argNames: ["ptr"], ); @override - Future ldkNodeStart({required LdkNode that, dynamic hint}) { + Future crateApiNodeLdkNodeCloseChannel( + {required LdkNode that, + required UserChannelId userChannelId, + required PublicKey counterpartyNodeId}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_start(port_, arg0); + var arg1 = cst_encode_box_autoadd_user_channel_id(userChannelId); + var arg2 = cst_encode_box_autoadd_public_key(counterpartyNodeId); + return wire.wire__crate__api__node__ldk_node_close_channel( + port_, arg0, arg1, arg2); }, codec: DcoCodec( decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeStartConstMeta, - argValues: [that], + constMeta: kCrateApiNodeLdkNodeCloseChannelConstMeta, + argValues: [that, userChannelId, counterpartyNodeId], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeStartConstMeta => const TaskConstMeta( - debugName: "ldk_node_start", - argNames: ["that"], + TaskConstMeta get kCrateApiNodeLdkNodeCloseChannelConstMeta => + const TaskConstMeta( + debugName: "ldk_node_close_channel", + argNames: ["that", "userChannelId", "counterpartyNodeId"], ); @override - Future ldkNodeStop({required LdkNode that, dynamic hint}) { + Future crateApiNodeLdkNodeConfig({required LdkNode that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_stop(port_, arg0); + return wire.wire__crate__api__node__ldk_node_config(port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_config, + decodeErrorData: null, ), - constMeta: kLdkNodeStopConstMeta, + constMeta: kCrateApiNodeLdkNodeConfigConstMeta, argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeStopConstMeta => const TaskConstMeta( - debugName: "ldk_node_stop", + TaskConstMeta get kCrateApiNodeLdkNodeConfigConstMeta => const TaskConstMeta( + debugName: "ldk_node_config", argNames: ["that"], ); @override - Future ldkNodeSyncWallets({required LdkNode that, dynamic hint}) { + Future crateApiNodeLdkNodeConnect( + {required LdkNode that, + required PublicKey nodeId, + required SocketAddress address, + required bool persist}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_sync_wallets(port_, arg0); + 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__crate__api__node__ldk_node_connect( + port_, arg0, arg1, arg2, arg3); }, codec: DcoCodec( decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeSyncWalletsConstMeta, - argValues: [that], + constMeta: kCrateApiNodeLdkNodeConnectConstMeta, + argValues: [that, nodeId, address, persist], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeSyncWalletsConstMeta => const TaskConstMeta( - debugName: "ldk_node_sync_wallets", - argNames: ["that"], + TaskConstMeta get kCrateApiNodeLdkNodeConnectConstMeta => const TaskConstMeta( + debugName: "ldk_node_connect", + argNames: ["that", "nodeId", "address", "persist"], ); @override - Future ldkNodeTotalOnchainBalanceSats( - {required LdkNode that, dynamic hint}) { + Future crateApiNodeLdkNodeConnectOpenChannel( + {required LdkNode that, + required SocketAddress socketAddress, + required PublicKey nodeId, + required BigInt channelAmountSats, + BigInt? pushToCounterpartyMsat, + required bool announceChannel, + ChannelConfig? channelConfig}) { 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); + 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__crate__api__node__ldk_node_connect_open_channel( + port_, arg0, arg1, arg2, arg3, arg4, arg5, arg6); }, codec: DcoCodec( - decodeSuccessData: dco_decode_u_64, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_user_channel_id, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeTotalOnchainBalanceSatsConstMeta, + constMeta: kCrateApiNodeLdkNodeConnectOpenChannelConstMeta, + argValues: [ + that, + socketAddress, + nodeId, + channelAmountSats, + pushToCounterpartyMsat, + announceChannel, + channelConfig + ], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeConnectOpenChannelConstMeta => + const TaskConstMeta( + debugName: "ldk_node_connect_open_channel", + argNames: [ + "that", + "socketAddress", + "nodeId", + "channelAmountSats", + "pushToCounterpartyMsat", + "announceChannel", + "channelConfig" + ], + ); + + @override + Future crateApiNodeLdkNodeDisconnect( + {required LdkNode that, required PublicKey counterpartyNodeId}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + var arg1 = cst_encode_box_autoadd_public_key(counterpartyNodeId); + return wire.wire__crate__api__node__ldk_node_disconnect( + port_, arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiNodeLdkNodeDisconnectConstMeta, + argValues: [that, counterpartyNodeId], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeDisconnectConstMeta => + const TaskConstMeta( + debugName: "ldk_node_disconnect", + argNames: ["that", "counterpartyNodeId"], + ); + + @override + Future crateApiNodeLdkNodeEventHandled({required LdkNode that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire__crate__api__node__ldk_node_event_handled(port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: null, + ), + constMeta: kCrateApiNodeLdkNodeEventHandledConstMeta, argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeTotalOnchainBalanceSatsConstMeta => + TaskConstMeta get kCrateApiNodeLdkNodeEventHandledConstMeta => const TaskConstMeta( - debugName: "ldk_node_total_onchain_balance_sats", + debugName: "ldk_node_event_handled", argNames: ["that"], ); @override - Future ldkNodeUpdateChannelConfig( + Future crateApiNodeLdkNodeForceCloseChannel( {required LdkNode that, - required ChannelId channelId, - required PublicKey counterpartyNodeId, - required ChannelConfig channelConfig, - dynamic hint}) { + required UserChannelId userChannelId, + required PublicKey counterpartyNodeId}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); - var arg1 = cst_encode_box_autoadd_channel_id(channelId); + var arg1 = cst_encode_box_autoadd_user_channel_id(userChannelId); var arg2 = cst_encode_box_autoadd_public_key(counterpartyNodeId); - var arg3 = cst_encode_box_autoadd_channel_config(channelConfig); - return wire.wire_ldk_node_update_channel_config( - port_, arg0, arg1, arg2, arg3); + return wire.wire__crate__api__node__ldk_node_force_close_channel( + port_, arg0, arg1, arg2); }, codec: DcoCodec( decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeUpdateChannelConfigConstMeta, - argValues: [that, channelId, counterpartyNodeId, channelConfig], + constMeta: kCrateApiNodeLdkNodeForceCloseChannelConstMeta, + argValues: [that, userChannelId, counterpartyNodeId], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeUpdateChannelConfigConstMeta => const TaskConstMeta( - debugName: "ldk_node_update_channel_config", - argNames: ["that", "channelId", "counterpartyNodeId", "channelConfig"], + TaskConstMeta get kCrateApiNodeLdkNodeForceCloseChannelConstMeta => + const TaskConstMeta( + debugName: "ldk_node_force_close_channel", + argNames: ["that", "userChannelId", "counterpartyNodeId"], ); @override - Future ldkNodeVerifySignature( - {required LdkNode that, - required List msg, - required String sig, - required PublicKey pkey, - dynamic hint}) { + Future crateApiNodeLdkNodeListBalances( + {required LdkNode that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { 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_ldk_node_verify_signature( - port_, arg0, arg1, arg2, arg3); + return wire.wire__crate__api__node__ldk_node_list_balances(port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_bool, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_balance_details, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeVerifySignatureConstMeta, - argValues: [that, msg, sig, pkey], + constMeta: kCrateApiNodeLdkNodeListBalancesConstMeta, + argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeVerifySignatureConstMeta => const TaskConstMeta( - debugName: "ldk_node_verify_signature", - argNames: ["that", "msg", "sig", "pkey"], + TaskConstMeta get kCrateApiNodeLdkNodeListBalancesConstMeta => + const TaskConstMeta( + debugName: "ldk_node_list_balances", + argNames: ["that"], ); @override - Future ldkNodeWaitNextEvent({required LdkNode that, dynamic hint}) { + Future> crateApiNodeLdkNodeListChannels( + {required LdkNode that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_wait_next_event(port_, arg0); + return wire.wire__crate__api__node__ldk_node_list_channels(port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_event, + decodeSuccessData: dco_decode_list_channel_details, decodeErrorData: null, ), - constMeta: kLdkNodeWaitNextEventConstMeta, + constMeta: kCrateApiNodeLdkNodeListChannelsConstMeta, argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeWaitNextEventConstMeta => const TaskConstMeta( - debugName: "ldk_node_wait_next_event", + TaskConstMeta get kCrateApiNodeLdkNodeListChannelsConstMeta => + const TaskConstMeta( + debugName: "ldk_node_list_channels", argNames: ["that"], ); @override - Future socketAddressAsString( - {required SocketAddress that, dynamic hint}) { + Future> crateApiNodeLdkNodeListPayments( + {required LdkNode that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_socket_address(that); - return wire.wire_socket_address_as_string(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire__crate__api__node__ldk_node_list_payments(port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_String, + decodeSuccessData: dco_decode_list_payment_details, decodeErrorData: null, ), - constMeta: kSocketAddressAsStringConstMeta, + constMeta: kCrateApiNodeLdkNodeListPaymentsConstMeta, argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kSocketAddressAsStringConstMeta => const TaskConstMeta( - debugName: "socket_address_as_string", + TaskConstMeta get kCrateApiNodeLdkNodeListPaymentsConstMeta => + const TaskConstMeta( + debugName: "ldk_node_list_payments", argNames: ["that"], ); @override - Future socketAddressFromStr( - {required String address, dynamic hint}) { + Future> crateApiNodeLdkNodeListPaymentsWithFilter( + {required LdkNode that, required PaymentDirection paymentDirection}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_String(address); - return wire.wire_socket_address_from_str(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_node(that); + var arg1 = cst_encode_payment_direction(paymentDirection); + return wire.wire__crate__api__node__ldk_node_list_payments_with_filter( + port_, arg0, arg1); }, codec: DcoCodec( - decodeSuccessData: dco_decode_socket_address, - decodeErrorData: dco_decode_builder_exception, + decodeSuccessData: dco_decode_list_payment_details, + decodeErrorData: null, ), - constMeta: kSocketAddressFromStrConstMeta, - argValues: [address], + constMeta: kCrateApiNodeLdkNodeListPaymentsWithFilterConstMeta, + argValues: [that, paymentDirection], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kSocketAddressFromStrConstMeta => const TaskConstMeta( - debugName: "socket_address_from_str", - argNames: ["address"], + TaskConstMeta get kCrateApiNodeLdkNodeListPaymentsWithFilterConstMeta => + const TaskConstMeta( + debugName: "ldk_node_list_payments_with_filter", + argNames: ["that", "paymentDirection"], ); - RustArcIncrementStrongCountFnType - get rust_arc_increment_strong_count_NodeSqliteStore => - wire.rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore; + @override + Future> crateApiNodeLdkNodeListPeers( + {required LdkNode that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire__crate__api__node__ldk_node_list_peers(port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_list_peer_details, + decodeErrorData: null, + ), + constMeta: kCrateApiNodeLdkNodeListPeersConstMeta, + argValues: [that], + apiImpl: this, + )); + } - RustArcDecrementStrongCountFnType - get rust_arc_decrement_strong_count_NodeSqliteStore => - wire.rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore; + TaskConstMeta get kCrateApiNodeLdkNodeListPeersConstMeta => + const TaskConstMeta( + debugName: "ldk_node_list_peers", + argNames: ["that"], + ); - @protected - NodeSqliteStore dco_decode_RustOpaque_NodeSqliteStore(dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - return NodeSqliteStore.dcoDecode(raw as List); + @override + Future?> crateApiNodeLdkNodeListeningAddresses( + {required LdkNode that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire__crate__api__node__ldk_node_listening_addresses( + port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_opt_list_socket_address, + decodeErrorData: null, + ), + constMeta: kCrateApiNodeLdkNodeListeningAddressesConstMeta, + argValues: [that], + apiImpl: this, + )); } - @protected - String dco_decode_String(dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - return raw as String; + TaskConstMeta get kCrateApiNodeLdkNodeListeningAddressesConstMeta => + const TaskConstMeta( + debugName: "ldk_node_listening_addresses", + argNames: ["that"], + ); + + @override + Future crateApiNodeLdkNodeNetworkGraph( + {required LdkNode ptr}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(ptr); + return wire.wire__crate__api__node__ldk_node_network_graph(port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_ldk_network_graph, + decodeErrorData: null, + ), + constMeta: kCrateApiNodeLdkNodeNetworkGraphConstMeta, + argValues: [ptr], + apiImpl: this, + )); } - @protected - Address dco_decode_address(dynamic raw) { + TaskConstMeta get kCrateApiNodeLdkNodeNetworkGraphConstMeta => + const TaskConstMeta( + debugName: "ldk_node_network_graph", + argNames: ["ptr"], + ); + + @override + Future crateApiNodeLdkNodeNextEvent({required LdkNode that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire__crate__api__node__ldk_node_next_event(port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_opt_box_autoadd_event, + decodeErrorData: null, + ), + constMeta: kCrateApiNodeLdkNodeNextEventConstMeta, + argValues: [that], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeNextEventConstMeta => + const TaskConstMeta( + debugName: "ldk_node_next_event", + argNames: ["that"], + ); + + @override + Future crateApiNodeLdkNodeNextEventAsync({required LdkNode that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire__crate__api__node__ldk_node_next_event_async( + port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_event, + decodeErrorData: null, + ), + constMeta: kCrateApiNodeLdkNodeNextEventAsyncConstMeta, + argValues: [that], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeNextEventAsyncConstMeta => + const TaskConstMeta( + debugName: "ldk_node_next_event_async", + argNames: ["that"], + ); + + @override + Future crateApiNodeLdkNodeNodeId({required LdkNode that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire__crate__api__node__ldk_node_node_id(port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_public_key, + decodeErrorData: null, + ), + constMeta: kCrateApiNodeLdkNodeNodeIdConstMeta, + argValues: [that], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeNodeIdConstMeta => const TaskConstMeta( + debugName: "ldk_node_node_id", + argNames: ["that"], + ); + + @override + Future crateApiNodeLdkNodeOnChainPayment( + {required LdkNode ptr}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(ptr); + return wire.wire__crate__api__node__ldk_node_on_chain_payment( + port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_ldk_on_chain_payment, + decodeErrorData: null, + ), + constMeta: kCrateApiNodeLdkNodeOnChainPaymentConstMeta, + argValues: [ptr], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeOnChainPaymentConstMeta => + const TaskConstMeta( + debugName: "ldk_node_on_chain_payment", + argNames: ["ptr"], + ); + + @override + Future crateApiNodeLdkNodePayment( + {required LdkNode that, required PaymentId paymentId}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + var arg1 = cst_encode_box_autoadd_payment_id(paymentId); + return wire.wire__crate__api__node__ldk_node_payment(port_, arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_opt_box_autoadd_payment_details, + decodeErrorData: null, + ), + constMeta: kCrateApiNodeLdkNodePaymentConstMeta, + argValues: [that, paymentId], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodePaymentConstMeta => const TaskConstMeta( + debugName: "ldk_node_payment", + argNames: ["that", "paymentId"], + ); + + @override + Future crateApiNodeLdkNodeRemovePayment( + {required LdkNode that, required PaymentId paymentId}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + var arg1 = cst_encode_box_autoadd_payment_id(paymentId); + return wire.wire__crate__api__node__ldk_node_remove_payment( + port_, arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiNodeLdkNodeRemovePaymentConstMeta, + argValues: [that, paymentId], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeRemovePaymentConstMeta => + const TaskConstMeta( + debugName: "ldk_node_remove_payment", + argNames: ["that", "paymentId"], + ); + + @override + Future crateApiNodeLdkNodeSignMessage( + {required LdkNode that, required List msg}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + var arg1 = cst_encode_list_prim_u_8_loose(msg); + return wire.wire__crate__api__node__ldk_node_sign_message( + port_, arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiNodeLdkNodeSignMessageConstMeta, + argValues: [that, msg], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeSignMessageConstMeta => + const TaskConstMeta( + debugName: "ldk_node_sign_message", + argNames: ["that", "msg"], + ); + + @override + Future crateApiNodeLdkNodeSpontaneousPayment( + {required LdkNode ptr}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(ptr); + return wire.wire__crate__api__node__ldk_node_spontaneous_payment( + port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_ldk_spontaneous_payment, + decodeErrorData: null, + ), + constMeta: kCrateApiNodeLdkNodeSpontaneousPaymentConstMeta, + argValues: [ptr], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeSpontaneousPaymentConstMeta => + const TaskConstMeta( + debugName: "ldk_node_spontaneous_payment", + argNames: ["ptr"], + ); + + @override + Future crateApiNodeLdkNodeStart({required LdkNode that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire__crate__api__node__ldk_node_start(port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiNodeLdkNodeStartConstMeta, + argValues: [that], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeStartConstMeta => const TaskConstMeta( + debugName: "ldk_node_start", + argNames: ["that"], + ); + + @override + Future crateApiNodeLdkNodeStatus({required LdkNode that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire__crate__api__node__ldk_node_status(port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_node_status, + decodeErrorData: null, + ), + constMeta: kCrateApiNodeLdkNodeStatusConstMeta, + argValues: [that], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeStatusConstMeta => const TaskConstMeta( + debugName: "ldk_node_status", + argNames: ["that"], + ); + + @override + Future crateApiNodeLdkNodeStop({required LdkNode that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire__crate__api__node__ldk_node_stop(port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiNodeLdkNodeStopConstMeta, + argValues: [that], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeStopConstMeta => const TaskConstMeta( + debugName: "ldk_node_stop", + argNames: ["that"], + ); + + @override + Future crateApiNodeLdkNodeSyncWallets({required LdkNode that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire__crate__api__node__ldk_node_sync_wallets(port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiNodeLdkNodeSyncWalletsConstMeta, + argValues: [that], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeSyncWalletsConstMeta => + const TaskConstMeta( + debugName: "ldk_node_sync_wallets", + argNames: ["that"], + ); + + @override + Future crateApiNodeLdkNodeUpdateChannelConfig( + {required LdkNode that, + required UserChannelId userChannelId, + required PublicKey counterpartyNodeId, + required ChannelConfig channelConfig}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + var arg1 = cst_encode_box_autoadd_user_channel_id(userChannelId); + var arg2 = cst_encode_box_autoadd_public_key(counterpartyNodeId); + var arg3 = cst_encode_box_autoadd_channel_config(channelConfig); + return wire.wire__crate__api__node__ldk_node_update_channel_config( + port_, arg0, arg1, arg2, arg3); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiNodeLdkNodeUpdateChannelConfigConstMeta, + argValues: [that, userChannelId, counterpartyNodeId, channelConfig], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeUpdateChannelConfigConstMeta => + const TaskConstMeta( + debugName: "ldk_node_update_channel_config", + argNames: [ + "that", + "userChannelId", + "counterpartyNodeId", + "channelConfig" + ], + ); + + @override + Future crateApiNodeLdkNodeVerifySignature( + {required LdkNode that, + required List msg, + required String sig, + required PublicKey publicKey}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + 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(publicKey); + return wire.wire__crate__api__node__ldk_node_verify_signature( + port_, arg0, arg1, arg2, arg3); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_bool, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiNodeLdkNodeVerifySignatureConstMeta, + argValues: [that, msg, sig, publicKey], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeVerifySignatureConstMeta => + const TaskConstMeta( + debugName: "ldk_node_verify_signature", + argNames: ["that", "msg", "sig", "publicKey"], + ); + + @override + Future crateApiNodeLdkNodeWaitNextEvent({required LdkNode that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire__crate__api__node__ldk_node_wait_next_event( + port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_event, + decodeErrorData: null, + ), + constMeta: kCrateApiNodeLdkNodeWaitNextEventConstMeta, + argValues: [that], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeWaitNextEventConstMeta => + const TaskConstMeta( + debugName: "ldk_node_wait_next_event", + argNames: ["that"], + ); + + @override + Future
crateApiOnChainLdkOnChainPaymentNewAddress( + {required LdkOnChainPayment that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_on_chain_payment(that); + return wire + .wire__crate__api__on_chain__ldk_on_chain_payment_new_address( + port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_address, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiOnChainLdkOnChainPaymentNewAddressConstMeta, + argValues: [that], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiOnChainLdkOnChainPaymentNewAddressConstMeta => + const TaskConstMeta( + debugName: "ldk_on_chain_payment_new_address", + argNames: ["that"], + ); + + @override + Future crateApiOnChainLdkOnChainPaymentSendAllToAddress( + {required LdkOnChainPayment that, required Address address}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_on_chain_payment(that); + var arg1 = cst_encode_box_autoadd_address(address); + return wire + .wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address( + port_, arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_txid, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiOnChainLdkOnChainPaymentSendAllToAddressConstMeta, + argValues: [that, address], + apiImpl: this, + )); + } + + TaskConstMeta + get kCrateApiOnChainLdkOnChainPaymentSendAllToAddressConstMeta => + const TaskConstMeta( + debugName: "ldk_on_chain_payment_send_all_to_address", + argNames: ["that", "address"], + ); + + @override + Future crateApiOnChainLdkOnChainPaymentSendToAddress( + {required LdkOnChainPayment that, + required Address address, + required BigInt amountSats}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_on_chain_payment(that); + var arg1 = cst_encode_box_autoadd_address(address); + var arg2 = cst_encode_u_64(amountSats); + return wire + .wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address( + port_, arg0, arg1, arg2); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_txid, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiOnChainLdkOnChainPaymentSendToAddressConstMeta, + argValues: [that, address, amountSats], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiOnChainLdkOnChainPaymentSendToAddressConstMeta => + const TaskConstMeta( + debugName: "ldk_on_chain_payment_send_to_address", + argNames: ["that", "address", "amountSats"], + ); + + @override + Future crateApiSpontaneousLdkSpontaneousPaymentSend( + {required LdkSpontaneousPayment that, + required BigInt amountMsat, + required PublicKey nodeId}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_spontaneous_payment(that); + var arg1 = cst_encode_u_64(amountMsat); + var arg2 = cst_encode_box_autoadd_public_key(nodeId); + return wire.wire__crate__api__spontaneous__ldk_spontaneous_payment_send( + port_, arg0, arg1, arg2); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_payment_id, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiSpontaneousLdkSpontaneousPaymentSendConstMeta, + argValues: [that, amountMsat, nodeId], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiSpontaneousLdkSpontaneousPaymentSendConstMeta => + const TaskConstMeta( + debugName: "ldk_spontaneous_payment_send", + argNames: ["that", "amountMsat", "nodeId"], + ); + + @override + Future crateApiSpontaneousLdkSpontaneousPaymentSendProbes( + {required LdkSpontaneousPayment that, + required BigInt amountMsat, + required PublicKey nodeId}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_spontaneous_payment(that); + var arg1 = cst_encode_u_64(amountMsat); + var arg2 = cst_encode_box_autoadd_public_key(nodeId); + return wire + .wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes( + port_, arg0, arg1, arg2); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiSpontaneousLdkSpontaneousPaymentSendProbesConstMeta, + argValues: [that, amountMsat, nodeId], + apiImpl: this, + )); + } + + TaskConstMeta + get kCrateApiSpontaneousLdkSpontaneousPaymentSendProbesConstMeta => + const TaskConstMeta( + debugName: "ldk_spontaneous_payment_send_probes", + argNames: ["that", "amountMsat", "nodeId"], + ); + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_ArcBolt12Payment => wire + .rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_ArcBolt12Payment => wire + .rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment; + + RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_Node => + wire.rust_arc_increment_strong_count_RustOpaque_Node; + + RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_Node => + wire.rust_arc_decrement_strong_count_RustOpaque_Node; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_NodeBuilder => wire + .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_NodeBuilder => wire + .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_Builder => + wire.rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilder; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_Builder => + wire.rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilder; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_NetworkGraph => wire + .rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraph; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_NetworkGraph => wire + .rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraph; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_Bolt11Payment => wire + .rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_Bolt11Payment => wire + .rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_OnchainPayment => wire + .rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_OnchainPayment => wire + .rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_SpontaneousPayment => wire + .rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_SpontaneousPayment => wire + .rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment; + + @protected + NodeBuilder + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return NodeBuilderImpl.frbInternalDcoDecode(raw as List); + } + + @protected + NodeBuilder + dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return NodeBuilderImpl.frbInternalDcoDecode(raw as List); + } + + @protected + NodeBuilder + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return NodeBuilderImpl.frbInternalDcoDecode(raw as List); + } + + @protected + ArcBolt12Payment dco_decode_RustOpaque_Arcldk_nodepaymentBolt12Payment( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return ArcBolt12PaymentImpl.frbInternalDcoDecode(raw as List); + } + + @protected + Node dco_decode_RustOpaque_Node(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return NodeImpl.frbInternalDcoDecode(raw as List); + } + + @protected + NodeBuilder + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return NodeBuilderImpl.frbInternalDcoDecode(raw as List); + } + + @protected + Builder dco_decode_RustOpaque_ldk_nodeBuilder(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return BuilderImpl.frbInternalDcoDecode(raw as List); + } + + @protected + NetworkGraph dco_decode_RustOpaque_ldk_nodegraphNetworkGraph(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return NetworkGraphImpl.frbInternalDcoDecode(raw as List); + } + + @protected + Bolt11Payment dco_decode_RustOpaque_ldk_nodepaymentBolt11Payment( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Bolt11PaymentImpl.frbInternalDcoDecode(raw as List); + } + + @protected + OnchainPayment dco_decode_RustOpaque_ldk_nodepaymentOnchainPayment( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return OnchainPaymentImpl.frbInternalDcoDecode(raw as List); + } + + @protected + SpontaneousPayment dco_decode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return SpontaneousPaymentImpl.frbInternalDcoDecode(raw as List); + } + + @protected + String dco_decode_String(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw as String; + } + + @protected + Address dco_decode_address(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 Address( + s: dco_decode_String(arr[0]), + ); + } + + @protected + AnchorChannelsConfig dco_decode_anchor_channels_config(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 AnchorChannelsConfig( + trustedPeersNoReserve: dco_decode_list_public_key(arr[0]), + perChannelReserveSats: dco_decode_u_64(arr[1]), + ); + } + + @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 + final arr = raw as List; + if (arr.length != 1) + throw Exception('unexpected arr length: expect 1 but see ${arr.length}'); + return Bolt11Invoice( + signedRawInvoice: dco_decode_String(arr[0]), + ); + } + + @protected + Bolt12Invoice dco_decode_bolt_12_invoice(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 Bolt12Invoice( + data: dco_decode_list_prim_u_8_strict(arr[0]), + ); + } + + @protected + Bolt12ParseError dco_decode_bolt_12_parse_error(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + switch (raw[0]) { + case 0: + return Bolt12ParseError_InvalidContinuation(); + case 1: + return Bolt12ParseError_InvalidBech32Hrp(); + case 2: + return Bolt12ParseError_Bech32( + dco_decode_String(raw[1]), + ); + case 3: + return Bolt12ParseError_Decode( + dco_decode_box_autoadd_decode_error(raw[1]), + ); + case 4: + return Bolt12ParseError_InvalidSemantics( + dco_decode_String(raw[1]), + ); + case 5: + return Bolt12ParseError_InvalidSignature( + dco_decode_String(raw[1]), + ); + default: + throw Exception("unreachable"); + } + } + + @protected + bool dco_decode_bool(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw as bool; + } + + @protected + Address dco_decode_box_autoadd_address(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_address(raw); + } + + @protected + AnchorChannelsConfig dco_decode_box_autoadd_anchor_channels_config( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_anchor_channels_config(raw); + } + + @protected + Bolt11Invoice dco_decode_box_autoadd_bolt_11_invoice(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_bolt_11_invoice(raw); + } + + @protected + Bolt12ParseError dco_decode_box_autoadd_bolt_12_parse_error(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_bolt_12_parse_error(raw); + } + + @protected + ChainDataSourceConfig dco_decode_box_autoadd_chain_data_source_config( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_chain_data_source_config(raw); + } + + @protected + ChannelConfig dco_decode_box_autoadd_channel_config(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_channel_config(raw); + } + + @protected + ChannelId dco_decode_box_autoadd_channel_id(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_channel_id(raw); + } + + @protected + ChannelInfo dco_decode_box_autoadd_channel_info(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_channel_info(raw); + } + + @protected + ChannelUpdateInfo dco_decode_box_autoadd_channel_update_info(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_channel_update_info(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 + return dco_decode_config(raw); + } + + @protected + DecodeError dco_decode_box_autoadd_decode_error(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_decode_error(raw); + } + + @protected + EntropySourceConfig dco_decode_box_autoadd_entropy_source_config( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_entropy_source_config(raw); + } + + @protected + Event dco_decode_box_autoadd_event(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_event(raw); + } + + @protected + GossipSourceConfig dco_decode_box_autoadd_gossip_source_config(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_gossip_source_config(raw); + } + + @protected + LdkBolt11Payment dco_decode_box_autoadd_ldk_bolt_11_payment(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_ldk_bolt_11_payment(raw); + } + + @protected + LdkBolt12Payment dco_decode_box_autoadd_ldk_bolt_12_payment(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 Address( - s: dco_decode_String(arr[0]), - ); + return dco_decode_ldk_bolt_12_payment(raw); } @protected - Bolt11Invoice dco_decode_bolt_11_invoice(dynamic raw) { + LdkMnemonic dco_decode_box_autoadd_ldk_mnemonic(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 Bolt11Invoice( - signedRawInvoice: dco_decode_String(arr[0]), - ); + return dco_decode_ldk_mnemonic(raw); } @protected - bool dco_decode_bool(dynamic raw) { + LdkNetworkGraph dco_decode_box_autoadd_ldk_network_graph(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return raw as bool; + return dco_decode_ldk_network_graph(raw); } @protected - Address dco_decode_box_autoadd_address(dynamic raw) { + LdkNode dco_decode_box_autoadd_ldk_node(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_address(raw); + return dco_decode_ldk_node(raw); } @protected - Bolt11Invoice dco_decode_box_autoadd_bolt_11_invoice(dynamic raw) { + LdkOnChainPayment dco_decode_box_autoadd_ldk_on_chain_payment(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_bolt_11_invoice(raw); + return dco_decode_ldk_on_chain_payment(raw); } @protected - ChainDataSourceConfig dco_decode_box_autoadd_chain_data_source_config( + LdkSpontaneousPayment dco_decode_box_autoadd_ldk_spontaneous_payment( dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_chain_data_source_config(raw); + return dco_decode_ldk_spontaneous_payment(raw); } @protected - ChannelConfig dco_decode_box_autoadd_channel_config(dynamic raw) { + LiquiditySourceConfig dco_decode_box_autoadd_liquidity_source_config( + dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_channel_config(raw); + return dco_decode_liquidity_source_config(raw); } @protected - ChannelId dco_decode_box_autoadd_channel_id(dynamic raw) { + LSPFeeLimits dco_decode_box_autoadd_lsp_fee_limits(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_channel_id(raw); + return dco_decode_lsp_fee_limits(raw); } @protected - Config dco_decode_box_autoadd_config(dynamic raw) { + MaxDustHTLCExposure dco_decode_box_autoadd_max_dust_htlc_exposure( + dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_config(raw); + return dco_decode_max_dust_htlc_exposure(raw); } @protected - EntropySourceConfig dco_decode_box_autoadd_entropy_source_config( + NodeAnnouncementInfo dco_decode_box_autoadd_node_announcement_info( dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_entropy_source_config(raw); + return dco_decode_node_announcement_info(raw); } @protected - Event dco_decode_box_autoadd_event(dynamic raw) { + NodeId dco_decode_box_autoadd_node_id(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_event(raw); + return dco_decode_node_id(raw); } @protected - GossipSourceConfig dco_decode_box_autoadd_gossip_source_config(dynamic raw) { + NodeInfo dco_decode_box_autoadd_node_info(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_gossip_source_config(raw); + return dco_decode_node_info(raw); } @protected - LdkMnemonic dco_decode_box_autoadd_ldk_mnemonic(dynamic raw) { + Offer dco_decode_box_autoadd_offer(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_ldk_mnemonic(raw); + return dco_decode_offer(raw); } @protected - LdkNode dco_decode_box_autoadd_ldk_node(dynamic raw) { + OfferId dco_decode_box_autoadd_offer_id(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_ldk_node(raw); + return dco_decode_offer_id(raw); } @protected @@ -1441,12 +2662,25 @@ 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 return dco_decode_payment_hash(raw); } + @protected + PaymentId dco_decode_box_autoadd_payment_id(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_payment_id(raw); + } + @protected PaymentPreimage dco_decode_box_autoadd_payment_preimage(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1465,6 +2699,12 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return dco_decode_public_key(raw); } + @protected + Refund dco_decode_box_autoadd_refund(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_refund(raw); + } + @protected SocketAddress dco_decode_box_autoadd_socket_address(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1472,27 +2712,33 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - int dco_decode_box_autoadd_u_32(dynamic raw) { + 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_64(dynamic raw) { + int dco_decode_box_autoadd_u_32(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_u_64(raw); + return raw as int; } @protected - UserChannelId dco_decode_box_autoadd_user_channel_id(dynamic raw) { + BigInt dco_decode_box_autoadd_u_64(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_user_channel_id(raw); + return dco_decode_u_64(raw); } @protected - BuilderException dco_decode_builder_exception(dynamic raw) { + UserChannelId dco_decode_box_autoadd_user_channel_id(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return BuilderException.values[raw as int]; + return dco_decode_user_channel_id(raw); } @protected @@ -1518,7 +2764,8 @@ 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_max_dust_htlc_exposure(arr[3]), + maxDustHtlcExposure: + dco_decode_opt_box_autoadd_max_dust_htlc_exposure(arr[3]), forceCloseAvoidanceMaxFeeSatoshis: dco_decode_u_64(arr[4]), acceptUnderpayingHtlcs: dco_decode_bool(arr[5]), ); @@ -1528,133 +2775,515 @@ 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 != 16) - throw Exception('unexpected arr length: expect 16 but see ${arr.length}'); + if (arr.length != 28) + throw Exception('unexpected arr length: expect 28 but see ${arr.length}'); return ChannelDetails( channelId: dco_decode_channel_id(arr[0]), counterpartyNodeId: dco_decode_public_key(arr[1]), - fundingTxo: dco_decode_opt_String(arr[2]), + fundingTxo: dco_decode_opt_box_autoadd_out_point(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]), - 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]), + 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]), + ); + } + + @protected + ChannelId dco_decode_channel_id(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 ChannelId( + data: dco_decode_u_8_array_32(arr[0]), + ); + } + + @protected + ChannelInfo dco_decode_channel_info(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 ChannelInfo( + nodeOne: dco_decode_node_id(arr[0]), + oneToTwo: dco_decode_opt_box_autoadd_channel_update_info(arr[1]), + nodeTwo: dco_decode_node_id(arr[2]), + twoToOne: dco_decode_opt_box_autoadd_channel_update_info(arr[3]), + capacitySats: dco_decode_opt_box_autoadd_u_64(arr[4]), + ); + } + + @protected + ChannelUpdateInfo dco_decode_channel_update_info(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + final arr = raw as List; + if (arr.length != 6) + throw Exception('unexpected arr length: expect 6 but see ${arr.length}'); + return ChannelUpdateInfo( + lastUpdate: dco_decode_u_32(arr[0]), + enabled: dco_decode_bool(arr[1]), + cltvExpiryDelta: dco_decode_u_16(arr[2]), + htlcMinimumMsat: dco_decode_u_64(arr[3]), + htlcMaximumMsat: dco_decode_u_64(arr[4]), + fees: dco_decode_routing_fees(arr[5]), + ); + } + + @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_LegacyCooperativeClosure(); + case 3: + return ClosureReason_CounterpartyInitiatedCooperativeClosure(); + case 4: + return ClosureReason_LocallyInitiatedCooperativeClosure(); + case 5: + return ClosureReason_CommitmentTxConfirmed(); + case 6: + return ClosureReason_FundingTimedOut(); + case 7: + return ClosureReason_ProcessingError( + err: dco_decode_String(raw[1]), + ); + case 8: + return ClosureReason_DisconnectedPeer(); + case 9: + return ClosureReason_OutdatedChannelManager(); + case 10: + return ClosureReason_CounterpartyCoopClosedUnfundedChannel(); + case 11: + return ClosureReason_FundingBatchClosure(); + case 12: + return ClosureReason_HTLCsTimedOut(); + default: + throw Exception("unreachable"); + } + } + + @protected + Config dco_decode_config(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + final arr = raw as List; + if (arr.length != 12) + throw Exception('unexpected arr length: expect 12 but see ${arr.length}'); + return Config( + storageDirPath: dco_decode_String(arr[0]), + logDirPath: dco_decode_opt_String(arr[1]), + network: dco_decode_network(arr[2]), + listeningAddresses: dco_decode_opt_list_socket_address(arr[3]), + defaultCltvExpiryDelta: dco_decode_u_32(arr[4]), + onchainWalletSyncIntervalSecs: dco_decode_u_64(arr[5]), + walletSyncIntervalSecs: dco_decode_u_64(arr[6]), + feeRateCacheUpdateIntervalSecs: dco_decode_u_64(arr[7]), + trustedPeers0Conf: dco_decode_list_public_key(arr[8]), + probingLiquidityLimitMultiplier: dco_decode_u_64(arr[9]), + logLevel: dco_decode_log_level(arr[10]), + anchorChannelsConfig: + dco_decode_opt_box_autoadd_anchor_channels_config(arr[11]), + ); + } + + @protected + DecodeError dco_decode_decode_error(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + switch (raw[0]) { + case 0: + return DecodeError_UnknownVersion(); + case 1: + return DecodeError_UnknownRequiredFeature(); + case 2: + return DecodeError_InvalidValue(); + case 3: + return DecodeError_ShortRead(); + case 4: + return DecodeError_BadLengthDescriptor(); + case 5: + return DecodeError_Io( + dco_decode_String(raw[1]), + ); + case 6: + return DecodeError_UnsupportedCompression(); + case 7: + return DecodeError_DangerousValue(); + default: + throw Exception("unreachable"); + } + } + + @protected + EntropySourceConfig dco_decode_entropy_source_config(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + switch (raw[0]) { + case 0: + return EntropySourceConfig_SeedFile( + dco_decode_String(raw[1]), + ); + case 1: + return EntropySourceConfig_SeedBytes( + dco_decode_u_8_array_64(raw[1]), + ); + case 2: + return EntropySourceConfig_Bip39Mnemonic( + mnemonic: dco_decode_box_autoadd_ldk_mnemonic(raw[1]), + passphrase: dco_decode_opt_String(raw[2]), + ); + default: + throw Exception("unreachable"); + } + } + + @protected + Event dco_decode_event(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + switch (raw[0]) { + case 0: + return Event_PaymentClaimable( + paymentId: dco_decode_box_autoadd_payment_id(raw[1]), + paymentHash: dco_decode_box_autoadd_payment_hash(raw[2]), + claimableAmountMsat: dco_decode_u_64(raw[3]), + claimDeadline: dco_decode_opt_box_autoadd_u_32(raw[4]), + ); + case 1: + return Event_PaymentSuccessful( + paymentId: dco_decode_opt_box_autoadd_payment_id(raw[1]), + paymentHash: dco_decode_box_autoadd_payment_hash(raw[2]), + feePaidMsat: dco_decode_opt_box_autoadd_u_64(raw[3]), + ); + case 2: + return Event_PaymentFailed( + paymentId: dco_decode_opt_box_autoadd_payment_id(raw[1]), + paymentHash: dco_decode_box_autoadd_payment_hash(raw[2]), + reason: dco_decode_opt_box_autoadd_payment_failure_reason(raw[3]), + ); + case 3: + return Event_PaymentReceived( + paymentId: dco_decode_opt_box_autoadd_payment_id(raw[1]), + paymentHash: dco_decode_box_autoadd_payment_hash(raw[2]), + amountMsat: dco_decode_u_64(raw[3]), + ); + case 4: + return Event_ChannelPending( + 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]), + ); + case 5: + return Event_ChannelReady( + 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 6: + 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]), + reason: dco_decode_opt_box_autoadd_closure_reason(raw[4]), + ); + default: + throw Exception("unreachable"); + } + } + + @protected + GossipSourceConfig dco_decode_gossip_source_config(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + switch (raw[0]) { + case 0: + return GossipSourceConfig_P2PNetwork(); + case 1: + return GossipSourceConfig_RapidGossipSync( + dco_decode_String(raw[1]), + ); + default: + throw Exception("unreachable"); + } + } + + @protected + int dco_decode_i_32(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw as int; + } + + @protected + LdkBolt11Payment dco_decode_ldk_bolt_11_payment(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 LdkBolt11Payment( + ptr: dco_decode_RustOpaque_ldk_nodepaymentBolt11Payment(arr[0]), + ); + } + + @protected + LdkBolt12Payment dco_decode_ldk_bolt_12_payment(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 LdkBolt12Payment( + ptr: dco_decode_RustOpaque_Arcldk_nodepaymentBolt12Payment(arr[0]), + ); + } + + @protected + LdkBuilderError dco_decode_ldk_builder_error(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return LdkBuilderError.values[raw as int]; + } + + @protected + LdkMnemonic dco_decode_ldk_mnemonic(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 LdkMnemonic( + seedPhrase: dco_decode_String(arr[0]), ); } @protected - ChannelId dco_decode_channel_id(dynamic raw) { + LdkNetworkGraph dco_decode_ldk_network_graph(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 ChannelId( - data: dco_decode_u_8_array_32(arr[0]), + return LdkNetworkGraph( + ptr: dco_decode_RustOpaque_ldk_nodegraphNetworkGraph(arr[0]), ); } @protected - Config dco_decode_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 != 11) - throw Exception('unexpected arr length: expect 11 but see ${arr.length}'); - return Config( - storageDirPath: dco_decode_String(arr[0]), - logDirPath: dco_decode_opt_String(arr[1]), - network: dco_decode_network(arr[2]), - listeningAddresses: dco_decode_opt_list_socket_address(arr[3]), - defaultCltvExpiryDelta: dco_decode_u_32(arr[4]), - onchainWalletSyncIntervalSecs: dco_decode_u_64(arr[5]), - walletSyncIntervalSecs: dco_decode_u_64(arr[6]), - feeRateCacheUpdateIntervalSecs: dco_decode_u_64(arr[7]), - trustedPeers0Conf: dco_decode_list_public_key(arr[8]), - probingLiquidityLimitMultiplier: dco_decode_u_64(arr[9]), - logLevel: dco_decode_log_level(arr[10]), + if (arr.length != 1) + throw Exception('unexpected arr length: expect 1 but see ${arr.length}'); + return LdkNode( + ptr: dco_decode_RustOpaque_Node(arr[0]), ); } @protected - EntropySourceConfig dco_decode_entropy_source_config(dynamic raw) { + LdkNodeError dco_decode_ldk_node_error(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs switch (raw[0]) { case 0: - return EntropySourceConfig_SeedFile( - dco_decode_String(raw[1]), - ); + return LdkNodeError_InvalidTxid(); case 1: - return EntropySourceConfig_SeedBytes( - dco_decode_u_8_array_64(raw[1]), - ); + return LdkNodeError_AlreadyRunning(); case 2: - return EntropySourceConfig_Bip39Mnemonic( - mnemonic: dco_decode_box_autoadd_ldk_mnemonic(raw[1]), - passphrase: dco_decode_opt_String(raw[2]), + return LdkNodeError_NotRunning(); + case 3: + return LdkNodeError_OnchainTxCreationFailed(); + case 4: + return LdkNodeError_ConnectionFailed(); + case 5: + return LdkNodeError_InvoiceCreationFailed(); + case 6: + return LdkNodeError_PaymentSendingFailed(); + case 7: + return LdkNodeError_ProbeSendingFailed(); + case 8: + return LdkNodeError_ChannelCreationFailed(); + case 9: + return LdkNodeError_ChannelClosingFailed(); + case 10: + return LdkNodeError_ChannelConfigUpdateFailed(); + case 11: + return LdkNodeError_PersistenceFailed(); + case 12: + return LdkNodeError_WalletOperationFailed(); + case 13: + return LdkNodeError_OnchainTxSigningFailed(); + case 14: + return LdkNodeError_MessageSigningFailed(); + case 15: + return LdkNodeError_TxSyncFailed(); + case 16: + return LdkNodeError_GossipUpdateFailed(); + case 17: + return LdkNodeError_InvalidAddress(); + case 18: + return LdkNodeError_InvalidSocketAddress(); + case 19: + return LdkNodeError_InvalidPublicKey(); + case 20: + return LdkNodeError_InvalidSecretKey(); + case 21: + return LdkNodeError_InvalidPaymentHash(); + case 22: + return LdkNodeError_InvalidPaymentPreimage(); + case 23: + return LdkNodeError_InvalidPaymentSecret(); + case 24: + return LdkNodeError_InvalidAmount(); + case 25: + return LdkNodeError_InvalidInvoice(); + case 26: + return LdkNodeError_InvalidChannelId(); + case 27: + return LdkNodeError_InvalidNetwork(); + case 28: + return LdkNodeError_DuplicatePayment(); + case 29: + return LdkNodeError_InsufficientFunds(); + case 30: + return LdkNodeError_FeerateEstimationUpdateFailed(); + case 31: + return LdkNodeError_LiquidityRequestFailed(); + case 32: + return LdkNodeError_LiquiditySourceUnavailable(); + case 33: + return LdkNodeError_LiquidityFeeTooHigh(); + case 34: + return LdkNodeError_InvalidPaymentId(); + case 35: + return LdkNodeError_Decode( + dco_decode_box_autoadd_decode_error(raw[1]), ); + case 36: + return LdkNodeError_Bolt12Parse( + dco_decode_box_autoadd_bolt_12_parse_error(raw[1]), + ); + case 37: + return LdkNodeError_InvoiceRequestCreationFailed(); + case 38: + return LdkNodeError_OfferCreationFailed(); + case 39: + return LdkNodeError_RefundCreationFailed(); + case 40: + return LdkNodeError_FeerateEstimationUpdateTimeout(); + case 41: + return LdkNodeError_WalletOperationTimeout(); + case 42: + return LdkNodeError_TxSyncTimeout(); + case 43: + return LdkNodeError_GossipUpdateTimeout(); + case 44: + return LdkNodeError_InvalidOfferId(); + case 45: + return LdkNodeError_InvalidNodeId(); + case 46: + return LdkNodeError_InvalidOffer(); + case 47: + return LdkNodeError_InvalidRefund(); + case 48: + return LdkNodeError_UnsupportedCurrency(); default: throw Exception("unreachable"); } } @protected - Event dco_decode_event(dynamic raw) { + LdkOnChainPayment dco_decode_ldk_on_chain_payment(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 LdkOnChainPayment( + ptr: dco_decode_RustOpaque_ldk_nodepaymentOnchainPayment(arr[0]), + ); + } + + @protected + LdkSpontaneousPayment dco_decode_ldk_spontaneous_payment(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 LdkSpontaneousPayment( + ptr: dco_decode_RustOpaque_ldk_nodepaymentSpontaneousPayment(arr[0]), + ); + } + + @protected + LightningBalance dco_decode_lightning_balance(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs switch (raw[0]) { case 0: - return Event_PaymentSuccessful( - paymentHash: dco_decode_box_autoadd_payment_hash(raw[1]), + 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 Event_PaymentFailed( - paymentHash: dco_decode_box_autoadd_payment_hash(raw[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 Event_PaymentReceived( - paymentHash: dco_decode_box_autoadd_payment_hash(raw[1]), - amountMsat: dco_decode_u_64(raw[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 Event_ChannelReady( + return LightningBalance_MaybeTimeoutClaimableHTLC( 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]), + 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 Event_ChannelClosed( + return LightningBalance_MaybePreimageClaimableHTLC( 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]), + 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 Event_ChannelPending( + return LightningBalance_CounterpartyRevokedOutputClaimable( 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]), - ); - default: - throw Exception("unreachable"); - } - } - - @protected - GossipSourceConfig dco_decode_gossip_source_config(dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - switch (raw[0]) { - case 0: - return GossipSourceConfig_P2PNetwork(); - case 1: - return GossipSourceConfig_RapidGossipSync( - dco_decode_String(raw[1]), + counterpartyNodeId: dco_decode_box_autoadd_public_key(raw[2]), + amountSatoshis: dco_decode_u_64(raw[3]), ); default: throw Exception("unreachable"); @@ -1662,37 +3291,33 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - int dco_decode_i_32(dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - return raw as int; - } - - @protected - LdkMnemonic dco_decode_ldk_mnemonic(dynamic raw) { + LiquiditySourceConfig dco_decode_liquidity_source_config(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 LdkMnemonic( - seedPhrase: dco_decode_String(arr[0]), + return LiquiditySourceConfig( + lsps2Service: + dco_decode_record_socket_address_public_key_opt_string(arr[0]), ); } @protected - LdkNode dco_decode_ldk_node(dynamic raw) { + List dco_decode_list_channel_details(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 LdkNode( - ptr: dco_decode_RustOpaque_NodeSqliteStore(arr[0]), - ); + return (raw as List).map(dco_decode_channel_details).toList(); } @protected - List dco_decode_list_channel_details(dynamic raw) { + 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_channel_details).toList(); + return (raw as List).map(dco_decode_lightning_balance).toList(); + } + + @protected + List dco_decode_list_node_id(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return (raw as List).map(dco_decode_node_id).toList(); } @protected @@ -1707,6 +3332,20 @@ 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 + Uint64List dco_decode_list_prim_u_64_strict(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dcoDecodeUint64List(raw); + } + @protected List dco_decode_list_prim_u_8_loose(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1737,6 +3376,18 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return LogLevel.values[raw as int]; } + @protected + LSPFeeLimits dco_decode_lsp_fee_limits(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 LSPFeeLimits( + maxTotalOpeningFeeMsat: dco_decode_opt_box_autoadd_u_64(arr[0]), + maxProportionalOpeningFeePpmMsat: dco_decode_opt_box_autoadd_u_64(arr[1]), + ); + } + @protected MaxDustHTLCExposure dco_decode_max_dust_htlc_exposure(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1761,9 +3412,82 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - NodeException dco_decode_node_exception(dynamic raw) { + NodeAnnouncementInfo dco_decode_node_announcement_info(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + final arr = raw as List; + if (arr.length != 3) + throw Exception('unexpected arr length: expect 3 but see ${arr.length}'); + return NodeAnnouncementInfo( + lastUpdate: dco_decode_u_32(arr[0]), + alias: dco_decode_String(arr[1]), + addresses: dco_decode_list_socket_address(arr[2]), + ); + } + + @protected + NodeId dco_decode_node_id(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 NodeId( + compressed: dco_decode_list_prim_u_8_strict(arr[0]), + ); + } + + @protected + NodeInfo dco_decode_node_info(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 NodeInfo( + channels: dco_decode_list_prim_u_64_strict(arr[0]), + announcementInfo: + dco_decode_opt_box_autoadd_node_announcement_info(arr[1]), + ); + } + + @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]), + ); + } + + @protected + Offer dco_decode_offer(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 Offer( + s: dco_decode_String(arr[0]), + ); + } + + @protected + OfferId dco_decode_offer_id(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return NodeException.values[raw as int]; + final arr = raw as List; + if (arr.length != 1) + throw Exception('unexpected arr length: expect 1 but see ${arr.length}'); + return OfferId( + field0: dco_decode_u_8_array_32(arr[0]), + ); } @protected @@ -1772,6 +3496,15 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return raw == null ? null : dco_decode_String(raw); } + @protected + AnchorChannelsConfig? dco_decode_opt_box_autoadd_anchor_channels_config( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw == null + ? null + : dco_decode_box_autoadd_anchor_channels_config(raw); + } + @protected ChainDataSourceConfig? dco_decode_opt_box_autoadd_chain_data_source_config( dynamic raw) { @@ -1787,6 +3520,31 @@ 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 + ChannelInfo? dco_decode_opt_box_autoadd_channel_info(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw == null ? null : dco_decode_box_autoadd_channel_info(raw); + } + + @protected + ChannelUpdateInfo? dco_decode_opt_box_autoadd_channel_update_info( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw == null ? null : dco_decode_box_autoadd_channel_update_info(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) { @@ -1811,12 +3569,72 @@ 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 + NodeAnnouncementInfo? dco_decode_opt_box_autoadd_node_announcement_info( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw == null + ? null + : dco_decode_box_autoadd_node_announcement_info(raw); + } + + @protected + NodeInfo? dco_decode_opt_box_autoadd_node_info(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw == null ? null : dco_decode_box_autoadd_node_info(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 + PaymentHash? dco_decode_opt_box_autoadd_payment_hash(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw == null ? null : dco_decode_box_autoadd_payment_hash(raw); + } + + @protected + PaymentId? dco_decode_opt_box_autoadd_payment_id(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw == null ? null : dco_decode_box_autoadd_payment_id(raw); + } + @protected PaymentPreimage? dco_decode_opt_box_autoadd_payment_preimage(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1835,6 +3653,12 @@ 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 @@ -1842,7 +3666,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - int? dco_decode_opt_box_autoadd_u_64(dynamic raw) { + BigInt? dco_decode_opt_box_autoadd_u_64(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs return raw == null ? null : dco_decode_box_autoadd_u_64(raw); } @@ -1869,15 +3693,14 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { PaymentDetails dco_decode_payment_details(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs final arr = raw as List; - if (arr.length != 6) - throw Exception('unexpected arr length: expect 6 but see ${arr.length}'); + if (arr.length != 5) + throw Exception('unexpected arr length: expect 5 but see ${arr.length}'); return PaymentDetails( - hash: dco_decode_payment_hash(arr[0]), - preimage: dco_decode_opt_box_autoadd_payment_preimage(arr[1]), - secret: dco_decode_opt_box_autoadd_payment_secret(arr[2]), - amountMsat: dco_decode_opt_box_autoadd_u_64(arr[3]), - direction: dco_decode_payment_direction(arr[4]), - status: dco_decode_payment_status(arr[5]), + id: dco_decode_payment_id(arr[0]), + kind: dco_decode_payment_kind(arr[1]), + amountMsat: dco_decode_opt_box_autoadd_u_64(arr[2]), + direction: dco_decode_payment_direction(arr[3]), + status: dco_decode_payment_status(arr[4]), ); } @@ -1887,6 +3710,12 @@ 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 @@ -1898,6 +3727,59 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { ); } + @protected + PaymentId dco_decode_payment_id(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 PaymentId( + field0: dco_decode_u_8_array_32(arr[0]), + ); + } + + @protected + PaymentKind dco_decode_payment_kind(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + switch (raw[0]) { + case 0: + return PaymentKind_Onchain(); + case 1: + return PaymentKind_Bolt11( + hash: dco_decode_box_autoadd_payment_hash(raw[1]), + preimage: dco_decode_opt_box_autoadd_payment_preimage(raw[2]), + secret: dco_decode_opt_box_autoadd_payment_secret(raw[3]), + ); + case 2: + return PaymentKind_Bolt11Jit( + hash: dco_decode_box_autoadd_payment_hash(raw[1]), + preimage: dco_decode_opt_box_autoadd_payment_preimage(raw[2]), + secret: dco_decode_opt_box_autoadd_payment_secret(raw[3]), + lspFeeLimits: dco_decode_box_autoadd_lsp_fee_limits(raw[4]), + ); + case 3: + return PaymentKind_Spontaneous( + hash: dco_decode_box_autoadd_payment_hash(raw[1]), + preimage: dco_decode_opt_box_autoadd_payment_preimage(raw[2]), + ); + case 4: + return PaymentKind_Bolt12Offer( + hash: dco_decode_opt_box_autoadd_payment_hash(raw[1]), + preimage: dco_decode_opt_box_autoadd_payment_preimage(raw[2]), + secret: dco_decode_opt_box_autoadd_payment_secret(raw[3]), + offerId: dco_decode_box_autoadd_offer_id(raw[4]), + ); + case 5: + return PaymentKind_Bolt12Refund( + hash: dco_decode_opt_box_autoadd_payment_hash(raw[1]), + preimage: dco_decode_opt_box_autoadd_payment_preimage(raw[2]), + secret: dco_decode_opt_box_autoadd_payment_secret(raw[3]), + ); + default: + throw Exception("unreachable"); + } + } + @protected PaymentPreimage dco_decode_payment_preimage(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1939,6 +3821,35 @@ 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 @@ -1950,6 +3861,44 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { ); } + @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]), + ); + } + + @protected + Refund dco_decode_refund(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 Refund( + s: dco_decode_String(arr[0]), + ); + } + + @protected + RoutingFees dco_decode_routing_fees(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 RoutingFees( + baseMsat: dco_decode_u_32(arr[0]), + proportionalMillionths: dco_decode_u_32(arr[1]), + ); + } + @protected SocketAddress dco_decode_socket_address(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -2009,9 +3958,9 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - int dco_decode_u_64(dynamic raw) { + BigInt dco_decode_u_64(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dcoDecodeI64OrU64(raw); + return dcoDecodeU64(raw); } @protected @@ -2063,21 +4012,103 @@ 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_u_64(arr[0]), + data: dco_decode_list_prim_u_8_strict(arr[0]), ); } @protected - int dco_decode_usize(dynamic raw) { + BigInt dco_decode_usize(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dcoDecodeI64OrU64(raw); + return dcoDecodeU64(raw); + } + + @protected + NodeBuilder + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return NodeBuilderImpl.frbInternalSseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + NodeBuilder + sse_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return NodeBuilderImpl.frbInternalSseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + NodeBuilder + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return NodeBuilderImpl.frbInternalSseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + ArcBolt12Payment sse_decode_RustOpaque_Arcldk_nodepaymentBolt12Payment( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return ArcBolt12PaymentImpl.frbInternalSseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Node sse_decode_RustOpaque_Node(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return NodeImpl.frbInternalSseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + NodeBuilder + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return NodeBuilderImpl.frbInternalSseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Builder sse_decode_RustOpaque_ldk_nodeBuilder(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return BuilderImpl.frbInternalSseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + NetworkGraph sse_decode_RustOpaque_ldk_nodegraphNetworkGraph( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return NetworkGraphImpl.frbInternalSseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Bolt11Payment sse_decode_RustOpaque_ldk_nodepaymentBolt11Payment( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return Bolt11PaymentImpl.frbInternalSseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + OnchainPayment sse_decode_RustOpaque_ldk_nodepaymentOnchainPayment( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return OnchainPaymentImpl.frbInternalSseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); } @protected - NodeSqliteStore sse_decode_RustOpaque_NodeSqliteStore( + SpontaneousPayment sse_decode_RustOpaque_ldk_nodepaymentSpontaneousPayment( SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return NodeSqliteStore.sseDecode( + return SpontaneousPaymentImpl.frbInternalSseDecode( sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); } @@ -2095,6 +4126,43 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return Address(s: var_s); } + @protected + AnchorChannelsConfig sse_decode_anchor_channels_config( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_trustedPeersNoReserve = sse_decode_list_public_key(deserializer); + var var_perChannelReserveSats = sse_decode_u_64(deserializer); + return AnchorChannelsConfig( + trustedPeersNoReserve: var_trustedPeersNoReserve, + perChannelReserveSats: var_perChannelReserveSats); + } + + @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 @@ -2102,6 +4170,41 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return Bolt11Invoice(signedRawInvoice: var_signedRawInvoice); } + @protected + Bolt12Invoice sse_decode_bolt_12_invoice(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_data = sse_decode_list_prim_u_8_strict(deserializer); + return Bolt12Invoice(data: var_data); + } + + @protected + Bolt12ParseError sse_decode_bolt_12_parse_error( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + var tag_ = sse_decode_i_32(deserializer); + switch (tag_) { + case 0: + return Bolt12ParseError_InvalidContinuation(); + case 1: + return Bolt12ParseError_InvalidBech32Hrp(); + case 2: + var var_field0 = sse_decode_String(deserializer); + return Bolt12ParseError_Bech32(var_field0); + case 3: + var var_field0 = sse_decode_box_autoadd_decode_error(deserializer); + return Bolt12ParseError_Decode(var_field0); + case 4: + var var_field0 = sse_decode_String(deserializer); + return Bolt12ParseError_InvalidSemantics(var_field0); + case 5: + var var_field0 = sse_decode_String(deserializer); + return Bolt12ParseError_InvalidSignature(var_field0); + default: + throw UnimplementedError(''); + } + } + @protected bool sse_decode_bool(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -2111,73 +4214,202 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { @protected Address sse_decode_box_autoadd_address(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_address(deserializer)); + return (sse_decode_address(deserializer)); + } + + @protected + AnchorChannelsConfig sse_decode_box_autoadd_anchor_channels_config( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_anchor_channels_config(deserializer)); + } + + @protected + Bolt11Invoice sse_decode_box_autoadd_bolt_11_invoice( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_bolt_11_invoice(deserializer)); + } + + @protected + Bolt12ParseError sse_decode_box_autoadd_bolt_12_parse_error( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_bolt_12_parse_error(deserializer)); + } + + @protected + ChainDataSourceConfig sse_decode_box_autoadd_chain_data_source_config( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_chain_data_source_config(deserializer)); + } + + @protected + ChannelConfig sse_decode_box_autoadd_channel_config( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_channel_config(deserializer)); + } + + @protected + ChannelId sse_decode_box_autoadd_channel_id(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_channel_id(deserializer)); + } + + @protected + ChannelInfo sse_decode_box_autoadd_channel_info( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_channel_info(deserializer)); + } + + @protected + ChannelUpdateInfo sse_decode_box_autoadd_channel_update_info( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_channel_update_info(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 + return (sse_decode_config(deserializer)); + } + + @protected + DecodeError sse_decode_box_autoadd_decode_error( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_decode_error(deserializer)); + } + + @protected + EntropySourceConfig sse_decode_box_autoadd_entropy_source_config( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_entropy_source_config(deserializer)); + } + + @protected + Event sse_decode_box_autoadd_event(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_event(deserializer)); + } + + @protected + GossipSourceConfig sse_decode_box_autoadd_gossip_source_config( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_gossip_source_config(deserializer)); + } + + @protected + LdkBolt11Payment sse_decode_box_autoadd_ldk_bolt_11_payment( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_ldk_bolt_11_payment(deserializer)); + } + + @protected + LdkBolt12Payment sse_decode_box_autoadd_ldk_bolt_12_payment( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_ldk_bolt_12_payment(deserializer)); + } + + @protected + LdkMnemonic sse_decode_box_autoadd_ldk_mnemonic( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_ldk_mnemonic(deserializer)); + } + + @protected + LdkNetworkGraph sse_decode_box_autoadd_ldk_network_graph( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_ldk_network_graph(deserializer)); + } + + @protected + LdkNode sse_decode_box_autoadd_ldk_node(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_ldk_node(deserializer)); } @protected - Bolt11Invoice sse_decode_box_autoadd_bolt_11_invoice( + LdkOnChainPayment sse_decode_box_autoadd_ldk_on_chain_payment( SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_bolt_11_invoice(deserializer)); + return (sse_decode_ldk_on_chain_payment(deserializer)); } @protected - ChainDataSourceConfig sse_decode_box_autoadd_chain_data_source_config( + LdkSpontaneousPayment sse_decode_box_autoadd_ldk_spontaneous_payment( SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_chain_data_source_config(deserializer)); + return (sse_decode_ldk_spontaneous_payment(deserializer)); } @protected - ChannelConfig sse_decode_box_autoadd_channel_config( + LiquiditySourceConfig sse_decode_box_autoadd_liquidity_source_config( SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_channel_config(deserializer)); + return (sse_decode_liquidity_source_config(deserializer)); } @protected - ChannelId sse_decode_box_autoadd_channel_id(SseDeserializer deserializer) { + LSPFeeLimits sse_decode_box_autoadd_lsp_fee_limits( + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_channel_id(deserializer)); + return (sse_decode_lsp_fee_limits(deserializer)); } @protected - Config sse_decode_box_autoadd_config(SseDeserializer deserializer) { + MaxDustHTLCExposure sse_decode_box_autoadd_max_dust_htlc_exposure( + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_config(deserializer)); + return (sse_decode_max_dust_htlc_exposure(deserializer)); } @protected - EntropySourceConfig sse_decode_box_autoadd_entropy_source_config( + NodeAnnouncementInfo sse_decode_box_autoadd_node_announcement_info( SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_entropy_source_config(deserializer)); + return (sse_decode_node_announcement_info(deserializer)); } @protected - Event sse_decode_box_autoadd_event(SseDeserializer deserializer) { + NodeId sse_decode_box_autoadd_node_id(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_event(deserializer)); + return (sse_decode_node_id(deserializer)); } @protected - GossipSourceConfig sse_decode_box_autoadd_gossip_source_config( - SseDeserializer deserializer) { + NodeInfo sse_decode_box_autoadd_node_info(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_gossip_source_config(deserializer)); + return (sse_decode_node_info(deserializer)); } @protected - LdkMnemonic sse_decode_box_autoadd_ldk_mnemonic( - SseDeserializer deserializer) { + Offer sse_decode_box_autoadd_offer(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_ldk_mnemonic(deserializer)); + return (sse_decode_offer(deserializer)); } @protected - LdkNode sse_decode_box_autoadd_ldk_node(SseDeserializer deserializer) { + OfferId sse_decode_box_autoadd_offer_id(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_ldk_node(deserializer)); + return (sse_decode_offer_id(deserializer)); } @protected @@ -2193,6 +4425,13 @@ 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) { @@ -2200,6 +4439,12 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return (sse_decode_payment_hash(deserializer)); } + @protected + PaymentId sse_decode_box_autoadd_payment_id(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_payment_id(deserializer)); + } + @protected PaymentPreimage sse_decode_box_autoadd_payment_preimage( SseDeserializer deserializer) { @@ -2220,6 +4465,12 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return (sse_decode_public_key(deserializer)); } + @protected + Refund sse_decode_box_autoadd_refund(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_refund(deserializer)); + } + @protected SocketAddress sse_decode_box_autoadd_socket_address( SseDeserializer deserializer) { @@ -2227,6 +4478,18 @@ 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 @@ -2234,7 +4497,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - int sse_decode_box_autoadd_u_64(SseDeserializer deserializer) { + BigInt sse_decode_box_autoadd_u_64(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs return (sse_decode_u_64(deserializer)); } @@ -2246,13 +4509,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return (sse_decode_user_channel_id(deserializer)); } - @protected - 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 BuilderException.values[inner]; - } - @protected ChainDataSourceConfig sse_decode_chain_data_source_config( SseDeserializer deserializer) { @@ -2275,7 +4531,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_max_dust_htlc_exposure(deserializer); + sse_decode_opt_box_autoadd_max_dust_htlc_exposure(deserializer); var var_forceCloseAvoidanceMaxFeeSatoshis = sse_decode_u_64(deserializer); var var_acceptUnderpayingHtlcs = sse_decode_bool(deserializer); return ChannelConfig( @@ -2294,13 +4550,12 @@ 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_String(deserializer); + var var_fundingTxo = sse_decode_opt_box_autoadd_out_point(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 = @@ -2310,6 +4565,27 @@ 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, @@ -2318,7 +4594,6 @@ 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, @@ -2326,7 +4601,26 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { isOutbound: var_isOutbound, isChannelReady: var_isChannelReady, isUsable: var_isUsable, - isPublic: var_isPublic); + 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); } @protected @@ -2336,6 +4630,82 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return ChannelId(data: var_data); } + @protected + ChannelInfo sse_decode_channel_info(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_nodeOne = sse_decode_node_id(deserializer); + var var_oneToTwo = + sse_decode_opt_box_autoadd_channel_update_info(deserializer); + var var_nodeTwo = sse_decode_node_id(deserializer); + var var_twoToOne = + sse_decode_opt_box_autoadd_channel_update_info(deserializer); + var var_capacitySats = sse_decode_opt_box_autoadd_u_64(deserializer); + return ChannelInfo( + nodeOne: var_nodeOne, + oneToTwo: var_oneToTwo, + nodeTwo: var_nodeTwo, + twoToOne: var_twoToOne, + capacitySats: var_capacitySats); + } + + @protected + ChannelUpdateInfo sse_decode_channel_update_info( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_lastUpdate = sse_decode_u_32(deserializer); + var var_enabled = sse_decode_bool(deserializer); + var var_cltvExpiryDelta = sse_decode_u_16(deserializer); + var var_htlcMinimumMsat = sse_decode_u_64(deserializer); + var var_htlcMaximumMsat = sse_decode_u_64(deserializer); + var var_fees = sse_decode_routing_fees(deserializer); + return ChannelUpdateInfo( + lastUpdate: var_lastUpdate, + enabled: var_enabled, + cltvExpiryDelta: var_cltvExpiryDelta, + htlcMinimumMsat: var_htlcMinimumMsat, + htlcMaximumMsat: var_htlcMaximumMsat, + fees: var_fees); + } + + @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_LegacyCooperativeClosure(); + case 3: + return ClosureReason_CounterpartyInitiatedCooperativeClosure(); + case 4: + return ClosureReason_LocallyInitiatedCooperativeClosure(); + case 5: + return ClosureReason_CommitmentTxConfirmed(); + case 6: + return ClosureReason_FundingTimedOut(); + case 7: + var var_err = sse_decode_String(deserializer); + return ClosureReason_ProcessingError(err: var_err); + case 8: + return ClosureReason_DisconnectedPeer(); + case 9: + return ClosureReason_OutdatedChannelManager(); + case 10: + return ClosureReason_CounterpartyCoopClosedUnfundedChannel(); + case 11: + return ClosureReason_FundingBatchClosure(); + case 12: + return ClosureReason_HTLCsTimedOut(); + default: + throw UnimplementedError(''); + } + } + @protected Config sse_decode_config(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -2351,6 +4721,8 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { var var_trustedPeers0Conf = sse_decode_list_public_key(deserializer); var var_probingLiquidityLimitMultiplier = sse_decode_u_64(deserializer); var var_logLevel = sse_decode_log_level(deserializer); + var var_anchorChannelsConfig = + sse_decode_opt_box_autoadd_anchor_channels_config(deserializer); return Config( storageDirPath: var_storageDirPath, logDirPath: var_logDirPath, @@ -2362,7 +4734,36 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { feeRateCacheUpdateIntervalSecs: var_feeRateCacheUpdateIntervalSecs, trustedPeers0Conf: var_trustedPeers0Conf, probingLiquidityLimitMultiplier: var_probingLiquidityLimitMultiplier, - logLevel: var_logLevel); + logLevel: var_logLevel, + anchorChannelsConfig: var_anchorChannelsConfig); + } + + @protected + DecodeError sse_decode_decode_error(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + var tag_ = sse_decode_i_32(deserializer); + switch (tag_) { + case 0: + return DecodeError_UnknownVersion(); + case 1: + return DecodeError_UnknownRequiredFeature(); + case 2: + return DecodeError_InvalidValue(); + case 3: + return DecodeError_ShortRead(); + case 4: + return DecodeError_BadLengthDescriptor(); + case 5: + var var_field0 = sse_decode_String(deserializer); + return DecodeError_Io(var_field0); + case 6: + return DecodeError_UnsupportedCompression(); + case 7: + return DecodeError_DangerousValue(); + default: + throw UnimplementedError(''); + } } @protected @@ -2395,51 +4796,78 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { var tag_ = sse_decode_i_32(deserializer); switch (tag_) { case 0: + var var_paymentId = sse_decode_box_autoadd_payment_id(deserializer); var var_paymentHash = sse_decode_box_autoadd_payment_hash(deserializer); - return Event_PaymentSuccessful(paymentHash: var_paymentHash); + var var_claimableAmountMsat = sse_decode_u_64(deserializer); + var var_claimDeadline = sse_decode_opt_box_autoadd_u_32(deserializer); + return Event_PaymentClaimable( + paymentId: var_paymentId, + paymentHash: var_paymentHash, + claimableAmountMsat: var_claimableAmountMsat, + claimDeadline: var_claimDeadline); case 1: + var var_paymentId = sse_decode_opt_box_autoadd_payment_id(deserializer); var var_paymentHash = sse_decode_box_autoadd_payment_hash(deserializer); - return Event_PaymentFailed(paymentHash: var_paymentHash); + var var_feePaidMsat = sse_decode_opt_box_autoadd_u_64(deserializer); + return Event_PaymentSuccessful( + paymentId: var_paymentId, + paymentHash: var_paymentHash, + feePaidMsat: var_feePaidMsat); case 2: + var var_paymentId = sse_decode_opt_box_autoadd_payment_id(deserializer); + 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( + paymentId: var_paymentId, + paymentHash: var_paymentHash, + reason: var_reason); + case 3: + var var_paymentId = sse_decode_opt_box_autoadd_payment_id(deserializer); var var_paymentHash = sse_decode_box_autoadd_payment_hash(deserializer); var var_amountMsat = sse_decode_u_64(deserializer); return Event_PaymentReceived( - paymentHash: var_paymentHash, amountMsat: var_amountMsat); - case 3: + paymentId: var_paymentId, + paymentHash: var_paymentHash, + amountMsat: var_amountMsat); + 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_formerTemporaryChannelId = + sse_decode_box_autoadd_channel_id(deserializer); var var_counterpartyNodeId = - sse_decode_opt_box_autoadd_public_key(deserializer); - return Event_ChannelReady( + 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, - counterpartyNodeId: var_counterpartyNodeId); - case 4: + formerTemporaryChannelId: var_formerTemporaryChannelId, + counterpartyNodeId: var_counterpartyNodeId, + fundingTxo: var_fundingTxo); + case 5: 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_ChannelClosed( + return Event_ChannelReady( channelId: var_channelId, userChannelId: var_userChannelId, counterpartyNodeId: var_counterpartyNodeId); - case 5: + case 6: 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); + var var_reason = + sse_decode_opt_box_autoadd_closure_reason(deserializer); + return Event_ChannelClosed( channelId: var_channelId, userChannelId: var_userChannelId, - formerTemporaryChannelId: var_formerTemporaryChannelId, counterpartyNodeId: var_counterpartyNodeId, - fundingTxo: var_fundingTxo); + reason: var_reason); default: throw UnimplementedError(''); } @@ -2468,6 +4896,31 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return deserializer.buffer.getInt32(); } + @protected + LdkBolt11Payment sse_decode_ldk_bolt_11_payment( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_ptr = + sse_decode_RustOpaque_ldk_nodepaymentBolt11Payment(deserializer); + return LdkBolt11Payment(ptr: var_ptr); + } + + @protected + LdkBolt12Payment sse_decode_ldk_bolt_12_payment( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_ptr = + sse_decode_RustOpaque_Arcldk_nodepaymentBolt12Payment(deserializer); + return LdkBolt12Payment(ptr: var_ptr); + } + + @protected + LdkBuilderError sse_decode_ldk_builder_error(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var inner = sse_decode_i_32(deserializer); + return LdkBuilderError.values[inner]; + } + @protected LdkMnemonic sse_decode_ldk_mnemonic(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -2475,22 +4928,275 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return LdkMnemonic(seedPhrase: var_seedPhrase); } + @protected + LdkNetworkGraph sse_decode_ldk_network_graph(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_ptr = sse_decode_RustOpaque_ldk_nodegraphNetworkGraph(deserializer); + return LdkNetworkGraph(ptr: var_ptr); + } + @protected LdkNode sse_decode_ldk_node(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - var var_ptr = sse_decode_RustOpaque_NodeSqliteStore(deserializer); + var var_ptr = sse_decode_RustOpaque_Node(deserializer); return LdkNode(ptr: var_ptr); } @protected - List sse_decode_list_channel_details( - SseDeserializer deserializer) { + LdkNodeError sse_decode_ldk_node_error(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + var tag_ = sse_decode_i_32(deserializer); + switch (tag_) { + case 0: + return LdkNodeError_InvalidTxid(); + case 1: + return LdkNodeError_AlreadyRunning(); + case 2: + return LdkNodeError_NotRunning(); + case 3: + return LdkNodeError_OnchainTxCreationFailed(); + case 4: + return LdkNodeError_ConnectionFailed(); + case 5: + return LdkNodeError_InvoiceCreationFailed(); + case 6: + return LdkNodeError_PaymentSendingFailed(); + case 7: + return LdkNodeError_ProbeSendingFailed(); + case 8: + return LdkNodeError_ChannelCreationFailed(); + case 9: + return LdkNodeError_ChannelClosingFailed(); + case 10: + return LdkNodeError_ChannelConfigUpdateFailed(); + case 11: + return LdkNodeError_PersistenceFailed(); + case 12: + return LdkNodeError_WalletOperationFailed(); + case 13: + return LdkNodeError_OnchainTxSigningFailed(); + case 14: + return LdkNodeError_MessageSigningFailed(); + case 15: + return LdkNodeError_TxSyncFailed(); + case 16: + return LdkNodeError_GossipUpdateFailed(); + case 17: + return LdkNodeError_InvalidAddress(); + case 18: + return LdkNodeError_InvalidSocketAddress(); + case 19: + return LdkNodeError_InvalidPublicKey(); + case 20: + return LdkNodeError_InvalidSecretKey(); + case 21: + return LdkNodeError_InvalidPaymentHash(); + case 22: + return LdkNodeError_InvalidPaymentPreimage(); + case 23: + return LdkNodeError_InvalidPaymentSecret(); + case 24: + return LdkNodeError_InvalidAmount(); + case 25: + return LdkNodeError_InvalidInvoice(); + case 26: + return LdkNodeError_InvalidChannelId(); + case 27: + return LdkNodeError_InvalidNetwork(); + case 28: + return LdkNodeError_DuplicatePayment(); + case 29: + return LdkNodeError_InsufficientFunds(); + case 30: + return LdkNodeError_FeerateEstimationUpdateFailed(); + case 31: + return LdkNodeError_LiquidityRequestFailed(); + case 32: + return LdkNodeError_LiquiditySourceUnavailable(); + case 33: + return LdkNodeError_LiquidityFeeTooHigh(); + case 34: + return LdkNodeError_InvalidPaymentId(); + case 35: + var var_field0 = sse_decode_box_autoadd_decode_error(deserializer); + return LdkNodeError_Decode(var_field0); + case 36: + var var_field0 = + sse_decode_box_autoadd_bolt_12_parse_error(deserializer); + return LdkNodeError_Bolt12Parse(var_field0); + case 37: + return LdkNodeError_InvoiceRequestCreationFailed(); + case 38: + return LdkNodeError_OfferCreationFailed(); + case 39: + return LdkNodeError_RefundCreationFailed(); + case 40: + return LdkNodeError_FeerateEstimationUpdateTimeout(); + case 41: + return LdkNodeError_WalletOperationTimeout(); + case 42: + return LdkNodeError_TxSyncTimeout(); + case 43: + return LdkNodeError_GossipUpdateTimeout(); + case 44: + return LdkNodeError_InvalidOfferId(); + case 45: + return LdkNodeError_InvalidNodeId(); + case 46: + return LdkNodeError_InvalidOffer(); + case 47: + return LdkNodeError_InvalidRefund(); + case 48: + return LdkNodeError_UnsupportedCurrency(); + default: + throw UnimplementedError(''); + } + } + + @protected + LdkOnChainPayment sse_decode_ldk_on_chain_payment( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_ptr = + sse_decode_RustOpaque_ldk_nodepaymentOnchainPayment(deserializer); + return LdkOnChainPayment(ptr: var_ptr); + } + + @protected + LdkSpontaneousPayment sse_decode_ldk_spontaneous_payment( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_ptr = + sse_decode_RustOpaque_ldk_nodepaymentSpontaneousPayment(deserializer); + return LdkSpontaneousPayment(ptr: var_ptr); + } + + @protected + LightningBalance sse_decode_lightning_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_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(''); + } + } + + @protected + LiquiditySourceConfig sse_decode_liquidity_source_config( + 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); + } + + @protected + List sse_decode_list_channel_details( + 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_channel_details(deserializer)); + } + 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_node_id(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var len_ = sse_decode_i_32(deserializer); - var ans_ = []; + var ans_ = []; for (var idx_ = 0; idx_ < len_; ++idx_) { - ans_.add(sse_decode_channel_details(deserializer)); + ans_.add(sse_decode_node_id(deserializer)); } return ans_; } @@ -2520,6 +5226,26 @@ 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 + Uint64List sse_decode_list_prim_u_64_strict(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var len_ = sse_decode_i_32(deserializer); + return deserializer.buffer.getUint64List(len_); + } + @protected List sse_decode_list_prim_u_8_loose(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -2566,6 +5292,18 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return LogLevel.values[inner]; } + @protected + LSPFeeLimits sse_decode_lsp_fee_limits(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_maxTotalOpeningFeeMsat = + sse_decode_opt_box_autoadd_u_64(deserializer); + var var_maxProportionalOpeningFeePpmMsat = + sse_decode_opt_box_autoadd_u_64(deserializer); + return LSPFeeLimits( + maxTotalOpeningFeeMsat: var_maxTotalOpeningFeeMsat, + maxProportionalOpeningFeePpmMsat: var_maxProportionalOpeningFeePpmMsat); + } + @protected MaxDustHTLCExposure sse_decode_max_dust_htlc_exposure( SseDeserializer deserializer) { @@ -2592,10 +5330,74 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - NodeException sse_decode_node_exception(SseDeserializer deserializer) { + NodeAnnouncementInfo sse_decode_node_announcement_info( + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - var inner = sse_decode_i_32(deserializer); - return NodeException.values[inner]; + var var_lastUpdate = sse_decode_u_32(deserializer); + var var_alias = sse_decode_String(deserializer); + var var_addresses = sse_decode_list_socket_address(deserializer); + return NodeAnnouncementInfo( + lastUpdate: var_lastUpdate, alias: var_alias, addresses: var_addresses); + } + + @protected + NodeId sse_decode_node_id(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_compressed = sse_decode_list_prim_u_8_strict(deserializer); + return NodeId(compressed: var_compressed); + } + + @protected + NodeInfo sse_decode_node_info(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_channels = sse_decode_list_prim_u_64_strict(deserializer); + var var_announcementInfo = + sse_decode_opt_box_autoadd_node_announcement_info(deserializer); + return NodeInfo( + channels: var_channels, announcementInfo: var_announcementInfo); + } + + @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); + } + + @protected + Offer sse_decode_offer(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_s = sse_decode_String(deserializer); + return Offer(s: var_s); + } + + @protected + OfferId sse_decode_offer_id(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_field0 = sse_decode_u_8_array_32(deserializer); + return OfferId(field0: var_field0); } @protected @@ -2609,6 +5411,18 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } } + @protected + AnchorChannelsConfig? sse_decode_opt_box_autoadd_anchor_channels_config( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + if (sse_decode_bool(deserializer)) { + return (sse_decode_box_autoadd_anchor_channels_config(deserializer)); + } else { + return null; + } + } + @protected ChainDataSourceConfig? sse_decode_opt_box_autoadd_chain_data_source_config( SseDeserializer deserializer) { @@ -2633,6 +5447,54 @@ 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 + ChannelInfo? sse_decode_opt_box_autoadd_channel_info( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + if (sse_decode_bool(deserializer)) { + return (sse_decode_box_autoadd_channel_info(deserializer)); + } else { + return null; + } + } + + @protected + ChannelUpdateInfo? sse_decode_opt_box_autoadd_channel_update_info( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + if (sse_decode_bool(deserializer)) { + return (sse_decode_box_autoadd_channel_update_info(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) { @@ -2668,6 +5530,64 @@ 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 + NodeAnnouncementInfo? sse_decode_opt_box_autoadd_node_announcement_info( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + if (sse_decode_bool(deserializer)) { + return (sse_decode_box_autoadd_node_announcement_info(deserializer)); + } else { + return null; + } + } + + @protected + NodeInfo? sse_decode_opt_box_autoadd_node_info(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + if (sse_decode_bool(deserializer)) { + return (sse_decode_box_autoadd_node_info(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) { @@ -2680,6 +5600,42 @@ 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 + PaymentHash? sse_decode_opt_box_autoadd_payment_hash( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + if (sse_decode_bool(deserializer)) { + return (sse_decode_box_autoadd_payment_hash(deserializer)); + } else { + return null; + } + } + + @protected + PaymentId? sse_decode_opt_box_autoadd_payment_id( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + if (sse_decode_bool(deserializer)) { + return (sse_decode_box_autoadd_payment_id(deserializer)); + } else { + return null; + } + } + @protected PaymentPreimage? sse_decode_opt_box_autoadd_payment_preimage( SseDeserializer deserializer) { @@ -2716,6 +5672,17 @@ 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 @@ -2728,7 +5695,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - int? sse_decode_opt_box_autoadd_u_64(SseDeserializer deserializer) { + BigInt? sse_decode_opt_box_autoadd_u_64(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs if (sse_decode_bool(deserializer)) { @@ -2761,17 +5728,14 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { @protected PaymentDetails sse_decode_payment_details(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - var var_hash = sse_decode_payment_hash(deserializer); - var var_preimage = - sse_decode_opt_box_autoadd_payment_preimage(deserializer); - var var_secret = sse_decode_opt_box_autoadd_payment_secret(deserializer); + var var_id = sse_decode_payment_id(deserializer); + var var_kind = sse_decode_payment_kind(deserializer); var var_amountMsat = sse_decode_opt_box_autoadd_u_64(deserializer); var var_direction = sse_decode_payment_direction(deserializer); var var_status = sse_decode_payment_status(deserializer); return PaymentDetails( - hash: var_hash, - preimage: var_preimage, - secret: var_secret, + id: var_id, + kind: var_kind, amountMsat: var_amountMsat, direction: var_direction, status: var_status); @@ -2784,6 +5748,14 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return PaymentDirection.values[inner]; } + @protected + PaymentFailureReason sse_decode_payment_failure_reason( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var inner = sse_decode_i_32(deserializer); + return PaymentFailureReason.values[inner]; + } + @protected PaymentHash sse_decode_payment_hash(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -2791,6 +5763,72 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return PaymentHash(data: var_data); } + @protected + PaymentId sse_decode_payment_id(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_field0 = sse_decode_u_8_array_32(deserializer); + return PaymentId(field0: var_field0); + } + + @protected + PaymentKind sse_decode_payment_kind(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + var tag_ = sse_decode_i_32(deserializer); + switch (tag_) { + case 0: + return PaymentKind_Onchain(); + case 1: + var var_hash = sse_decode_box_autoadd_payment_hash(deserializer); + var var_preimage = + sse_decode_opt_box_autoadd_payment_preimage(deserializer); + var var_secret = + sse_decode_opt_box_autoadd_payment_secret(deserializer); + return PaymentKind_Bolt11( + hash: var_hash, preimage: var_preimage, secret: var_secret); + case 2: + var var_hash = sse_decode_box_autoadd_payment_hash(deserializer); + var var_preimage = + sse_decode_opt_box_autoadd_payment_preimage(deserializer); + var var_secret = + sse_decode_opt_box_autoadd_payment_secret(deserializer); + var var_lspFeeLimits = + sse_decode_box_autoadd_lsp_fee_limits(deserializer); + return PaymentKind_Bolt11Jit( + hash: var_hash, + preimage: var_preimage, + secret: var_secret, + lspFeeLimits: var_lspFeeLimits); + case 3: + var var_hash = sse_decode_box_autoadd_payment_hash(deserializer); + var var_preimage = + sse_decode_opt_box_autoadd_payment_preimage(deserializer); + return PaymentKind_Spontaneous(hash: var_hash, preimage: var_preimage); + case 4: + var var_hash = sse_decode_opt_box_autoadd_payment_hash(deserializer); + var var_preimage = + sse_decode_opt_box_autoadd_payment_preimage(deserializer); + var var_secret = + sse_decode_opt_box_autoadd_payment_secret(deserializer); + var var_offerId = sse_decode_box_autoadd_offer_id(deserializer); + return PaymentKind_Bolt12Offer( + hash: var_hash, + preimage: var_preimage, + secret: var_secret, + offerId: var_offerId); + case 5: + var var_hash = sse_decode_opt_box_autoadd_payment_hash(deserializer); + var var_preimage = + sse_decode_opt_box_autoadd_payment_preimage(deserializer); + var var_secret = + sse_decode_opt_box_autoadd_payment_secret(deserializer); + return PaymentKind_Bolt12Refund( + hash: var_hash, preimage: var_preimage, secret: var_secret); + default: + throw UnimplementedError(''); + } + } + @protected PaymentPreimage sse_decode_payment_preimage(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -2801,32 +5839,99 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { @protected PaymentSecret sse_decode_payment_secret(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - var var_data = sse_decode_u_8_array_32(deserializer); - return PaymentSecret(data: var_data); + var var_data = sse_decode_u_8_array_32(deserializer); + return PaymentSecret(data: var_data); + } + + @protected + PaymentStatus sse_decode_payment_status(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var inner = sse_decode_i_32(deserializer); + return PaymentStatus.values[inner]; + } + + @protected + PeerDetails sse_decode_peer_details(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_nodeId = sse_decode_public_key(deserializer); + var var_address = sse_decode_socket_address(deserializer); + var var_isConnected = sse_decode_bool(deserializer); + return PeerDetails( + 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_hex = sse_decode_String(deserializer); + return PublicKey(hex: var_hex); } @protected - PaymentStatus sse_decode_payment_status(SseDeserializer deserializer) { + (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 inner = sse_decode_i_32(deserializer); - return PaymentStatus.values[inner]; + 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); } @protected - PeerDetails sse_decode_peer_details(SseDeserializer deserializer) { + Refund sse_decode_refund(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - var var_nodeId = sse_decode_public_key(deserializer); - var var_address = sse_decode_socket_address(deserializer); - var var_isConnected = sse_decode_bool(deserializer); - return PeerDetails( - nodeId: var_nodeId, address: var_address, isConnected: var_isConnected); + var var_s = sse_decode_String(deserializer); + return Refund(s: var_s); } @protected - PublicKey sse_decode_public_key(SseDeserializer deserializer) { + RoutingFees sse_decode_routing_fees(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - var var_hex = sse_decode_String(deserializer); - return PublicKey(hex: var_hex); + var var_baseMsat = sse_decode_u_32(deserializer); + var var_proportionalMillionths = sse_decode_u_32(deserializer); + return RoutingFees( + baseMsat: var_baseMsat, + proportionalMillionths: var_proportionalMillionths); } @protected @@ -2885,9 +5990,9 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - int sse_decode_u_64(SseDeserializer deserializer) { + BigInt sse_decode_u_64(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return deserializer.buffer.getUint64(); + return deserializer.buffer.getBigUint64(); } @protected @@ -2939,33 +6044,103 @@ 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_u_64(deserializer); + var var_data = sse_decode_list_prim_u_8_strict(deserializer); return UserChannelId(data: var_data); } @protected - int sse_decode_usize(SseDeserializer deserializer) { + BigInt sse_decode_usize(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return deserializer.buffer.getUint64(); + return deserializer.buffer.getBigUint64(); } @protected - int cst_encode_RustOpaque_NodeSqliteStore(NodeSqliteStore raw) { + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder raw) { // Codec=Cst (C-struct based), see doc to use other codecs // ignore: invalid_use_of_internal_member - return raw.cstEncode(); + return (raw as NodeBuilderImpl).frbInternalCstEncode(move: true); } @protected - bool cst_encode_bool(bool raw) { + int cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder raw) { // Codec=Cst (C-struct based), see doc to use other codecs - return raw; +// ignore: invalid_use_of_internal_member + return (raw as NodeBuilderImpl).frbInternalCstEncode(move: false); } @protected - int cst_encode_builder_exception(BuilderException raw) { + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder raw) { // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_i_32(raw.index); +// ignore: invalid_use_of_internal_member + return (raw as NodeBuilderImpl).frbInternalCstEncode(move: false); + } + + @protected + int cst_encode_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ArcBolt12Payment raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return (raw as ArcBolt12PaymentImpl).frbInternalCstEncode(); + } + + @protected + int cst_encode_RustOpaque_Node(Node raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return (raw as NodeImpl).frbInternalCstEncode(); + } + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return (raw as NodeBuilderImpl).frbInternalCstEncode(); + } + + @protected + int cst_encode_RustOpaque_ldk_nodeBuilder(Builder raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return (raw as BuilderImpl).frbInternalCstEncode(); + } + + @protected + int cst_encode_RustOpaque_ldk_nodegraphNetworkGraph(NetworkGraph raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return (raw as NetworkGraphImpl).frbInternalCstEncode(); + } + + @protected + int cst_encode_RustOpaque_ldk_nodepaymentBolt11Payment(Bolt11Payment raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return (raw as Bolt11PaymentImpl).frbInternalCstEncode(); + } + + @protected + int cst_encode_RustOpaque_ldk_nodepaymentOnchainPayment(OnchainPayment raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return (raw as OnchainPaymentImpl).frbInternalCstEncode(); + } + + @protected + int cst_encode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + SpontaneousPayment raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return (raw as SpontaneousPaymentImpl).frbInternalCstEncode(); + } + + @protected + bool cst_encode_bool(bool raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw; } @protected @@ -2974,6 +6149,12 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return raw; } + @protected + int cst_encode_ldk_builder_error(LdkBuilderError raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return cst_encode_i_32(raw.index); + } + @protected int cst_encode_log_level(LogLevel raw) { // Codec=Cst (C-struct based), see doc to use other codecs @@ -2987,13 +6168,13 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - int cst_encode_node_exception(NodeException raw) { + int cst_encode_payment_direction(PaymentDirection raw) { // Codec=Cst (C-struct based), see doc to use other codecs return cst_encode_i_32(raw.index); } @protected - int cst_encode_payment_direction(PaymentDirection raw) { + 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); } @@ -3029,114 +6210,389 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - int cst_encode_usize(int raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw; + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize( + (self as NodeBuilderImpl).frbInternalSseEncode(move: true), serializer); + } + + @protected + void + sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize( + (self as NodeBuilderImpl).frbInternalSseEncode(move: false), + serializer); + } + + @protected + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize( + (self as NodeBuilderImpl).frbInternalSseEncode(move: false), + serializer); + } + + @protected + void sse_encode_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ArcBolt12Payment self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize( + (self as ArcBolt12PaymentImpl).frbInternalSseEncode(move: null), + serializer); + } + + @protected + void sse_encode_RustOpaque_Node(Node self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize( + (self as NodeImpl).frbInternalSseEncode(move: null), serializer); + } + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize( + (self as NodeBuilderImpl).frbInternalSseEncode(move: null), serializer); + } + + @protected + void sse_encode_RustOpaque_ldk_nodeBuilder( + Builder self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize( + (self as BuilderImpl).frbInternalSseEncode(move: null), serializer); + } + + @protected + void sse_encode_RustOpaque_ldk_nodegraphNetworkGraph( + NetworkGraph self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize( + (self as NetworkGraphImpl).frbInternalSseEncode(move: null), + serializer); + } + + @protected + void sse_encode_RustOpaque_ldk_nodepaymentBolt11Payment( + Bolt11Payment self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize( + (self as Bolt11PaymentImpl).frbInternalSseEncode(move: null), + serializer); + } + + @protected + void sse_encode_RustOpaque_ldk_nodepaymentOnchainPayment( + OnchainPayment self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize( + (self as OnchainPaymentImpl).frbInternalSseEncode(move: null), + serializer); + } + + @protected + void sse_encode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + SpontaneousPayment self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize( + (self as SpontaneousPaymentImpl).frbInternalSseEncode(move: null), + serializer); + } + + @protected + void sse_encode_String(String self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_list_prim_u_8_strict(utf8.encoder.convert(self), serializer); + } + + @protected + void sse_encode_address(Address self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_String(self.s, serializer); + } + + @protected + void sse_encode_anchor_channels_config( + AnchorChannelsConfig self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_list_public_key(self.trustedPeersNoReserve, serializer); + sse_encode_u_64(self.perChannelReserveSats, 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) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_String(self.signedRawInvoice, serializer); + } + + @protected + void sse_encode_bolt_12_invoice( + Bolt12Invoice self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_list_prim_u_8_strict(self.data, serializer); + } + + @protected + void sse_encode_bolt_12_parse_error( + Bolt12ParseError self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + switch (self) { + case Bolt12ParseError_InvalidContinuation(): + sse_encode_i_32(0, serializer); + case Bolt12ParseError_InvalidBech32Hrp(): + sse_encode_i_32(1, serializer); + case Bolt12ParseError_Bech32(field0: final field0): + sse_encode_i_32(2, serializer); + sse_encode_String(field0, serializer); + case Bolt12ParseError_Decode(field0: final field0): + sse_encode_i_32(3, serializer); + sse_encode_box_autoadd_decode_error(field0, serializer); + case Bolt12ParseError_InvalidSemantics(field0: final field0): + sse_encode_i_32(4, serializer); + sse_encode_String(field0, serializer); + case Bolt12ParseError_InvalidSignature(field0: final field0): + sse_encode_i_32(5, serializer); + sse_encode_String(field0, serializer); + default: + throw UnimplementedError(''); + } + } + + @protected + void sse_encode_bool(bool self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + serializer.buffer.putUint8(self ? 1 : 0); + } + + @protected + void sse_encode_box_autoadd_address(Address self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_address(self, serializer); + } + + @protected + void sse_encode_box_autoadd_anchor_channels_config( + AnchorChannelsConfig self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_anchor_channels_config(self, serializer); + } + + @protected + void sse_encode_box_autoadd_bolt_11_invoice( + Bolt11Invoice self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_bolt_11_invoice(self, serializer); + } + + @protected + void sse_encode_box_autoadd_bolt_12_parse_error( + Bolt12ParseError self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_bolt_12_parse_error(self, serializer); + } + + @protected + void sse_encode_box_autoadd_chain_data_source_config( + ChainDataSourceConfig self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_chain_data_source_config(self, serializer); + } + + @protected + void sse_encode_box_autoadd_channel_config( + ChannelConfig self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_channel_config(self, serializer); + } + + @protected + void sse_encode_box_autoadd_channel_id( + ChannelId self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_channel_id(self, serializer); + } + + @protected + void sse_encode_box_autoadd_channel_info( + ChannelInfo self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_channel_info(self, serializer); + } + + @protected + void sse_encode_box_autoadd_channel_update_info( + ChannelUpdateInfo self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_channel_update_info(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 + sse_encode_config(self, serializer); + } + + @protected + void sse_encode_box_autoadd_decode_error( + DecodeError self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_decode_error(self, serializer); } @protected - void sse_encode_RustOpaque_NodeSqliteStore( - NodeSqliteStore self, SseSerializer serializer) { + void sse_encode_box_autoadd_entropy_source_config( + EntropySourceConfig self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_entropy_source_config(self, serializer); + } + + @protected + void sse_encode_box_autoadd_event(Event self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_usize(self.sseEncode(move: null), serializer); + sse_encode_event(self, serializer); + } + + @protected + void sse_encode_box_autoadd_gossip_source_config( + GossipSourceConfig self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_gossip_source_config(self, serializer); } @protected - void sse_encode_String(String self, SseSerializer serializer) { + void sse_encode_box_autoadd_ldk_bolt_11_payment( + LdkBolt11Payment self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_list_prim_u_8_strict(utf8.encoder.convert(self), serializer); + sse_encode_ldk_bolt_11_payment(self, serializer); } @protected - void sse_encode_address(Address self, SseSerializer serializer) { + void sse_encode_box_autoadd_ldk_bolt_12_payment( + LdkBolt12Payment self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_String(self.s, serializer); + sse_encode_ldk_bolt_12_payment(self, serializer); } @protected - void sse_encode_bolt_11_invoice( - Bolt11Invoice 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_String(self.signedRawInvoice, serializer); + sse_encode_ldk_mnemonic(self, serializer); } @protected - void sse_encode_bool(bool self, SseSerializer serializer) { + void sse_encode_box_autoadd_ldk_network_graph( + LdkNetworkGraph self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - serializer.buffer.putUint8(self ? 1 : 0); + sse_encode_ldk_network_graph(self, serializer); } @protected - void sse_encode_box_autoadd_address(Address 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_address(self, serializer); + sse_encode_ldk_node(self, serializer); } @protected - void sse_encode_box_autoadd_bolt_11_invoice( - Bolt11Invoice self, SseSerializer serializer) { + void sse_encode_box_autoadd_ldk_on_chain_payment( + LdkOnChainPayment self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_bolt_11_invoice(self, serializer); + sse_encode_ldk_on_chain_payment(self, serializer); } @protected - void sse_encode_box_autoadd_chain_data_source_config( - ChainDataSourceConfig self, SseSerializer serializer) { + void sse_encode_box_autoadd_ldk_spontaneous_payment( + LdkSpontaneousPayment self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_chain_data_source_config(self, serializer); + sse_encode_ldk_spontaneous_payment(self, serializer); } @protected - void sse_encode_box_autoadd_channel_config( - ChannelConfig self, SseSerializer serializer) { + void sse_encode_box_autoadd_liquidity_source_config( + LiquiditySourceConfig self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_channel_config(self, serializer); + sse_encode_liquidity_source_config(self, serializer); } @protected - void sse_encode_box_autoadd_channel_id( - ChannelId self, SseSerializer serializer) { + void sse_encode_box_autoadd_lsp_fee_limits( + LSPFeeLimits self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_channel_id(self, serializer); + sse_encode_lsp_fee_limits(self, serializer); } @protected - void sse_encode_box_autoadd_config(Config self, SseSerializer serializer) { + 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_config(self, serializer); + sse_encode_max_dust_htlc_exposure(self, serializer); } @protected - void sse_encode_box_autoadd_entropy_source_config( - EntropySourceConfig self, SseSerializer serializer) { + void sse_encode_box_autoadd_node_announcement_info( + NodeAnnouncementInfo self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_entropy_source_config(self, serializer); + sse_encode_node_announcement_info(self, serializer); } @protected - void sse_encode_box_autoadd_event(Event self, SseSerializer serializer) { + void sse_encode_box_autoadd_node_id(NodeId self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_event(self, serializer); + sse_encode_node_id(self, serializer); } @protected - void sse_encode_box_autoadd_gossip_source_config( - GossipSourceConfig self, SseSerializer serializer) { + void sse_encode_box_autoadd_node_info( + NodeInfo self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_gossip_source_config(self, serializer); + sse_encode_node_info(self, serializer); } @protected - void sse_encode_box_autoadd_ldk_mnemonic( - LdkMnemonic self, SseSerializer serializer) { + void sse_encode_box_autoadd_offer(Offer self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_ldk_mnemonic(self, serializer); + sse_encode_offer(self, serializer); } @protected - void sse_encode_box_autoadd_ldk_node(LdkNode self, SseSerializer serializer) { + void sse_encode_box_autoadd_offer_id(OfferId self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_ldk_node(self, serializer); + sse_encode_offer_id(self, serializer); } @protected @@ -3153,6 +6609,13 @@ 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) { @@ -3160,6 +6623,13 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_payment_hash(self, serializer); } + @protected + void sse_encode_box_autoadd_payment_id( + PaymentId self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_payment_id(self, serializer); + } + @protected void sse_encode_box_autoadd_payment_preimage( PaymentPreimage self, SseSerializer serializer) { @@ -3181,6 +6651,12 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_public_key(self, serializer); } + @protected + void sse_encode_box_autoadd_refund(Refund self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_refund(self, serializer); + } + @protected void sse_encode_box_autoadd_socket_address( SocketAddress self, SseSerializer serializer) { @@ -3188,6 +6664,18 @@ 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 @@ -3195,7 +6683,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - void sse_encode_box_autoadd_u_64(int self, SseSerializer serializer) { + void sse_encode_box_autoadd_u_64(BigInt self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_u_64(self, serializer); } @@ -3207,13 +6695,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_user_channel_id(self, serializer); } - @protected - 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); - } - @protected void sse_encode_chain_data_source_config( ChainDataSourceConfig self, SseSerializer serializer) { @@ -3222,6 +6703,8 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { case ChainDataSourceConfig_Esplora(field0: final field0): sse_encode_i_32(0, serializer); sse_encode_String(field0, serializer); + default: + throw UnimplementedError(''); } } @@ -3231,7 +6714,8 @@ 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_max_dust_htlc_exposure(self.maxDustHtlcExposure, serializer); + sse_encode_opt_box_autoadd_max_dust_htlc_exposure( + self.maxDustHtlcExposure, serializer); sse_encode_u_64(self.forceCloseAvoidanceMaxFeeSatoshis, serializer); sse_encode_bool(self.acceptUnderpayingHtlcs, serializer); } @@ -3242,13 +6726,12 @@ 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_String(self.fundingTxo, serializer); + sse_encode_opt_box_autoadd_out_point(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); @@ -3257,6 +6740,24 @@ 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 @@ -3265,6 +6766,65 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_u_8_array_32(self.data, serializer); } + @protected + void sse_encode_channel_info(ChannelInfo self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_node_id(self.nodeOne, serializer); + sse_encode_opt_box_autoadd_channel_update_info(self.oneToTwo, serializer); + sse_encode_node_id(self.nodeTwo, serializer); + sse_encode_opt_box_autoadd_channel_update_info(self.twoToOne, serializer); + sse_encode_opt_box_autoadd_u_64(self.capacitySats, serializer); + } + + @protected + void sse_encode_channel_update_info( + ChannelUpdateInfo self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_u_32(self.lastUpdate, serializer); + sse_encode_bool(self.enabled, serializer); + sse_encode_u_16(self.cltvExpiryDelta, serializer); + sse_encode_u_64(self.htlcMinimumMsat, serializer); + sse_encode_u_64(self.htlcMaximumMsat, serializer); + sse_encode_routing_fees(self.fees, 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_LegacyCooperativeClosure(): + sse_encode_i_32(2, serializer); + case ClosureReason_CounterpartyInitiatedCooperativeClosure(): + sse_encode_i_32(3, serializer); + case ClosureReason_LocallyInitiatedCooperativeClosure(): + sse_encode_i_32(4, serializer); + case ClosureReason_CommitmentTxConfirmed(): + sse_encode_i_32(5, serializer); + case ClosureReason_FundingTimedOut(): + sse_encode_i_32(6, serializer); + case ClosureReason_ProcessingError(err: final err): + sse_encode_i_32(7, serializer); + sse_encode_String(err, serializer); + case ClosureReason_DisconnectedPeer(): + sse_encode_i_32(8, serializer); + case ClosureReason_OutdatedChannelManager(): + sse_encode_i_32(9, serializer); + case ClosureReason_CounterpartyCoopClosedUnfundedChannel(): + sse_encode_i_32(10, serializer); + case ClosureReason_FundingBatchClosure(): + sse_encode_i_32(11, serializer); + case ClosureReason_HTLCsTimedOut(): + sse_encode_i_32(12, serializer); + default: + throw UnimplementedError(''); + } + } + @protected void sse_encode_config(Config self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -3279,6 +6839,34 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_list_public_key(self.trustedPeers0Conf, serializer); sse_encode_u_64(self.probingLiquidityLimitMultiplier, serializer); sse_encode_log_level(self.logLevel, serializer); + sse_encode_opt_box_autoadd_anchor_channels_config( + self.anchorChannelsConfig, serializer); + } + + @protected + void sse_encode_decode_error(DecodeError self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + switch (self) { + case DecodeError_UnknownVersion(): + sse_encode_i_32(0, serializer); + case DecodeError_UnknownRequiredFeature(): + sse_encode_i_32(1, serializer); + case DecodeError_InvalidValue(): + sse_encode_i_32(2, serializer); + case DecodeError_ShortRead(): + sse_encode_i_32(3, serializer); + case DecodeError_BadLengthDescriptor(): + sse_encode_i_32(4, serializer); + case DecodeError_Io(field0: final field0): + sse_encode_i_32(5, serializer); + sse_encode_String(field0, serializer); + case DecodeError_UnsupportedCompression(): + sse_encode_i_32(6, serializer); + case DecodeError_DangerousValue(): + sse_encode_i_32(7, serializer); + default: + throw UnimplementedError(''); + } } @protected @@ -3299,6 +6887,8 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_i_32(2, serializer); sse_encode_box_autoadd_ldk_mnemonic(mnemonic, serializer); sse_encode_opt_String(passphrase, serializer); + default: + throw UnimplementedError(''); } } @@ -3306,50 +6896,79 @@ 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): + case Event_PaymentClaimable( + paymentId: final paymentId, + paymentHash: final paymentHash, + claimableAmountMsat: final claimableAmountMsat, + claimDeadline: final claimDeadline + ): sse_encode_i_32(0, serializer); + sse_encode_box_autoadd_payment_id(paymentId, serializer); sse_encode_box_autoadd_payment_hash(paymentHash, serializer); - case Event_PaymentFailed(paymentHash: final paymentHash): + sse_encode_u_64(claimableAmountMsat, serializer); + sse_encode_opt_box_autoadd_u_32(claimDeadline, serializer); + case Event_PaymentSuccessful( + paymentId: final paymentId, + paymentHash: final paymentHash, + feePaidMsat: final feePaidMsat + ): sse_encode_i_32(1, serializer); + sse_encode_opt_box_autoadd_payment_id(paymentId, serializer); + sse_encode_box_autoadd_payment_hash(paymentHash, serializer); + sse_encode_opt_box_autoadd_u_64(feePaidMsat, serializer); + case Event_PaymentFailed( + paymentId: final paymentId, + paymentHash: final paymentHash, + reason: final reason + ): + sse_encode_i_32(2, serializer); + sse_encode_opt_box_autoadd_payment_id(paymentId, serializer); sse_encode_box_autoadd_payment_hash(paymentHash, serializer); + sse_encode_opt_box_autoadd_payment_failure_reason(reason, serializer); case Event_PaymentReceived( + paymentId: final paymentId, paymentHash: final paymentHash, amountMsat: final amountMsat ): - sse_encode_i_32(2, serializer); + sse_encode_i_32(3, serializer); + sse_encode_opt_box_autoadd_payment_id(paymentId, serializer); sse_encode_box_autoadd_payment_hash(paymentHash, serializer); sse_encode_u_64(amountMsat, serializer); - case Event_ChannelReady( + case Event_ChannelPending( channelId: final channelId, userChannelId: final userChannelId, - counterpartyNodeId: final counterpartyNodeId + formerTemporaryChannelId: final formerTemporaryChannelId, + counterpartyNodeId: final counterpartyNodeId, + fundingTxo: final fundingTxo ): - sse_encode_i_32(3, serializer); + sse_encode_i_32(4, 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); - case Event_ChannelClosed( + 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( channelId: final channelId, userChannelId: final userChannelId, counterpartyNodeId: final counterpartyNodeId ): - sse_encode_i_32(4, serializer); + 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); - case Event_ChannelPending( + case Event_ChannelClosed( channelId: final channelId, userChannelId: final userChannelId, - formerTemporaryChannelId: final formerTemporaryChannelId, counterpartyNodeId: final counterpartyNodeId, - fundingTxo: final fundingTxo + reason: final reason ): - sse_encode_i_32(5, serializer); + sse_encode_i_32(6, 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); + sse_encode_opt_box_autoadd_public_key(counterpartyNodeId, serializer); + sse_encode_opt_box_autoadd_closure_reason(reason, serializer); + default: + throw UnimplementedError(''); } } @@ -3363,6 +6982,8 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { case GossipSourceConfig_RapidGossipSync(field0: final field0): sse_encode_i_32(1, serializer); sse_encode_String(field0, serializer); + default: + throw UnimplementedError(''); } } @@ -3372,6 +6993,27 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { serializer.buffer.putInt32(self); } + @protected + void sse_encode_ldk_bolt_11_payment( + LdkBolt11Payment self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_RustOpaque_ldk_nodepaymentBolt11Payment(self.ptr, serializer); + } + + @protected + void sse_encode_ldk_bolt_12_payment( + LdkBolt12Payment self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_RustOpaque_Arcldk_nodepaymentBolt12Payment(self.ptr, serializer); + } + + @protected + void sse_encode_ldk_builder_error( + LdkBuilderError self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_i_32(self.index, serializer); + } + @protected void sse_encode_ldk_mnemonic(LdkMnemonic self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -3379,18 +7021,256 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - void sse_encode_ldk_node(LdkNode self, SseSerializer serializer) { + void sse_encode_ldk_network_graph( + LdkNetworkGraph self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_RustOpaque_ldk_nodegraphNetworkGraph(self.ptr, serializer); + } + + @protected + void sse_encode_ldk_node(LdkNode self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_RustOpaque_Node(self.ptr, serializer); + } + + @protected + void sse_encode_ldk_node_error(LdkNodeError self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + switch (self) { + case LdkNodeError_InvalidTxid(): + sse_encode_i_32(0, serializer); + case LdkNodeError_AlreadyRunning(): + sse_encode_i_32(1, serializer); + case LdkNodeError_NotRunning(): + sse_encode_i_32(2, serializer); + case LdkNodeError_OnchainTxCreationFailed(): + sse_encode_i_32(3, serializer); + case LdkNodeError_ConnectionFailed(): + sse_encode_i_32(4, serializer); + case LdkNodeError_InvoiceCreationFailed(): + sse_encode_i_32(5, serializer); + case LdkNodeError_PaymentSendingFailed(): + sse_encode_i_32(6, serializer); + case LdkNodeError_ProbeSendingFailed(): + sse_encode_i_32(7, serializer); + case LdkNodeError_ChannelCreationFailed(): + sse_encode_i_32(8, serializer); + case LdkNodeError_ChannelClosingFailed(): + sse_encode_i_32(9, serializer); + case LdkNodeError_ChannelConfigUpdateFailed(): + sse_encode_i_32(10, serializer); + case LdkNodeError_PersistenceFailed(): + sse_encode_i_32(11, serializer); + case LdkNodeError_WalletOperationFailed(): + sse_encode_i_32(12, serializer); + case LdkNodeError_OnchainTxSigningFailed(): + sse_encode_i_32(13, serializer); + case LdkNodeError_MessageSigningFailed(): + sse_encode_i_32(14, serializer); + case LdkNodeError_TxSyncFailed(): + sse_encode_i_32(15, serializer); + case LdkNodeError_GossipUpdateFailed(): + sse_encode_i_32(16, serializer); + case LdkNodeError_InvalidAddress(): + sse_encode_i_32(17, serializer); + case LdkNodeError_InvalidSocketAddress(): + sse_encode_i_32(18, serializer); + case LdkNodeError_InvalidPublicKey(): + sse_encode_i_32(19, serializer); + case LdkNodeError_InvalidSecretKey(): + sse_encode_i_32(20, serializer); + case LdkNodeError_InvalidPaymentHash(): + sse_encode_i_32(21, serializer); + case LdkNodeError_InvalidPaymentPreimage(): + sse_encode_i_32(22, serializer); + case LdkNodeError_InvalidPaymentSecret(): + sse_encode_i_32(23, serializer); + case LdkNodeError_InvalidAmount(): + sse_encode_i_32(24, serializer); + case LdkNodeError_InvalidInvoice(): + sse_encode_i_32(25, serializer); + case LdkNodeError_InvalidChannelId(): + sse_encode_i_32(26, serializer); + case LdkNodeError_InvalidNetwork(): + sse_encode_i_32(27, serializer); + case LdkNodeError_DuplicatePayment(): + sse_encode_i_32(28, serializer); + case LdkNodeError_InsufficientFunds(): + sse_encode_i_32(29, serializer); + case LdkNodeError_FeerateEstimationUpdateFailed(): + sse_encode_i_32(30, serializer); + case LdkNodeError_LiquidityRequestFailed(): + sse_encode_i_32(31, serializer); + case LdkNodeError_LiquiditySourceUnavailable(): + sse_encode_i_32(32, serializer); + case LdkNodeError_LiquidityFeeTooHigh(): + sse_encode_i_32(33, serializer); + case LdkNodeError_InvalidPaymentId(): + sse_encode_i_32(34, serializer); + case LdkNodeError_Decode(field0: final field0): + sse_encode_i_32(35, serializer); + sse_encode_box_autoadd_decode_error(field0, serializer); + case LdkNodeError_Bolt12Parse(field0: final field0): + sse_encode_i_32(36, serializer); + sse_encode_box_autoadd_bolt_12_parse_error(field0, serializer); + case LdkNodeError_InvoiceRequestCreationFailed(): + sse_encode_i_32(37, serializer); + case LdkNodeError_OfferCreationFailed(): + sse_encode_i_32(38, serializer); + case LdkNodeError_RefundCreationFailed(): + sse_encode_i_32(39, serializer); + case LdkNodeError_FeerateEstimationUpdateTimeout(): + sse_encode_i_32(40, serializer); + case LdkNodeError_WalletOperationTimeout(): + sse_encode_i_32(41, serializer); + case LdkNodeError_TxSyncTimeout(): + sse_encode_i_32(42, serializer); + case LdkNodeError_GossipUpdateTimeout(): + sse_encode_i_32(43, serializer); + case LdkNodeError_InvalidOfferId(): + sse_encode_i_32(44, serializer); + case LdkNodeError_InvalidNodeId(): + sse_encode_i_32(45, serializer); + case LdkNodeError_InvalidOffer(): + sse_encode_i_32(46, serializer); + case LdkNodeError_InvalidRefund(): + sse_encode_i_32(47, serializer); + case LdkNodeError_UnsupportedCurrency(): + sse_encode_i_32(48, serializer); + default: + throw UnimplementedError(''); + } + } + + @protected + void sse_encode_ldk_on_chain_payment( + LdkOnChainPayment self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_RustOpaque_ldk_nodepaymentOnchainPayment(self.ptr, serializer); + } + + @protected + void sse_encode_ldk_spontaneous_payment( + LdkSpontaneousPayment self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + self.ptr, serializer); + } + + @protected + void sse_encode_lightning_balance( + LightningBalance 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); + default: + throw UnimplementedError(''); + } + } + + @protected + void sse_encode_liquidity_source_config( + LiquiditySourceConfig 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); + } + + @protected + void sse_encode_list_channel_details( + 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_channel_details(item, serializer); + } + } + + @protected + void sse_encode_list_lightning_balance( + List self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_RustOpaque_NodeSqliteStore(self.ptr, serializer); + sse_encode_i_32(self.length, serializer); + for (final item in self) { + sse_encode_lightning_balance(item, serializer); + } } @protected - void sse_encode_list_channel_details( - List self, SseSerializer serializer) { + void sse_encode_list_node_id(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_channel_details(item, serializer); + sse_encode_node_id(item, serializer); } } @@ -3414,6 +7294,24 @@ 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_64_strict( + Uint64List self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_i_32(self.length, serializer); + serializer.buffer.putUint64List(self); + } + @protected void sse_encode_list_prim_u_8_loose( List self, SseSerializer serializer) { @@ -3457,6 +7355,14 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_i_32(self.index, serializer); } + @protected + void sse_encode_lsp_fee_limits(LSPFeeLimits self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_opt_box_autoadd_u_64(self.maxTotalOpeningFeeMsat, serializer); + sse_encode_opt_box_autoadd_u_64( + self.maxProportionalOpeningFeePpmMsat, serializer); + } + @protected void sse_encode_max_dust_htlc_exposure( MaxDustHTLCExposure self, SseSerializer serializer) { @@ -3468,6 +7374,8 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { case MaxDustHTLCExposure_FeeRateMultiplier(field0: final field0): sse_encode_i_32(1, serializer); sse_encode_u_64(field0, serializer); + default: + throw UnimplementedError(''); } } @@ -3478,9 +7386,55 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - void sse_encode_node_exception(NodeException self, SseSerializer serializer) { + void sse_encode_node_announcement_info( + NodeAnnouncementInfo self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_i_32(self.index, serializer); + sse_encode_u_32(self.lastUpdate, serializer); + sse_encode_String(self.alias, serializer); + sse_encode_list_socket_address(self.addresses, serializer); + } + + @protected + void sse_encode_node_id(NodeId self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_list_prim_u_8_strict(self.compressed, serializer); + } + + @protected + void sse_encode_node_info(NodeInfo self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_list_prim_u_64_strict(self.channels, serializer); + sse_encode_opt_box_autoadd_node_announcement_info( + self.announcementInfo, 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_offer(Offer self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_String(self.s, serializer); + } + + @protected + void sse_encode_offer_id(OfferId self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_u_8_array_32(self.field0, serializer); } @protected @@ -3493,6 +7447,17 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } } + @protected + void sse_encode_opt_box_autoadd_anchor_channels_config( + AnchorChannelsConfig? 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_anchor_channels_config(self, serializer); + } + } + @protected void sse_encode_opt_box_autoadd_chain_data_source_config( ChainDataSourceConfig? self, SseSerializer serializer) { @@ -3515,6 +7480,50 @@ 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_channel_info( + ChannelInfo? 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_info(self, serializer); + } + } + + @protected + void sse_encode_opt_box_autoadd_channel_update_info( + ChannelUpdateInfo? 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_update_info(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) { @@ -3547,6 +7556,61 @@ 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_node_announcement_info( + NodeAnnouncementInfo? 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_node_announcement_info(self, serializer); + } + } + + @protected + void sse_encode_opt_box_autoadd_node_info( + NodeInfo? 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_node_info(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) { @@ -3558,6 +7622,39 @@ 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_hash( + PaymentHash? 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_hash(self, serializer); + } + } + + @protected + void sse_encode_opt_box_autoadd_payment_id( + PaymentId? 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_id(self, serializer); + } + } + @protected void sse_encode_opt_box_autoadd_payment_preimage( PaymentPreimage? self, SseSerializer serializer) { @@ -3591,6 +7688,16 @@ 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 @@ -3602,7 +7709,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - void sse_encode_opt_box_autoadd_u_64(int? self, SseSerializer serializer) { + void sse_encode_opt_box_autoadd_u_64(BigInt? self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_bool(self != null, serializer); @@ -3633,9 +7740,8 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { void sse_encode_payment_details( PaymentDetails self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_payment_hash(self.hash, serializer); - sse_encode_opt_box_autoadd_payment_preimage(self.preimage, serializer); - sse_encode_opt_box_autoadd_payment_secret(self.secret, serializer); + sse_encode_payment_id(self.id, serializer); + sse_encode_payment_kind(self.kind, serializer); sse_encode_opt_box_autoadd_u_64(self.amountMsat, serializer); sse_encode_payment_direction(self.direction, serializer); sse_encode_payment_status(self.status, serializer); @@ -3648,12 +7754,80 @@ 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 sse_encode_u_8_array_32(self.data, serializer); } + @protected + void sse_encode_payment_id(PaymentId self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_u_8_array_32(self.field0, serializer); + } + + @protected + void sse_encode_payment_kind(PaymentKind self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + switch (self) { + case PaymentKind_Onchain(): + sse_encode_i_32(0, serializer); + case PaymentKind_Bolt11( + hash: final hash, + preimage: final preimage, + secret: final secret + ): + sse_encode_i_32(1, serializer); + sse_encode_box_autoadd_payment_hash(hash, serializer); + sse_encode_opt_box_autoadd_payment_preimage(preimage, serializer); + sse_encode_opt_box_autoadd_payment_secret(secret, serializer); + case PaymentKind_Bolt11Jit( + hash: final hash, + preimage: final preimage, + secret: final secret, + lspFeeLimits: final lspFeeLimits + ): + sse_encode_i_32(2, serializer); + sse_encode_box_autoadd_payment_hash(hash, serializer); + sse_encode_opt_box_autoadd_payment_preimage(preimage, serializer); + sse_encode_opt_box_autoadd_payment_secret(secret, serializer); + sse_encode_box_autoadd_lsp_fee_limits(lspFeeLimits, serializer); + case PaymentKind_Spontaneous(hash: final hash, preimage: final preimage): + sse_encode_i_32(3, serializer); + sse_encode_box_autoadd_payment_hash(hash, serializer); + sse_encode_opt_box_autoadd_payment_preimage(preimage, serializer); + case PaymentKind_Bolt12Offer( + hash: final hash, + preimage: final preimage, + secret: final secret, + offerId: final offerId + ): + sse_encode_i_32(4, serializer); + sse_encode_opt_box_autoadd_payment_hash(hash, serializer); + sse_encode_opt_box_autoadd_payment_preimage(preimage, serializer); + sse_encode_opt_box_autoadd_payment_secret(secret, serializer); + sse_encode_box_autoadd_offer_id(offerId, serializer); + case PaymentKind_Bolt12Refund( + hash: final hash, + preimage: final preimage, + secret: final secret + ): + sse_encode_i_32(5, serializer); + sse_encode_opt_box_autoadd_payment_hash(hash, serializer); + sse_encode_opt_box_autoadd_payment_preimage(preimage, serializer); + sse_encode_opt_box_autoadd_payment_secret(secret, serializer); + default: + throw UnimplementedError(''); + } + } + @protected void sse_encode_payment_preimage( PaymentPreimage self, SseSerializer serializer) { @@ -3681,12 +7855,75 @@ 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); + default: + throw UnimplementedError(''); + } + } + @protected void sse_encode_public_key(PublicKey self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_String(self.hex, 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); + } + + @protected + void sse_encode_refund(Refund self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_String(self.s, serializer); + } + + @protected + void sse_encode_routing_fees(RoutingFees self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_u_32(self.baseMsat, serializer); + sse_encode_u_32(self.proportionalMillionths, serializer); + } + @protected void sse_encode_socket_address(SocketAddress self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -3717,6 +7954,8 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_i_32(4, serializer); sse_encode_String(addr, serializer); sse_encode_u_16(port, serializer); + default: + throw UnimplementedError(''); } } @@ -3739,9 +7978,9 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - void sse_encode_u_64(int self, SseSerializer serializer) { + void sse_encode_u_64(BigInt self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - serializer.buffer.putUint64(self); + serializer.buffer.putBigUint64(self); } @protected @@ -3789,12 +8028,192 @@ 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_u_64(self.data, serializer); + sse_encode_list_prim_u_8_strict(self.data, serializer); } @protected - void sse_encode_usize(int self, SseSerializer serializer) { + void sse_encode_usize(BigInt self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - serializer.buffer.putUint64(self); + serializer.buffer.putBigUint64(self); } } + +@sealed +class ArcBolt12PaymentImpl extends RustOpaque implements ArcBolt12Payment { + // Not to be used by end users + ArcBolt12PaymentImpl.frbInternalDcoDecode(List wire) + : super.frbInternalDcoDecode(wire, _kStaticData); + + // Not to be used by end users + ArcBolt12PaymentImpl.frbInternalSseDecode( + BigInt ptr, int externalSizeOnNative) + : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + core.instance.api.rust_arc_increment_strong_count_ArcBolt12Payment, + rustArcDecrementStrongCount: + core.instance.api.rust_arc_decrement_strong_count_ArcBolt12Payment, + rustArcDecrementStrongCountPtr: + core.instance.api.rust_arc_decrement_strong_count_ArcBolt12PaymentPtr, + ); +} + +@sealed +class Bolt11PaymentImpl extends RustOpaque implements Bolt11Payment { + // Not to be used by end users + Bolt11PaymentImpl.frbInternalDcoDecode(List wire) + : super.frbInternalDcoDecode(wire, _kStaticData); + + // Not to be used by end users + Bolt11PaymentImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative) + : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + core.instance.api.rust_arc_increment_strong_count_Bolt11Payment, + rustArcDecrementStrongCount: + core.instance.api.rust_arc_decrement_strong_count_Bolt11Payment, + rustArcDecrementStrongCountPtr: + core.instance.api.rust_arc_decrement_strong_count_Bolt11PaymentPtr, + ); +} + +@sealed +class BuilderImpl extends RustOpaque implements Builder { + // Not to be used by end users + BuilderImpl.frbInternalDcoDecode(List wire) + : super.frbInternalDcoDecode(wire, _kStaticData); + + // Not to be used by end users + BuilderImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative) + : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + core.instance.api.rust_arc_increment_strong_count_Builder, + rustArcDecrementStrongCount: + core.instance.api.rust_arc_decrement_strong_count_Builder, + rustArcDecrementStrongCountPtr: + core.instance.api.rust_arc_decrement_strong_count_BuilderPtr, + ); +} + +@sealed +class NetworkGraphImpl extends RustOpaque implements NetworkGraph { + // Not to be used by end users + NetworkGraphImpl.frbInternalDcoDecode(List wire) + : super.frbInternalDcoDecode(wire, _kStaticData); + + // Not to be used by end users + NetworkGraphImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative) + : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + core.instance.api.rust_arc_increment_strong_count_NetworkGraph, + rustArcDecrementStrongCount: + core.instance.api.rust_arc_decrement_strong_count_NetworkGraph, + rustArcDecrementStrongCountPtr: + core.instance.api.rust_arc_decrement_strong_count_NetworkGraphPtr, + ); +} + +@sealed +class NodeBuilderImpl extends RustOpaque implements NodeBuilder { + // Not to be used by end users + NodeBuilderImpl.frbInternalDcoDecode(List wire) + : super.frbInternalDcoDecode(wire, _kStaticData); + + // Not to be used by end users + NodeBuilderImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative) + : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + core.instance.api.rust_arc_increment_strong_count_NodeBuilder, + rustArcDecrementStrongCount: + core.instance.api.rust_arc_decrement_strong_count_NodeBuilder, + rustArcDecrementStrongCountPtr: + core.instance.api.rust_arc_decrement_strong_count_NodeBuilderPtr, + ); + + Builder get builder => + core.instance.api.crateApiBuilderNodeBuilderAutoAccessorGetBuilder( + that: this, + ); + + void set builder(Builder builder) => + core.instance.api.crateApiBuilderNodeBuilderAutoAccessorSetBuilder( + that: this, builder: builder); + + Future build() => core.instance.api.crateApiBuilderNodeBuilderBuild( + that: this, + ); + + Future buildWithFsStore() => + core.instance.api.crateApiBuilderNodeBuilderBuildWithFsStore( + that: this, + ); +} + +@sealed +class NodeImpl extends RustOpaque implements Node { + // Not to be used by end users + NodeImpl.frbInternalDcoDecode(List wire) + : super.frbInternalDcoDecode(wire, _kStaticData); + + // Not to be used by end users + NodeImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative) + : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + core.instance.api.rust_arc_increment_strong_count_Node, + rustArcDecrementStrongCount: + core.instance.api.rust_arc_decrement_strong_count_Node, + rustArcDecrementStrongCountPtr: + core.instance.api.rust_arc_decrement_strong_count_NodePtr, + ); +} + +@sealed +class OnchainPaymentImpl extends RustOpaque implements OnchainPayment { + // Not to be used by end users + OnchainPaymentImpl.frbInternalDcoDecode(List wire) + : super.frbInternalDcoDecode(wire, _kStaticData); + + // Not to be used by end users + OnchainPaymentImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative) + : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + core.instance.api.rust_arc_increment_strong_count_OnchainPayment, + rustArcDecrementStrongCount: + core.instance.api.rust_arc_decrement_strong_count_OnchainPayment, + rustArcDecrementStrongCountPtr: + core.instance.api.rust_arc_decrement_strong_count_OnchainPaymentPtr, + ); +} + +@sealed +class SpontaneousPaymentImpl extends RustOpaque implements SpontaneousPayment { + // Not to be used by end users + SpontaneousPaymentImpl.frbInternalDcoDecode(List wire) + : super.frbInternalDcoDecode(wire, _kStaticData); + + // Not to be used by end users + SpontaneousPaymentImpl.frbInternalSseDecode( + BigInt ptr, int externalSizeOnNative) + : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + core.instance.api.rust_arc_increment_strong_count_SpontaneousPayment, + rustArcDecrementStrongCount: + core.instance.api.rust_arc_decrement_strong_count_SpontaneousPayment, + rustArcDecrementStrongCountPtr: + core.instance.api.rust_arc_decrement_strong_count_SpontaneousPaymentPtr, + ); +} diff --git a/lib/src/generated/frb_generated.io.dart b/lib/src/generated/frb_generated.io.dart index f729196..a49e574 100644 --- a/lib/src/generated/frb_generated.io.dart +++ b/lib/src/generated/frb_generated.io.dart @@ -1,19 +1,26 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. +// Generated by `flutter_rust_bridge`@ 2.0.0. // 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 -import 'api/error.dart'; +import 'api/bolt11.dart'; +import 'api/bolt12.dart'; +import 'api/builder.dart'; +import 'api/graph.dart'; import 'api/node.dart'; +import 'api/on_chain.dart'; +import 'api/spontaneous.dart'; import 'api/types.dart'; import 'dart:async'; import 'dart:convert'; import 'dart:ffi' as ffi; import 'frb_generated.dart'; +import 'lib.dart'; import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated_io.dart'; +import 'utils/error.dart'; -abstract class LdkCoreApiImplPlatform extends BaseApiImpl { - LdkCoreApiImplPlatform({ +abstract class coreApiImplPlatform extends BaseApiImpl { + coreApiImplPlatform({ required super.handler, required super.wire, required super.generalizedFrbRustBinding, @@ -21,11 +28,78 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { }); CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_NodeSqliteStorePtr => - wire._rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStorePtr; + get rust_arc_decrement_strong_count_ArcBolt12PaymentPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12PaymentPtr; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_NodePtr => + wire._rust_arc_decrement_strong_count_RustOpaque_NodePtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_NodeBuilderPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilderPtr; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_BuilderPtr => + wire._rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilderPtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_NetworkGraphPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraphPtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_Bolt11PaymentPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11PaymentPtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_OnchainPaymentPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPaymentPtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_SpontaneousPaymentPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPaymentPtr; + + @protected + NodeBuilder + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + dynamic raw); + + @protected + NodeBuilder + dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + dynamic raw); + + @protected + NodeBuilder + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + dynamic raw); + + @protected + ArcBolt12Payment dco_decode_RustOpaque_Arcldk_nodepaymentBolt12Payment( + dynamic raw); + + @protected + Node dco_decode_RustOpaque_Node(dynamic raw); + + @protected + NodeBuilder + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + dynamic raw); + + @protected + Builder dco_decode_RustOpaque_ldk_nodeBuilder(dynamic raw); + + @protected + NetworkGraph dco_decode_RustOpaque_ldk_nodegraphNetworkGraph(dynamic raw); + + @protected + Bolt11Payment dco_decode_RustOpaque_ldk_nodepaymentBolt11Payment(dynamic raw); + + @protected + OnchainPayment dco_decode_RustOpaque_ldk_nodepaymentOnchainPayment( + dynamic raw); @protected - NodeSqliteStore dco_decode_RustOpaque_NodeSqliteStore(dynamic raw); + SpontaneousPayment dco_decode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + dynamic raw); @protected String dco_decode_String(dynamic raw); @@ -33,18 +107,40 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected Address dco_decode_address(dynamic raw); + @protected + AnchorChannelsConfig dco_decode_anchor_channels_config(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); + @protected + Bolt12Invoice dco_decode_bolt_12_invoice(dynamic raw); + + @protected + Bolt12ParseError dco_decode_bolt_12_parse_error(dynamic raw); + @protected bool dco_decode_bool(dynamic raw); @protected Address dco_decode_box_autoadd_address(dynamic raw); + @protected + AnchorChannelsConfig dco_decode_box_autoadd_anchor_channels_config( + dynamic raw); + @protected Bolt11Invoice dco_decode_box_autoadd_bolt_11_invoice(dynamic raw); + @protected + Bolt12ParseError dco_decode_box_autoadd_bolt_12_parse_error(dynamic raw); + @protected ChainDataSourceConfig dco_decode_box_autoadd_chain_data_source_config( dynamic raw); @@ -55,9 +151,21 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected ChannelId dco_decode_box_autoadd_channel_id(dynamic raw); + @protected + ChannelInfo dco_decode_box_autoadd_channel_info(dynamic raw); + + @protected + ChannelUpdateInfo dco_decode_box_autoadd_channel_update_info(dynamic raw); + + @protected + ClosureReason dco_decode_box_autoadd_closure_reason(dynamic raw); + @protected Config dco_decode_box_autoadd_config(dynamic raw); + @protected + DecodeError dco_decode_box_autoadd_decode_error(dynamic raw); + @protected EntropySourceConfig dco_decode_box_autoadd_entropy_source_config(dynamic raw); @@ -67,21 +175,71 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected GossipSourceConfig dco_decode_box_autoadd_gossip_source_config(dynamic raw); + @protected + LdkBolt11Payment dco_decode_box_autoadd_ldk_bolt_11_payment(dynamic raw); + + @protected + LdkBolt12Payment dco_decode_box_autoadd_ldk_bolt_12_payment(dynamic raw); + @protected LdkMnemonic dco_decode_box_autoadd_ldk_mnemonic(dynamic raw); + @protected + LdkNetworkGraph dco_decode_box_autoadd_ldk_network_graph(dynamic raw); + @protected LdkNode dco_decode_box_autoadd_ldk_node(dynamic raw); + @protected + LdkOnChainPayment dco_decode_box_autoadd_ldk_on_chain_payment(dynamic raw); + + @protected + LdkSpontaneousPayment dco_decode_box_autoadd_ldk_spontaneous_payment( + dynamic raw); + + @protected + LiquiditySourceConfig dco_decode_box_autoadd_liquidity_source_config( + dynamic raw); + + @protected + LSPFeeLimits dco_decode_box_autoadd_lsp_fee_limits(dynamic raw); + + @protected + MaxDustHTLCExposure dco_decode_box_autoadd_max_dust_htlc_exposure( + dynamic raw); + + @protected + NodeAnnouncementInfo dco_decode_box_autoadd_node_announcement_info( + dynamic raw); + + @protected + NodeId dco_decode_box_autoadd_node_id(dynamic raw); + + @protected + NodeInfo dco_decode_box_autoadd_node_info(dynamic raw); + + @protected + Offer dco_decode_box_autoadd_offer(dynamic raw); + + @protected + OfferId dco_decode_box_autoadd_offer_id(dynamic raw); + @protected OutPoint dco_decode_box_autoadd_out_point(dynamic raw); @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); + @protected + PaymentId dco_decode_box_autoadd_payment_id(dynamic raw); + @protected PaymentPreimage dco_decode_box_autoadd_payment_preimage(dynamic raw); @@ -91,20 +249,26 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected PublicKey dco_decode_box_autoadd_public_key(dynamic raw); + @protected + Refund dco_decode_box_autoadd_refund(dynamic raw); + @protected SocketAddress dco_decode_box_autoadd_socket_address(dynamic raw); @protected - int dco_decode_box_autoadd_u_32(dynamic raw); + Txid dco_decode_box_autoadd_txid(dynamic raw); @protected - int dco_decode_box_autoadd_u_64(dynamic raw); + int dco_decode_box_autoadd_u_16(dynamic raw); @protected - UserChannelId dco_decode_box_autoadd_user_channel_id(dynamic raw); + int dco_decode_box_autoadd_u_32(dynamic raw); + + @protected + BigInt dco_decode_box_autoadd_u_64(dynamic raw); @protected - BuilderException dco_decode_builder_exception(dynamic raw); + UserChannelId dco_decode_box_autoadd_user_channel_id(dynamic raw); @protected ChainDataSourceConfig dco_decode_chain_data_source_config(dynamic raw); @@ -118,9 +282,21 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected ChannelId dco_decode_channel_id(dynamic raw); + @protected + ChannelInfo dco_decode_channel_info(dynamic raw); + + @protected + ChannelUpdateInfo dco_decode_channel_update_info(dynamic raw); + + @protected + ClosureReason dco_decode_closure_reason(dynamic raw); + @protected Config dco_decode_config(dynamic raw); + @protected + DecodeError dco_decode_decode_error(dynamic raw); + @protected EntropySourceConfig dco_decode_entropy_source_config(dynamic raw); @@ -133,21 +309,60 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected int dco_decode_i_32(dynamic raw); + @protected + LdkBolt11Payment dco_decode_ldk_bolt_11_payment(dynamic raw); + + @protected + LdkBolt12Payment dco_decode_ldk_bolt_12_payment(dynamic raw); + + @protected + LdkBuilderError dco_decode_ldk_builder_error(dynamic raw); + @protected LdkMnemonic dco_decode_ldk_mnemonic(dynamic raw); + @protected + LdkNetworkGraph dco_decode_ldk_network_graph(dynamic raw); + @protected LdkNode dco_decode_ldk_node(dynamic raw); + @protected + LdkNodeError dco_decode_ldk_node_error(dynamic raw); + + @protected + LdkOnChainPayment dco_decode_ldk_on_chain_payment(dynamic raw); + + @protected + LdkSpontaneousPayment dco_decode_ldk_spontaneous_payment(dynamic raw); + + @protected + LightningBalance dco_decode_lightning_balance(dynamic raw); + + @protected + LiquiditySourceConfig dco_decode_liquidity_source_config(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_node_id(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 + Uint64List dco_decode_list_prim_u_64_strict(dynamic raw); + @protected List dco_decode_list_prim_u_8_loose(dynamic raw); @@ -163,6 +378,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected LogLevel dco_decode_log_level(dynamic raw); + @protected + LSPFeeLimits dco_decode_lsp_fee_limits(dynamic raw); + @protected MaxDustHTLCExposure dco_decode_max_dust_htlc_exposure(dynamic raw); @@ -170,11 +388,30 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { Network dco_decode_network(dynamic raw); @protected - NodeException dco_decode_node_exception(dynamic raw); + NodeAnnouncementInfo dco_decode_node_announcement_info(dynamic raw); + + @protected + NodeId dco_decode_node_id(dynamic raw); + + @protected + NodeInfo dco_decode_node_info(dynamic raw); + + @protected + NodeStatus dco_decode_node_status(dynamic raw); + + @protected + Offer dco_decode_offer(dynamic raw); + + @protected + OfferId dco_decode_offer_id(dynamic raw); @protected String? dco_decode_opt_String(dynamic raw); + @protected + AnchorChannelsConfig? dco_decode_opt_box_autoadd_anchor_channels_config( + dynamic raw); + @protected ChainDataSourceConfig? dco_decode_opt_box_autoadd_chain_data_source_config( dynamic raw); @@ -182,6 +419,19 @@ 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 + ChannelInfo? dco_decode_opt_box_autoadd_channel_info(dynamic raw); + + @protected + ChannelUpdateInfo? dco_decode_opt_box_autoadd_channel_update_info( + 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); @@ -193,9 +443,37 @@ 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 + NodeAnnouncementInfo? dco_decode_opt_box_autoadd_node_announcement_info( + dynamic raw); + + @protected + NodeInfo? dco_decode_opt_box_autoadd_node_info(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 + PaymentHash? dco_decode_opt_box_autoadd_payment_hash(dynamic raw); + + @protected + PaymentId? dco_decode_opt_box_autoadd_payment_id(dynamic raw); + @protected PaymentPreimage? dco_decode_opt_box_autoadd_payment_preimage(dynamic raw); @@ -205,11 +483,14 @@ 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); @protected - int? dco_decode_opt_box_autoadd_u_64(dynamic raw); + BigInt? dco_decode_opt_box_autoadd_u_64(dynamic raw); @protected List? dco_decode_opt_list_socket_address(dynamic raw); @@ -223,9 +504,18 @@ 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); + @protected + PaymentId dco_decode_payment_id(dynamic raw); + + @protected + PaymentKind dco_decode_payment_kind(dynamic raw); + @protected PaymentPreimage dco_decode_payment_preimage(dynamic raw); @@ -238,9 +528,22 @@ 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 + Refund dco_decode_refund(dynamic raw); + + @protected + RoutingFees dco_decode_routing_fees(dynamic raw); + @protected SocketAddress dco_decode_socket_address(dynamic raw); @@ -254,7 +557,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { int dco_decode_u_32(dynamic raw); @protected - int dco_decode_u_64(dynamic raw); + BigInt dco_decode_u_64(dynamic raw); @protected int dco_decode_u_8(dynamic raw); @@ -281,140 +584,331 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { UserChannelId dco_decode_user_channel_id(dynamic raw); @protected - int dco_decode_usize(dynamic raw); + BigInt dco_decode_usize(dynamic raw); @protected - NodeSqliteStore sse_decode_RustOpaque_NodeSqliteStore( - SseDeserializer deserializer); + NodeBuilder + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + SseDeserializer deserializer); @protected - String sse_decode_String(SseDeserializer deserializer); + NodeBuilder + sse_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + SseDeserializer deserializer); @protected - Address sse_decode_address(SseDeserializer deserializer); + NodeBuilder + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + SseDeserializer deserializer); @protected - Bolt11Invoice sse_decode_bolt_11_invoice(SseDeserializer deserializer); + ArcBolt12Payment sse_decode_RustOpaque_Arcldk_nodepaymentBolt12Payment( + SseDeserializer deserializer); @protected - bool sse_decode_bool(SseDeserializer deserializer); + Node sse_decode_RustOpaque_Node(SseDeserializer deserializer); @protected - Address sse_decode_box_autoadd_address(SseDeserializer deserializer); + NodeBuilder + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + SseDeserializer deserializer); @protected - Bolt11Invoice sse_decode_box_autoadd_bolt_11_invoice( + Builder sse_decode_RustOpaque_ldk_nodeBuilder(SseDeserializer deserializer); + + @protected + NetworkGraph sse_decode_RustOpaque_ldk_nodegraphNetworkGraph( SseDeserializer deserializer); @protected - ChainDataSourceConfig sse_decode_box_autoadd_chain_data_source_config( + Bolt11Payment sse_decode_RustOpaque_ldk_nodepaymentBolt11Payment( SseDeserializer deserializer); @protected - ChannelConfig sse_decode_box_autoadd_channel_config( + OnchainPayment sse_decode_RustOpaque_ldk_nodepaymentOnchainPayment( SseDeserializer deserializer); @protected - ChannelId sse_decode_box_autoadd_channel_id(SseDeserializer deserializer); + SpontaneousPayment sse_decode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + SseDeserializer deserializer); @protected - Config sse_decode_box_autoadd_config(SseDeserializer deserializer); + String sse_decode_String(SseDeserializer deserializer); @protected - EntropySourceConfig sse_decode_box_autoadd_entropy_source_config( + Address sse_decode_address(SseDeserializer deserializer); + + @protected + AnchorChannelsConfig sse_decode_anchor_channels_config( SseDeserializer deserializer); @protected - Event sse_decode_box_autoadd_event(SseDeserializer deserializer); + BalanceDetails sse_decode_balance_details(SseDeserializer deserializer); @protected - GossipSourceConfig sse_decode_box_autoadd_gossip_source_config( - SseDeserializer deserializer); + BestBlock sse_decode_best_block(SseDeserializer deserializer); @protected - LdkMnemonic sse_decode_box_autoadd_ldk_mnemonic(SseDeserializer deserializer); + Bolt11Invoice sse_decode_bolt_11_invoice(SseDeserializer deserializer); @protected - LdkNode sse_decode_box_autoadd_ldk_node(SseDeserializer deserializer); + Bolt12Invoice sse_decode_bolt_12_invoice(SseDeserializer deserializer); @protected - OutPoint sse_decode_box_autoadd_out_point(SseDeserializer deserializer); + Bolt12ParseError sse_decode_bolt_12_parse_error(SseDeserializer deserializer); @protected - PaymentDetails sse_decode_box_autoadd_payment_details( - SseDeserializer deserializer); + bool sse_decode_bool(SseDeserializer deserializer); @protected - PaymentHash sse_decode_box_autoadd_payment_hash(SseDeserializer deserializer); + Address sse_decode_box_autoadd_address(SseDeserializer deserializer); @protected - PaymentPreimage sse_decode_box_autoadd_payment_preimage( + AnchorChannelsConfig sse_decode_box_autoadd_anchor_channels_config( SseDeserializer deserializer); @protected - PaymentSecret sse_decode_box_autoadd_payment_secret( + Bolt11Invoice sse_decode_box_autoadd_bolt_11_invoice( SseDeserializer deserializer); @protected - PublicKey sse_decode_box_autoadd_public_key(SseDeserializer deserializer); + Bolt12ParseError sse_decode_box_autoadd_bolt_12_parse_error( + SseDeserializer deserializer); @protected - SocketAddress sse_decode_box_autoadd_socket_address( + ChainDataSourceConfig sse_decode_box_autoadd_chain_data_source_config( SseDeserializer deserializer); @protected - int sse_decode_box_autoadd_u_32(SseDeserializer deserializer); + ChannelConfig sse_decode_box_autoadd_channel_config( + SseDeserializer deserializer); @protected - int sse_decode_box_autoadd_u_64(SseDeserializer deserializer); + ChannelId sse_decode_box_autoadd_channel_id(SseDeserializer deserializer); @protected - UserChannelId sse_decode_box_autoadd_user_channel_id( - SseDeserializer deserializer); + ChannelInfo sse_decode_box_autoadd_channel_info(SseDeserializer deserializer); @protected - BuilderException sse_decode_builder_exception(SseDeserializer deserializer); + ChannelUpdateInfo sse_decode_box_autoadd_channel_update_info( + SseDeserializer deserializer); @protected - ChainDataSourceConfig sse_decode_chain_data_source_config( + ClosureReason sse_decode_box_autoadd_closure_reason( SseDeserializer deserializer); @protected - ChannelConfig sse_decode_channel_config(SseDeserializer deserializer); + Config sse_decode_box_autoadd_config(SseDeserializer deserializer); @protected - ChannelDetails sse_decode_channel_details(SseDeserializer deserializer); + DecodeError sse_decode_box_autoadd_decode_error(SseDeserializer deserializer); @protected - ChannelId sse_decode_channel_id(SseDeserializer deserializer); + EntropySourceConfig sse_decode_box_autoadd_entropy_source_config( + SseDeserializer deserializer); @protected - Config sse_decode_config(SseDeserializer deserializer); + Event sse_decode_box_autoadd_event(SseDeserializer deserializer); @protected - EntropySourceConfig sse_decode_entropy_source_config( + GossipSourceConfig sse_decode_box_autoadd_gossip_source_config( SseDeserializer deserializer); @protected - Event sse_decode_event(SseDeserializer deserializer); + LdkBolt11Payment sse_decode_box_autoadd_ldk_bolt_11_payment( + SseDeserializer deserializer); @protected - GossipSourceConfig sse_decode_gossip_source_config( + LdkBolt12Payment sse_decode_box_autoadd_ldk_bolt_12_payment( SseDeserializer deserializer); @protected - int sse_decode_i_32(SseDeserializer deserializer); + LdkMnemonic sse_decode_box_autoadd_ldk_mnemonic(SseDeserializer deserializer); + + @protected + LdkNetworkGraph sse_decode_box_autoadd_ldk_network_graph( + SseDeserializer deserializer); + + @protected + LdkNode sse_decode_box_autoadd_ldk_node(SseDeserializer deserializer); + + @protected + LdkOnChainPayment sse_decode_box_autoadd_ldk_on_chain_payment( + SseDeserializer deserializer); + + @protected + LdkSpontaneousPayment sse_decode_box_autoadd_ldk_spontaneous_payment( + SseDeserializer deserializer); + + @protected + LiquiditySourceConfig sse_decode_box_autoadd_liquidity_source_config( + SseDeserializer deserializer); + + @protected + LSPFeeLimits sse_decode_box_autoadd_lsp_fee_limits( + SseDeserializer deserializer); + + @protected + MaxDustHTLCExposure sse_decode_box_autoadd_max_dust_htlc_exposure( + SseDeserializer deserializer); + + @protected + NodeAnnouncementInfo sse_decode_box_autoadd_node_announcement_info( + SseDeserializer deserializer); + + @protected + NodeId sse_decode_box_autoadd_node_id(SseDeserializer deserializer); + + @protected + NodeInfo sse_decode_box_autoadd_node_info(SseDeserializer deserializer); + + @protected + Offer sse_decode_box_autoadd_offer(SseDeserializer deserializer); + + @protected + OfferId sse_decode_box_autoadd_offer_id(SseDeserializer deserializer); + + @protected + OutPoint sse_decode_box_autoadd_out_point(SseDeserializer deserializer); + + @protected + 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); + + @protected + PaymentId sse_decode_box_autoadd_payment_id(SseDeserializer deserializer); + + @protected + PaymentPreimage sse_decode_box_autoadd_payment_preimage( + SseDeserializer deserializer); + + @protected + PaymentSecret sse_decode_box_autoadd_payment_secret( + SseDeserializer deserializer); + + @protected + PublicKey sse_decode_box_autoadd_public_key(SseDeserializer deserializer); + + @protected + Refund sse_decode_box_autoadd_refund(SseDeserializer deserializer); + + @protected + 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); + + @protected + BigInt sse_decode_box_autoadd_u_64(SseDeserializer deserializer); + + @protected + UserChannelId sse_decode_box_autoadd_user_channel_id( + SseDeserializer deserializer); + + @protected + ChainDataSourceConfig sse_decode_chain_data_source_config( + SseDeserializer deserializer); + + @protected + ChannelConfig sse_decode_channel_config(SseDeserializer deserializer); + + @protected + ChannelDetails sse_decode_channel_details(SseDeserializer deserializer); + + @protected + ChannelId sse_decode_channel_id(SseDeserializer deserializer); + + @protected + ChannelInfo sse_decode_channel_info(SseDeserializer deserializer); + + @protected + ChannelUpdateInfo sse_decode_channel_update_info( + SseDeserializer deserializer); + + @protected + ClosureReason sse_decode_closure_reason(SseDeserializer deserializer); + + @protected + Config sse_decode_config(SseDeserializer deserializer); + + @protected + DecodeError sse_decode_decode_error(SseDeserializer deserializer); + + @protected + EntropySourceConfig sse_decode_entropy_source_config( + SseDeserializer deserializer); + + @protected + Event sse_decode_event(SseDeserializer deserializer); + + @protected + GossipSourceConfig sse_decode_gossip_source_config( + SseDeserializer deserializer); + + @protected + int sse_decode_i_32(SseDeserializer deserializer); + + @protected + LdkBolt11Payment sse_decode_ldk_bolt_11_payment(SseDeserializer deserializer); + + @protected + LdkBolt12Payment sse_decode_ldk_bolt_12_payment(SseDeserializer deserializer); + + @protected + LdkBuilderError sse_decode_ldk_builder_error(SseDeserializer deserializer); @protected LdkMnemonic sse_decode_ldk_mnemonic(SseDeserializer deserializer); + @protected + LdkNetworkGraph sse_decode_ldk_network_graph(SseDeserializer deserializer); + @protected LdkNode sse_decode_ldk_node(SseDeserializer deserializer); + @protected + LdkNodeError sse_decode_ldk_node_error(SseDeserializer deserializer); + + @protected + LdkOnChainPayment sse_decode_ldk_on_chain_payment( + SseDeserializer deserializer); + + @protected + LdkSpontaneousPayment sse_decode_ldk_spontaneous_payment( + SseDeserializer deserializer); + + @protected + LightningBalance sse_decode_lightning_balance(SseDeserializer deserializer); + + @protected + LiquiditySourceConfig sse_decode_liquidity_source_config( + 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_node_id(SseDeserializer deserializer); + @protected List sse_decode_list_payment_details( SseDeserializer deserializer); @@ -422,6 +916,13 @@ 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 + Uint64List sse_decode_list_prim_u_64_strict(SseDeserializer deserializer); + @protected List sse_decode_list_prim_u_8_loose(SseDeserializer deserializer); @@ -438,6 +939,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected LogLevel sse_decode_log_level(SseDeserializer deserializer); + @protected + LSPFeeLimits sse_decode_lsp_fee_limits(SseDeserializer deserializer); + @protected MaxDustHTLCExposure sse_decode_max_dust_htlc_exposure( SseDeserializer deserializer); @@ -446,11 +950,31 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { Network sse_decode_network(SseDeserializer deserializer); @protected - NodeException sse_decode_node_exception(SseDeserializer deserializer); + NodeAnnouncementInfo sse_decode_node_announcement_info( + SseDeserializer deserializer); + + @protected + NodeId sse_decode_node_id(SseDeserializer deserializer); + + @protected + NodeInfo sse_decode_node_info(SseDeserializer deserializer); + + @protected + NodeStatus sse_decode_node_status(SseDeserializer deserializer); + + @protected + Offer sse_decode_offer(SseDeserializer deserializer); + + @protected + OfferId sse_decode_offer_id(SseDeserializer deserializer); @protected String? sse_decode_opt_String(SseDeserializer deserializer); + @protected + AnchorChannelsConfig? sse_decode_opt_box_autoadd_anchor_channels_config( + SseDeserializer deserializer); + @protected ChainDataSourceConfig? sse_decode_opt_box_autoadd_chain_data_source_config( SseDeserializer deserializer); @@ -459,6 +983,22 @@ 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 + ChannelInfo? sse_decode_opt_box_autoadd_channel_info( + SseDeserializer deserializer); + + @protected + ChannelUpdateInfo? sse_decode_opt_box_autoadd_channel_update_info( + 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); @@ -470,10 +1010,40 @@ 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 + NodeAnnouncementInfo? sse_decode_opt_box_autoadd_node_announcement_info( + SseDeserializer deserializer); + + @protected + NodeInfo? sse_decode_opt_box_autoadd_node_info(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 + PaymentHash? sse_decode_opt_box_autoadd_payment_hash( + SseDeserializer deserializer); + + @protected + PaymentId? sse_decode_opt_box_autoadd_payment_id( + SseDeserializer deserializer); + @protected PaymentPreimage? sse_decode_opt_box_autoadd_payment_preimage( SseDeserializer deserializer); @@ -486,11 +1056,14 @@ 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); @protected - int? sse_decode_opt_box_autoadd_u_64(SseDeserializer deserializer); + BigInt? sse_decode_opt_box_autoadd_u_64(SseDeserializer deserializer); @protected List? sse_decode_opt_list_socket_address( @@ -505,9 +1078,19 @@ 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); + @protected + PaymentId sse_decode_payment_id(SseDeserializer deserializer); + + @protected + PaymentKind sse_decode_payment_kind(SseDeserializer deserializer); + @protected PaymentPreimage sse_decode_payment_preimage(SseDeserializer deserializer); @@ -520,9 +1103,24 @@ 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 + Refund sse_decode_refund(SseDeserializer deserializer); + + @protected + RoutingFees sse_decode_routing_fees(SseDeserializer deserializer); + @protected SocketAddress sse_decode_socket_address(SseDeserializer deserializer); @@ -536,7 +1134,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { int sse_decode_u_32(SseDeserializer deserializer); @protected - int sse_decode_u_64(SseDeserializer deserializer); + BigInt sse_decode_u_64(SseDeserializer deserializer); @protected int sse_decode_u_8(SseDeserializer deserializer); @@ -563,7 +1161,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { UserChannelId sse_decode_user_channel_id(SseDeserializer deserializer); @protected - int sse_decode_usize(SseDeserializer deserializer); + BigInt sse_decode_usize(SseDeserializer deserializer); @protected ffi.Pointer cst_encode_String(String raw) { @@ -579,6 +1177,15 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ptr; } + @protected + ffi.Pointer + cst_encode_box_autoadd_anchor_channels_config(AnchorChannelsConfig raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_anchor_channels_config(); + cst_api_fill_to_wire_anchor_channels_config(raw, ptr.ref); + return ptr; + } + @protected ffi.Pointer cst_encode_box_autoadd_bolt_11_invoice( Bolt11Invoice raw) { @@ -588,6 +1195,15 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ptr; } + @protected + ffi.Pointer + cst_encode_box_autoadd_bolt_12_parse_error(Bolt12ParseError raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_bolt_12_parse_error(); + cst_api_fill_to_wire_bolt_12_parse_error(raw, ptr.ref); + return ptr; + } + @protected ffi.Pointer cst_encode_box_autoadd_chain_data_source_config( @@ -616,6 +1232,33 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ptr; } + @protected + ffi.Pointer cst_encode_box_autoadd_channel_info( + ChannelInfo raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_channel_info(); + cst_api_fill_to_wire_channel_info(raw, ptr.ref); + return ptr; + } + + @protected + ffi.Pointer + cst_encode_box_autoadd_channel_update_info(ChannelUpdateInfo raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_channel_update_info(); + cst_api_fill_to_wire_channel_update_info(raw, ptr.ref); + 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 @@ -624,6 +1267,15 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ptr; } + @protected + ffi.Pointer cst_encode_box_autoadd_decode_error( + DecodeError raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_decode_error(); + cst_api_fill_to_wire_decode_error(raw, ptr.ref); + return ptr; + } + @protected ffi.Pointer cst_encode_box_autoadd_entropy_source_config(EntropySourceConfig raw) { @@ -651,26 +1303,142 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { } @protected - ffi.Pointer cst_encode_box_autoadd_ldk_mnemonic( - LdkMnemonic raw) { + ffi.Pointer + cst_encode_box_autoadd_ldk_bolt_11_payment(LdkBolt11Payment raw) { // Codec=Cst (C-struct based), see doc to use other codecs - final ptr = wire.cst_new_box_autoadd_ldk_mnemonic(); - cst_api_fill_to_wire_ldk_mnemonic(raw, ptr.ref); + final ptr = wire.cst_new_box_autoadd_ldk_bolt_11_payment(); + cst_api_fill_to_wire_ldk_bolt_11_payment(raw, ptr.ref); return ptr; } @protected - ffi.Pointer cst_encode_box_autoadd_ldk_node(LdkNode raw) { + ffi.Pointer + cst_encode_box_autoadd_ldk_bolt_12_payment(LdkBolt12Payment raw) { // Codec=Cst (C-struct based), see doc to use other codecs - final ptr = wire.cst_new_box_autoadd_ldk_node(); - cst_api_fill_to_wire_ldk_node(raw, ptr.ref); + final ptr = wire.cst_new_box_autoadd_ldk_bolt_12_payment(); + cst_api_fill_to_wire_ldk_bolt_12_payment(raw, ptr.ref); return ptr; } @protected - ffi.Pointer cst_encode_box_autoadd_out_point( - OutPoint raw) { - // Codec=Cst (C-struct based), see doc to use other codecs + 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_ldk_mnemonic(); + cst_api_fill_to_wire_ldk_mnemonic(raw, ptr.ref); + return ptr; + } + + @protected + ffi.Pointer + cst_encode_box_autoadd_ldk_network_graph(LdkNetworkGraph raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_ldk_network_graph(); + cst_api_fill_to_wire_ldk_network_graph(raw, ptr.ref); + return ptr; + } + + @protected + 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_ldk_node(); + cst_api_fill_to_wire_ldk_node(raw, ptr.ref); + return ptr; + } + + @protected + ffi.Pointer + cst_encode_box_autoadd_ldk_on_chain_payment(LdkOnChainPayment raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_ldk_on_chain_payment(); + cst_api_fill_to_wire_ldk_on_chain_payment(raw, ptr.ref); + return ptr; + } + + @protected + ffi.Pointer + cst_encode_box_autoadd_ldk_spontaneous_payment( + LdkSpontaneousPayment raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_ldk_spontaneous_payment(); + cst_api_fill_to_wire_ldk_spontaneous_payment(raw, ptr.ref); + return ptr; + } + + @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_lsp_fee_limits( + LSPFeeLimits raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_lsp_fee_limits(); + cst_api_fill_to_wire_lsp_fee_limits(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_node_announcement_info(NodeAnnouncementInfo raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_node_announcement_info(); + cst_api_fill_to_wire_node_announcement_info(raw, ptr.ref); + return ptr; + } + + @protected + ffi.Pointer cst_encode_box_autoadd_node_id(NodeId raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_node_id(); + cst_api_fill_to_wire_node_id(raw, ptr.ref); + return ptr; + } + + @protected + ffi.Pointer cst_encode_box_autoadd_node_info( + NodeInfo raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_node_info(); + cst_api_fill_to_wire_node_info(raw, ptr.ref); + return ptr; + } + + @protected + ffi.Pointer cst_encode_box_autoadd_offer(Offer raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_offer(); + cst_api_fill_to_wire_offer(raw, ptr.ref); + return ptr; + } + + @protected + ffi.Pointer cst_encode_box_autoadd_offer_id(OfferId raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_offer_id(); + cst_api_fill_to_wire_offer_id(raw, ptr.ref); + return ptr; + } + + @protected + ffi.Pointer cst_encode_box_autoadd_out_point( + OutPoint raw) { + // Codec=Cst (C-struct based), see doc to use other codecs final ptr = wire.cst_new_box_autoadd_out_point(); cst_api_fill_to_wire_out_point(raw, ptr.ref); return ptr; @@ -685,6 +1453,14 @@ 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) { @@ -694,6 +1470,15 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ptr; } + @protected + ffi.Pointer cst_encode_box_autoadd_payment_id( + PaymentId raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_payment_id(); + cst_api_fill_to_wire_payment_id(raw, ptr.ref); + return ptr; + } + @protected ffi.Pointer cst_encode_box_autoadd_payment_preimage(PaymentPreimage raw) { @@ -721,6 +1506,14 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ptr; } + @protected + ffi.Pointer cst_encode_box_autoadd_refund(Refund raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_refund(); + cst_api_fill_to_wire_refund(raw, ptr.ref); + return ptr; + } + @protected ffi.Pointer cst_encode_box_autoadd_socket_address( SocketAddress raw) { @@ -730,6 +1523,20 @@ 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 @@ -737,7 +1544,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { } @protected - ffi.Pointer cst_encode_box_autoadd_u_64(int raw) { + ffi.Pointer cst_encode_box_autoadd_u_64(BigInt raw) { // Codec=Cst (C-struct based), see doc to use other codecs return wire.cst_new_box_autoadd_u_64(cst_encode_u_64(raw)); } @@ -762,6 +1569,27 @@ 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_node_id(List raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ans = wire.cst_new_list_node_id(raw.length); + for (var i = 0; i < raw.length; ++i) { + cst_api_fill_to_wire_node_id(raw[i], ans.ref.ptr[i]); + } + return ans; + } + @protected ffi.Pointer cst_encode_list_payment_details( List raw) { @@ -784,6 +1612,26 @@ 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_64_strict( + Uint64List raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ans = wire.cst_new_list_prim_u_64_strict(raw.length); + ans.ref.ptr.asTypedList(raw.length).setAll(0, raw.inner); + return ans; + } + @protected ffi.Pointer cst_encode_list_prim_u_8_loose( List raw) { @@ -831,6 +1679,16 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return raw == null ? ffi.nullptr : cst_encode_String(raw); } + @protected + ffi.Pointer + cst_encode_opt_box_autoadd_anchor_channels_config( + AnchorChannelsConfig? raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw == null + ? ffi.nullptr + : cst_encode_box_autoadd_anchor_channels_config(raw); + } + @protected ffi.Pointer cst_encode_opt_box_autoadd_chain_data_source_config( @@ -850,6 +1708,38 @@ 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_channel_info( + ChannelInfo? raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw == null ? ffi.nullptr : cst_encode_box_autoadd_channel_info(raw); + } + + @protected + ffi.Pointer + cst_encode_opt_box_autoadd_channel_update_info(ChannelUpdateInfo? raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw == null + ? ffi.nullptr + : cst_encode_box_autoadd_channel_update_info(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( @@ -875,6 +1765,50 @@ 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_node_announcement_info( + NodeAnnouncementInfo? raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw == null + ? ffi.nullptr + : cst_encode_box_autoadd_node_announcement_info(raw); + } + + @protected + ffi.Pointer cst_encode_opt_box_autoadd_node_info( + NodeInfo? raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw == null ? ffi.nullptr : cst_encode_box_autoadd_node_info(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) { @@ -884,6 +1818,29 @@ 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_hash( + PaymentHash? raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw == null ? ffi.nullptr : cst_encode_box_autoadd_payment_hash(raw); + } + + @protected + ffi.Pointer cst_encode_opt_box_autoadd_payment_id( + PaymentId? raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw == null ? ffi.nullptr : cst_encode_box_autoadd_payment_id(raw); + } + @protected ffi.Pointer cst_encode_opt_box_autoadd_payment_preimage(PaymentPreimage? raw) { @@ -909,6 +1866,12 @@ 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 @@ -916,7 +1879,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { } @protected - ffi.Pointer cst_encode_opt_box_autoadd_u_64(int? raw) { + ffi.Pointer cst_encode_opt_box_autoadd_u_64(BigInt? raw) { // Codec=Cst (C-struct based), see doc to use other codecs return raw == null ? ffi.nullptr : cst_encode_box_autoadd_u_64(raw); } @@ -929,9 +1892,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { } @protected - int cst_encode_u_64(int raw) { + int cst_encode_u_64(BigInt raw) { // Codec=Cst (C-struct based), see doc to use other codecs - return raw.toInt(); + return raw.toSigned(64).toInt(); } @protected @@ -979,29 +1942,124 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ans; } + @protected + int cst_encode_usize(BigInt raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw.toSigned(64).toInt(); + } + @protected void cst_api_fill_to_wire_address(Address apiObj, wire_cst_address wireObj) { wireObj.s = cst_encode_String(apiObj.s); } + @protected + void cst_api_fill_to_wire_anchor_channels_config( + AnchorChannelsConfig apiObj, wire_cst_anchor_channels_config wireObj) { + wireObj.trusted_peers_no_reserve = + cst_encode_list_public_key(apiObj.trustedPeersNoReserve); + wireObj.per_channel_reserve_sats = + cst_encode_u_64(apiObj.perChannelReserveSats); + } + + @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) { wireObj.signed_raw_invoice = cst_encode_String(apiObj.signedRawInvoice); } + @protected + void cst_api_fill_to_wire_bolt_12_invoice( + Bolt12Invoice apiObj, wire_cst_bolt_12_invoice wireObj) { + wireObj.data = cst_encode_list_prim_u_8_strict(apiObj.data); + } + + @protected + void cst_api_fill_to_wire_bolt_12_parse_error( + Bolt12ParseError apiObj, wire_cst_bolt_12_parse_error wireObj) { + if (apiObj is Bolt12ParseError_InvalidContinuation) { + wireObj.tag = 0; + return; + } + if (apiObj is Bolt12ParseError_InvalidBech32Hrp) { + wireObj.tag = 1; + return; + } + if (apiObj is Bolt12ParseError_Bech32) { + var pre_field0 = cst_encode_String(apiObj.field0); + wireObj.tag = 2; + wireObj.kind.Bech32.field0 = pre_field0; + return; + } + if (apiObj is Bolt12ParseError_Decode) { + var pre_field0 = cst_encode_box_autoadd_decode_error(apiObj.field0); + wireObj.tag = 3; + wireObj.kind.Decode.field0 = pre_field0; + return; + } + if (apiObj is Bolt12ParseError_InvalidSemantics) { + var pre_field0 = cst_encode_String(apiObj.field0); + wireObj.tag = 4; + wireObj.kind.InvalidSemantics.field0 = pre_field0; + return; + } + if (apiObj is Bolt12ParseError_InvalidSignature) { + var pre_field0 = cst_encode_String(apiObj.field0); + wireObj.tag = 5; + wireObj.kind.InvalidSignature.field0 = pre_field0; + return; + } + } + @protected void cst_api_fill_to_wire_box_autoadd_address( Address apiObj, ffi.Pointer wireObj) { cst_api_fill_to_wire_address(apiObj, wireObj.ref); } + @protected + void cst_api_fill_to_wire_box_autoadd_anchor_channels_config( + AnchorChannelsConfig apiObj, + ffi.Pointer wireObj) { + cst_api_fill_to_wire_anchor_channels_config(apiObj, wireObj.ref); + } + @protected void cst_api_fill_to_wire_box_autoadd_bolt_11_invoice( Bolt11Invoice apiObj, ffi.Pointer wireObj) { cst_api_fill_to_wire_bolt_11_invoice(apiObj, wireObj.ref); } + @protected + void cst_api_fill_to_wire_box_autoadd_bolt_12_parse_error( + Bolt12ParseError apiObj, + ffi.Pointer wireObj) { + cst_api_fill_to_wire_bolt_12_parse_error(apiObj, wireObj.ref); + } + @protected void cst_api_fill_to_wire_box_autoadd_chain_data_source_config( ChainDataSourceConfig apiObj, @@ -1021,12 +2079,37 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { cst_api_fill_to_wire_channel_id(apiObj, wireObj.ref); } + @protected + void cst_api_fill_to_wire_box_autoadd_channel_info( + ChannelInfo apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_channel_info(apiObj, wireObj.ref); + } + + @protected + void cst_api_fill_to_wire_box_autoadd_channel_update_info( + ChannelUpdateInfo apiObj, + ffi.Pointer wireObj) { + cst_api_fill_to_wire_channel_update_info(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) { cst_api_fill_to_wire_config(apiObj, wireObj.ref); } + @protected + void cst_api_fill_to_wire_box_autoadd_decode_error( + DecodeError apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_decode_error(apiObj, wireObj.ref); + } + @protected void cst_api_fill_to_wire_box_autoadd_entropy_source_config( EntropySourceConfig apiObj, @@ -1048,17 +2131,102 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { } @protected - 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); + void cst_api_fill_to_wire_box_autoadd_ldk_bolt_11_payment( + LdkBolt11Payment apiObj, + ffi.Pointer wireObj) { + cst_api_fill_to_wire_ldk_bolt_11_payment(apiObj, wireObj.ref); } @protected - void cst_api_fill_to_wire_box_autoadd_ldk_node( + void cst_api_fill_to_wire_box_autoadd_ldk_bolt_12_payment( + LdkBolt12Payment apiObj, + ffi.Pointer wireObj) { + cst_api_fill_to_wire_ldk_bolt_12_payment(apiObj, wireObj.ref); + } + + @protected + 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_ldk_network_graph( + LdkNetworkGraph apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_ldk_network_graph(apiObj, wireObj.ref); + } + + @protected + 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 + void cst_api_fill_to_wire_box_autoadd_ldk_on_chain_payment( + LdkOnChainPayment apiObj, + ffi.Pointer wireObj) { + cst_api_fill_to_wire_ldk_on_chain_payment(apiObj, wireObj.ref); + } + + @protected + void cst_api_fill_to_wire_box_autoadd_ldk_spontaneous_payment( + LdkSpontaneousPayment apiObj, + ffi.Pointer wireObj) { + cst_api_fill_to_wire_ldk_spontaneous_payment(apiObj, wireObj.ref); + } + + @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_lsp_fee_limits( + LSPFeeLimits apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_lsp_fee_limits(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_node_announcement_info( + NodeAnnouncementInfo apiObj, + ffi.Pointer wireObj) { + cst_api_fill_to_wire_node_announcement_info(apiObj, wireObj.ref); + } + + @protected + void cst_api_fill_to_wire_box_autoadd_node_id( + NodeId apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_node_id(apiObj, wireObj.ref); + } + + @protected + void cst_api_fill_to_wire_box_autoadd_node_info( + NodeInfo apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_node_info(apiObj, wireObj.ref); + } + + @protected + void cst_api_fill_to_wire_box_autoadd_offer( + Offer apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_offer(apiObj, wireObj.ref); + } + + @protected + void cst_api_fill_to_wire_box_autoadd_offer_id( + OfferId apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_offer_id(apiObj, wireObj.ref); + } + @protected void cst_api_fill_to_wire_box_autoadd_out_point( OutPoint apiObj, ffi.Pointer wireObj) { @@ -1077,6 +2245,12 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { cst_api_fill_to_wire_payment_hash(apiObj, wireObj.ref); } + @protected + void cst_api_fill_to_wire_box_autoadd_payment_id( + PaymentId apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_payment_id(apiObj, wireObj.ref); + } + @protected void cst_api_fill_to_wire_box_autoadd_payment_preimage( PaymentPreimage apiObj, ffi.Pointer wireObj) { @@ -1095,12 +2269,24 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { cst_api_fill_to_wire_public_key(apiObj, wireObj.ref); } + @protected + void cst_api_fill_to_wire_box_autoadd_refund( + Refund apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_refund(apiObj, wireObj.ref); + } + @protected void cst_api_fill_to_wire_box_autoadd_socket_address( SocketAddress apiObj, ffi.Pointer wireObj) { 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) { @@ -1126,8 +2312,9 @@ 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); - cst_api_fill_to_wire_max_dust_htlc_exposure( - apiObj.maxDustHtlcExposure, wireObj.max_dust_htlc_exposure); + wireObj.max_dust_htlc_exposure = + cst_encode_opt_box_autoadd_max_dust_htlc_exposure( + apiObj.maxDustHtlcExposure); wireObj.force_close_avoidance_max_fee_satoshis = cst_encode_u_64(apiObj.forceCloseAvoidanceMaxFeeSatoshis); wireObj.accept_underpaying_htlcs = @@ -1140,7 +2327,8 @@ 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_String(apiObj.fundingTxo); + wireObj.funding_txo = + cst_encode_opt_box_autoadd_out_point(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); @@ -1148,7 +2336,6 @@ 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); @@ -1160,6 +2347,36 @@ 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 @@ -1168,6 +2385,91 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { wireObj.data = cst_encode_u_8_array_32(apiObj.data); } + @protected + void cst_api_fill_to_wire_channel_info( + ChannelInfo apiObj, wire_cst_channel_info wireObj) { + cst_api_fill_to_wire_node_id(apiObj.nodeOne, wireObj.node_one); + wireObj.one_to_two = + cst_encode_opt_box_autoadd_channel_update_info(apiObj.oneToTwo); + cst_api_fill_to_wire_node_id(apiObj.nodeTwo, wireObj.node_two); + wireObj.two_to_one = + cst_encode_opt_box_autoadd_channel_update_info(apiObj.twoToOne); + wireObj.capacity_sats = + cst_encode_opt_box_autoadd_u_64(apiObj.capacitySats); + } + + @protected + void cst_api_fill_to_wire_channel_update_info( + ChannelUpdateInfo apiObj, wire_cst_channel_update_info wireObj) { + wireObj.last_update = cst_encode_u_32(apiObj.lastUpdate); + wireObj.enabled = cst_encode_bool(apiObj.enabled); + wireObj.cltv_expiry_delta = cst_encode_u_16(apiObj.cltvExpiryDelta); + wireObj.htlc_minimum_msat = cst_encode_u_64(apiObj.htlcMinimumMsat); + wireObj.htlc_maximum_msat = cst_encode_u_64(apiObj.htlcMaximumMsat); + cst_api_fill_to_wire_routing_fees(apiObj.fees, wireObj.fees); + } + + @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_LegacyCooperativeClosure) { + wireObj.tag = 2; + return; + } + if (apiObj is ClosureReason_CounterpartyInitiatedCooperativeClosure) { + wireObj.tag = 3; + return; + } + if (apiObj is ClosureReason_LocallyInitiatedCooperativeClosure) { + wireObj.tag = 4; + return; + } + if (apiObj is ClosureReason_CommitmentTxConfirmed) { + wireObj.tag = 5; + return; + } + if (apiObj is ClosureReason_FundingTimedOut) { + wireObj.tag = 6; + return; + } + if (apiObj is ClosureReason_ProcessingError) { + var pre_err = cst_encode_String(apiObj.err); + wireObj.tag = 7; + wireObj.kind.ProcessingError.err = pre_err; + return; + } + if (apiObj is ClosureReason_DisconnectedPeer) { + wireObj.tag = 8; + return; + } + if (apiObj is ClosureReason_OutdatedChannelManager) { + wireObj.tag = 9; + return; + } + if (apiObj is ClosureReason_CounterpartyCoopClosedUnfundedChannel) { + wireObj.tag = 10; + return; + } + if (apiObj is ClosureReason_FundingBatchClosure) { + wireObj.tag = 11; + return; + } + if (apiObj is ClosureReason_HTLCsTimedOut) { + wireObj.tag = 12; + return; + } + } + @protected void cst_api_fill_to_wire_config(Config apiObj, wire_cst_config wireObj) { wireObj.storage_dir_path = cst_encode_String(apiObj.storageDirPath); @@ -1188,6 +2490,48 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { wireObj.probing_liquidity_limit_multiplier = cst_encode_u_64(apiObj.probingLiquidityLimitMultiplier); wireObj.log_level = cst_encode_log_level(apiObj.logLevel); + wireObj.anchor_channels_config = + cst_encode_opt_box_autoadd_anchor_channels_config( + apiObj.anchorChannelsConfig); + } + + @protected + void cst_api_fill_to_wire_decode_error( + DecodeError apiObj, wire_cst_decode_error wireObj) { + if (apiObj is DecodeError_UnknownVersion) { + wireObj.tag = 0; + return; + } + if (apiObj is DecodeError_UnknownRequiredFeature) { + wireObj.tag = 1; + return; + } + if (apiObj is DecodeError_InvalidValue) { + wireObj.tag = 2; + return; + } + if (apiObj is DecodeError_ShortRead) { + wireObj.tag = 3; + return; + } + if (apiObj is DecodeError_BadLengthDescriptor) { + wireObj.tag = 4; + return; + } + if (apiObj is DecodeError_Io) { + var pre_field0 = cst_encode_String(apiObj.field0); + wireObj.tag = 5; + wireObj.kind.Io.field0 = pre_field0; + return; + } + if (apiObj is DecodeError_UnsupportedCompression) { + wireObj.tag = 6; + return; + } + if (apiObj is DecodeError_DangerousValue) { + wireObj.tag = 7; + return; + } } @protected @@ -1217,36 +2561,86 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected void cst_api_fill_to_wire_event(Event apiObj, wire_cst_event wireObj) { - if (apiObj is Event_PaymentSuccessful) { + if (apiObj is Event_PaymentClaimable) { + var pre_payment_id = cst_encode_box_autoadd_payment_id(apiObj.paymentId); var pre_payment_hash = cst_encode_box_autoadd_payment_hash(apiObj.paymentHash); + var pre_claimable_amount_msat = + cst_encode_u_64(apiObj.claimableAmountMsat); + var pre_claim_deadline = + cst_encode_opt_box_autoadd_u_32(apiObj.claimDeadline); wireObj.tag = 0; + wireObj.kind.PaymentClaimable.payment_id = pre_payment_id; + wireObj.kind.PaymentClaimable.payment_hash = pre_payment_hash; + wireObj.kind.PaymentClaimable.claimable_amount_msat = + pre_claimable_amount_msat; + wireObj.kind.PaymentClaimable.claim_deadline = pre_claim_deadline; + return; + } + if (apiObj is Event_PaymentSuccessful) { + var pre_payment_id = + cst_encode_opt_box_autoadd_payment_id(apiObj.paymentId); + 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 = 1; + wireObj.kind.PaymentSuccessful.payment_id = pre_payment_id; 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_id = + cst_encode_opt_box_autoadd_payment_id(apiObj.paymentId); var pre_payment_hash = cst_encode_box_autoadd_payment_hash(apiObj.paymentHash); - wireObj.tag = 1; + var pre_reason = + cst_encode_opt_box_autoadd_payment_failure_reason(apiObj.reason); + wireObj.tag = 2; + wireObj.kind.PaymentFailed.payment_id = pre_payment_id; wireObj.kind.PaymentFailed.payment_hash = pre_payment_hash; + wireObj.kind.PaymentFailed.reason = pre_reason; return; } if (apiObj is Event_PaymentReceived) { + var pre_payment_id = + cst_encode_opt_box_autoadd_payment_id(apiObj.paymentId); var pre_payment_hash = cst_encode_box_autoadd_payment_hash(apiObj.paymentHash); var pre_amount_msat = cst_encode_u_64(apiObj.amountMsat); - wireObj.tag = 2; + wireObj.tag = 3; + wireObj.kind.PaymentReceived.payment_id = pre_payment_id; wireObj.kind.PaymentReceived.payment_hash = pre_payment_hash; wireObj.kind.PaymentReceived.amount_msat = pre_amount_msat; return; } + 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_box_autoadd_public_key(apiObj.counterpartyNodeId); + var pre_funding_txo = cst_encode_box_autoadd_out_point(apiObj.fundingTxo); + wireObj.tag = 4; + 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; + return; + } 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_counterparty_node_id = cst_encode_opt_box_autoadd_public_key(apiObj.counterpartyNodeId); - wireObj.tag = 3; + wireObj.tag = 5; 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; @@ -1258,30 +2652,13 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { 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; + var pre_reason = cst_encode_opt_box_autoadd_closure_reason(apiObj.reason); + wireObj.tag = 6; 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_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_box_autoadd_public_key(apiObj.counterpartyNodeId); - var pre_funding_txo = cst_encode_box_autoadd_out_point(apiObj.fundingTxo); - wireObj.tag = 5; - 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.ChannelClosed.reason = pre_reason; return; } } @@ -1302,1318 +2679,2829 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { } @protected - 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_ldk_node( - LdkNode apiObj, wire_cst_ldk_node wireObj) { - wireObj.ptr = cst_encode_RustOpaque_NodeSqliteStore(apiObj.ptr); - } - - @protected - void cst_api_fill_to_wire_max_dust_htlc_exposure( - MaxDustHTLCExposure apiObj, wire_cst_max_dust_htlc_exposure wireObj) { - if (apiObj is MaxDustHTLCExposure_FixedLimitMsat) { - var pre_field0 = cst_encode_u_64(apiObj.field0); - wireObj.tag = 0; - wireObj.kind.FixedLimitMsat.field0 = pre_field0; - return; - } - if (apiObj is MaxDustHTLCExposure_FeeRateMultiplier) { - var pre_field0 = cst_encode_u_64(apiObj.field0); - wireObj.tag = 1; - wireObj.kind.FeeRateMultiplier.field0 = pre_field0; - return; - } - } - - @protected - void cst_api_fill_to_wire_out_point( - OutPoint apiObj, wire_cst_out_point wireObj) { - cst_api_fill_to_wire_txid(apiObj.txid, wireObj.txid); - wireObj.vout = cst_encode_u_32(apiObj.vout); - } - - @protected - void cst_api_fill_to_wire_payment_details( - PaymentDetails apiObj, wire_cst_payment_details wireObj) { - cst_api_fill_to_wire_payment_hash(apiObj.hash, wireObj.hash); - wireObj.preimage = - cst_encode_opt_box_autoadd_payment_preimage(apiObj.preimage); - wireObj.secret = cst_encode_opt_box_autoadd_payment_secret(apiObj.secret); - wireObj.amount_msat = cst_encode_opt_box_autoadd_u_64(apiObj.amountMsat); - wireObj.direction = cst_encode_payment_direction(apiObj.direction); - wireObj.status = cst_encode_payment_status(apiObj.status); - } - - @protected - void cst_api_fill_to_wire_payment_hash( - PaymentHash apiObj, wire_cst_payment_hash wireObj) { - wireObj.data = cst_encode_u_8_array_32(apiObj.data); + void cst_api_fill_to_wire_ldk_bolt_11_payment( + LdkBolt11Payment apiObj, wire_cst_ldk_bolt_11_payment wireObj) { + wireObj.ptr = + cst_encode_RustOpaque_ldk_nodepaymentBolt11Payment(apiObj.ptr); } @protected - void cst_api_fill_to_wire_payment_preimage( - PaymentPreimage apiObj, wire_cst_payment_preimage wireObj) { - wireObj.data = cst_encode_u_8_array_32(apiObj.data); + void cst_api_fill_to_wire_ldk_bolt_12_payment( + LdkBolt12Payment apiObj, wire_cst_ldk_bolt_12_payment wireObj) { + wireObj.ptr = + cst_encode_RustOpaque_Arcldk_nodepaymentBolt12Payment(apiObj.ptr); } @protected - void cst_api_fill_to_wire_payment_secret( - PaymentSecret apiObj, wire_cst_payment_secret wireObj) { - wireObj.data = cst_encode_u_8_array_32(apiObj.data); + 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_peer_details( - PeerDetails apiObj, wire_cst_peer_details wireObj) { - cst_api_fill_to_wire_public_key(apiObj.nodeId, wireObj.node_id); - cst_api_fill_to_wire_socket_address(apiObj.address, wireObj.address); - wireObj.is_connected = cst_encode_bool(apiObj.isConnected); + void cst_api_fill_to_wire_ldk_network_graph( + LdkNetworkGraph apiObj, wire_cst_ldk_network_graph wireObj) { + wireObj.ptr = cst_encode_RustOpaque_ldk_nodegraphNetworkGraph(apiObj.ptr); } @protected - void cst_api_fill_to_wire_public_key( - PublicKey apiObj, wire_cst_public_key wireObj) { - wireObj.hex = cst_encode_String(apiObj.hex); + void cst_api_fill_to_wire_ldk_node( + LdkNode apiObj, wire_cst_ldk_node wireObj) { + wireObj.ptr = cst_encode_RustOpaque_Node(apiObj.ptr); } @protected - void cst_api_fill_to_wire_socket_address( - SocketAddress apiObj, wire_cst_socket_address wireObj) { - if (apiObj is SocketAddress_TcpIpV4) { - var pre_addr = cst_encode_u_8_array_4(apiObj.addr); - var pre_port = cst_encode_u_16(apiObj.port); + void cst_api_fill_to_wire_ldk_node_error( + LdkNodeError apiObj, wire_cst_ldk_node_error wireObj) { + if (apiObj is LdkNodeError_InvalidTxid) { wireObj.tag = 0; - wireObj.kind.TcpIpV4.addr = pre_addr; - wireObj.kind.TcpIpV4.port = pre_port; return; } - if (apiObj is SocketAddress_TcpIpV6) { - var pre_addr = cst_encode_u_8_array_16(apiObj.addr); - var pre_port = cst_encode_u_16(apiObj.port); + if (apiObj is LdkNodeError_AlreadyRunning) { wireObj.tag = 1; - wireObj.kind.TcpIpV6.addr = pre_addr; - wireObj.kind.TcpIpV6.port = pre_port; return; } - if (apiObj is SocketAddress_OnionV2) { - var pre_field0 = cst_encode_u_8_array_12(apiObj.field0); + if (apiObj is LdkNodeError_NotRunning) { wireObj.tag = 2; - wireObj.kind.OnionV2.field0 = pre_field0; return; } - if (apiObj is SocketAddress_OnionV3) { - var pre_ed25519_pubkey = cst_encode_u_8_array_32(apiObj.ed25519Pubkey); - var pre_checksum = cst_encode_u_16(apiObj.checksum); - var pre_version = cst_encode_u_8(apiObj.version); - var pre_port = cst_encode_u_16(apiObj.port); + if (apiObj is LdkNodeError_OnchainTxCreationFailed) { wireObj.tag = 3; - wireObj.kind.OnionV3.ed25519_pubkey = pre_ed25519_pubkey; - wireObj.kind.OnionV3.checksum = pre_checksum; - wireObj.kind.OnionV3.version = pre_version; - wireObj.kind.OnionV3.port = pre_port; return; } - if (apiObj is SocketAddress_Hostname) { - var pre_addr = cst_encode_String(apiObj.addr); - var pre_port = cst_encode_u_16(apiObj.port); + if (apiObj is LdkNodeError_ConnectionFailed) { wireObj.tag = 4; - wireObj.kind.Hostname.addr = pre_addr; - wireObj.kind.Hostname.port = pre_port; + return; + } + if (apiObj is LdkNodeError_InvoiceCreationFailed) { + wireObj.tag = 5; + return; + } + if (apiObj is LdkNodeError_PaymentSendingFailed) { + wireObj.tag = 6; + return; + } + if (apiObj is LdkNodeError_ProbeSendingFailed) { + wireObj.tag = 7; + return; + } + if (apiObj is LdkNodeError_ChannelCreationFailed) { + wireObj.tag = 8; + return; + } + if (apiObj is LdkNodeError_ChannelClosingFailed) { + wireObj.tag = 9; + return; + } + if (apiObj is LdkNodeError_ChannelConfigUpdateFailed) { + wireObj.tag = 10; + return; + } + if (apiObj is LdkNodeError_PersistenceFailed) { + wireObj.tag = 11; + return; + } + if (apiObj is LdkNodeError_WalletOperationFailed) { + wireObj.tag = 12; + return; + } + if (apiObj is LdkNodeError_OnchainTxSigningFailed) { + wireObj.tag = 13; + return; + } + if (apiObj is LdkNodeError_MessageSigningFailed) { + wireObj.tag = 14; + return; + } + if (apiObj is LdkNodeError_TxSyncFailed) { + wireObj.tag = 15; + return; + } + if (apiObj is LdkNodeError_GossipUpdateFailed) { + wireObj.tag = 16; + return; + } + if (apiObj is LdkNodeError_InvalidAddress) { + wireObj.tag = 17; + return; + } + if (apiObj is LdkNodeError_InvalidSocketAddress) { + wireObj.tag = 18; + return; + } + if (apiObj is LdkNodeError_InvalidPublicKey) { + wireObj.tag = 19; + return; + } + if (apiObj is LdkNodeError_InvalidSecretKey) { + wireObj.tag = 20; + return; + } + if (apiObj is LdkNodeError_InvalidPaymentHash) { + wireObj.tag = 21; + return; + } + if (apiObj is LdkNodeError_InvalidPaymentPreimage) { + wireObj.tag = 22; + return; + } + if (apiObj is LdkNodeError_InvalidPaymentSecret) { + wireObj.tag = 23; + return; + } + if (apiObj is LdkNodeError_InvalidAmount) { + wireObj.tag = 24; + return; + } + if (apiObj is LdkNodeError_InvalidInvoice) { + wireObj.tag = 25; + return; + } + if (apiObj is LdkNodeError_InvalidChannelId) { + wireObj.tag = 26; + return; + } + if (apiObj is LdkNodeError_InvalidNetwork) { + wireObj.tag = 27; + return; + } + if (apiObj is LdkNodeError_DuplicatePayment) { + wireObj.tag = 28; + return; + } + if (apiObj is LdkNodeError_InsufficientFunds) { + wireObj.tag = 29; + return; + } + if (apiObj is LdkNodeError_FeerateEstimationUpdateFailed) { + wireObj.tag = 30; + return; + } + if (apiObj is LdkNodeError_LiquidityRequestFailed) { + wireObj.tag = 31; + return; + } + if (apiObj is LdkNodeError_LiquiditySourceUnavailable) { + wireObj.tag = 32; + return; + } + if (apiObj is LdkNodeError_LiquidityFeeTooHigh) { + wireObj.tag = 33; + return; + } + if (apiObj is LdkNodeError_InvalidPaymentId) { + wireObj.tag = 34; + return; + } + if (apiObj is LdkNodeError_Decode) { + var pre_field0 = cst_encode_box_autoadd_decode_error(apiObj.field0); + wireObj.tag = 35; + wireObj.kind.Decode.field0 = pre_field0; + return; + } + if (apiObj is LdkNodeError_Bolt12Parse) { + var pre_field0 = + cst_encode_box_autoadd_bolt_12_parse_error(apiObj.field0); + wireObj.tag = 36; + wireObj.kind.Bolt12Parse.field0 = pre_field0; + return; + } + if (apiObj is LdkNodeError_InvoiceRequestCreationFailed) { + wireObj.tag = 37; + return; + } + if (apiObj is LdkNodeError_OfferCreationFailed) { + wireObj.tag = 38; + return; + } + if (apiObj is LdkNodeError_RefundCreationFailed) { + wireObj.tag = 39; + return; + } + if (apiObj is LdkNodeError_FeerateEstimationUpdateTimeout) { + wireObj.tag = 40; + return; + } + if (apiObj is LdkNodeError_WalletOperationTimeout) { + wireObj.tag = 41; + return; + } + if (apiObj is LdkNodeError_TxSyncTimeout) { + wireObj.tag = 42; + return; + } + if (apiObj is LdkNodeError_GossipUpdateTimeout) { + wireObj.tag = 43; + return; + } + if (apiObj is LdkNodeError_InvalidOfferId) { + wireObj.tag = 44; + return; + } + if (apiObj is LdkNodeError_InvalidNodeId) { + wireObj.tag = 45; + return; + } + if (apiObj is LdkNodeError_InvalidOffer) { + wireObj.tag = 46; + return; + } + if (apiObj is LdkNodeError_InvalidRefund) { + wireObj.tag = 47; + return; + } + if (apiObj is LdkNodeError_UnsupportedCurrency) { + wireObj.tag = 48; return; } } @protected - void cst_api_fill_to_wire_txid(Txid apiObj, wire_cst_txid wireObj) { - wireObj.hash = cst_encode_String(apiObj.hash); + void cst_api_fill_to_wire_ldk_on_chain_payment( + LdkOnChainPayment apiObj, wire_cst_ldk_on_chain_payment wireObj) { + wireObj.ptr = + cst_encode_RustOpaque_ldk_nodepaymentOnchainPayment(apiObj.ptr); } @protected - void cst_api_fill_to_wire_user_channel_id( - UserChannelId apiObj, wire_cst_user_channel_id wireObj) { - wireObj.data = cst_encode_u_64(apiObj.data); + void cst_api_fill_to_wire_ldk_spontaneous_payment( + LdkSpontaneousPayment apiObj, wire_cst_ldk_spontaneous_payment wireObj) { + wireObj.ptr = + cst_encode_RustOpaque_ldk_nodepaymentSpontaneousPayment(apiObj.ptr); } @protected - int cst_encode_RustOpaque_NodeSqliteStore(NodeSqliteStore raw); + 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; + } + } @protected - bool cst_encode_bool(bool raw); + 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); + } @protected - int cst_encode_builder_exception(BuilderException raw); + void cst_api_fill_to_wire_lsp_fee_limits( + LSPFeeLimits apiObj, wire_cst_lsp_fee_limits wireObj) { + wireObj.max_total_opening_fee_msat = + cst_encode_opt_box_autoadd_u_64(apiObj.maxTotalOpeningFeeMsat); + wireObj.max_proportional_opening_fee_ppm_msat = + cst_encode_opt_box_autoadd_u_64( + apiObj.maxProportionalOpeningFeePpmMsat); + } @protected - int cst_encode_i_32(int raw); + void cst_api_fill_to_wire_max_dust_htlc_exposure( + MaxDustHTLCExposure apiObj, wire_cst_max_dust_htlc_exposure wireObj) { + if (apiObj is MaxDustHTLCExposure_FixedLimitMsat) { + var pre_field0 = cst_encode_u_64(apiObj.field0); + wireObj.tag = 0; + wireObj.kind.FixedLimitMsat.field0 = pre_field0; + return; + } + if (apiObj is MaxDustHTLCExposure_FeeRateMultiplier) { + var pre_field0 = cst_encode_u_64(apiObj.field0); + wireObj.tag = 1; + wireObj.kind.FeeRateMultiplier.field0 = pre_field0; + return; + } + } @protected - int cst_encode_log_level(LogLevel raw); + void cst_api_fill_to_wire_node_announcement_info( + NodeAnnouncementInfo apiObj, wire_cst_node_announcement_info wireObj) { + wireObj.last_update = cst_encode_u_32(apiObj.lastUpdate); + wireObj.alias = cst_encode_String(apiObj.alias); + wireObj.addresses = cst_encode_list_socket_address(apiObj.addresses); + } @protected - int cst_encode_network(Network raw); + void cst_api_fill_to_wire_node_id(NodeId apiObj, wire_cst_node_id wireObj) { + wireObj.compressed = cst_encode_list_prim_u_8_strict(apiObj.compressed); + } @protected - int cst_encode_node_exception(NodeException raw); + void cst_api_fill_to_wire_node_info( + NodeInfo apiObj, wire_cst_node_info wireObj) { + wireObj.channels = cst_encode_list_prim_u_64_strict(apiObj.channels); + wireObj.announcement_info = + cst_encode_opt_box_autoadd_node_announcement_info( + apiObj.announcementInfo); + } @protected - int cst_encode_payment_direction(PaymentDirection raw); + 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 - int cst_encode_payment_status(PaymentStatus raw); + void cst_api_fill_to_wire_offer(Offer apiObj, wire_cst_offer wireObj) { + wireObj.s = cst_encode_String(apiObj.s); + } @protected - int cst_encode_u_16(int raw); + void cst_api_fill_to_wire_offer_id( + OfferId apiObj, wire_cst_offer_id wireObj) { + wireObj.field0 = cst_encode_u_8_array_32(apiObj.field0); + } @protected - int cst_encode_u_32(int raw); + void cst_api_fill_to_wire_out_point( + OutPoint apiObj, wire_cst_out_point wireObj) { + cst_api_fill_to_wire_txid(apiObj.txid, wireObj.txid); + wireObj.vout = cst_encode_u_32(apiObj.vout); + } @protected - int cst_encode_u_8(int raw); + void cst_api_fill_to_wire_payment_details( + PaymentDetails apiObj, wire_cst_payment_details wireObj) { + cst_api_fill_to_wire_payment_id(apiObj.id, wireObj.id); + cst_api_fill_to_wire_payment_kind(apiObj.kind, wireObj.kind); + wireObj.amount_msat = cst_encode_opt_box_autoadd_u_64(apiObj.amountMsat); + wireObj.direction = cst_encode_payment_direction(apiObj.direction); + wireObj.status = cst_encode_payment_status(apiObj.status); + } @protected - void cst_encode_unit(void raw); + void cst_api_fill_to_wire_payment_hash( + PaymentHash apiObj, wire_cst_payment_hash wireObj) { + wireObj.data = cst_encode_u_8_array_32(apiObj.data); + } @protected - int cst_encode_usize(int raw); + void cst_api_fill_to_wire_payment_id( + PaymentId apiObj, wire_cst_payment_id wireObj) { + wireObj.field0 = cst_encode_u_8_array_32(apiObj.field0); + } @protected - void sse_encode_RustOpaque_NodeSqliteStore( - NodeSqliteStore self, SseSerializer serializer); + void cst_api_fill_to_wire_payment_kind( + PaymentKind apiObj, wire_cst_payment_kind wireObj) { + if (apiObj is PaymentKind_Onchain) { + wireObj.tag = 0; + return; + } + if (apiObj is PaymentKind_Bolt11) { + var pre_hash = cst_encode_box_autoadd_payment_hash(apiObj.hash); + var pre_preimage = + cst_encode_opt_box_autoadd_payment_preimage(apiObj.preimage); + var pre_secret = cst_encode_opt_box_autoadd_payment_secret(apiObj.secret); + wireObj.tag = 1; + wireObj.kind.Bolt11.hash = pre_hash; + wireObj.kind.Bolt11.preimage = pre_preimage; + wireObj.kind.Bolt11.secret = pre_secret; + return; + } + if (apiObj is PaymentKind_Bolt11Jit) { + var pre_hash = cst_encode_box_autoadd_payment_hash(apiObj.hash); + var pre_preimage = + cst_encode_opt_box_autoadd_payment_preimage(apiObj.preimage); + var pre_secret = cst_encode_opt_box_autoadd_payment_secret(apiObj.secret); + var pre_lsp_fee_limits = + cst_encode_box_autoadd_lsp_fee_limits(apiObj.lspFeeLimits); + wireObj.tag = 2; + wireObj.kind.Bolt11Jit.hash = pre_hash; + wireObj.kind.Bolt11Jit.preimage = pre_preimage; + wireObj.kind.Bolt11Jit.secret = pre_secret; + wireObj.kind.Bolt11Jit.lsp_fee_limits = pre_lsp_fee_limits; + return; + } + if (apiObj is PaymentKind_Spontaneous) { + var pre_hash = cst_encode_box_autoadd_payment_hash(apiObj.hash); + var pre_preimage = + cst_encode_opt_box_autoadd_payment_preimage(apiObj.preimage); + wireObj.tag = 3; + wireObj.kind.Spontaneous.hash = pre_hash; + wireObj.kind.Spontaneous.preimage = pre_preimage; + return; + } + if (apiObj is PaymentKind_Bolt12Offer) { + var pre_hash = cst_encode_opt_box_autoadd_payment_hash(apiObj.hash); + var pre_preimage = + cst_encode_opt_box_autoadd_payment_preimage(apiObj.preimage); + var pre_secret = cst_encode_opt_box_autoadd_payment_secret(apiObj.secret); + var pre_offer_id = cst_encode_box_autoadd_offer_id(apiObj.offerId); + wireObj.tag = 4; + wireObj.kind.Bolt12Offer.hash = pre_hash; + wireObj.kind.Bolt12Offer.preimage = pre_preimage; + wireObj.kind.Bolt12Offer.secret = pre_secret; + wireObj.kind.Bolt12Offer.offer_id = pre_offer_id; + return; + } + if (apiObj is PaymentKind_Bolt12Refund) { + var pre_hash = cst_encode_opt_box_autoadd_payment_hash(apiObj.hash); + var pre_preimage = + cst_encode_opt_box_autoadd_payment_preimage(apiObj.preimage); + var pre_secret = cst_encode_opt_box_autoadd_payment_secret(apiObj.secret); + wireObj.tag = 5; + wireObj.kind.Bolt12Refund.hash = pre_hash; + wireObj.kind.Bolt12Refund.preimage = pre_preimage; + wireObj.kind.Bolt12Refund.secret = pre_secret; + return; + } + } @protected - void sse_encode_String(String self, SseSerializer serializer); + void cst_api_fill_to_wire_payment_preimage( + PaymentPreimage apiObj, wire_cst_payment_preimage wireObj) { + wireObj.data = cst_encode_u_8_array_32(apiObj.data); + } @protected - void sse_encode_address(Address self, SseSerializer serializer); + void cst_api_fill_to_wire_payment_secret( + PaymentSecret apiObj, wire_cst_payment_secret wireObj) { + wireObj.data = cst_encode_u_8_array_32(apiObj.data); + } @protected - void sse_encode_bolt_11_invoice(Bolt11Invoice self, SseSerializer serializer); + void cst_api_fill_to_wire_peer_details( + PeerDetails apiObj, wire_cst_peer_details wireObj) { + cst_api_fill_to_wire_public_key(apiObj.nodeId, wireObj.node_id); + cst_api_fill_to_wire_socket_address(apiObj.address, wireObj.address); + wireObj.is_connected = cst_encode_bool(apiObj.isConnected); + } @protected - void sse_encode_bool(bool self, SseSerializer serializer); + 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 sse_encode_box_autoadd_address(Address self, SseSerializer serializer); + void cst_api_fill_to_wire_public_key( + PublicKey apiObj, wire_cst_public_key wireObj) { + wireObj.hex = cst_encode_String(apiObj.hex); + } @protected - void sse_encode_box_autoadd_bolt_11_invoice( - Bolt11Invoice self, SseSerializer serializer); + 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); + } @protected - void sse_encode_box_autoadd_chain_data_source_config( - ChainDataSourceConfig self, SseSerializer serializer); + void cst_api_fill_to_wire_refund(Refund apiObj, wire_cst_refund wireObj) { + wireObj.s = cst_encode_String(apiObj.s); + } @protected - void sse_encode_box_autoadd_channel_config( - ChannelConfig self, SseSerializer serializer); + void cst_api_fill_to_wire_routing_fees( + RoutingFees apiObj, wire_cst_routing_fees wireObj) { + wireObj.base_msat = cst_encode_u_32(apiObj.baseMsat); + wireObj.proportional_millionths = + cst_encode_u_32(apiObj.proportionalMillionths); + } @protected - void sse_encode_box_autoadd_channel_id( - ChannelId self, SseSerializer serializer); + void cst_api_fill_to_wire_socket_address( + SocketAddress apiObj, wire_cst_socket_address wireObj) { + if (apiObj is SocketAddress_TcpIpV4) { + var pre_addr = cst_encode_u_8_array_4(apiObj.addr); + var pre_port = cst_encode_u_16(apiObj.port); + wireObj.tag = 0; + wireObj.kind.TcpIpV4.addr = pre_addr; + wireObj.kind.TcpIpV4.port = pre_port; + return; + } + if (apiObj is SocketAddress_TcpIpV6) { + var pre_addr = cst_encode_u_8_array_16(apiObj.addr); + var pre_port = cst_encode_u_16(apiObj.port); + wireObj.tag = 1; + wireObj.kind.TcpIpV6.addr = pre_addr; + wireObj.kind.TcpIpV6.port = pre_port; + return; + } + if (apiObj is SocketAddress_OnionV2) { + var pre_field0 = cst_encode_u_8_array_12(apiObj.field0); + wireObj.tag = 2; + wireObj.kind.OnionV2.field0 = pre_field0; + return; + } + if (apiObj is SocketAddress_OnionV3) { + var pre_ed25519_pubkey = cst_encode_u_8_array_32(apiObj.ed25519Pubkey); + var pre_checksum = cst_encode_u_16(apiObj.checksum); + var pre_version = cst_encode_u_8(apiObj.version); + var pre_port = cst_encode_u_16(apiObj.port); + wireObj.tag = 3; + wireObj.kind.OnionV3.ed25519_pubkey = pre_ed25519_pubkey; + wireObj.kind.OnionV3.checksum = pre_checksum; + wireObj.kind.OnionV3.version = pre_version; + wireObj.kind.OnionV3.port = pre_port; + return; + } + if (apiObj is SocketAddress_Hostname) { + var pre_addr = cst_encode_String(apiObj.addr); + var pre_port = cst_encode_u_16(apiObj.port); + wireObj.tag = 4; + wireObj.kind.Hostname.addr = pre_addr; + wireObj.kind.Hostname.port = pre_port; + return; + } + } @protected - void sse_encode_box_autoadd_config(Config self, SseSerializer serializer); + void cst_api_fill_to_wire_txid(Txid apiObj, wire_cst_txid wireObj) { + wireObj.hash = cst_encode_String(apiObj.hash); + } @protected - void sse_encode_box_autoadd_entropy_source_config( - EntropySourceConfig self, SseSerializer serializer); + 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); + } @protected - void sse_encode_box_autoadd_event(Event self, SseSerializer serializer); + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder raw); @protected - void sse_encode_box_autoadd_gossip_source_config( - GossipSourceConfig self, SseSerializer serializer); + int cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder raw); @protected - void sse_encode_box_autoadd_ldk_mnemonic( - LdkMnemonic self, SseSerializer serializer); + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder raw); @protected - void sse_encode_box_autoadd_ldk_node(LdkNode self, SseSerializer serializer); + int cst_encode_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ArcBolt12Payment raw); @protected - void sse_encode_box_autoadd_out_point( - OutPoint self, SseSerializer serializer); + int cst_encode_RustOpaque_Node(Node raw); @protected - void sse_encode_box_autoadd_payment_details( - PaymentDetails self, SseSerializer serializer); + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder raw); @protected - void sse_encode_box_autoadd_payment_hash( - PaymentHash self, SseSerializer serializer); + int cst_encode_RustOpaque_ldk_nodeBuilder(Builder raw); @protected - void sse_encode_box_autoadd_payment_preimage( - PaymentPreimage self, SseSerializer serializer); + int cst_encode_RustOpaque_ldk_nodegraphNetworkGraph(NetworkGraph raw); @protected - void sse_encode_box_autoadd_payment_secret( - PaymentSecret self, SseSerializer serializer); + int cst_encode_RustOpaque_ldk_nodepaymentBolt11Payment(Bolt11Payment raw); @protected - void sse_encode_box_autoadd_public_key( - PublicKey self, SseSerializer serializer); + int cst_encode_RustOpaque_ldk_nodepaymentOnchainPayment(OnchainPayment raw); @protected - void sse_encode_box_autoadd_socket_address( - SocketAddress self, SseSerializer serializer); + int cst_encode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + SpontaneousPayment raw); @protected - void sse_encode_box_autoadd_u_32(int self, SseSerializer serializer); + bool cst_encode_bool(bool raw); @protected - void sse_encode_box_autoadd_u_64(int self, SseSerializer serializer); + int cst_encode_i_32(int raw); @protected - void sse_encode_box_autoadd_user_channel_id( - UserChannelId self, SseSerializer serializer); + int cst_encode_ldk_builder_error(LdkBuilderError raw); @protected - void sse_encode_builder_exception( - BuilderException self, SseSerializer serializer); + int cst_encode_log_level(LogLevel raw); @protected - void sse_encode_chain_data_source_config( - ChainDataSourceConfig self, SseSerializer serializer); + int cst_encode_network(Network raw); @protected - void sse_encode_channel_config(ChannelConfig self, SseSerializer serializer); + int cst_encode_payment_direction(PaymentDirection raw); @protected - void sse_encode_channel_details( - ChannelDetails self, SseSerializer serializer); + int cst_encode_payment_failure_reason(PaymentFailureReason raw); @protected - void sse_encode_channel_id(ChannelId self, SseSerializer serializer); + int cst_encode_payment_status(PaymentStatus raw); @protected - void sse_encode_config(Config self, SseSerializer serializer); + int cst_encode_u_16(int raw); @protected - void sse_encode_entropy_source_config( - EntropySourceConfig self, SseSerializer serializer); + int cst_encode_u_32(int raw); @protected - void sse_encode_event(Event self, SseSerializer serializer); + int cst_encode_u_8(int raw); @protected - void sse_encode_gossip_source_config( - GossipSourceConfig self, SseSerializer serializer); + void cst_encode_unit(void raw); @protected - void sse_encode_i_32(int self, SseSerializer serializer); + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder self, SseSerializer serializer); @protected - void sse_encode_ldk_mnemonic(LdkMnemonic self, SseSerializer serializer); + void + sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder self, SseSerializer serializer); @protected - void sse_encode_ldk_node(LdkNode self, SseSerializer serializer); + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder self, SseSerializer serializer); @protected - void sse_encode_list_channel_details( - List self, SseSerializer serializer); + void sse_encode_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ArcBolt12Payment self, SseSerializer serializer); @protected - void sse_encode_list_payment_details( - List self, SseSerializer serializer); + void sse_encode_RustOpaque_Node(Node self, SseSerializer serializer); @protected - void sse_encode_list_peer_details( - List self, SseSerializer serializer); + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder self, SseSerializer serializer); @protected - void sse_encode_list_prim_u_8_loose(List self, SseSerializer serializer); + void sse_encode_RustOpaque_ldk_nodeBuilder( + Builder self, SseSerializer serializer); @protected - void sse_encode_list_prim_u_8_strict( - Uint8List self, SseSerializer serializer); + void sse_encode_RustOpaque_ldk_nodegraphNetworkGraph( + NetworkGraph self, SseSerializer serializer); @protected - void sse_encode_list_public_key( - List self, SseSerializer serializer); + void sse_encode_RustOpaque_ldk_nodepaymentBolt11Payment( + Bolt11Payment self, SseSerializer serializer); @protected - void sse_encode_list_socket_address( - List self, SseSerializer serializer); + void sse_encode_RustOpaque_ldk_nodepaymentOnchainPayment( + OnchainPayment self, SseSerializer serializer); @protected - void sse_encode_log_level(LogLevel self, SseSerializer serializer); + void sse_encode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + SpontaneousPayment self, SseSerializer serializer); @protected - void sse_encode_max_dust_htlc_exposure( - MaxDustHTLCExposure self, SseSerializer serializer); + void sse_encode_String(String self, SseSerializer serializer); @protected - void sse_encode_network(Network self, SseSerializer serializer); + void sse_encode_address(Address self, SseSerializer serializer); @protected - void sse_encode_node_exception(NodeException self, SseSerializer serializer); + void sse_encode_anchor_channels_config( + AnchorChannelsConfig self, SseSerializer serializer); @protected - void sse_encode_opt_String(String? self, SseSerializer serializer); + void sse_encode_balance_details( + BalanceDetails self, SseSerializer serializer); @protected - void sse_encode_opt_box_autoadd_chain_data_source_config( - ChainDataSourceConfig? self, SseSerializer serializer); + void sse_encode_best_block(BestBlock self, SseSerializer serializer); @protected - void sse_encode_opt_box_autoadd_channel_config( - ChannelConfig? self, SseSerializer serializer); + void sse_encode_bolt_11_invoice(Bolt11Invoice self, SseSerializer serializer); @protected - void sse_encode_opt_box_autoadd_entropy_source_config( - EntropySourceConfig? self, SseSerializer serializer); + void sse_encode_bolt_12_invoice(Bolt12Invoice self, SseSerializer serializer); @protected - void sse_encode_opt_box_autoadd_event(Event? self, SseSerializer serializer); + void sse_encode_bolt_12_parse_error( + Bolt12ParseError self, SseSerializer serializer); @protected - void sse_encode_opt_box_autoadd_gossip_source_config( - GossipSourceConfig? self, SseSerializer serializer); + void sse_encode_bool(bool self, SseSerializer serializer); @protected - void sse_encode_opt_box_autoadd_payment_details( - PaymentDetails? self, SseSerializer serializer); + void sse_encode_box_autoadd_address(Address self, SseSerializer serializer); @protected - void sse_encode_opt_box_autoadd_payment_preimage( - PaymentPreimage? self, SseSerializer serializer); + void sse_encode_box_autoadd_anchor_channels_config( + AnchorChannelsConfig self, SseSerializer serializer); @protected - void sse_encode_opt_box_autoadd_payment_secret( - PaymentSecret? self, SseSerializer serializer); + void sse_encode_box_autoadd_bolt_11_invoice( + Bolt11Invoice self, SseSerializer serializer); @protected - void sse_encode_opt_box_autoadd_public_key( - PublicKey? self, SseSerializer serializer); + void sse_encode_box_autoadd_bolt_12_parse_error( + Bolt12ParseError self, SseSerializer serializer); @protected - void sse_encode_opt_box_autoadd_u_32(int? self, SseSerializer serializer); + void sse_encode_box_autoadd_chain_data_source_config( + ChainDataSourceConfig self, SseSerializer serializer); @protected - void sse_encode_opt_box_autoadd_u_64(int? self, SseSerializer serializer); + void sse_encode_box_autoadd_channel_config( + ChannelConfig self, SseSerializer serializer); @protected - void sse_encode_opt_list_socket_address( - List? self, SseSerializer serializer); + void sse_encode_box_autoadd_channel_id( + ChannelId self, SseSerializer serializer); @protected - void sse_encode_out_point(OutPoint self, SseSerializer serializer); + void sse_encode_box_autoadd_channel_info( + ChannelInfo self, SseSerializer serializer); @protected - void sse_encode_payment_details( - PaymentDetails self, SseSerializer serializer); + void sse_encode_box_autoadd_channel_update_info( + ChannelUpdateInfo self, SseSerializer serializer); @protected - void sse_encode_payment_direction( - PaymentDirection self, SseSerializer serializer); + void sse_encode_box_autoadd_closure_reason( + ClosureReason self, SseSerializer serializer); @protected - void sse_encode_payment_hash(PaymentHash self, SseSerializer serializer); + void sse_encode_box_autoadd_config(Config self, SseSerializer serializer); @protected - void sse_encode_payment_preimage( - PaymentPreimage self, SseSerializer serializer); + void sse_encode_box_autoadd_decode_error( + DecodeError self, SseSerializer serializer); @protected - void sse_encode_payment_secret(PaymentSecret self, SseSerializer serializer); + void sse_encode_box_autoadd_entropy_source_config( + EntropySourceConfig self, SseSerializer serializer); @protected - void sse_encode_payment_status(PaymentStatus self, SseSerializer serializer); + void sse_encode_box_autoadd_event(Event self, SseSerializer serializer); @protected - void sse_encode_peer_details(PeerDetails self, SseSerializer serializer); + void sse_encode_box_autoadd_gossip_source_config( + GossipSourceConfig self, SseSerializer serializer); @protected - void sse_encode_public_key(PublicKey self, SseSerializer serializer); + void sse_encode_box_autoadd_ldk_bolt_11_payment( + LdkBolt11Payment self, SseSerializer serializer); @protected - void sse_encode_socket_address(SocketAddress self, SseSerializer serializer); + void sse_encode_box_autoadd_ldk_bolt_12_payment( + LdkBolt12Payment self, SseSerializer serializer); @protected - void sse_encode_txid(Txid self, SseSerializer serializer); + void sse_encode_box_autoadd_ldk_mnemonic( + LdkMnemonic self, SseSerializer serializer); @protected - void sse_encode_u_16(int self, SseSerializer serializer); + void sse_encode_box_autoadd_ldk_network_graph( + LdkNetworkGraph self, SseSerializer serializer); @protected - void sse_encode_u_32(int self, SseSerializer serializer); + void sse_encode_box_autoadd_ldk_node(LdkNode self, SseSerializer serializer); @protected - void sse_encode_u_64(int self, SseSerializer serializer); + void sse_encode_box_autoadd_ldk_on_chain_payment( + LdkOnChainPayment self, SseSerializer serializer); @protected - void sse_encode_u_8(int self, SseSerializer serializer); + void sse_encode_box_autoadd_ldk_spontaneous_payment( + LdkSpontaneousPayment self, SseSerializer serializer); @protected - void sse_encode_u_8_array_12(U8Array12 self, SseSerializer serializer); + void sse_encode_box_autoadd_liquidity_source_config( + LiquiditySourceConfig self, SseSerializer serializer); @protected - void sse_encode_u_8_array_16(U8Array16 self, SseSerializer serializer); + void sse_encode_box_autoadd_lsp_fee_limits( + LSPFeeLimits self, SseSerializer serializer); @protected - void sse_encode_u_8_array_32(U8Array32 self, SseSerializer serializer); + void sse_encode_box_autoadd_max_dust_htlc_exposure( + MaxDustHTLCExposure self, SseSerializer serializer); @protected - void sse_encode_u_8_array_4(U8Array4 self, SseSerializer serializer); + void sse_encode_box_autoadd_node_announcement_info( + NodeAnnouncementInfo self, SseSerializer serializer); @protected - void sse_encode_u_8_array_64(U8Array64 self, SseSerializer serializer); + void sse_encode_box_autoadd_node_id(NodeId self, SseSerializer serializer); @protected - void sse_encode_unit(void self, SseSerializer serializer); + void sse_encode_box_autoadd_node_info( + NodeInfo self, SseSerializer serializer); + + @protected + void sse_encode_box_autoadd_offer(Offer self, SseSerializer serializer); + + @protected + void sse_encode_box_autoadd_offer_id(OfferId self, SseSerializer serializer); + + @protected + void sse_encode_box_autoadd_out_point( + OutPoint self, SseSerializer serializer); + + @protected + 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); + + @protected + void sse_encode_box_autoadd_payment_id( + PaymentId self, SseSerializer serializer); + + @protected + void sse_encode_box_autoadd_payment_preimage( + PaymentPreimage self, SseSerializer serializer); + + @protected + void sse_encode_box_autoadd_payment_secret( + PaymentSecret self, SseSerializer serializer); + + @protected + void sse_encode_box_autoadd_public_key( + PublicKey self, SseSerializer serializer); + + @protected + void sse_encode_box_autoadd_refund(Refund self, SseSerializer serializer); + + @protected + 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); + + @protected + void sse_encode_box_autoadd_u_64(BigInt self, SseSerializer serializer); + + @protected + void sse_encode_box_autoadd_user_channel_id( + UserChannelId self, SseSerializer serializer); + + @protected + void sse_encode_chain_data_source_config( + ChainDataSourceConfig self, SseSerializer serializer); + + @protected + void sse_encode_channel_config(ChannelConfig self, SseSerializer serializer); + + @protected + void sse_encode_channel_details( + ChannelDetails self, SseSerializer serializer); + + @protected + void sse_encode_channel_id(ChannelId self, SseSerializer serializer); + + @protected + void sse_encode_channel_info(ChannelInfo self, SseSerializer serializer); + + @protected + void sse_encode_channel_update_info( + ChannelUpdateInfo self, SseSerializer serializer); + + @protected + void sse_encode_closure_reason(ClosureReason self, SseSerializer serializer); + + @protected + void sse_encode_config(Config self, SseSerializer serializer); + + @protected + void sse_encode_decode_error(DecodeError self, SseSerializer serializer); + + @protected + void sse_encode_entropy_source_config( + EntropySourceConfig self, SseSerializer serializer); + + @protected + void sse_encode_event(Event self, SseSerializer serializer); + + @protected + void sse_encode_gossip_source_config( + GossipSourceConfig self, SseSerializer serializer); + + @protected + void sse_encode_i_32(int self, SseSerializer serializer); + + @protected + void sse_encode_ldk_bolt_11_payment( + LdkBolt11Payment self, SseSerializer serializer); + + @protected + void sse_encode_ldk_bolt_12_payment( + LdkBolt12Payment self, SseSerializer serializer); + + @protected + void sse_encode_ldk_builder_error( + LdkBuilderError self, SseSerializer serializer); + + @protected + void sse_encode_ldk_mnemonic(LdkMnemonic self, SseSerializer serializer); + + @protected + void sse_encode_ldk_network_graph( + LdkNetworkGraph self, SseSerializer serializer); + + @protected + void sse_encode_ldk_node(LdkNode self, SseSerializer serializer); + + @protected + void sse_encode_ldk_node_error(LdkNodeError self, SseSerializer serializer); + + @protected + void sse_encode_ldk_on_chain_payment( + LdkOnChainPayment self, SseSerializer serializer); + + @protected + void sse_encode_ldk_spontaneous_payment( + LdkSpontaneousPayment self, SseSerializer serializer); + + @protected + void sse_encode_lightning_balance( + LightningBalance self, SseSerializer serializer); + + @protected + void sse_encode_liquidity_source_config( + LiquiditySourceConfig 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_node_id(List self, SseSerializer serializer); + + @protected + void sse_encode_list_payment_details( + List self, SseSerializer serializer); + + @protected + 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_64_strict( + Uint64List self, SseSerializer serializer); + + @protected + void sse_encode_list_prim_u_8_loose(List self, SseSerializer serializer); + + @protected + void sse_encode_list_prim_u_8_strict( + Uint8List self, SseSerializer serializer); + + @protected + void sse_encode_list_public_key( + List self, SseSerializer serializer); + + @protected + void sse_encode_list_socket_address( + List self, SseSerializer serializer); + + @protected + void sse_encode_log_level(LogLevel self, SseSerializer serializer); + + @protected + void sse_encode_lsp_fee_limits(LSPFeeLimits self, SseSerializer serializer); + + @protected + void sse_encode_max_dust_htlc_exposure( + MaxDustHTLCExposure self, SseSerializer serializer); + + @protected + void sse_encode_network(Network self, SseSerializer serializer); + + @protected + void sse_encode_node_announcement_info( + NodeAnnouncementInfo self, SseSerializer serializer); + + @protected + void sse_encode_node_id(NodeId self, SseSerializer serializer); + + @protected + void sse_encode_node_info(NodeInfo self, SseSerializer serializer); + + @protected + void sse_encode_node_status(NodeStatus self, SseSerializer serializer); + + @protected + void sse_encode_offer(Offer self, SseSerializer serializer); + + @protected + void sse_encode_offer_id(OfferId self, SseSerializer serializer); + + @protected + void sse_encode_opt_String(String? self, SseSerializer serializer); + + @protected + void sse_encode_opt_box_autoadd_anchor_channels_config( + AnchorChannelsConfig? self, SseSerializer serializer); + + @protected + void sse_encode_opt_box_autoadd_chain_data_source_config( + ChainDataSourceConfig? self, SseSerializer serializer); + + @protected + 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_channel_info( + ChannelInfo? self, SseSerializer serializer); + + @protected + void sse_encode_opt_box_autoadd_channel_update_info( + ChannelUpdateInfo? 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); + + @protected + void sse_encode_opt_box_autoadd_event(Event? self, SseSerializer serializer); + + @protected + 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_node_announcement_info( + NodeAnnouncementInfo? self, SseSerializer serializer); + + @protected + void sse_encode_opt_box_autoadd_node_info( + NodeInfo? 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_hash( + PaymentHash? self, SseSerializer serializer); + + @protected + void sse_encode_opt_box_autoadd_payment_id( + PaymentId? self, SseSerializer serializer); + + @protected + void sse_encode_opt_box_autoadd_payment_preimage( + PaymentPreimage? self, SseSerializer serializer); + + @protected + void sse_encode_opt_box_autoadd_payment_secret( + PaymentSecret? self, SseSerializer serializer); + + @protected + 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); + + @protected + void sse_encode_opt_box_autoadd_u_64(BigInt? self, SseSerializer serializer); + + @protected + void sse_encode_opt_list_socket_address( + List? self, SseSerializer serializer); + + @protected + void sse_encode_out_point(OutPoint self, SseSerializer serializer); + + @protected + void sse_encode_payment_details( + PaymentDetails self, SseSerializer serializer); + + @protected + 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); + + @protected + void sse_encode_payment_id(PaymentId self, SseSerializer serializer); + + @protected + void sse_encode_payment_kind(PaymentKind self, SseSerializer serializer); + + @protected + void sse_encode_payment_preimage( + PaymentPreimage self, SseSerializer serializer); + + @protected + void sse_encode_payment_secret(PaymentSecret self, SseSerializer serializer); + + @protected + void sse_encode_payment_status(PaymentStatus self, SseSerializer serializer); + + @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_refund(Refund self, SseSerializer serializer); + + @protected + void sse_encode_routing_fees(RoutingFees self, SseSerializer serializer); + + @protected + void sse_encode_socket_address(SocketAddress self, SseSerializer serializer); + + @protected + void sse_encode_txid(Txid self, SseSerializer serializer); + + @protected + void sse_encode_u_16(int self, SseSerializer serializer); + + @protected + void sse_encode_u_32(int self, SseSerializer serializer); + + @protected + void sse_encode_u_64(BigInt self, SseSerializer serializer); + + @protected + void sse_encode_u_8(int self, SseSerializer serializer); + + @protected + void sse_encode_u_8_array_12(U8Array12 self, SseSerializer serializer); + + @protected + void sse_encode_u_8_array_16(U8Array16 self, SseSerializer serializer); + + @protected + void sse_encode_u_8_array_32(U8Array32 self, SseSerializer serializer); + + @protected + void sse_encode_u_8_array_4(U8Array4 self, SseSerializer serializer); + + @protected + void sse_encode_u_8_array_64(U8Array64 self, SseSerializer serializer); + + @protected + void sse_encode_unit(void self, SseSerializer serializer); + + @protected + void sse_encode_user_channel_id(UserChannelId self, SseSerializer serializer); + + @protected + void sse_encode_usize(BigInt self, SseSerializer serializer); +} + +// Section: wire_class + +// ignore_for_file: camel_case_types, non_constant_identifier_names, avoid_positional_boolean_parameters, annotate_overrides, constant_identifier_names +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +// ignore_for_file: type=lint + +/// generated by flutter_rust_bridge +class coreWire implements BaseWire { + factory coreWire.fromExternalLibrary(ExternalLibrary lib) => + coreWire(lib.ffiDynamicLibrary); + + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + coreWire(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + coreWire.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + void store_dart_post_cobject( + DartPostCObjectFnType ptr, + ) { + return _store_dart_post_cobject( + ptr, + ); + } + + late final _store_dart_post_cobjectPtr = + _lookup>( + 'store_dart_post_cobject'); + late final _store_dart_post_cobject = _store_dart_post_cobjectPtr + .asFunction(); + + void wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hash( + int port_, + ffi.Pointer that, + ffi.Pointer payment_hash, + int claimable_amount_msat, + ffi.Pointer preimage, + ) { + return _wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hash( + port_, + that, + payment_hash, + claimable_amount_msat, + preimage, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hashPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Uint64, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hash'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hash = + _wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hashPtr + .asFunction< + void Function( + int, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + + void wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hash( + int port_, + ffi.Pointer that, + ffi.Pointer payment_hash, + ) { + return _wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hash( + port_, + that, + payment_hash, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hashPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hash'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hash = + _wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hashPtr + .asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer)>(); + + void wire__crate__api__bolt11__ldk_bolt_11_payment_receive( + int port_, + ffi.Pointer that, + int amount_msat, + ffi.Pointer description, + int expiry_secs, + ) { + return _wire__crate__api__bolt11__ldk_bolt_11_payment_receive( + port_, + that, + amount_msat, + description, + expiry_secs, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receivePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Uint64, + ffi.Pointer, + ffi.Uint32)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive = + _wire__crate__api__bolt11__ldk_bolt_11_payment_receivePtr.asFunction< + void Function(int, ffi.Pointer, int, + ffi.Pointer, int)>(); + + void wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hash( + int port_, + ffi.Pointer that, + ffi.Pointer payment_hash, + int amount_msat, + ffi.Pointer description, + int expiry_secs, + ) { + return _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hash( + port_, + that, + payment_hash, + amount_msat, + description, + expiry_secs, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hashPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Uint64, + ffi.Pointer, + ffi.Uint32)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hash'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hash = + _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hashPtr + .asFunction< + void Function( + int, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + int)>(); + + void wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount( + int port_, + ffi.Pointer that, + ffi.Pointer description, + int expiry_secs, + ) { + return _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount( + port_, + that, + description, + expiry_secs, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amountPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Uint32)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount = + _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amountPtr + .asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer, int)>(); + + void + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hash( + int port_, + ffi.Pointer that, + ffi.Pointer description, + int expiry_secs, + ffi.Pointer payment_hash, + ) { + return _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hash( + port_, + that, + description, + expiry_secs, + payment_hash, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hashPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Uint32, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hash'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hash = + _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hashPtr + .asFunction< + void Function( + int, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + + void + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_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__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel( + port_, + that, + description, + expiry_secs, + max_proportional_lsp_fee_limit_ppm_msat, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channelPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Uint32, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel = + _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channelPtr + .asFunction< + void Function( + int, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + + void wire__crate__api__bolt11__ldk_bolt_11_payment_receive_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__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel( + port_, + that, + amount_msat, + description, + expiry_secs, + max_total_lsp_fee_limit_msat, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_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__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel = + _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channelPtr + .asFunction< + void Function( + int, + ffi.Pointer, + int, + ffi.Pointer, + int, + ffi.Pointer)>(); + + void wire__crate__api__bolt11__ldk_bolt_11_payment_send( + int port_, + ffi.Pointer that, + ffi.Pointer invoice, + ) { + return _wire__crate__api__bolt11__ldk_bolt_11_payment_send( + port_, + that, + invoice, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_sendPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_send = + _wire__crate__api__bolt11__ldk_bolt_11_payment_sendPtr.asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer)>(); + + void wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes( + int port_, + ffi.Pointer that, + ffi.Pointer invoice, + ) { + return _wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes( + port_, + that, + invoice, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_send_probesPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes = + _wire__crate__api__bolt11__ldk_bolt_11_payment_send_probesPtr.asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer)>(); + + void wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount( + int port_, + ffi.Pointer that, + ffi.Pointer invoice, + int amount_msat, + ) { + return _wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount( + port_, + that, + invoice, + amount_msat, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amountPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Uint64)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount = + _wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amountPtr + .asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer, int)>(); + + void wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount( + int port_, + ffi.Pointer that, + ffi.Pointer invoice, + int amount_msat, + ) { + return _wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount( + port_, + that, + invoice, + amount_msat, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amountPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Uint64)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount = + _wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amountPtr + .asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer, int)>(); + + void wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refund( + int port_, + ffi.Pointer that, + int amount_msat, + int expiry_secs, + ) { + return _wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refund( + port_, + that, + amount_msat, + expiry_secs, + ); + } + + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refundPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Uint64, + ffi.Uint32)>>( + 'frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refund'); + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refund = + _wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refundPtr + .asFunction< + void Function( + int, ffi.Pointer, int, int)>(); + + void wire__crate__api__bolt12__ldk_bolt_12_payment_receive( + int port_, + ffi.Pointer that, + int amount_msat, + ffi.Pointer description, + ) { + return _wire__crate__api__bolt12__ldk_bolt_12_payment_receive( + port_, + that, + amount_msat, + description, + ); + } + + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_receivePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Uint64, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_receive'); + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_receive = + _wire__crate__api__bolt12__ldk_bolt_12_payment_receivePtr.asFunction< + void Function(int, ffi.Pointer, int, + ffi.Pointer)>(); + + void wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amount( + int port_, + ffi.Pointer that, + ffi.Pointer description, + ) { + return _wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amount( + port_, + that, + description, + ); + } + + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amountPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amount'); + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amount = + _wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amountPtr + .asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer)>(); + + void wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_payment( + int port_, + ffi.Pointer that, + ffi.Pointer refund, + ) { + return _wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_payment( + port_, + that, + refund, + ); + } + + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_paymentPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_payment'); + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_payment = + _wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_paymentPtr + .asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer)>(); + + void wire__crate__api__bolt12__ldk_bolt_12_payment_send( + int port_, + ffi.Pointer that, + ffi.Pointer offer, + ffi.Pointer payer_note, + ) { + return _wire__crate__api__bolt12__ldk_bolt_12_payment_send( + port_, + that, + offer, + payer_note, + ); + } + + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_sendPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_send'); + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_send = + _wire__crate__api__bolt12__ldk_bolt_12_payment_sendPtr.asFunction< + void Function( + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); - @protected - void sse_encode_user_channel_id(UserChannelId self, SseSerializer serializer); + void wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amount( + int port_, + ffi.Pointer that, + ffi.Pointer offer, + ffi.Pointer payer_note, + int amount_msat, + ) { + return _wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amount( + port_, + that, + offer, + payer_note, + amount_msat, + ); + } - @protected - void sse_encode_usize(int self, SseSerializer serializer); -} + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amountPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Uint64)>>( + 'frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amount'); + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amount = + _wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amountPtr + .asFunction< + void Function( + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); -// Section: wire_class + WireSyncRust2DartDco + wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder( + int that, + ) { + return _wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder( + that, + ); + } -// ignore_for_file: camel_case_types, non_constant_identifier_names, avoid_positional_boolean_parameters, annotate_overrides, constant_identifier_names -// AUTO GENERATED FILE, DO NOT EDIT. -// -// Generated by `package:ffigen`. -// ignore_for_file: type=lint + late final _wire__crate__api__builder__NodeBuilder_auto_accessor_get_builderPtr = + _lookup>( + 'frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder'); + late final _wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder = + _wire__crate__api__builder__NodeBuilder_auto_accessor_get_builderPtr + .asFunction(); -/// generated by flutter_rust_bridge -class LdkCoreWire implements BaseWire { - factory LdkCoreWire.fromExternalLibrary(ExternalLibrary lib) => - LdkCoreWire(lib.ffiDynamicLibrary); + WireSyncRust2DartDco + wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder( + int that, + int builder, + ) { + return _wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder( + that, + builder, + ); + } - /// Holds the symbol lookup function. - final ffi.Pointer Function(String symbolName) - _lookup; + late final _wire__crate__api__builder__NodeBuilder_auto_accessor_set_builderPtr = + _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function(ffi.UintPtr, ffi.UintPtr)>>( + 'frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder'); + late final _wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder = + _wire__crate__api__builder__NodeBuilder_auto_accessor_set_builderPtr + .asFunction(); - /// The symbols are looked up in [dynamicLibrary]. - LdkCoreWire(ffi.DynamicLibrary dynamicLibrary) - : _lookup = dynamicLibrary.lookup; + void wire__crate__api__builder__NodeBuilder_build( + int port_, + int that, + ) { + return _wire__crate__api__builder__NodeBuilder_build( + port_, + that, + ); + } - /// The symbols are looked up with [lookup]. - LdkCoreWire.fromLookup( - ffi.Pointer Function(String symbolName) - lookup) - : _lookup = lookup; + late final _wire__crate__api__builder__NodeBuilder_buildPtr = + _lookup>( + 'frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_build'); + late final _wire__crate__api__builder__NodeBuilder_build = + _wire__crate__api__builder__NodeBuilder_buildPtr + .asFunction(); - void store_dart_post_cobject( - DartPostCObjectFnType ptr, + void wire__crate__api__builder__NodeBuilder_build_with_fs_store( + int port_, + int that, ) { - return _store_dart_post_cobject( - ptr, + return _wire__crate__api__builder__NodeBuilder_build_with_fs_store( + port_, + that, ); } - late final _store_dart_post_cobjectPtr = - _lookup>( - 'store_dart_post_cobject'); - late final _store_dart_post_cobject = _store_dart_post_cobjectPtr - .asFunction(); + late final _wire__crate__api__builder__NodeBuilder_build_with_fs_storePtr = + _lookup>( + 'frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_build_with_fs_store'); + late final _wire__crate__api__builder__NodeBuilder_build_with_fs_store = + _wire__crate__api__builder__NodeBuilder_build_with_fs_storePtr + .asFunction(); - void wire_build_with_sqlite_store( + void wire__crate__api__builder__NodeBuilder_create_builder( 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, ) { - return _wire_build_with_sqlite_store( + return _wire__crate__api__builder__NodeBuilder_create_builder( port_, config, chain_data_source_config, entropy_source_config, gossip_source_config, + liquidity_source_config, ); } - late final _wire_build_with_sqlite_storePtr = _lookup< + late final _wire__crate__api__builder__NodeBuilder_create_builderPtr = _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< + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_create_builder'); + late final _wire__crate__api__builder__NodeBuilder_create_builder = + _wire__crate__api__builder__NodeBuilder_create_builderPtr.asFunction< void Function( int, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer)>(); - void wire_ldk_mnemonic_generate( + void wire__crate__api__builder__ldk_mnemonic_generate( int port_, ) { - return _wire_ldk_mnemonic_generate( + return _wire__crate__api__builder__ldk_mnemonic_generate( port_, ); } - late final _wire_ldk_mnemonic_generatePtr = + late final _wire__crate__api__builder__ldk_mnemonic_generatePtr = _lookup>( - 'frbgen_ldk_node_wire_ldk_mnemonic_generate'); - late final _wire_ldk_mnemonic_generate = - _wire_ldk_mnemonic_generatePtr.asFunction(); + 'frbgen_ldk_node_wire__crate__api__builder__ldk_mnemonic_generate'); + late final _wire__crate__api__builder__ldk_mnemonic_generate = + _wire__crate__api__builder__ldk_mnemonic_generatePtr + .asFunction(); - void wire_ldk_node_close_channel( + void wire__crate__api__graph__ldk_network_graph_channel( int port_, - ffi.Pointer that, - ffi.Pointer channel_id, - ffi.Pointer counterparty_node_id, + ffi.Pointer that, + int short_channel_id, ) { - return _wire_ldk_node_close_channel( + return _wire__crate__api__graph__ldk_network_graph_channel( port_, that, - channel_id, - counterparty_node_id, + short_channel_id, ); } - late final _wire_ldk_node_close_channelPtr = _lookup< + late final _wire__crate__api__graph__ldk_network_graph_channelPtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - ffi.Int64, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>( - '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)>(); - - void wire_ldk_node_connect( + ffi.Void Function(ffi.Int64, + ffi.Pointer, ffi.Uint64)>>( + 'frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_channel'); + late final _wire__crate__api__graph__ldk_network_graph_channel = + _wire__crate__api__graph__ldk_network_graph_channelPtr.asFunction< + void Function(int, ffi.Pointer, int)>(); + + void wire__crate__api__graph__ldk_network_graph_list_channels( int port_, - ffi.Pointer that, - ffi.Pointer node_id, - ffi.Pointer address, - bool persist, + ffi.Pointer that, ) { - return _wire_ldk_node_connect( + return _wire__crate__api__graph__ldk_network_graph_list_channels( port_, that, - node_id, - address, - persist, ); } - late final _wire_ldk_node_connectPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Int64, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - 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, - bool)>(); - - void wire_ldk_node_connect_open_channel( + late final _wire__crate__api__graph__ldk_network_graph_list_channelsPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_list_channels'); + late final _wire__crate__api__graph__ldk_network_graph_list_channels = + _wire__crate__api__graph__ldk_network_graph_list_channelsPtr.asFunction< + void Function(int, ffi.Pointer)>(); + + void wire__crate__api__graph__ldk_network_graph_list_nodes( int port_, - 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, + ffi.Pointer that, ) { - return _wire_ldk_node_connect_open_channel( + return _wire__crate__api__graph__ldk_network_graph_list_nodes( port_, that, - socket_address, - node_id, - channel_amount_sats, - push_to_counterparty_msat, - announce_channel, - channel_config, ); } - late final _wire_ldk_node_connect_open_channelPtr = _lookup< + late final _wire__crate__api__graph__ldk_network_graph_list_nodesPtr = _lookup< ffi.NativeFunction< ffi.Void Function( - ffi.Int64, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Uint64, - ffi.Pointer, - ffi.Bool, - ffi.Pointer)>>( - '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, - int, - ffi.Pointer, - bool, - ffi.Pointer)>(); + ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_list_nodes'); + late final _wire__crate__api__graph__ldk_network_graph_list_nodes = + _wire__crate__api__graph__ldk_network_graph_list_nodesPtr.asFunction< + void Function(int, ffi.Pointer)>(); - void wire_ldk_node_disconnect( + void wire__crate__api__graph__ldk_network_graph_node( int port_, - ffi.Pointer that, - ffi.Pointer counterparty_node_id, + ffi.Pointer that, + ffi.Pointer node_id, ) { - return _wire_ldk_node_disconnect( + return _wire__crate__api__graph__ldk_network_graph_node( port_, that, - counterparty_node_id, + node_id, ); } - late final _wire_ldk_node_disconnectPtr = _lookup< + late final _wire__crate__api__graph__ldk_network_graph_nodePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - 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_ldk_node_event_handled( + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_node'); + late final _wire__crate__api__graph__ldk_network_graph_node = + _wire__crate__api__graph__ldk_network_graph_nodePtr.asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer)>(); + + void wire__crate__api__node__ldk_node_bolt11_payment( int port_, - ffi.Pointer that, + ffi.Pointer ptr, ) { - return _wire_ldk_node_event_handled( + return _wire__crate__api__node__ldk_node_bolt11_payment( port_, - that, + ptr, ); } - late final _wire_ldk_node_event_handledPtr = _lookup< + late final _wire__crate__api__node__ldk_node_bolt11_paymentPtr = _lookup< ffi.NativeFunction< 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)>(); + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_bolt11_payment'); + late final _wire__crate__api__node__ldk_node_bolt11_payment = + _wire__crate__api__node__ldk_node_bolt11_paymentPtr + .asFunction)>(); - void wire_ldk_node_is_running( + void wire__crate__api__node__ldk_node_bolt12_payment( int port_, - ffi.Pointer that, + ffi.Pointer ptr, ) { - return _wire_ldk_node_is_running( + return _wire__crate__api__node__ldk_node_bolt12_payment( port_, - that, + ptr, ); } - late final _wire_ldk_node_is_runningPtr = _lookup< + late final _wire__crate__api__node__ldk_node_bolt12_paymentPtr = _lookup< ffi.NativeFunction< 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)>(); + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_bolt12_payment'); + late final _wire__crate__api__node__ldk_node_bolt12_payment = + _wire__crate__api__node__ldk_node_bolt12_paymentPtr + .asFunction)>(); - void wire_ldk_node_list_channels( + void wire__crate__api__node__ldk_node_close_channel( int port_, ffi.Pointer that, + ffi.Pointer user_channel_id, + ffi.Pointer counterparty_node_id, ) { - return _wire_ldk_node_list_channels( + return _wire__crate__api__node__ldk_node_close_channel( port_, that, + user_channel_id, + counterparty_node_id, ); } - late final _wire_ldk_node_list_channelsPtr = _lookup< + late final _wire__crate__api__node__ldk_node_close_channelPtr = _lookup< ffi.NativeFunction< - 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)>(); + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_close_channel'); + late final _wire__crate__api__node__ldk_node_close_channel = + _wire__crate__api__node__ldk_node_close_channelPtr.asFunction< + void Function( + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); - void wire_ldk_node_list_payments( + void wire__crate__api__node__ldk_node_config( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_list_payments( + return _wire__crate__api__node__ldk_node_config( port_, that, ); } - late final _wire_ldk_node_list_paymentsPtr = _lookup< + late final _wire__crate__api__node__ldk_node_configPtr = _lookup< ffi.NativeFunction< 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)>(); + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_config'); + late final _wire__crate__api__node__ldk_node_config = + _wire__crate__api__node__ldk_node_configPtr + .asFunction)>(); - void wire_ldk_node_list_payments_with_filter( + void wire__crate__api__node__ldk_node_connect( int port_, ffi.Pointer that, - int payment_direction, + ffi.Pointer node_id, + ffi.Pointer address, + bool persist, ) { - return _wire_ldk_node_list_payments_with_filter( + return _wire__crate__api__node__ldk_node_connect( port_, that, - payment_direction, + node_id, + address, + persist, ); } - late final _wire_ldk_node_list_payments_with_filterPtr = _lookup< + late final _wire__crate__api__node__ldk_node_connectPtr = _lookup< ffi.NativeFunction< ffi.Void Function( - 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)>(); + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_connect'); + late final _wire__crate__api__node__ldk_node_connect = + _wire__crate__api__node__ldk_node_connectPtr.asFunction< + void Function( + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool)>(); - void wire_ldk_node_list_peers( + void wire__crate__api__node__ldk_node_connect_open_channel( int port_, 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_ldk_node_list_peers( + return _wire__crate__api__node__ldk_node_connect_open_channel( port_, that, + socket_address, + node_id, + channel_amount_sats, + push_to_counterparty_msat, + announce_channel, + channel_config, ); } - late final _wire_ldk_node_list_peersPtr = _lookup< + late final _wire__crate__api__node__ldk_node_connect_open_channelPtr = _lookup< ffi.NativeFunction< - 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)>(); + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Uint64, + ffi.Pointer, + ffi.Bool, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_connect_open_channel'); + late final _wire__crate__api__node__ldk_node_connect_open_channel = + _wire__crate__api__node__ldk_node_connect_open_channelPtr.asFunction< + void Function( + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + bool, + ffi.Pointer)>(); - void wire_ldk_node_listening_addresses( + void wire__crate__api__node__ldk_node_disconnect( int port_, ffi.Pointer that, + ffi.Pointer counterparty_node_id, ) { - return _wire_ldk_node_listening_addresses( + return _wire__crate__api__node__ldk_node_disconnect( port_, that, + counterparty_node_id, ); } - late final _wire_ldk_node_listening_addressesPtr = _lookup< + late final _wire__crate__api__node__ldk_node_disconnectPtr = _lookup< ffi.NativeFunction< - 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)>(); + ffi.Void Function(ffi.Int64, ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_disconnect'); + late final _wire__crate__api__node__ldk_node_disconnect = + _wire__crate__api__node__ldk_node_disconnectPtr.asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer)>(); - void wire_ldk_node_new_onchain_address( + void wire__crate__api__node__ldk_node_event_handled( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_new_onchain_address( + return _wire__crate__api__node__ldk_node_event_handled( port_, that, ); } - late final _wire_ldk_node_new_onchain_addressPtr = _lookup< + late final _wire__crate__api__node__ldk_node_event_handledPtr = _lookup< ffi.NativeFunction< 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 + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_event_handled'); + late final _wire__crate__api__node__ldk_node_event_handled = + _wire__crate__api__node__ldk_node_event_handledPtr .asFunction)>(); - void wire_ldk_node_next_event( + void wire__crate__api__node__ldk_node_force_close_channel( int port_, ffi.Pointer that, + ffi.Pointer user_channel_id, + ffi.Pointer counterparty_node_id, ) { - return _wire_ldk_node_next_event( + return _wire__crate__api__node__ldk_node_force_close_channel( port_, that, + user_channel_id, + counterparty_node_id, ); } - late final _wire_ldk_node_next_eventPtr = _lookup< + late final _wire__crate__api__node__ldk_node_force_close_channelPtr = _lookup< ffi.NativeFunction< - 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)>(); + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_force_close_channel'); + late final _wire__crate__api__node__ldk_node_force_close_channel = + _wire__crate__api__node__ldk_node_force_close_channelPtr.asFunction< + void Function( + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); - void wire_ldk_node_node_id( + void wire__crate__api__node__ldk_node_list_balances( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_node_id( + return _wire__crate__api__node__ldk_node_list_balances( port_, that, ); } - late final _wire_ldk_node_node_idPtr = _lookup< + late final _wire__crate__api__node__ldk_node_list_balancesPtr = _lookup< ffi.NativeFunction< 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)>(); + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_list_balances'); + late final _wire__crate__api__node__ldk_node_list_balances = + _wire__crate__api__node__ldk_node_list_balancesPtr + .asFunction)>(); - void wire_ldk_node_payment( + void wire__crate__api__node__ldk_node_list_channels( int port_, ffi.Pointer that, - ffi.Pointer payment_hash, ) { - return _wire_ldk_node_payment( + return _wire__crate__api__node__ldk_node_list_channels( port_, that, - payment_hash, ); } - late final _wire_ldk_node_paymentPtr = _lookup< + late final _wire__crate__api__node__ldk_node_list_channelsPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - 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)>(); + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_list_channels'); + late final _wire__crate__api__node__ldk_node_list_channels = + _wire__crate__api__node__ldk_node_list_channelsPtr + .asFunction)>(); - void wire_ldk_node_receive_payment( + void wire__crate__api__node__ldk_node_list_payments( int port_, ffi.Pointer that, - int amount_msat, - ffi.Pointer description, - int expiry_secs, ) { - return _wire_ldk_node_receive_payment( + return _wire__crate__api__node__ldk_node_list_payments( port_, that, - amount_msat, - description, - expiry_secs, ); } - late final _wire_ldk_node_receive_paymentPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Int64, - ffi.Pointer, - ffi.Uint64, - ffi.Pointer, - 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)>(); + late final _wire__crate__api__node__ldk_node_list_paymentsPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_list_payments'); + late final _wire__crate__api__node__ldk_node_list_payments = + _wire__crate__api__node__ldk_node_list_paymentsPtr + .asFunction)>(); - void wire_ldk_node_receive_variable_amount_payment( + void wire__crate__api__node__ldk_node_list_payments_with_filter( int port_, ffi.Pointer that, - ffi.Pointer description, - int expiry_secs, + int payment_direction, ) { - return _wire_ldk_node_receive_variable_amount_payment( + return _wire__crate__api__node__ldk_node_list_payments_with_filter( port_, that, - description, - expiry_secs, + payment_direction, ); } - late final _wire_ldk_node_receive_variable_amount_paymentPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - ffi.Pointer, ffi.Uint32)>>( - '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)>(); + late final _wire__crate__api__node__ldk_node_list_payments_with_filterPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, ffi.Pointer, ffi.Int32)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_list_payments_with_filter'); + late final _wire__crate__api__node__ldk_node_list_payments_with_filter = + _wire__crate__api__node__ldk_node_list_payments_with_filterPtr.asFunction< + void Function(int, ffi.Pointer, int)>(); - void wire_ldk_node_remove_payment( + void wire__crate__api__node__ldk_node_list_peers( int port_, ffi.Pointer that, - ffi.Pointer payment_hash, ) { - return _wire_ldk_node_remove_payment( + return _wire__crate__api__node__ldk_node_list_peers( port_, that, - payment_hash, ); } - late final _wire_ldk_node_remove_paymentPtr = _lookup< + late final _wire__crate__api__node__ldk_node_list_peersPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - 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)>(); + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_list_peers'); + late final _wire__crate__api__node__ldk_node_list_peers = + _wire__crate__api__node__ldk_node_list_peersPtr + .asFunction)>(); - void wire_ldk_node_send_all_to_onchain_address( + void wire__crate__api__node__ldk_node_listening_addresses( int port_, ffi.Pointer that, - ffi.Pointer address, ) { - return _wire_ldk_node_send_all_to_onchain_address( + return _wire__crate__api__node__ldk_node_listening_addresses( port_, that, - address, ); } - late final _wire_ldk_node_send_all_to_onchain_addressPtr = _lookup< + late final _wire__crate__api__node__ldk_node_listening_addressesPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - 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)>(); + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_listening_addresses'); + late final _wire__crate__api__node__ldk_node_listening_addresses = + _wire__crate__api__node__ldk_node_listening_addressesPtr + .asFunction)>(); - void wire_ldk_node_send_payment( + void wire__crate__api__node__ldk_node_network_graph( int port_, - ffi.Pointer that, - ffi.Pointer invoice, + ffi.Pointer ptr, ) { - return _wire_ldk_node_send_payment( + return _wire__crate__api__node__ldk_node_network_graph( port_, - that, - invoice, + ptr, ); } - late final _wire_ldk_node_send_paymentPtr = _lookup< + late final _wire__crate__api__node__ldk_node_network_graphPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - 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)>(); + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_network_graph'); + late final _wire__crate__api__node__ldk_node_network_graph = + _wire__crate__api__node__ldk_node_network_graphPtr + .asFunction)>(); - void wire_ldk_node_send_payment_probes( + void wire__crate__api__node__ldk_node_next_event( int port_, ffi.Pointer that, - ffi.Pointer invoice, ) { - return _wire_ldk_node_send_payment_probes( + return _wire__crate__api__node__ldk_node_next_event( port_, that, - invoice, ); } - late final _wire_ldk_node_send_payment_probesPtr = _lookup< + late final _wire__crate__api__node__ldk_node_next_eventPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - 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)>(); + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_next_event'); + late final _wire__crate__api__node__ldk_node_next_event = + _wire__crate__api__node__ldk_node_next_eventPtr + .asFunction)>(); - void wire_ldk_node_send_payment_probes_using_amount( + void wire__crate__api__node__ldk_node_next_event_async( int port_, ffi.Pointer that, - ffi.Pointer invoice, - int amount_msat, ) { - return _wire_ldk_node_send_payment_probes_using_amount( + return _wire__crate__api__node__ldk_node_next_event_async( port_, that, - invoice, - amount_msat, ); } - late final _wire_ldk_node_send_payment_probes_using_amountPtr = _lookup< + late final _wire__crate__api__node__ldk_node_next_event_asyncPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - ffi.Pointer, ffi.Uint64)>>( - '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)>(); + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_next_event_async'); + late final _wire__crate__api__node__ldk_node_next_event_async = + _wire__crate__api__node__ldk_node_next_event_asyncPtr + .asFunction)>(); - void wire_ldk_node_send_payment_using_amount( + void wire__crate__api__node__ldk_node_node_id( int port_, ffi.Pointer that, - ffi.Pointer invoice, - int amount_msat, ) { - return _wire_ldk_node_send_payment_using_amount( + return _wire__crate__api__node__ldk_node_node_id( port_, that, - invoice, - amount_msat, ); } - late final _wire_ldk_node_send_payment_using_amountPtr = _lookup< + late final _wire__crate__api__node__ldk_node_node_idPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - ffi.Pointer, ffi.Uint64)>>( - '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)>(); + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_node_id'); + late final _wire__crate__api__node__ldk_node_node_id = + _wire__crate__api__node__ldk_node_node_idPtr + .asFunction)>(); - void wire_ldk_node_send_spontaneous_payment( + void wire__crate__api__node__ldk_node_on_chain_payment( int port_, - ffi.Pointer that, - int amount_msat, - ffi.Pointer node_id, + ffi.Pointer ptr, ) { - return _wire_ldk_node_send_spontaneous_payment( + return _wire__crate__api__node__ldk_node_on_chain_payment( port_, - that, - amount_msat, - node_id, + ptr, ); } - late final _wire_ldk_node_send_spontaneous_paymentPtr = _lookup< + late final _wire__crate__api__node__ldk_node_on_chain_paymentPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - ffi.Uint64, ffi.Pointer)>>( - '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)>(); + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_on_chain_payment'); + late final _wire__crate__api__node__ldk_node_on_chain_payment = + _wire__crate__api__node__ldk_node_on_chain_paymentPtr + .asFunction)>(); - void wire_ldk_node_send_spontaneous_payment_probes( + void wire__crate__api__node__ldk_node_payment( int port_, ffi.Pointer that, - int amount_msat, - ffi.Pointer node_id, + ffi.Pointer payment_id, ) { - return _wire_ldk_node_send_spontaneous_payment_probes( + return _wire__crate__api__node__ldk_node_payment( port_, that, - amount_msat, - node_id, + payment_id, ); } - late final _wire_ldk_node_send_spontaneous_payment_probesPtr = _lookup< + late final _wire__crate__api__node__ldk_node_paymentPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Int64, ffi.Pointer, - ffi.Uint64, ffi.Pointer)>>( - '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)>(); + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_payment'); + late final _wire__crate__api__node__ldk_node_payment = + _wire__crate__api__node__ldk_node_paymentPtr.asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer)>(); - void wire_ldk_node_send_to_onchain_address( + void wire__crate__api__node__ldk_node_remove_payment( int port_, ffi.Pointer that, - ffi.Pointer address, - int amount_sats, + ffi.Pointer payment_id, ) { - return _wire_ldk_node_send_to_onchain_address( + return _wire__crate__api__node__ldk_node_remove_payment( port_, that, - address, - amount_sats, + payment_id, ); } - late final _wire_ldk_node_send_to_onchain_addressPtr = _lookup< + late final _wire__crate__api__node__ldk_node_remove_paymentPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Int64, ffi.Pointer, - ffi.Pointer, ffi.Uint64)>>( - '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< + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_remove_payment'); + late final _wire__crate__api__node__ldk_node_remove_payment = + _wire__crate__api__node__ldk_node_remove_paymentPtr.asFunction< void Function(int, ffi.Pointer, - ffi.Pointer, int)>(); + ffi.Pointer)>(); - void wire_ldk_node_sign_message( + void wire__crate__api__node__ldk_node_sign_message( int port_, ffi.Pointer that, ffi.Pointer msg, ) { - return _wire_ldk_node_sign_message( + return _wire__crate__api__node__ldk_node_sign_message( port_, that, msg, ); } - late final _wire_ldk_node_sign_messagePtr = _lookup< + late final _wire__crate__api__node__ldk_node_sign_messagePtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Int64, ffi.Pointer, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_ldk_node_sign_message'); - late final _wire_ldk_node_sign_message = - _wire_ldk_node_sign_messagePtr.asFunction< + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_sign_message'); + late final _wire__crate__api__node__ldk_node_sign_message = + _wire__crate__api__node__ldk_node_sign_messagePtr.asFunction< void Function(int, ffi.Pointer, ffi.Pointer)>(); - void wire_ldk_node_spendable_onchain_balance_sats( + void wire__crate__api__node__ldk_node_spontaneous_payment( int port_, - ffi.Pointer that, + ffi.Pointer ptr, ) { - return _wire_ldk_node_spendable_onchain_balance_sats( + return _wire__crate__api__node__ldk_node_spontaneous_payment( port_, - that, + ptr, ); } - late final _wire_ldk_node_spendable_onchain_balance_satsPtr = _lookup< + late final _wire__crate__api__node__ldk_node_spontaneous_paymentPtr = _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 + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_spontaneous_payment'); + late final _wire__crate__api__node__ldk_node_spontaneous_payment = + _wire__crate__api__node__ldk_node_spontaneous_paymentPtr .asFunction)>(); - void wire_ldk_node_start( + void wire__crate__api__node__ldk_node_start( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_start( + return _wire__crate__api__node__ldk_node_start( port_, that, ); } - late final _wire_ldk_node_startPtr = _lookup< + late final _wire__crate__api__node__ldk_node_startPtr = _lookup< ffi.NativeFunction< 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)>(); + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_start'); + late final _wire__crate__api__node__ldk_node_start = + _wire__crate__api__node__ldk_node_startPtr + .asFunction)>(); - void wire_ldk_node_stop( + void wire__crate__api__node__ldk_node_status( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_stop( + return _wire__crate__api__node__ldk_node_status( port_, that, ); } - late final _wire_ldk_node_stopPtr = _lookup< + late final _wire__crate__api__node__ldk_node_statusPtr = _lookup< ffi.NativeFunction< 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)>(); + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_status'); + late final _wire__crate__api__node__ldk_node_status = + _wire__crate__api__node__ldk_node_statusPtr + .asFunction)>(); - void wire_ldk_node_sync_wallets( + void wire__crate__api__node__ldk_node_stop( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_sync_wallets( + return _wire__crate__api__node__ldk_node_stop( port_, that, ); } - late final _wire_ldk_node_sync_walletsPtr = _lookup< + late final _wire__crate__api__node__ldk_node_stopPtr = _lookup< ffi.NativeFunction< 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)>(); + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_stop'); + late final _wire__crate__api__node__ldk_node_stop = + _wire__crate__api__node__ldk_node_stopPtr + .asFunction)>(); - void wire_ldk_node_total_onchain_balance_sats( + void wire__crate__api__node__ldk_node_sync_wallets( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_total_onchain_balance_sats( + return _wire__crate__api__node__ldk_node_sync_wallets( port_, that, ); } - late final _wire_ldk_node_total_onchain_balance_satsPtr = _lookup< + late final _wire__crate__api__node__ldk_node_sync_walletsPtr = _lookup< ffi.NativeFunction< 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 + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_sync_wallets'); + late final _wire__crate__api__node__ldk_node_sync_wallets = + _wire__crate__api__node__ldk_node_sync_walletsPtr .asFunction)>(); - void wire_ldk_node_update_channel_config( + void wire__crate__api__node__ldk_node_update_channel_config( int port_, ffi.Pointer that, - ffi.Pointer channel_id, + ffi.Pointer user_channel_id, ffi.Pointer counterparty_node_id, ffi.Pointer channel_config, ) { - return _wire_ldk_node_update_channel_config( + return _wire__crate__api__node__ldk_node_update_channel_config( port_, that, - channel_id, + user_channel_id, counterparty_node_id, channel_config, ); } - late final _wire_ldk_node_update_channel_configPtr = _lookup< + late final _wire__crate__api__node__ldk_node_update_channel_configPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Int64, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_ldk_node_update_channel_config'); - late final _wire_ldk_node_update_channel_config = - _wire_ldk_node_update_channel_configPtr.asFunction< + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_update_channel_config'); + late final _wire__crate__api__node__ldk_node_update_channel_config = + _wire__crate__api__node__ldk_node_update_channel_configPtr.asFunction< void Function( int, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - void wire_ldk_node_verify_signature( + void wire__crate__api__node__ldk_node_verify_signature( int port_, ffi.Pointer that, ffi.Pointer msg, ffi.Pointer sig, - ffi.Pointer pkey, + ffi.Pointer public_key, ) { - return _wire_ldk_node_verify_signature( + return _wire__crate__api__node__ldk_node_verify_signature( port_, that, msg, sig, - pkey, + public_key, ); } - late final _wire_ldk_node_verify_signaturePtr = _lookup< + late final _wire__crate__api__node__ldk_node_verify_signaturePtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Int64, @@ -2621,9 +5509,9 @@ class LdkCoreWire implements BaseWire { ffi.Pointer, ffi.Pointer, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_ldk_node_verify_signature'); - late final _wire_ldk_node_verify_signature = - _wire_ldk_node_verify_signaturePtr.asFunction< + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_verify_signature'); + late final _wire__crate__api__node__ldk_node_verify_signature = + _wire__crate__api__node__ldk_node_verify_signaturePtr.asFunction< void Function( int, ffi.Pointer, @@ -2631,88 +5519,402 @@ class LdkCoreWire implements BaseWire { ffi.Pointer, ffi.Pointer)>(); - void wire_ldk_node_wait_next_event( + void wire__crate__api__node__ldk_node_wait_next_event( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_wait_next_event( + return _wire__crate__api__node__ldk_node_wait_next_event( port_, that, ); } - late final _wire_ldk_node_wait_next_eventPtr = _lookup< + late final _wire__crate__api__node__ldk_node_wait_next_eventPtr = _lookup< ffi.NativeFunction< 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)>(); + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_wait_next_event'); + late final _wire__crate__api__node__ldk_node_wait_next_event = + _wire__crate__api__node__ldk_node_wait_next_eventPtr + .asFunction)>(); - void wire_socket_address_as_string( + void wire__crate__api__on_chain__ldk_on_chain_payment_new_address( int port_, - ffi.Pointer that, + ffi.Pointer that, ) { - return _wire_socket_address_as_string( + return _wire__crate__api__on_chain__ldk_on_chain_payment_new_address( port_, that, ); } - late final _wire_socket_address_as_stringPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - 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)>(); + late final _wire__crate__api__on_chain__ldk_on_chain_payment_new_addressPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_new_address'); + late final _wire__crate__api__on_chain__ldk_on_chain_payment_new_address = + _wire__crate__api__on_chain__ldk_on_chain_payment_new_addressPtr + .asFunction< + void Function(int, ffi.Pointer)>(); - void wire_socket_address_from_str( + void wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address( int port_, - ffi.Pointer address, + ffi.Pointer that, + ffi.Pointer address, ) { - return _wire_socket_address_from_str( + return _wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address( port_, + that, 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)>(); + late final _wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_addressPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address'); + late final _wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address = + _wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_addressPtr + .asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer)>(); + + void wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address( + int port_, + ffi.Pointer that, + ffi.Pointer address, + int amount_sats, + ) { + return _wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address( + port_, + that, + address, + amount_sats, + ); + } + + late final _wire__crate__api__on_chain__ldk_on_chain_payment_send_to_addressPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Uint64)>>( + 'frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address'); + late final _wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address = + _wire__crate__api__on_chain__ldk_on_chain_payment_send_to_addressPtr + .asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer, int)>(); + + void wire__crate__api__spontaneous__ldk_spontaneous_payment_send( + int port_, + ffi.Pointer that, + int amount_msat, + ffi.Pointer node_id, + ) { + return _wire__crate__api__spontaneous__ldk_spontaneous_payment_send( + port_, + that, + amount_msat, + node_id, + ); + } + + late final _wire__crate__api__spontaneous__ldk_spontaneous_payment_sendPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Uint64, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__spontaneous__ldk_spontaneous_payment_send'); + late final _wire__crate__api__spontaneous__ldk_spontaneous_payment_send = + _wire__crate__api__spontaneous__ldk_spontaneous_payment_sendPtr + .asFunction< + void Function(int, ffi.Pointer, + int, ffi.Pointer)>(); + + void wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes( + int port_, + ffi.Pointer that, + int amount_msat, + ffi.Pointer node_id, + ) { + return _wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes( + port_, + that, + amount_msat, + node_id, + ); + } + + late final _wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probesPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Uint64, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes'); + late final _wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes = + _wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probesPtr + .asFunction< + void Function(int, ffi.Pointer, + int, ffi.Pointer)>(); + + void + rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12PaymentPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment'); + late final _rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment = + _rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12PaymentPtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12PaymentPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment'); + late final _rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment = + _rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12PaymentPtr + .asFunction)>(); + + void rust_arc_increment_strong_count_RustOpaque_Node( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_Node( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_NodePtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_Node'); + late final _rust_arc_increment_strong_count_RustOpaque_Node = + _rust_arc_increment_strong_count_RustOpaque_NodePtr + .asFunction)>(); + + void rust_arc_decrement_strong_count_RustOpaque_Node( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_Node( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_NodePtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_Node'); + late final _rust_arc_decrement_strong_count_RustOpaque_Node = + _rust_arc_decrement_strong_count_RustOpaque_NodePtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilderPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder'); + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder = + _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilderPtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilderPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder'); + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder = + _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilderPtr + .asFunction)>(); + + void rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilder( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilder( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilderPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilder'); + late final _rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilder = + _rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilderPtr + .asFunction)>(); + + void rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilder( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilder( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilderPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilder'); + late final _rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilder = + _rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilderPtr + .asFunction)>(); + + void rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraph( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraph( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraphPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraph'); + late final _rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraph = + _rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraphPtr + .asFunction)>(); + + void rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraph( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraph( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraphPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraph'); + late final _rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraph = + _rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraphPtr + .asFunction)>(); + + void rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( + ptr, + ); + } - void rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore( + late final _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11PaymentPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment'); + late final _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment = + _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11PaymentPtr + .asFunction)>(); + + void rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11PaymentPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment'); + late final _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment = + _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11PaymentPtr + .asFunction)>(); + + void rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPaymentPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment'); + late final _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment = + _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPaymentPtr + .asFunction)>(); + + void rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPaymentPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment'); + late final _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment = + _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPaymentPtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( ffi.Pointer ptr, ) { - return _rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore( + return _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( ptr, ); } - late final _rust_arc_increment_strong_count_RustOpaque_NodeSqliteStorePtr = + late final _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPaymentPtr = _lookup)>>( - 'frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore'); - late final _rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore = - _rust_arc_increment_strong_count_RustOpaque_NodeSqliteStorePtr + 'frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment'); + late final _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment = + _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPaymentPtr .asFunction)>(); - void rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore( + void + rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( ffi.Pointer ptr, ) { - return _rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore( + return _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( ptr, ); } - late final _rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStorePtr = + late final _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPaymentPtr = _lookup)>>( - 'frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore'); - late final _rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore = - _rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStorePtr + 'frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment'); + late final _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment = + _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPaymentPtr .asFunction)>(); ffi.Pointer cst_new_box_autoadd_address() { @@ -2725,6 +5927,19 @@ class LdkCoreWire implements BaseWire { late final _cst_new_box_autoadd_address = _cst_new_box_autoadd_addressPtr .asFunction Function()>(); + ffi.Pointer + cst_new_box_autoadd_anchor_channels_config() { + return _cst_new_box_autoadd_anchor_channels_config(); + } + + late final _cst_new_box_autoadd_anchor_channels_configPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_anchor_channels_config'); + late final _cst_new_box_autoadd_anchor_channels_config = + _cst_new_box_autoadd_anchor_channels_configPtr.asFunction< + ffi.Pointer Function()>(); + ffi.Pointer cst_new_box_autoadd_bolt_11_invoice() { return _cst_new_box_autoadd_bolt_11_invoice(); } @@ -2736,6 +5951,19 @@ class LdkCoreWire implements BaseWire { _cst_new_box_autoadd_bolt_11_invoicePtr .asFunction Function()>(); + ffi.Pointer + cst_new_box_autoadd_bolt_12_parse_error() { + return _cst_new_box_autoadd_bolt_12_parse_error(); + } + + late final _cst_new_box_autoadd_bolt_12_parse_errorPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_bolt_12_parse_error'); + late final _cst_new_box_autoadd_bolt_12_parse_error = + _cst_new_box_autoadd_bolt_12_parse_errorPtr + .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_chain_data_source_config() { return _cst_new_box_autoadd_chain_data_source_config(); @@ -2771,6 +5999,41 @@ class LdkCoreWire implements BaseWire { _cst_new_box_autoadd_channel_idPtr .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_channel_info() { + return _cst_new_box_autoadd_channel_info(); + } + + late final _cst_new_box_autoadd_channel_infoPtr = _lookup< + ffi.NativeFunction Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_channel_info'); + late final _cst_new_box_autoadd_channel_info = + _cst_new_box_autoadd_channel_infoPtr + .asFunction Function()>(); + + ffi.Pointer + cst_new_box_autoadd_channel_update_info() { + return _cst_new_box_autoadd_channel_update_info(); + } + + late final _cst_new_box_autoadd_channel_update_infoPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_channel_update_info'); + late final _cst_new_box_autoadd_channel_update_info = + _cst_new_box_autoadd_channel_update_infoPtr + .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(); } @@ -2781,6 +6044,17 @@ class LdkCoreWire implements BaseWire { late final _cst_new_box_autoadd_config = _cst_new_box_autoadd_configPtr .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_decode_error() { + return _cst_new_box_autoadd_decode_error(); + } + + late final _cst_new_box_autoadd_decode_errorPtr = _lookup< + ffi.NativeFunction Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_decode_error'); + late final _cst_new_box_autoadd_decode_error = + _cst_new_box_autoadd_decode_errorPtr + .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_entropy_source_config() { return _cst_new_box_autoadd_entropy_source_config(); @@ -2809,13 +6083,39 @@ class LdkCoreWire implements BaseWire { return _cst_new_box_autoadd_gossip_source_config(); } - late final _cst_new_box_autoadd_gossip_source_configPtr = _lookup< + late final _cst_new_box_autoadd_gossip_source_configPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_gossip_source_config'); + late final _cst_new_box_autoadd_gossip_source_config = + _cst_new_box_autoadd_gossip_source_configPtr + .asFunction Function()>(); + + ffi.Pointer + cst_new_box_autoadd_ldk_bolt_11_payment() { + return _cst_new_box_autoadd_ldk_bolt_11_payment(); + } + + late final _cst_new_box_autoadd_ldk_bolt_11_paymentPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_ldk_bolt_11_payment'); + late final _cst_new_box_autoadd_ldk_bolt_11_payment = + _cst_new_box_autoadd_ldk_bolt_11_paymentPtr + .asFunction Function()>(); + + ffi.Pointer + cst_new_box_autoadd_ldk_bolt_12_payment() { + return _cst_new_box_autoadd_ldk_bolt_12_payment(); + } + + late final _cst_new_box_autoadd_ldk_bolt_12_paymentPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function()>>( - 'frbgen_ldk_node_cst_new_box_autoadd_gossip_source_config'); - late final _cst_new_box_autoadd_gossip_source_config = - _cst_new_box_autoadd_gossip_source_configPtr - .asFunction Function()>(); + ffi.Pointer Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_ldk_bolt_12_payment'); + late final _cst_new_box_autoadd_ldk_bolt_12_payment = + _cst_new_box_autoadd_ldk_bolt_12_paymentPtr + .asFunction Function()>(); ffi.Pointer cst_new_box_autoadd_ldk_mnemonic() { return _cst_new_box_autoadd_ldk_mnemonic(); @@ -2828,6 +6128,19 @@ class LdkCoreWire implements BaseWire { _cst_new_box_autoadd_ldk_mnemonicPtr .asFunction Function()>(); + ffi.Pointer + cst_new_box_autoadd_ldk_network_graph() { + return _cst_new_box_autoadd_ldk_network_graph(); + } + + late final _cst_new_box_autoadd_ldk_network_graphPtr = _lookup< + ffi + .NativeFunction Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_ldk_network_graph'); + late final _cst_new_box_autoadd_ldk_network_graph = + _cst_new_box_autoadd_ldk_network_graphPtr + .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_ldk_node() { return _cst_new_box_autoadd_ldk_node(); } @@ -2838,6 +6151,122 @@ class LdkCoreWire implements BaseWire { late final _cst_new_box_autoadd_ldk_node = _cst_new_box_autoadd_ldk_nodePtr .asFunction Function()>(); + ffi.Pointer + cst_new_box_autoadd_ldk_on_chain_payment() { + return _cst_new_box_autoadd_ldk_on_chain_payment(); + } + + late final _cst_new_box_autoadd_ldk_on_chain_paymentPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_ldk_on_chain_payment'); + late final _cst_new_box_autoadd_ldk_on_chain_payment = + _cst_new_box_autoadd_ldk_on_chain_paymentPtr + .asFunction Function()>(); + + ffi.Pointer + cst_new_box_autoadd_ldk_spontaneous_payment() { + return _cst_new_box_autoadd_ldk_spontaneous_payment(); + } + + late final _cst_new_box_autoadd_ldk_spontaneous_paymentPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_ldk_spontaneous_payment'); + late final _cst_new_box_autoadd_ldk_spontaneous_payment = + _cst_new_box_autoadd_ldk_spontaneous_paymentPtr.asFunction< + ffi.Pointer 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_lsp_fee_limits() { + return _cst_new_box_autoadd_lsp_fee_limits(); + } + + late final _cst_new_box_autoadd_lsp_fee_limitsPtr = _lookup< + ffi.NativeFunction Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_lsp_fee_limits'); + late final _cst_new_box_autoadd_lsp_fee_limits = + _cst_new_box_autoadd_lsp_fee_limitsPtr + .asFunction 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_node_announcement_info() { + return _cst_new_box_autoadd_node_announcement_info(); + } + + late final _cst_new_box_autoadd_node_announcement_infoPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_node_announcement_info'); + late final _cst_new_box_autoadd_node_announcement_info = + _cst_new_box_autoadd_node_announcement_infoPtr.asFunction< + ffi.Pointer Function()>(); + + ffi.Pointer cst_new_box_autoadd_node_id() { + return _cst_new_box_autoadd_node_id(); + } + + late final _cst_new_box_autoadd_node_idPtr = + _lookup Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_node_id'); + late final _cst_new_box_autoadd_node_id = _cst_new_box_autoadd_node_idPtr + .asFunction Function()>(); + + ffi.Pointer cst_new_box_autoadd_node_info() { + return _cst_new_box_autoadd_node_info(); + } + + late final _cst_new_box_autoadd_node_infoPtr = + _lookup Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_node_info'); + late final _cst_new_box_autoadd_node_info = _cst_new_box_autoadd_node_infoPtr + .asFunction Function()>(); + + ffi.Pointer cst_new_box_autoadd_offer() { + return _cst_new_box_autoadd_offer(); + } + + late final _cst_new_box_autoadd_offerPtr = + _lookup Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_offer'); + late final _cst_new_box_autoadd_offer = _cst_new_box_autoadd_offerPtr + .asFunction Function()>(); + + ffi.Pointer cst_new_box_autoadd_offer_id() { + return _cst_new_box_autoadd_offer_id(); + } + + late final _cst_new_box_autoadd_offer_idPtr = + _lookup Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_offer_id'); + late final _cst_new_box_autoadd_offer_id = _cst_new_box_autoadd_offer_idPtr + .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_out_point() { return _cst_new_box_autoadd_out_point(); } @@ -2859,6 +6288,21 @@ 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(); } @@ -2870,6 +6314,17 @@ class LdkCoreWire implements BaseWire { _cst_new_box_autoadd_payment_hashPtr .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_payment_id() { + return _cst_new_box_autoadd_payment_id(); + } + + late final _cst_new_box_autoadd_payment_idPtr = + _lookup Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_payment_id'); + late final _cst_new_box_autoadd_payment_id = + _cst_new_box_autoadd_payment_idPtr + .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_payment_preimage() { return _cst_new_box_autoadd_payment_preimage(); @@ -2905,6 +6360,16 @@ class LdkCoreWire implements BaseWire { _cst_new_box_autoadd_public_keyPtr .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_refund() { + return _cst_new_box_autoadd_refund(); + } + + late final _cst_new_box_autoadd_refundPtr = + _lookup Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_refund'); + late final _cst_new_box_autoadd_refund = _cst_new_box_autoadd_refundPtr + .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_socket_address() { return _cst_new_box_autoadd_socket_address(); } @@ -2916,6 +6381,30 @@ 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, ) { @@ -2970,6 +6459,37 @@ 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_node_id( + int len, + ) { + return _cst_new_list_node_id( + len, + ); + } + + late final _cst_new_list_node_idPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Int32)>>('frbgen_ldk_node_cst_new_list_node_id'); + late final _cst_new_list_node_id = _cst_new_list_node_idPtr + .asFunction Function(int)>(); + ffi.Pointer cst_new_list_payment_details( int len, ) { @@ -3000,6 +6520,39 @@ 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_64_strict( + int len, + ) { + return _cst_new_list_prim_u_64_strict( + len, + ); + } + + late final _cst_new_list_prim_u_64_strictPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Int32)>>('frbgen_ldk_node_cst_new_list_prim_u_64_strict'); + late final _cst_new_list_prim_u_64_strict = _cst_new_list_prim_u_64_strictPtr + .asFunction Function(int)>(); + ffi.Pointer cst_new_list_prim_u_8_loose( int len, ) { @@ -3071,10 +6624,19 @@ class LdkCoreWire implements BaseWire { _dummy_method_to_enforce_bundlingPtr.asFunction(); } -typedef DartPostCObjectFnType = ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function(DartPort port_id, ffi.Pointer message)>>; +typedef DartPostCObjectFnType + = ffi.Pointer>; +typedef DartPostCObjectFnTypeFunction = ffi.Bool Function( + DartPort port_id, ffi.Pointer message); +typedef DartDartPostCObjectFnTypeFunction = bool Function( + DartDartPort port_id, ffi.Pointer message); typedef DartPort = ffi.Int64; +typedef DartDartPort = int; + +final class wire_cst_ldk_bolt_11_payment extends ffi.Struct { + @ffi.UintPtr() + external int ptr; +} final class wire_cst_list_prim_u_8_strict extends ffi.Struct { external ffi.Pointer ptr; @@ -3083,6 +6645,31 @@ final class wire_cst_list_prim_u_8_strict extends ffi.Struct { external int len; } +final class wire_cst_payment_hash extends ffi.Struct { + external ffi.Pointer data; +} + +final class wire_cst_payment_preimage extends ffi.Struct { + external ffi.Pointer data; +} + +final class wire_cst_bolt_11_invoice extends ffi.Struct { + external ffi.Pointer signed_raw_invoice; +} + +final class wire_cst_ldk_bolt_12_payment extends ffi.Struct { + @ffi.UintPtr() + external int ptr; +} + +final class wire_cst_refund extends ffi.Struct { + external ffi.Pointer s; +} + +final class wire_cst_offer extends ffi.Struct { + external ffi.Pointer s; +} + final class wire_cst_SocketAddress_TcpIpV4 extends ffi.Struct { external ffi.Pointer addr; @@ -3158,6 +6745,13 @@ final class wire_cst_list_public_key extends ffi.Struct { external int len; } +final class wire_cst_anchor_channels_config extends ffi.Struct { + external ffi.Pointer trusted_peers_no_reserve; + + @ffi.Uint64() + external int per_channel_reserve_sats; +} + final class wire_cst_config extends ffi.Struct { external ffi.Pointer storage_dir_path; @@ -3187,6 +6781,8 @@ final class wire_cst_config extends ffi.Struct { @ffi.Int32() external int log_level; + + external ffi.Pointer anchor_channels_config; } final class wire_cst_ChainDataSourceConfig_Esplora extends ffi.Struct { @@ -3252,12 +6848,34 @@ 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_network_graph extends ffi.Struct { + @ffi.UintPtr() + external int ptr; +} + +final class wire_cst_node_id extends ffi.Struct { + external ffi.Pointer compressed; +} + final class wire_cst_ldk_node extends ffi.Struct { @ffi.UintPtr() external int ptr; } -final class wire_cst_channel_id extends ffi.Struct { +final class wire_cst_user_channel_id extends ffi.Struct { external ffi.Pointer data; } @@ -3294,7 +6912,7 @@ final class wire_cst_channel_config extends ffi.Struct { @ffi.Uint16() external int cltv_expiry_delta; - external wire_cst_max_dust_htlc_exposure max_dust_htlc_exposure; + external ffi.Pointer max_dust_htlc_exposure; @ffi.Uint64() external int force_close_avoidance_max_fee_satoshis; @@ -3303,59 +6921,178 @@ final class wire_cst_channel_config extends ffi.Struct { external bool accept_underpaying_htlcs; } -final class wire_cst_payment_hash extends ffi.Struct { - external ffi.Pointer data; +final class wire_cst_payment_id extends ffi.Struct { + external ffi.Pointer field0; +} + +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_ldk_on_chain_payment extends ffi.Struct { + @ffi.UintPtr() + external int ptr; } 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_ldk_spontaneous_payment extends ffi.Struct { + @ffi.UintPtr() + external int ptr; } -final class wire_cst_list_prim_u_8_loose extends ffi.Struct { - external ffi.Pointer ptr; +final class wire_cst_Bolt12ParseError_Bech32 extends ffi.Struct { + external ffi.Pointer field0; +} + +final class wire_cst_DecodeError_Io extends ffi.Struct { + external ffi.Pointer field0; +} + +final class DecodeErrorKind extends ffi.Union { + external wire_cst_DecodeError_Io Io; +} +final class wire_cst_decode_error extends ffi.Struct { @ffi.Int32() - external int len; + external int tag; + + external DecodeErrorKind kind; } -final class wire_cst_Event_PaymentSuccessful extends ffi.Struct { - external ffi.Pointer payment_hash; +final class wire_cst_Bolt12ParseError_Decode extends ffi.Struct { + external ffi.Pointer field0; } -final class wire_cst_Event_PaymentFailed extends ffi.Struct { - external ffi.Pointer payment_hash; +final class wire_cst_Bolt12ParseError_InvalidSemantics extends ffi.Struct { + external ffi.Pointer field0; } -final class wire_cst_Event_PaymentReceived extends ffi.Struct { - external ffi.Pointer payment_hash; +final class wire_cst_Bolt12ParseError_InvalidSignature extends ffi.Struct { + external ffi.Pointer field0; +} + +final class Bolt12ParseErrorKind extends ffi.Union { + external wire_cst_Bolt12ParseError_Bech32 Bech32; + + external wire_cst_Bolt12ParseError_Decode Decode; + + external wire_cst_Bolt12ParseError_InvalidSemantics InvalidSemantics; + + external wire_cst_Bolt12ParseError_InvalidSignature InvalidSignature; +} + +final class wire_cst_bolt_12_parse_error extends ffi.Struct { + @ffi.Int32() + external int tag; + + external Bolt12ParseErrorKind kind; +} + +final class wire_cst_channel_id extends ffi.Struct { + external ffi.Pointer data; +} + +final class wire_cst_routing_fees extends ffi.Struct { + @ffi.Uint32() + external int base_msat; + + @ffi.Uint32() + external int proportional_millionths; +} + +final class wire_cst_channel_update_info extends ffi.Struct { + @ffi.Uint32() + external int last_update; + + @ffi.Bool() + external bool enabled; + + @ffi.Uint16() + external int cltv_expiry_delta; @ffi.Uint64() - external int amount_msat; + external int htlc_minimum_msat; + + @ffi.Uint64() + external int htlc_maximum_msat; + + external wire_cst_routing_fees fees; } -final class wire_cst_user_channel_id extends ffi.Struct { +final class wire_cst_channel_info extends ffi.Struct { + external wire_cst_node_id node_one; + + external ffi.Pointer one_to_two; + + external wire_cst_node_id node_two; + + external ffi.Pointer two_to_one; + + external ffi.Pointer capacity_sats; +} + +final class wire_cst_ClosureReason_CounterpartyForceClosed extends ffi.Struct { + external ffi.Pointer peer_msg; +} + +final class wire_cst_ClosureReason_ProcessingError extends ffi.Struct { + external ffi.Pointer err; +} + +final class ClosureReasonKind extends ffi.Union { + external wire_cst_ClosureReason_CounterpartyForceClosed + CounterpartyForceClosed; + + external wire_cst_ClosureReason_ProcessingError ProcessingError; +} + +final class wire_cst_closure_reason extends ffi.Struct { + @ffi.Int32() + external int tag; + + external ClosureReasonKind kind; +} + +final class wire_cst_Event_PaymentClaimable extends ffi.Struct { + external ffi.Pointer payment_id; + + external ffi.Pointer payment_hash; + @ffi.Uint64() - external int data; + external int claimable_amount_msat; + + external ffi.Pointer claim_deadline; } -final class wire_cst_Event_ChannelReady extends ffi.Struct { - external ffi.Pointer channel_id; +final class wire_cst_Event_PaymentSuccessful extends ffi.Struct { + external ffi.Pointer payment_id; - external ffi.Pointer user_channel_id; + external ffi.Pointer payment_hash; - external ffi.Pointer counterparty_node_id; + external ffi.Pointer fee_paid_msat; } -final class wire_cst_Event_ChannelClosed extends ffi.Struct { - external ffi.Pointer channel_id; +final class wire_cst_Event_PaymentFailed extends ffi.Struct { + external ffi.Pointer payment_id; - external ffi.Pointer user_channel_id; + external ffi.Pointer payment_hash; - external ffi.Pointer counterparty_node_id; + external ffi.Pointer reason; +} + +final class wire_cst_Event_PaymentReceived extends ffi.Struct { + external ffi.Pointer payment_id; + + external ffi.Pointer payment_hash; + + @ffi.Uint64() + external int amount_msat; } final class wire_cst_txid extends ffi.Struct { @@ -3381,18 +7118,38 @@ final class wire_cst_Event_ChannelPending extends ffi.Struct { external ffi.Pointer funding_txo; } +final class wire_cst_Event_ChannelReady extends ffi.Struct { + external ffi.Pointer channel_id; + + external ffi.Pointer user_channel_id; + + external ffi.Pointer counterparty_node_id; +} + +final class wire_cst_Event_ChannelClosed extends ffi.Struct { + external ffi.Pointer channel_id; + + external ffi.Pointer user_channel_id; + + external ffi.Pointer counterparty_node_id; + + external ffi.Pointer reason; +} + final class EventKind extends ffi.Union { + external wire_cst_Event_PaymentClaimable PaymentClaimable; + external wire_cst_Event_PaymentSuccessful PaymentSuccessful; external wire_cst_Event_PaymentFailed PaymentFailed; 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 { @@ -3402,20 +7159,107 @@ final class wire_cst_event extends ffi.Struct { external EventKind kind; } -final class wire_cst_payment_preimage extends ffi.Struct { - external ffi.Pointer data; +final class wire_cst_lsp_fee_limits extends ffi.Struct { + external ffi.Pointer max_total_opening_fee_msat; + + external ffi.Pointer max_proportional_opening_fee_ppm_msat; +} + +final class wire_cst_node_announcement_info extends ffi.Struct { + @ffi.Uint32() + external int last_update; + + external ffi.Pointer alias; + + external ffi.Pointer addresses; +} + +final class wire_cst_list_prim_u_64_strict extends ffi.Struct { + external ffi.Pointer ptr; + + @ffi.Int32() + external int len; +} + +final class wire_cst_node_info extends ffi.Struct { + external ffi.Pointer channels; + + external ffi.Pointer announcement_info; +} + +final class wire_cst_offer_id extends ffi.Struct { + external ffi.Pointer field0; } final class wire_cst_payment_secret extends ffi.Struct { external ffi.Pointer data; } -final class wire_cst_payment_details extends ffi.Struct { - external wire_cst_payment_hash hash; +final class wire_cst_PaymentKind_Bolt11 extends ffi.Struct { + external ffi.Pointer hash; + + external ffi.Pointer preimage; + + external ffi.Pointer secret; +} + +final class wire_cst_PaymentKind_Bolt11Jit extends ffi.Struct { + external ffi.Pointer hash; + + external ffi.Pointer preimage; + + external ffi.Pointer secret; + + external ffi.Pointer lsp_fee_limits; +} + +final class wire_cst_PaymentKind_Spontaneous extends ffi.Struct { + external ffi.Pointer hash; + + external ffi.Pointer preimage; +} + +final class wire_cst_PaymentKind_Bolt12Offer extends ffi.Struct { + external ffi.Pointer hash; + + external ffi.Pointer preimage; + + external ffi.Pointer secret; + + external ffi.Pointer offer_id; +} + +final class wire_cst_PaymentKind_Bolt12Refund extends ffi.Struct { + external ffi.Pointer hash; external ffi.Pointer preimage; external ffi.Pointer secret; +} + +final class PaymentKindKind extends ffi.Union { + external wire_cst_PaymentKind_Bolt11 Bolt11; + + external wire_cst_PaymentKind_Bolt11Jit Bolt11Jit; + + external wire_cst_PaymentKind_Spontaneous Spontaneous; + + external wire_cst_PaymentKind_Bolt12Offer Bolt12Offer; + + external wire_cst_PaymentKind_Bolt12Refund Bolt12Refund; +} + +final class wire_cst_payment_kind extends ffi.Struct { + @ffi.Int32() + external int tag; + + external PaymentKindKind kind; +} + +final class wire_cst_payment_details extends ffi.Struct { + external wire_cst_payment_id id; + + external wire_cst_payment_kind kind; external ffi.Pointer amount_msat; @@ -3431,7 +7275,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; @@ -3443,9 +7287,6 @@ 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; @@ -3467,6 +7308,38 @@ 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 { @@ -3476,6 +7349,125 @@ 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_node_id 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; @@ -3498,3 +7490,130 @@ 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_bolt_12_invoice extends ffi.Struct { + external ffi.Pointer data; +} + +final class wire_cst_LdkNodeError_Decode extends ffi.Struct { + external ffi.Pointer field0; +} + +final class wire_cst_LdkNodeError_Bolt12Parse extends ffi.Struct { + external ffi.Pointer field0; +} + +final class LdkNodeErrorKind extends ffi.Union { + external wire_cst_LdkNodeError_Decode Decode; + + external wire_cst_LdkNodeError_Bolt12Parse Bolt12Parse; +} + +final class wire_cst_ldk_node_error extends ffi.Struct { + @ffi.Int32() + external int tag; + + external LdkNodeErrorKind kind; +} + +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 deleted file mode 100644 index 7aa410c..0000000 --- a/lib/src/generated/frb_generated.web.dart +++ /dev/null @@ -1,1846 +0,0 @@ -// This file is automatically generated, so please do not edit it. -// 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 - -import 'api/error.dart'; -import 'api/node.dart'; -import 'api/types.dart'; -import 'dart:async'; -import 'dart:convert'; -import 'frb_generated.dart'; -import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated_web.dart'; - -abstract class LdkCoreApiImplPlatform extends BaseApiImpl { - LdkCoreApiImplPlatform({ - required super.handler, - required super.wire, - required super.generalizedFrbRustBinding, - required super.portManager, - }); - - CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_NodeSqliteStorePtr => - wire.rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore; - - @protected - NodeSqliteStore dco_decode_RustOpaque_NodeSqliteStore(dynamic raw); - - @protected - String dco_decode_String(dynamic raw); - - @protected - Address dco_decode_address(dynamic raw); - - @protected - Bolt11Invoice dco_decode_bolt_11_invoice(dynamic raw); - - @protected - bool dco_decode_bool(dynamic raw); - - @protected - Address dco_decode_box_autoadd_address(dynamic raw); - - @protected - Bolt11Invoice dco_decode_box_autoadd_bolt_11_invoice(dynamic raw); - - @protected - ChainDataSourceConfig dco_decode_box_autoadd_chain_data_source_config( - dynamic raw); - - @protected - ChannelConfig dco_decode_box_autoadd_channel_config(dynamic raw); - - @protected - ChannelId dco_decode_box_autoadd_channel_id(dynamic raw); - - @protected - Config dco_decode_box_autoadd_config(dynamic raw); - - @protected - EntropySourceConfig dco_decode_box_autoadd_entropy_source_config(dynamic raw); - - @protected - Event dco_decode_box_autoadd_event(dynamic raw); - - @protected - GossipSourceConfig dco_decode_box_autoadd_gossip_source_config(dynamic raw); - - @protected - LdkMnemonic dco_decode_box_autoadd_ldk_mnemonic(dynamic raw); - - @protected - LdkNode dco_decode_box_autoadd_ldk_node(dynamic raw); - - @protected - OutPoint dco_decode_box_autoadd_out_point(dynamic raw); - - @protected - PaymentDetails dco_decode_box_autoadd_payment_details(dynamic raw); - - @protected - PaymentHash dco_decode_box_autoadd_payment_hash(dynamic raw); - - @protected - PaymentPreimage dco_decode_box_autoadd_payment_preimage(dynamic raw); - - @protected - PaymentSecret dco_decode_box_autoadd_payment_secret(dynamic raw); - - @protected - PublicKey dco_decode_box_autoadd_public_key(dynamic raw); - - @protected - SocketAddress dco_decode_box_autoadd_socket_address(dynamic raw); - - @protected - int dco_decode_box_autoadd_u_32(dynamic raw); - - @protected - int dco_decode_box_autoadd_u_64(dynamic raw); - - @protected - UserChannelId dco_decode_box_autoadd_user_channel_id(dynamic raw); - - @protected - BuilderException dco_decode_builder_exception(dynamic raw); - - @protected - ChainDataSourceConfig dco_decode_chain_data_source_config(dynamic raw); - - @protected - ChannelConfig dco_decode_channel_config(dynamic raw); - - @protected - ChannelDetails dco_decode_channel_details(dynamic raw); - - @protected - ChannelId dco_decode_channel_id(dynamic raw); - - @protected - Config dco_decode_config(dynamic raw); - - @protected - EntropySourceConfig dco_decode_entropy_source_config(dynamic raw); - - @protected - Event dco_decode_event(dynamic raw); - - @protected - GossipSourceConfig dco_decode_gossip_source_config(dynamic raw); - - @protected - int dco_decode_i_32(dynamic raw); - - @protected - LdkMnemonic dco_decode_ldk_mnemonic(dynamic raw); - - @protected - LdkNode dco_decode_ldk_node(dynamic raw); - - @protected - List dco_decode_list_channel_details(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_prim_u_8_loose(dynamic raw); - - @protected - Uint8List dco_decode_list_prim_u_8_strict(dynamic raw); - - @protected - List dco_decode_list_public_key(dynamic raw); - - @protected - List dco_decode_list_socket_address(dynamic raw); - - @protected - LogLevel dco_decode_log_level(dynamic raw); - - @protected - MaxDustHTLCExposure dco_decode_max_dust_htlc_exposure(dynamic raw); - - @protected - Network dco_decode_network(dynamic raw); - - @protected - NodeException dco_decode_node_exception(dynamic raw); - - @protected - String? dco_decode_opt_String(dynamic raw); - - @protected - ChainDataSourceConfig? dco_decode_opt_box_autoadd_chain_data_source_config( - dynamic raw); - - @protected - ChannelConfig? dco_decode_opt_box_autoadd_channel_config(dynamic raw); - - @protected - EntropySourceConfig? dco_decode_opt_box_autoadd_entropy_source_config( - dynamic raw); - - @protected - Event? dco_decode_opt_box_autoadd_event(dynamic raw); - - @protected - GossipSourceConfig? dco_decode_opt_box_autoadd_gossip_source_config( - dynamic raw); - - @protected - PaymentDetails? dco_decode_opt_box_autoadd_payment_details(dynamic raw); - - @protected - PaymentPreimage? dco_decode_opt_box_autoadd_payment_preimage(dynamic raw); - - @protected - PaymentSecret? dco_decode_opt_box_autoadd_payment_secret(dynamic raw); - - @protected - PublicKey? dco_decode_opt_box_autoadd_public_key(dynamic raw); - - @protected - int? dco_decode_opt_box_autoadd_u_32(dynamic raw); - - @protected - int? dco_decode_opt_box_autoadd_u_64(dynamic raw); - - @protected - List? dco_decode_opt_list_socket_address(dynamic raw); - - @protected - OutPoint dco_decode_out_point(dynamic raw); - - @protected - PaymentDetails dco_decode_payment_details(dynamic raw); - - @protected - PaymentDirection dco_decode_payment_direction(dynamic raw); - - @protected - PaymentHash dco_decode_payment_hash(dynamic raw); - - @protected - PaymentPreimage dco_decode_payment_preimage(dynamic raw); - - @protected - PaymentSecret dco_decode_payment_secret(dynamic raw); - - @protected - PaymentStatus dco_decode_payment_status(dynamic raw); - - @protected - PeerDetails dco_decode_peer_details(dynamic raw); - - @protected - PublicKey dco_decode_public_key(dynamic raw); - - @protected - SocketAddress dco_decode_socket_address(dynamic raw); - - @protected - Txid dco_decode_txid(dynamic raw); - - @protected - int dco_decode_u_16(dynamic raw); - - @protected - int dco_decode_u_32(dynamic raw); - - @protected - int dco_decode_u_64(dynamic raw); - - @protected - int dco_decode_u_8(dynamic raw); - - @protected - U8Array12 dco_decode_u_8_array_12(dynamic raw); - - @protected - U8Array16 dco_decode_u_8_array_16(dynamic raw); - - @protected - U8Array32 dco_decode_u_8_array_32(dynamic raw); - - @protected - U8Array4 dco_decode_u_8_array_4(dynamic raw); - - @protected - U8Array64 dco_decode_u_8_array_64(dynamic raw); - - @protected - void dco_decode_unit(dynamic raw); - - @protected - UserChannelId dco_decode_user_channel_id(dynamic raw); - - @protected - int dco_decode_usize(dynamic raw); - - @protected - NodeSqliteStore sse_decode_RustOpaque_NodeSqliteStore( - SseDeserializer deserializer); - - @protected - String sse_decode_String(SseDeserializer deserializer); - - @protected - Address sse_decode_address(SseDeserializer deserializer); - - @protected - Bolt11Invoice sse_decode_bolt_11_invoice(SseDeserializer deserializer); - - @protected - bool sse_decode_bool(SseDeserializer deserializer); - - @protected - Address sse_decode_box_autoadd_address(SseDeserializer deserializer); - - @protected - Bolt11Invoice sse_decode_box_autoadd_bolt_11_invoice( - SseDeserializer deserializer); - - @protected - ChainDataSourceConfig sse_decode_box_autoadd_chain_data_source_config( - SseDeserializer deserializer); - - @protected - ChannelConfig sse_decode_box_autoadd_channel_config( - SseDeserializer deserializer); - - @protected - ChannelId sse_decode_box_autoadd_channel_id(SseDeserializer deserializer); - - @protected - Config sse_decode_box_autoadd_config(SseDeserializer deserializer); - - @protected - EntropySourceConfig sse_decode_box_autoadd_entropy_source_config( - SseDeserializer deserializer); - - @protected - Event sse_decode_box_autoadd_event(SseDeserializer deserializer); - - @protected - GossipSourceConfig sse_decode_box_autoadd_gossip_source_config( - SseDeserializer deserializer); - - @protected - LdkMnemonic sse_decode_box_autoadd_ldk_mnemonic(SseDeserializer deserializer); - - @protected - LdkNode sse_decode_box_autoadd_ldk_node(SseDeserializer deserializer); - - @protected - OutPoint sse_decode_box_autoadd_out_point(SseDeserializer deserializer); - - @protected - PaymentDetails sse_decode_box_autoadd_payment_details( - SseDeserializer deserializer); - - @protected - PaymentHash sse_decode_box_autoadd_payment_hash(SseDeserializer deserializer); - - @protected - PaymentPreimage sse_decode_box_autoadd_payment_preimage( - SseDeserializer deserializer); - - @protected - PaymentSecret sse_decode_box_autoadd_payment_secret( - SseDeserializer deserializer); - - @protected - PublicKey sse_decode_box_autoadd_public_key(SseDeserializer deserializer); - - @protected - SocketAddress sse_decode_box_autoadd_socket_address( - SseDeserializer deserializer); - - @protected - int sse_decode_box_autoadd_u_32(SseDeserializer deserializer); - - @protected - int sse_decode_box_autoadd_u_64(SseDeserializer deserializer); - - @protected - UserChannelId sse_decode_box_autoadd_user_channel_id( - SseDeserializer deserializer); - - @protected - BuilderException sse_decode_builder_exception(SseDeserializer deserializer); - - @protected - ChainDataSourceConfig sse_decode_chain_data_source_config( - SseDeserializer deserializer); - - @protected - ChannelConfig sse_decode_channel_config(SseDeserializer deserializer); - - @protected - ChannelDetails sse_decode_channel_details(SseDeserializer deserializer); - - @protected - ChannelId sse_decode_channel_id(SseDeserializer deserializer); - - @protected - Config sse_decode_config(SseDeserializer deserializer); - - @protected - EntropySourceConfig sse_decode_entropy_source_config( - SseDeserializer deserializer); - - @protected - Event sse_decode_event(SseDeserializer deserializer); - - @protected - GossipSourceConfig sse_decode_gossip_source_config( - SseDeserializer deserializer); - - @protected - int sse_decode_i_32(SseDeserializer deserializer); - - @protected - LdkMnemonic sse_decode_ldk_mnemonic(SseDeserializer deserializer); - - @protected - LdkNode sse_decode_ldk_node(SseDeserializer deserializer); - - @protected - List sse_decode_list_channel_details( - SseDeserializer deserializer); - - @protected - List sse_decode_list_payment_details( - SseDeserializer deserializer); - - @protected - List sse_decode_list_peer_details(SseDeserializer deserializer); - - @protected - List sse_decode_list_prim_u_8_loose(SseDeserializer deserializer); - - @protected - Uint8List sse_decode_list_prim_u_8_strict(SseDeserializer deserializer); - - @protected - List sse_decode_list_public_key(SseDeserializer deserializer); - - @protected - List sse_decode_list_socket_address( - SseDeserializer deserializer); - - @protected - LogLevel sse_decode_log_level(SseDeserializer deserializer); - - @protected - MaxDustHTLCExposure sse_decode_max_dust_htlc_exposure( - SseDeserializer deserializer); - - @protected - Network sse_decode_network(SseDeserializer deserializer); - - @protected - NodeException sse_decode_node_exception(SseDeserializer deserializer); - - @protected - String? sse_decode_opt_String(SseDeserializer deserializer); - - @protected - ChainDataSourceConfig? sse_decode_opt_box_autoadd_chain_data_source_config( - SseDeserializer deserializer); - - @protected - ChannelConfig? sse_decode_opt_box_autoadd_channel_config( - SseDeserializer deserializer); - - @protected - EntropySourceConfig? sse_decode_opt_box_autoadd_entropy_source_config( - SseDeserializer deserializer); - - @protected - Event? sse_decode_opt_box_autoadd_event(SseDeserializer deserializer); - - @protected - GossipSourceConfig? sse_decode_opt_box_autoadd_gossip_source_config( - SseDeserializer deserializer); - - @protected - PaymentDetails? sse_decode_opt_box_autoadd_payment_details( - SseDeserializer deserializer); - - @protected - PaymentPreimage? sse_decode_opt_box_autoadd_payment_preimage( - SseDeserializer deserializer); - - @protected - PaymentSecret? sse_decode_opt_box_autoadd_payment_secret( - SseDeserializer deserializer); - - @protected - PublicKey? sse_decode_opt_box_autoadd_public_key( - SseDeserializer deserializer); - - @protected - int? sse_decode_opt_box_autoadd_u_32(SseDeserializer deserializer); - - @protected - int? sse_decode_opt_box_autoadd_u_64(SseDeserializer deserializer); - - @protected - List? sse_decode_opt_list_socket_address( - SseDeserializer deserializer); - - @protected - OutPoint sse_decode_out_point(SseDeserializer deserializer); - - @protected - PaymentDetails sse_decode_payment_details(SseDeserializer deserializer); - - @protected - PaymentDirection sse_decode_payment_direction(SseDeserializer deserializer); - - @protected - PaymentHash sse_decode_payment_hash(SseDeserializer deserializer); - - @protected - PaymentPreimage sse_decode_payment_preimage(SseDeserializer deserializer); - - @protected - PaymentSecret sse_decode_payment_secret(SseDeserializer deserializer); - - @protected - PaymentStatus sse_decode_payment_status(SseDeserializer deserializer); - - @protected - PeerDetails sse_decode_peer_details(SseDeserializer deserializer); - - @protected - PublicKey sse_decode_public_key(SseDeserializer deserializer); - - @protected - SocketAddress sse_decode_socket_address(SseDeserializer deserializer); - - @protected - Txid sse_decode_txid(SseDeserializer deserializer); - - @protected - int sse_decode_u_16(SseDeserializer deserializer); - - @protected - int sse_decode_u_32(SseDeserializer deserializer); - - @protected - int sse_decode_u_64(SseDeserializer deserializer); - - @protected - int sse_decode_u_8(SseDeserializer deserializer); - - @protected - U8Array12 sse_decode_u_8_array_12(SseDeserializer deserializer); - - @protected - U8Array16 sse_decode_u_8_array_16(SseDeserializer deserializer); - - @protected - U8Array32 sse_decode_u_8_array_32(SseDeserializer deserializer); - - @protected - U8Array4 sse_decode_u_8_array_4(SseDeserializer deserializer); - - @protected - U8Array64 sse_decode_u_8_array_64(SseDeserializer deserializer); - - @protected - void sse_decode_unit(SseDeserializer deserializer); - - @protected - UserChannelId sse_decode_user_channel_id(SseDeserializer deserializer); - - @protected - int sse_decode_usize(SseDeserializer deserializer); - - @protected - String cst_encode_String(String raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw; - } - - @protected - List cst_encode_address(Address raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_String(raw.s)]; - } - - @protected - List cst_encode_bolt_11_invoice(Bolt11Invoice raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_String(raw.signedRawInvoice)]; - } - - @protected - List cst_encode_box_autoadd_address(Address raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_address(raw); - } - - @protected - List cst_encode_box_autoadd_bolt_11_invoice(Bolt11Invoice raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_bolt_11_invoice(raw); - } - - @protected - List cst_encode_box_autoadd_chain_data_source_config( - ChainDataSourceConfig raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_chain_data_source_config(raw); - } - - @protected - List cst_encode_box_autoadd_channel_config(ChannelConfig raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_channel_config(raw); - } - - @protected - List cst_encode_box_autoadd_channel_id(ChannelId raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_channel_id(raw); - } - - @protected - List cst_encode_box_autoadd_config(Config raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_config(raw); - } - - @protected - List cst_encode_box_autoadd_entropy_source_config( - EntropySourceConfig raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_entropy_source_config(raw); - } - - @protected - List cst_encode_box_autoadd_event(Event raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_event(raw); - } - - @protected - List cst_encode_box_autoadd_gossip_source_config( - GossipSourceConfig raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_gossip_source_config(raw); - } - - @protected - List cst_encode_box_autoadd_ldk_mnemonic(LdkMnemonic raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_ldk_mnemonic(raw); - } - - @protected - List cst_encode_box_autoadd_ldk_node(LdkNode raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_ldk_node(raw); - } - - @protected - List cst_encode_box_autoadd_out_point(OutPoint raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_out_point(raw); - } - - @protected - List cst_encode_box_autoadd_payment_details(PaymentDetails raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_payment_details(raw); - } - - @protected - List cst_encode_box_autoadd_payment_hash(PaymentHash raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_payment_hash(raw); - } - - @protected - List cst_encode_box_autoadd_payment_preimage(PaymentPreimage raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_payment_preimage(raw); - } - - @protected - List cst_encode_box_autoadd_payment_secret(PaymentSecret raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_payment_secret(raw); - } - - @protected - List cst_encode_box_autoadd_public_key(PublicKey raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_public_key(raw); - } - - @protected - List cst_encode_box_autoadd_socket_address(SocketAddress raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_socket_address(raw); - } - - @protected - int cst_encode_box_autoadd_u_32(int raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_u_32(raw); - } - - @protected - Object cst_encode_box_autoadd_u_64(int raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_u_64(raw); - } - - @protected - List cst_encode_box_autoadd_user_channel_id(UserChannelId raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_user_channel_id(raw); - } - - @protected - List cst_encode_chain_data_source_config(ChainDataSourceConfig raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - if (raw is ChainDataSourceConfig_Esplora) { - return [0, cst_encode_String(raw.field0)]; - } - - throw Exception('unreachable'); - } - - @protected - List cst_encode_channel_config(ChannelConfig raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [ - cst_encode_u_32(raw.forwardingFeeProportionalMillionths), - cst_encode_u_32(raw.forwardingFeeBaseMsat), - cst_encode_u_16(raw.cltvExpiryDelta), - cst_encode_max_dust_htlc_exposure(raw.maxDustHtlcExposure), - cst_encode_u_64(raw.forceCloseAvoidanceMaxFeeSatoshis), - cst_encode_bool(raw.acceptUnderpayingHtlcs) - ]; - } - - @protected - List cst_encode_channel_details(ChannelDetails raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [ - cst_encode_channel_id(raw.channelId), - cst_encode_public_key(raw.counterpartyNodeId), - 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), - cst_encode_opt_box_autoadd_u_32(raw.confirmations), - cst_encode_bool(raw.isOutbound), - cst_encode_bool(raw.isChannelReady), - cst_encode_bool(raw.isUsable), - cst_encode_bool(raw.isPublic) - ]; - } - - @protected - List cst_encode_channel_id(ChannelId raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_u_8_array_32(raw.data)]; - } - - @protected - List cst_encode_config(Config raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [ - cst_encode_String(raw.storageDirPath), - cst_encode_opt_String(raw.logDirPath), - cst_encode_network(raw.network), - cst_encode_opt_list_socket_address(raw.listeningAddresses), - cst_encode_u_32(raw.defaultCltvExpiryDelta), - cst_encode_u_64(raw.onchainWalletSyncIntervalSecs), - cst_encode_u_64(raw.walletSyncIntervalSecs), - cst_encode_u_64(raw.feeRateCacheUpdateIntervalSecs), - cst_encode_list_public_key(raw.trustedPeers0Conf), - cst_encode_u_64(raw.probingLiquidityLimitMultiplier), - cst_encode_log_level(raw.logLevel) - ]; - } - - @protected - List cst_encode_entropy_source_config(EntropySourceConfig raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - if (raw is EntropySourceConfig_SeedFile) { - return [0, cst_encode_String(raw.field0)]; - } - if (raw is EntropySourceConfig_SeedBytes) { - return [1, cst_encode_u_8_array_64(raw.field0)]; - } - if (raw is EntropySourceConfig_Bip39Mnemonic) { - return [ - 2, - cst_encode_box_autoadd_ldk_mnemonic(raw.mnemonic), - cst_encode_opt_String(raw.passphrase) - ]; - } - - throw Exception('unreachable'); - } - - @protected - 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)]; - } - if (raw is Event_PaymentFailed) { - return [1, cst_encode_box_autoadd_payment_hash(raw.paymentHash)]; - } - if (raw is Event_PaymentReceived) { - return [ - 2, - cst_encode_box_autoadd_payment_hash(raw.paymentHash), - cst_encode_u_64(raw.amountMsat) - ]; - } - 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_opt_box_autoadd_public_key(raw.counterpartyNodeId) - ]; - } - if (raw is Event_ChannelClosed) { - return [ - 4, - 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) - ]; - } - 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_box_autoadd_channel_id(raw.formerTemporaryChannelId), - cst_encode_box_autoadd_public_key(raw.counterpartyNodeId), - cst_encode_box_autoadd_out_point(raw.fundingTxo) - ]; - } - - throw Exception('unreachable'); - } - - @protected - List cst_encode_gossip_source_config(GossipSourceConfig raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - if (raw is GossipSourceConfig_P2PNetwork) { - return [0]; - } - if (raw is GossipSourceConfig_RapidGossipSync) { - return [1, cst_encode_String(raw.field0)]; - } - - throw Exception('unreachable'); - } - - @protected - List cst_encode_ldk_mnemonic(LdkMnemonic raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_String(raw.seedPhrase)]; - } - - @protected - List cst_encode_ldk_node(LdkNode raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_RustOpaque_NodeSqliteStore(raw.ptr)]; - } - - @protected - List cst_encode_list_channel_details(List raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw.map(cst_encode_channel_details).toList(); - } - - @protected - List cst_encode_list_payment_details(List raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw.map(cst_encode_payment_details).toList(); - } - - @protected - List cst_encode_list_peer_details(List raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw.map(cst_encode_peer_details).toList(); - } - - @protected - List cst_encode_list_prim_u_8_loose(List raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw; - } - - @protected - Uint8List cst_encode_list_prim_u_8_strict(Uint8List raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw; - } - - @protected - List cst_encode_list_public_key(List raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw.map(cst_encode_public_key).toList(); - } - - @protected - List cst_encode_list_socket_address(List raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw.map(cst_encode_socket_address).toList(); - } - - @protected - List cst_encode_max_dust_htlc_exposure(MaxDustHTLCExposure raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - if (raw is MaxDustHTLCExposure_FixedLimitMsat) { - return [0, cst_encode_u_64(raw.field0)]; - } - if (raw is MaxDustHTLCExposure_FeeRateMultiplier) { - return [1, cst_encode_u_64(raw.field0)]; - } - - throw Exception('unreachable'); - } - - @protected - String? cst_encode_opt_String(String? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? null : cst_encode_String(raw); - } - - @protected - List? cst_encode_opt_box_autoadd_chain_data_source_config( - ChainDataSourceConfig? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null - ? null - : cst_encode_box_autoadd_chain_data_source_config(raw); - } - - @protected - List? cst_encode_opt_box_autoadd_channel_config(ChannelConfig? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? null : cst_encode_box_autoadd_channel_config(raw); - } - - @protected - List? cst_encode_opt_box_autoadd_entropy_source_config( - EntropySourceConfig? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null - ? null - : cst_encode_box_autoadd_entropy_source_config(raw); - } - - @protected - List? cst_encode_opt_box_autoadd_event(Event? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? null : cst_encode_box_autoadd_event(raw); - } - - @protected - List? cst_encode_opt_box_autoadd_gossip_source_config( - GossipSourceConfig? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null - ? null - : cst_encode_box_autoadd_gossip_source_config(raw); - } - - @protected - List? cst_encode_opt_box_autoadd_payment_details( - PaymentDetails? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? null : cst_encode_box_autoadd_payment_details(raw); - } - - @protected - List? cst_encode_opt_box_autoadd_payment_preimage( - PaymentPreimage? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? null : cst_encode_box_autoadd_payment_preimage(raw); - } - - @protected - List? cst_encode_opt_box_autoadd_payment_secret(PaymentSecret? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? null : cst_encode_box_autoadd_payment_secret(raw); - } - - @protected - List? cst_encode_opt_box_autoadd_public_key(PublicKey? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? null : cst_encode_box_autoadd_public_key(raw); - } - - @protected - int? cst_encode_opt_box_autoadd_u_32(int? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? null : cst_encode_box_autoadd_u_32(raw); - } - - @protected - Object? cst_encode_opt_box_autoadd_u_64(int? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? null : cst_encode_box_autoadd_u_64(raw); - } - - @protected - List? cst_encode_opt_list_socket_address(List? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? null : cst_encode_list_socket_address(raw); - } - - @protected - List cst_encode_out_point(OutPoint raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_txid(raw.txid), cst_encode_u_32(raw.vout)]; - } - - @protected - List cst_encode_payment_details(PaymentDetails raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [ - cst_encode_payment_hash(raw.hash), - cst_encode_opt_box_autoadd_payment_preimage(raw.preimage), - cst_encode_opt_box_autoadd_payment_secret(raw.secret), - cst_encode_opt_box_autoadd_u_64(raw.amountMsat), - cst_encode_payment_direction(raw.direction), - cst_encode_payment_status(raw.status) - ]; - } - - @protected - List cst_encode_payment_hash(PaymentHash raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_u_8_array_32(raw.data)]; - } - - @protected - List cst_encode_payment_preimage(PaymentPreimage raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_u_8_array_32(raw.data)]; - } - - @protected - List cst_encode_payment_secret(PaymentSecret raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_u_8_array_32(raw.data)]; - } - - @protected - List cst_encode_peer_details(PeerDetails raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [ - cst_encode_public_key(raw.nodeId), - cst_encode_socket_address(raw.address), - cst_encode_bool(raw.isConnected) - ]; - } - - @protected - List cst_encode_public_key(PublicKey raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_String(raw.hex)]; - } - - @protected - List cst_encode_socket_address(SocketAddress raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - if (raw is SocketAddress_TcpIpV4) { - return [0, cst_encode_u_8_array_4(raw.addr), cst_encode_u_16(raw.port)]; - } - if (raw is SocketAddress_TcpIpV6) { - return [1, cst_encode_u_8_array_16(raw.addr), cst_encode_u_16(raw.port)]; - } - if (raw is SocketAddress_OnionV2) { - return [2, cst_encode_u_8_array_12(raw.field0)]; - } - if (raw is SocketAddress_OnionV3) { - return [ - 3, - cst_encode_u_8_array_32(raw.ed25519Pubkey), - cst_encode_u_16(raw.checksum), - cst_encode_u_8(raw.version), - cst_encode_u_16(raw.port) - ]; - } - if (raw is SocketAddress_Hostname) { - return [4, cst_encode_String(raw.addr), cst_encode_u_16(raw.port)]; - } - - throw Exception('unreachable'); - } - - @protected - List cst_encode_txid(Txid raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_String(raw.hash)]; - } - - @protected - Object cst_encode_u_64(int raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return castNativeBigInt(raw); - } - - @protected - Uint8List cst_encode_u_8_array_12(U8Array12 raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return Uint8List.fromList(raw); - } - - @protected - Uint8List cst_encode_u_8_array_16(U8Array16 raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return Uint8List.fromList(raw); - } - - @protected - Uint8List cst_encode_u_8_array_32(U8Array32 raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return Uint8List.fromList(raw); - } - - @protected - Uint8List cst_encode_u_8_array_4(U8Array4 raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return Uint8List.fromList(raw); - } - - @protected - Uint8List cst_encode_u_8_array_64(U8Array64 raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return Uint8List.fromList(raw); - } - - @protected - List cst_encode_user_channel_id(UserChannelId raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_u_64(raw.data)]; - } - - @protected - int cst_encode_RustOpaque_NodeSqliteStore(NodeSqliteStore raw); - - @protected - bool cst_encode_bool(bool raw); - - @protected - int cst_encode_builder_exception(BuilderException raw); - - @protected - int cst_encode_i_32(int raw); - - @protected - int cst_encode_log_level(LogLevel raw); - - @protected - int cst_encode_network(Network raw); - - @protected - int cst_encode_node_exception(NodeException raw); - - @protected - int cst_encode_payment_direction(PaymentDirection raw); - - @protected - int cst_encode_payment_status(PaymentStatus raw); - - @protected - int cst_encode_u_16(int raw); - - @protected - int cst_encode_u_32(int raw); - - @protected - int cst_encode_u_8(int raw); - - @protected - void cst_encode_unit(void raw); - - @protected - int cst_encode_usize(int raw); - - @protected - void sse_encode_RustOpaque_NodeSqliteStore( - NodeSqliteStore self, SseSerializer serializer); - - @protected - void sse_encode_String(String self, SseSerializer serializer); - - @protected - void sse_encode_address(Address self, SseSerializer serializer); - - @protected - void sse_encode_bolt_11_invoice(Bolt11Invoice self, SseSerializer serializer); - - @protected - void sse_encode_bool(bool self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_address(Address self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_bolt_11_invoice( - Bolt11Invoice self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_chain_data_source_config( - ChainDataSourceConfig self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_channel_config( - ChannelConfig self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_channel_id( - ChannelId self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_config(Config self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_entropy_source_config( - EntropySourceConfig self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_event(Event self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_gossip_source_config( - GossipSourceConfig self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_ldk_mnemonic( - LdkMnemonic self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_ldk_node(LdkNode self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_out_point( - OutPoint self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_payment_details( - PaymentDetails self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_payment_hash( - PaymentHash self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_payment_preimage( - PaymentPreimage self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_payment_secret( - PaymentSecret self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_public_key( - PublicKey self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_socket_address( - SocketAddress self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_u_32(int self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_u_64(int self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_user_channel_id( - UserChannelId self, SseSerializer serializer); - - @protected - void sse_encode_builder_exception( - BuilderException self, SseSerializer serializer); - - @protected - void sse_encode_chain_data_source_config( - ChainDataSourceConfig self, SseSerializer serializer); - - @protected - void sse_encode_channel_config(ChannelConfig self, SseSerializer serializer); - - @protected - void sse_encode_channel_details( - ChannelDetails self, SseSerializer serializer); - - @protected - void sse_encode_channel_id(ChannelId self, SseSerializer serializer); - - @protected - void sse_encode_config(Config self, SseSerializer serializer); - - @protected - void sse_encode_entropy_source_config( - EntropySourceConfig self, SseSerializer serializer); - - @protected - void sse_encode_event(Event self, SseSerializer serializer); - - @protected - void sse_encode_gossip_source_config( - GossipSourceConfig self, SseSerializer serializer); - - @protected - void sse_encode_i_32(int self, SseSerializer serializer); - - @protected - void sse_encode_ldk_mnemonic(LdkMnemonic self, SseSerializer serializer); - - @protected - 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_payment_details( - List self, SseSerializer serializer); - - @protected - void sse_encode_list_peer_details( - List self, SseSerializer serializer); - - @protected - void sse_encode_list_prim_u_8_loose(List self, SseSerializer serializer); - - @protected - void sse_encode_list_prim_u_8_strict( - Uint8List self, SseSerializer serializer); - - @protected - void sse_encode_list_public_key( - List self, SseSerializer serializer); - - @protected - void sse_encode_list_socket_address( - List self, SseSerializer serializer); - - @protected - void sse_encode_log_level(LogLevel self, SseSerializer serializer); - - @protected - void sse_encode_max_dust_htlc_exposure( - MaxDustHTLCExposure self, SseSerializer serializer); - - @protected - void sse_encode_network(Network self, SseSerializer serializer); - - @protected - void sse_encode_node_exception(NodeException self, SseSerializer serializer); - - @protected - void sse_encode_opt_String(String? self, SseSerializer serializer); - - @protected - void sse_encode_opt_box_autoadd_chain_data_source_config( - ChainDataSourceConfig? self, SseSerializer serializer); - - @protected - void sse_encode_opt_box_autoadd_channel_config( - ChannelConfig? self, SseSerializer serializer); - - @protected - void sse_encode_opt_box_autoadd_entropy_source_config( - EntropySourceConfig? self, SseSerializer serializer); - - @protected - void sse_encode_opt_box_autoadd_event(Event? self, SseSerializer serializer); - - @protected - void sse_encode_opt_box_autoadd_gossip_source_config( - GossipSourceConfig? self, SseSerializer serializer); - - @protected - void sse_encode_opt_box_autoadd_payment_details( - PaymentDetails? self, SseSerializer serializer); - - @protected - void sse_encode_opt_box_autoadd_payment_preimage( - PaymentPreimage? self, SseSerializer serializer); - - @protected - void sse_encode_opt_box_autoadd_payment_secret( - PaymentSecret? self, SseSerializer serializer); - - @protected - void sse_encode_opt_box_autoadd_public_key( - PublicKey? self, SseSerializer serializer); - - @protected - void sse_encode_opt_box_autoadd_u_32(int? self, SseSerializer serializer); - - @protected - void sse_encode_opt_box_autoadd_u_64(int? self, SseSerializer serializer); - - @protected - void sse_encode_opt_list_socket_address( - List? self, SseSerializer serializer); - - @protected - void sse_encode_out_point(OutPoint self, SseSerializer serializer); - - @protected - void sse_encode_payment_details( - PaymentDetails self, SseSerializer serializer); - - @protected - void sse_encode_payment_direction( - PaymentDirection self, SseSerializer serializer); - - @protected - void sse_encode_payment_hash(PaymentHash self, SseSerializer serializer); - - @protected - void sse_encode_payment_preimage( - PaymentPreimage self, SseSerializer serializer); - - @protected - void sse_encode_payment_secret(PaymentSecret self, SseSerializer serializer); - - @protected - void sse_encode_payment_status(PaymentStatus self, SseSerializer serializer); - - @protected - void sse_encode_peer_details(PeerDetails self, SseSerializer serializer); - - @protected - void sse_encode_public_key(PublicKey self, SseSerializer serializer); - - @protected - void sse_encode_socket_address(SocketAddress self, SseSerializer serializer); - - @protected - void sse_encode_txid(Txid self, SseSerializer serializer); - - @protected - void sse_encode_u_16(int self, SseSerializer serializer); - - @protected - void sse_encode_u_32(int self, SseSerializer serializer); - - @protected - void sse_encode_u_64(int self, SseSerializer serializer); - - @protected - void sse_encode_u_8(int self, SseSerializer serializer); - - @protected - void sse_encode_u_8_array_12(U8Array12 self, SseSerializer serializer); - - @protected - void sse_encode_u_8_array_16(U8Array16 self, SseSerializer serializer); - - @protected - void sse_encode_u_8_array_32(U8Array32 self, SseSerializer serializer); - - @protected - void sse_encode_u_8_array_4(U8Array4 self, SseSerializer serializer); - - @protected - void sse_encode_u_8_array_64(U8Array64 self, SseSerializer serializer); - - @protected - void sse_encode_unit(void self, SseSerializer serializer); - - @protected - void sse_encode_user_channel_id(UserChannelId self, SseSerializer serializer); - - @protected - void sse_encode_usize(int self, SseSerializer serializer); -} - -// Section: wire_class - -class LdkCoreWire implements BaseWire { - LdkCoreWire.fromExternalLibrary(ExternalLibrary lib); - - 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_ldk_mnemonic_generate(NativePortType port_) => - wasmModule.wire_ldk_mnemonic_generate(port_); - - 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_ldk_node_connect(NativePortType port_, List that, - List node_id, List address, bool persist) => - wasmModule.wire_ldk_node_connect(port_, that, node_id, address, persist); - - void wire_ldk_node_connect_open_channel( - NativePortType port_, - List that, - List socket_address, - List node_id, - Object channel_amount_sats, - Object? push_to_counterparty_msat, - bool announce_channel, - List? channel_config) => - wasmModule.wire_ldk_node_connect_open_channel( - port_, - that, - socket_address, - node_id, - channel_amount_sats, - push_to_counterparty_msat, - announce_channel, - channel_config); - - void wire_ldk_node_disconnect(NativePortType port_, List that, - List counterparty_node_id) => - wasmModule.wire_ldk_node_disconnect(port_, that, counterparty_node_id); - - void wire_ldk_node_event_handled(NativePortType port_, List that) => - wasmModule.wire_ldk_node_event_handled(port_, that); - - void wire_ldk_node_is_running(NativePortType port_, List that) => - wasmModule.wire_ldk_node_is_running(port_, that); - - void wire_ldk_node_list_channels(NativePortType port_, List that) => - wasmModule.wire_ldk_node_list_channels(port_, that); - - void wire_ldk_node_list_payments(NativePortType port_, List that) => - wasmModule.wire_ldk_node_list_payments(port_, that); - - void wire_ldk_node_list_payments_with_filter( - NativePortType port_, List that, int payment_direction) => - wasmModule.wire_ldk_node_list_payments_with_filter( - port_, that, payment_direction); - - void wire_ldk_node_list_peers(NativePortType port_, List that) => - wasmModule.wire_ldk_node_list_peers(port_, that); - - void wire_ldk_node_listening_addresses( - NativePortType port_, List that) => - wasmModule.wire_ldk_node_listening_addresses(port_, that); - - void wire_ldk_node_new_onchain_address( - NativePortType port_, List that) => - wasmModule.wire_ldk_node_new_onchain_address(port_, that); - - void wire_ldk_node_next_event(NativePortType port_, List that) => - wasmModule.wire_ldk_node_next_event(port_, that); - - void wire_ldk_node_node_id(NativePortType port_, List that) => - wasmModule.wire_ldk_node_node_id(port_, that); - - void wire_ldk_node_payment(NativePortType port_, List that, - List payment_hash) => - wasmModule.wire_ldk_node_payment(port_, that, payment_hash); - - void wire_ldk_node_receive_payment(NativePortType port_, List that, - Object amount_msat, String description, int expiry_secs) => - wasmModule.wire_ldk_node_receive_payment( - port_, that, amount_msat, description, expiry_secs); - - void wire_ldk_node_receive_variable_amount_payment(NativePortType port_, - List that, String description, int expiry_secs) => - wasmModule.wire_ldk_node_receive_variable_amount_payment( - port_, that, description, expiry_secs); - - void wire_ldk_node_remove_payment(NativePortType port_, List that, - List payment_hash) => - wasmModule.wire_ldk_node_remove_payment(port_, that, payment_hash); - - void wire_ldk_node_send_all_to_onchain_address( - NativePortType port_, List that, List address) => - wasmModule.wire_ldk_node_send_all_to_onchain_address( - port_, that, address); - - void wire_ldk_node_send_payment( - NativePortType port_, List that, List invoice) => - wasmModule.wire_ldk_node_send_payment(port_, that, invoice); - - void wire_ldk_node_send_payment_probes( - NativePortType port_, List that, List invoice) => - wasmModule.wire_ldk_node_send_payment_probes(port_, that, invoice); - - void wire_ldk_node_send_payment_probes_using_amount(NativePortType port_, - List that, List invoice, Object amount_msat) => - wasmModule.wire_ldk_node_send_payment_probes_using_amount( - port_, that, invoice, amount_msat); - - void wire_ldk_node_send_payment_using_amount(NativePortType port_, - List that, List invoice, Object amount_msat) => - wasmModule.wire_ldk_node_send_payment_using_amount( - port_, that, invoice, amount_msat); - - void wire_ldk_node_send_spontaneous_payment(NativePortType port_, - List that, Object amount_msat, List node_id) => - wasmModule.wire_ldk_node_send_spontaneous_payment( - port_, that, amount_msat, node_id); - - void wire_ldk_node_send_spontaneous_payment_probes(NativePortType port_, - List that, Object amount_msat, List node_id) => - wasmModule.wire_ldk_node_send_spontaneous_payment_probes( - port_, that, amount_msat, node_id); - - void wire_ldk_node_send_to_onchain_address(NativePortType port_, - List that, List address, Object amount_sats) => - wasmModule.wire_ldk_node_send_to_onchain_address( - port_, that, address, amount_sats); - - void wire_ldk_node_sign_message( - NativePortType port_, List that, List 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_ldk_node_start(NativePortType port_, List that) => - wasmModule.wire_ldk_node_start(port_, that); - - void wire_ldk_node_stop(NativePortType port_, List that) => - wasmModule.wire_ldk_node_stop(port_, that); - - void wire_ldk_node_sync_wallets(NativePortType port_, List that) => - wasmModule.wire_ldk_node_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_ldk_node_update_channel_config( - NativePortType port_, - List that, - List channel_id, - List counterparty_node_id, - List channel_config) => - wasmModule.wire_ldk_node_update_channel_config( - port_, that, channel_id, counterparty_node_id, channel_config); - - void wire_ldk_node_verify_signature(NativePortType port_, List that, - List msg, String sig, List pkey) => - wasmModule.wire_ldk_node_verify_signature(port_, that, msg, sig, pkey); - - void wire_ldk_node_wait_next_event( - NativePortType port_, List that) => - wasmModule.wire_ldk_node_wait_next_event(port_, that); - - 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) => - wasmModule - .rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore(ptr); - - void rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore( - dynamic ptr) => - wasmModule - .rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore(ptr); -} - -@JS('wasm_bindgen') -external LdkCoreWasmModule get wasmModule; - -@JS() -@anonymous -class LdkCoreWasmModule implements WasmModule { - @override - external Object /* Promise */ call([String? moduleName]); - - @override - external LdkCoreWasmModule bind(dynamic thisArg, String moduleName); - - 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_ldk_node_close_channel( - NativePortType port_, - List that, - List channel_id, - List counterparty_node_id); - - external void wire_ldk_node_connect(NativePortType port_, List that, - List node_id, List address, bool persist); - - external void wire_ldk_node_connect_open_channel( - NativePortType port_, - List that, - List socket_address, - List node_id, - Object channel_amount_sats, - Object? push_to_counterparty_msat, - bool announce_channel, - List? channel_config); - - external void wire_ldk_node_disconnect(NativePortType port_, - List that, List counterparty_node_id); - - external void wire_ldk_node_event_handled( - NativePortType port_, List that); - - external void wire_ldk_node_is_running( - NativePortType port_, List that); - - external void wire_ldk_node_list_channels( - NativePortType port_, List that); - - external void wire_ldk_node_list_payments( - NativePortType port_, List that); - - external void wire_ldk_node_list_payments_with_filter( - NativePortType port_, List that, int payment_direction); - - external void wire_ldk_node_list_peers( - NativePortType port_, List that); - - external void wire_ldk_node_listening_addresses( - NativePortType port_, List that); - - external void wire_ldk_node_new_onchain_address( - NativePortType port_, List that); - - external void wire_ldk_node_next_event( - NativePortType port_, List that); - - external void wire_ldk_node_node_id(NativePortType port_, List that); - - external void wire_ldk_node_payment( - NativePortType port_, List that, List payment_hash); - - external void wire_ldk_node_receive_payment( - NativePortType port_, - List that, - Object amount_msat, - String description, - int expiry_secs); - - external void wire_ldk_node_receive_variable_amount_payment( - NativePortType port_, - List that, - String description, - int expiry_secs); - - external void wire_ldk_node_remove_payment( - NativePortType port_, List that, List payment_hash); - - external void wire_ldk_node_send_all_to_onchain_address( - NativePortType port_, List that, List address); - - external void wire_ldk_node_send_payment( - NativePortType port_, List that, List invoice); - - external void wire_ldk_node_send_payment_probes( - NativePortType port_, List that, List invoice); - - external void wire_ldk_node_send_payment_probes_using_amount( - NativePortType port_, - List that, - List invoice, - Object amount_msat); - - external void wire_ldk_node_send_payment_using_amount(NativePortType port_, - List that, List invoice, Object amount_msat); - - external void wire_ldk_node_send_spontaneous_payment(NativePortType port_, - List that, Object amount_msat, List node_id); - - external void wire_ldk_node_send_spontaneous_payment_probes( - NativePortType port_, - List that, - Object amount_msat, - List node_id); - - external void wire_ldk_node_send_to_onchain_address(NativePortType port_, - List that, List address, Object amount_sats); - - external void wire_ldk_node_sign_message( - NativePortType port_, List that, List msg); - - 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_ldk_node_stop(NativePortType port_, List that); - - external void wire_ldk_node_sync_wallets( - NativePortType port_, List that); - - external void wire_ldk_node_total_onchain_balance_sats( - NativePortType port_, List that); - - external void wire_ldk_node_update_channel_config( - NativePortType port_, - List that, - List channel_id, - List counterparty_node_id, - List channel_config); - - external void wire_ldk_node_verify_signature(NativePortType port_, - List that, List msg, String sig, List pkey); - - external void wire_ldk_node_wait_next_event( - NativePortType port_, List that); - - 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); - - external void rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore( - dynamic ptr); -} diff --git a/lib/src/generated/lib.dart b/lib/src/generated/lib.dart new file mode 100644 index 0000000..1672b4b --- /dev/null +++ b/lib/src/generated/lib.dart @@ -0,0 +1,90 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0. + +// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import + +import 'frb_generated.dart'; +import 'package:collection/collection.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; + +// Rust type: RustOpaqueNom +abstract class NetworkGraph implements RustOpaqueInterface {} + +// Rust type: RustOpaqueNom +abstract class Bolt11Payment implements RustOpaqueInterface {} + +// Rust type: RustOpaqueNom +abstract class OnchainPayment implements RustOpaqueInterface {} + +// Rust type: RustOpaqueNom +abstract class SpontaneousPayment implements RustOpaqueInterface {} + +class U8Array12 extends NonGrowableListView { + static const arraySize = 12; + + @internal + Uint8List get inner => _inner; + final Uint8List _inner; + + U8Array12(this._inner) + : assert(_inner.length == arraySize), + super(_inner); + + U8Array12.init() : this(Uint8List(arraySize)); +} + +class U8Array16 extends NonGrowableListView { + static const arraySize = 16; + + @internal + Uint8List get inner => _inner; + final Uint8List _inner; + + U8Array16(this._inner) + : assert(_inner.length == arraySize), + super(_inner); + + U8Array16.init() : this(Uint8List(arraySize)); +} + +class U8Array32 extends NonGrowableListView { + static const arraySize = 32; + + @internal + Uint8List get inner => _inner; + final Uint8List _inner; + + U8Array32(this._inner) + : assert(_inner.length == arraySize), + super(_inner); + + U8Array32.init() : this(Uint8List(arraySize)); +} + +class U8Array4 extends NonGrowableListView { + static const arraySize = 4; + + @internal + Uint8List get inner => _inner; + final Uint8List _inner; + + U8Array4(this._inner) + : assert(_inner.length == arraySize), + super(_inner); + + U8Array4.init() : this(Uint8List(arraySize)); +} + +class U8Array64 extends NonGrowableListView { + static const arraySize = 64; + + @internal + Uint8List get inner => _inner; + final Uint8List _inner; + + U8Array64(this._inner) + : assert(_inner.length == arraySize), + super(_inner); + + U8Array64.init() : this(Uint8List(arraySize)); +} diff --git a/lib/src/generated/utils/error.dart b/lib/src/generated/utils/error.dart new file mode 100644 index 0000000..4579b40 --- /dev/null +++ b/lib/src/generated/utils/error.dart @@ -0,0 +1,272 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0. + +// 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'; +import 'package:freezed_annotation/freezed_annotation.dart' hide protected; +part 'error.freezed.dart'; + +@freezed +sealed class Bolt12ParseError with _$Bolt12ParseError { + const Bolt12ParseError._(); + + const factory Bolt12ParseError.invalidContinuation() = + Bolt12ParseError_InvalidContinuation; + const factory Bolt12ParseError.invalidBech32Hrp() = + Bolt12ParseError_InvalidBech32Hrp; + const factory Bolt12ParseError.bech32( + String field0, + ) = Bolt12ParseError_Bech32; + const factory Bolt12ParseError.decode( + DecodeError field0, + ) = Bolt12ParseError_Decode; + const factory Bolt12ParseError.invalidSemantics( + String field0, + ) = Bolt12ParseError_InvalidSemantics; + const factory Bolt12ParseError.invalidSignature( + String field0, + ) = Bolt12ParseError_InvalidSignature; +} + +@freezed +sealed class DecodeError with _$DecodeError { + const DecodeError._(); + + const factory DecodeError.unknownVersion() = DecodeError_UnknownVersion; + const factory DecodeError.unknownRequiredFeature() = + DecodeError_UnknownRequiredFeature; + const factory DecodeError.invalidValue() = DecodeError_InvalidValue; + const factory DecodeError.shortRead() = DecodeError_ShortRead; + const factory DecodeError.badLengthDescriptor() = + DecodeError_BadLengthDescriptor; + const factory DecodeError.io( + String field0, + ) = DecodeError_Io; + const factory DecodeError.unsupportedCompression() = + DecodeError_UnsupportedCompression; + const factory DecodeError.dangerousValue() = DecodeError_DangerousValue; +} + +enum LdkBuilderError { + socketAddressParseError, + + /// The given seed bytes are invalid, e.g., have invalid length. + invalidSeedBytes, + + /// The given seed file is invalid, e.g., has invalid length, or could not be read. + invalidSeedFile, + + /// The current system time is invalid, clocks might have gone backwards. + invalidSystemTime, + + /// The a read channel monitor is invalid. + invalidChannelMonitor, + + /// The given listening addresses are invalid, e.g. too many were passed. + invalidListeningAddress, + + /// We failed to read data from the [`KVStore`]. + readFailed, + + /// We failed to write data to the [`KVStore`]. + writeFailed, + + /// We failed to access the given `storage_dir_path`. + storagePathAccessFailed, + + /// We failed to setup our [`KVStore`]. + kvStoreSetupFailed, + + /// We failed to setup the onchain wallet. + walletSetupFailed, + + /// We failed to setup the logger. + loggerSetupFailed, + invalidPublicKey, + ; +} + +@freezed +sealed class LdkNodeError with _$LdkNodeError implements FrbException { + const LdkNodeError._(); + + const factory LdkNodeError.invalidTxid() = LdkNodeError_InvalidTxid; + + /// Returned when trying to start [Node] while it is already running. + const factory LdkNodeError.alreadyRunning() = LdkNodeError_AlreadyRunning; + + /// Returned when trying to stop [Node] while it is not running. + const factory LdkNodeError.notRunning() = LdkNodeError_NotRunning; + + /// An on-chain transaction could not be created. + const factory LdkNodeError.onchainTxCreationFailed() = + LdkNodeError_OnchainTxCreationFailed; + + /// A network connection has been closed. + const factory LdkNodeError.connectionFailed() = LdkNodeError_ConnectionFailed; + + /// Invoice creation failed. + const factory LdkNodeError.invoiceCreationFailed() = + LdkNodeError_InvoiceCreationFailed; + + /// Sending a payment has failed. + const factory LdkNodeError.paymentSendingFailed() = + LdkNodeError_PaymentSendingFailed; + + /// Sending a payment probe has failed. + const factory LdkNodeError.probeSendingFailed() = + LdkNodeError_ProbeSendingFailed; + + /// A channel could not be opened. + const factory LdkNodeError.channelCreationFailed() = + LdkNodeError_ChannelCreationFailed; + + /// A channel could not be closed. + const factory LdkNodeError.channelClosingFailed() = + LdkNodeError_ChannelClosingFailed; + + /// A channel config could not be updated. + const factory LdkNodeError.channelConfigUpdateFailed() = + LdkNodeError_ChannelConfigUpdateFailed; + + /// Persistence failed. + const factory LdkNodeError.persistenceFailed() = + LdkNodeError_PersistenceFailed; + + /// A wallet operation failed. + const factory LdkNodeError.walletOperationFailed() = + LdkNodeError_WalletOperationFailed; + + /// A signing operation for transaction failed. + const factory LdkNodeError.onchainTxSigningFailed() = + LdkNodeError_OnchainTxSigningFailed; + + /// A signing operation for message failed. + const factory LdkNodeError.messageSigningFailed() = + LdkNodeError_MessageSigningFailed; + + /// A transaction sync operation failed. + const factory LdkNodeError.txSyncFailed() = LdkNodeError_TxSyncFailed; + + /// A gossip updating operation failed. + const factory LdkNodeError.gossipUpdateFailed() = + LdkNodeError_GossipUpdateFailed; + + /// The given address is invalid. + const factory LdkNodeError.invalidAddress() = LdkNodeError_InvalidAddress; + + /// The given network address is invalid. + const factory LdkNodeError.invalidSocketAddress() = + LdkNodeError_InvalidSocketAddress; + + /// The given public key is invalid. + const factory LdkNodeError.invalidPublicKey() = LdkNodeError_InvalidPublicKey; + + /// The given secret key is invalid. + const factory LdkNodeError.invalidSecretKey() = LdkNodeError_InvalidSecretKey; + + /// The given payment hash is invalid. + const factory LdkNodeError.invalidPaymentHash() = + LdkNodeError_InvalidPaymentHash; + + /// The given payment preimage is invalid. + const factory LdkNodeError.invalidPaymentPreimage() = + LdkNodeError_InvalidPaymentPreimage; + + /// The given payment secret is invalid. + const factory LdkNodeError.invalidPaymentSecret() = + LdkNodeError_InvalidPaymentSecret; + + /// The given amount is invalid. + const factory LdkNodeError.invalidAmount() = LdkNodeError_InvalidAmount; + + /// The given invoice is invalid. + const factory LdkNodeError.invalidInvoice() = LdkNodeError_InvalidInvoice; + + /// The given channel ID is invalid. + const factory LdkNodeError.invalidChannelId() = LdkNodeError_InvalidChannelId; + + /// The given network is invalid. + const factory LdkNodeError.invalidNetwork() = LdkNodeError_InvalidNetwork; + + /// A payment with the given hash has already been initiated. + const factory LdkNodeError.duplicatePayment() = LdkNodeError_DuplicatePayment; + + /// There are insufficient funds to complete the given operation. + const factory LdkNodeError.insufficientFunds() = + LdkNodeError_InsufficientFunds; + + ///A fee rate estimation update failed. + const factory LdkNodeError.feerateEstimationUpdateFailed() = + LdkNodeError_FeerateEstimationUpdateFailed; + + ///A liquidity request operation failed. + const factory LdkNodeError.liquidityRequestFailed() = + LdkNodeError_LiquidityRequestFailed; + + ///The given operation failed due to the required liquidity source being unavailable. + const factory LdkNodeError.liquiditySourceUnavailable() = + LdkNodeError_LiquiditySourceUnavailable; + + ///The given operation failed due to the LSP's required opening fee being too high. + const factory LdkNodeError.liquidityFeeTooHigh() = + LdkNodeError_LiquidityFeeTooHigh; + + ///The given payment id is invalid. + const factory LdkNodeError.invalidPaymentId() = LdkNodeError_InvalidPaymentId; + + ///An error in decoding a message or struct. + const factory LdkNodeError.decode( + DecodeError field0, + ) = LdkNodeError_Decode; + + ///An error in decoding the Bolt12 offer. + const factory LdkNodeError.bolt12Parse( + Bolt12ParseError field0, + ) = LdkNodeError_Bolt12Parse; + + ///Invoice request creation failed. + const factory LdkNodeError.invoiceRequestCreationFailed() = + LdkNodeError_InvoiceRequestCreationFailed; + + ///Offer creation failed. + const factory LdkNodeError.offerCreationFailed() = + LdkNodeError_OfferCreationFailed; + + ///Refund creation failed. + const factory LdkNodeError.refundCreationFailed() = + LdkNodeError_RefundCreationFailed; + + ///A fee rate estimation update timed out. + const factory LdkNodeError.feerateEstimationUpdateTimeout() = + LdkNodeError_FeerateEstimationUpdateTimeout; + + ///A wallet operation timed out. + const factory LdkNodeError.walletOperationTimeout() = + LdkNodeError_WalletOperationTimeout; + + ///A transaction sync operation timed out. + const factory LdkNodeError.txSyncTimeout() = LdkNodeError_TxSyncTimeout; + + ///A gossip updating operation timed out. + const factory LdkNodeError.gossipUpdateTimeout() = + LdkNodeError_GossipUpdateTimeout; + + ///The given offer id is invalid. + const factory LdkNodeError.invalidOfferId() = LdkNodeError_InvalidOfferId; + + ///The given node id is invalid. + const factory LdkNodeError.invalidNodeId() = LdkNodeError_InvalidNodeId; + + ///The given offer is invalid. + const factory LdkNodeError.invalidOffer() = LdkNodeError_InvalidOffer; + + ///The given refund is invalid. + const factory LdkNodeError.invalidRefund() = LdkNodeError_InvalidRefund; + + ///The provided offer was denominated in an unsupported currency. + const factory LdkNodeError.unsupportedCurrency() = + LdkNodeError_UnsupportedCurrency; +} diff --git a/lib/src/generated/utils/error.freezed.dart b/lib/src/generated/utils/error.freezed.dart new file mode 100644 index 0000000..2f4dd6b --- /dev/null +++ b/lib/src/generated/utils/error.freezed.dart @@ -0,0 +1,26142 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'error.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + +/// @nodoc +mixin _$Bolt12ParseError { + @optionalTypeArgs + TResult when({ + required TResult Function() invalidContinuation, + required TResult Function() invalidBech32Hrp, + required TResult Function(String field0) bech32, + required TResult Function(DecodeError field0) decode, + required TResult Function(String field0) invalidSemantics, + required TResult Function(String field0) invalidSignature, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidContinuation, + TResult? Function()? invalidBech32Hrp, + TResult? Function(String field0)? bech32, + TResult? Function(DecodeError field0)? decode, + TResult? Function(String field0)? invalidSemantics, + TResult? Function(String field0)? invalidSignature, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidContinuation, + TResult Function()? invalidBech32Hrp, + TResult Function(String field0)? bech32, + TResult Function(DecodeError field0)? decode, + TResult Function(String field0)? invalidSemantics, + TResult Function(String field0)? invalidSignature, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map({ + required TResult Function(Bolt12ParseError_InvalidContinuation value) + invalidContinuation, + required TResult Function(Bolt12ParseError_InvalidBech32Hrp value) + invalidBech32Hrp, + required TResult Function(Bolt12ParseError_Bech32 value) bech32, + required TResult Function(Bolt12ParseError_Decode value) decode, + required TResult Function(Bolt12ParseError_InvalidSemantics value) + invalidSemantics, + required TResult Function(Bolt12ParseError_InvalidSignature value) + invalidSignature, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult? Function(Bolt12ParseError_InvalidBech32Hrp value)? + invalidBech32Hrp, + TResult? Function(Bolt12ParseError_Bech32 value)? bech32, + TResult? Function(Bolt12ParseError_Decode value)? decode, + TResult? Function(Bolt12ParseError_InvalidSemantics value)? + invalidSemantics, + TResult? Function(Bolt12ParseError_InvalidSignature value)? + invalidSignature, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult Function(Bolt12ParseError_InvalidBech32Hrp value)? invalidBech32Hrp, + TResult Function(Bolt12ParseError_Bech32 value)? bech32, + TResult Function(Bolt12ParseError_Decode value)? decode, + TResult Function(Bolt12ParseError_InvalidSemantics value)? invalidSemantics, + TResult Function(Bolt12ParseError_InvalidSignature value)? invalidSignature, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $Bolt12ParseErrorCopyWith<$Res> { + factory $Bolt12ParseErrorCopyWith( + Bolt12ParseError value, $Res Function(Bolt12ParseError) then) = + _$Bolt12ParseErrorCopyWithImpl<$Res, Bolt12ParseError>; +} + +/// @nodoc +class _$Bolt12ParseErrorCopyWithImpl<$Res, $Val extends Bolt12ParseError> + implements $Bolt12ParseErrorCopyWith<$Res> { + _$Bolt12ParseErrorCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; +} + +/// @nodoc +abstract class _$$Bolt12ParseError_InvalidContinuationImplCopyWith<$Res> { + factory _$$Bolt12ParseError_InvalidContinuationImplCopyWith( + _$Bolt12ParseError_InvalidContinuationImpl value, + $Res Function(_$Bolt12ParseError_InvalidContinuationImpl) then) = + __$$Bolt12ParseError_InvalidContinuationImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$Bolt12ParseError_InvalidContinuationImplCopyWithImpl<$Res> + extends _$Bolt12ParseErrorCopyWithImpl<$Res, + _$Bolt12ParseError_InvalidContinuationImpl> + implements _$$Bolt12ParseError_InvalidContinuationImplCopyWith<$Res> { + __$$Bolt12ParseError_InvalidContinuationImplCopyWithImpl( + _$Bolt12ParseError_InvalidContinuationImpl _value, + $Res Function(_$Bolt12ParseError_InvalidContinuationImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$Bolt12ParseError_InvalidContinuationImpl + extends Bolt12ParseError_InvalidContinuation { + const _$Bolt12ParseError_InvalidContinuationImpl() : super._(); + + @override + String toString() { + return 'Bolt12ParseError.invalidContinuation()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Bolt12ParseError_InvalidContinuationImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidContinuation, + required TResult Function() invalidBech32Hrp, + required TResult Function(String field0) bech32, + required TResult Function(DecodeError field0) decode, + required TResult Function(String field0) invalidSemantics, + required TResult Function(String field0) invalidSignature, + }) { + return invalidContinuation(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidContinuation, + TResult? Function()? invalidBech32Hrp, + TResult? Function(String field0)? bech32, + TResult? Function(DecodeError field0)? decode, + TResult? Function(String field0)? invalidSemantics, + TResult? Function(String field0)? invalidSignature, + }) { + return invalidContinuation?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidContinuation, + TResult Function()? invalidBech32Hrp, + TResult Function(String field0)? bech32, + TResult Function(DecodeError field0)? decode, + TResult Function(String field0)? invalidSemantics, + TResult Function(String field0)? invalidSignature, + required TResult orElse(), + }) { + if (invalidContinuation != null) { + return invalidContinuation(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Bolt12ParseError_InvalidContinuation value) + invalidContinuation, + required TResult Function(Bolt12ParseError_InvalidBech32Hrp value) + invalidBech32Hrp, + required TResult Function(Bolt12ParseError_Bech32 value) bech32, + required TResult Function(Bolt12ParseError_Decode value) decode, + required TResult Function(Bolt12ParseError_InvalidSemantics value) + invalidSemantics, + required TResult Function(Bolt12ParseError_InvalidSignature value) + invalidSignature, + }) { + return invalidContinuation(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult? Function(Bolt12ParseError_InvalidBech32Hrp value)? + invalidBech32Hrp, + TResult? Function(Bolt12ParseError_Bech32 value)? bech32, + TResult? Function(Bolt12ParseError_Decode value)? decode, + TResult? Function(Bolt12ParseError_InvalidSemantics value)? + invalidSemantics, + TResult? Function(Bolt12ParseError_InvalidSignature value)? + invalidSignature, + }) { + return invalidContinuation?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult Function(Bolt12ParseError_InvalidBech32Hrp value)? invalidBech32Hrp, + TResult Function(Bolt12ParseError_Bech32 value)? bech32, + TResult Function(Bolt12ParseError_Decode value)? decode, + TResult Function(Bolt12ParseError_InvalidSemantics value)? invalidSemantics, + TResult Function(Bolt12ParseError_InvalidSignature value)? invalidSignature, + required TResult orElse(), + }) { + if (invalidContinuation != null) { + return invalidContinuation(this); + } + return orElse(); + } +} + +abstract class Bolt12ParseError_InvalidContinuation extends Bolt12ParseError { + const factory Bolt12ParseError_InvalidContinuation() = + _$Bolt12ParseError_InvalidContinuationImpl; + const Bolt12ParseError_InvalidContinuation._() : super._(); +} + +/// @nodoc +abstract class _$$Bolt12ParseError_InvalidBech32HrpImplCopyWith<$Res> { + factory _$$Bolt12ParseError_InvalidBech32HrpImplCopyWith( + _$Bolt12ParseError_InvalidBech32HrpImpl value, + $Res Function(_$Bolt12ParseError_InvalidBech32HrpImpl) then) = + __$$Bolt12ParseError_InvalidBech32HrpImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$Bolt12ParseError_InvalidBech32HrpImplCopyWithImpl<$Res> + extends _$Bolt12ParseErrorCopyWithImpl<$Res, + _$Bolt12ParseError_InvalidBech32HrpImpl> + implements _$$Bolt12ParseError_InvalidBech32HrpImplCopyWith<$Res> { + __$$Bolt12ParseError_InvalidBech32HrpImplCopyWithImpl( + _$Bolt12ParseError_InvalidBech32HrpImpl _value, + $Res Function(_$Bolt12ParseError_InvalidBech32HrpImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$Bolt12ParseError_InvalidBech32HrpImpl + extends Bolt12ParseError_InvalidBech32Hrp { + const _$Bolt12ParseError_InvalidBech32HrpImpl() : super._(); + + @override + String toString() { + return 'Bolt12ParseError.invalidBech32Hrp()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Bolt12ParseError_InvalidBech32HrpImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidContinuation, + required TResult Function() invalidBech32Hrp, + required TResult Function(String field0) bech32, + required TResult Function(DecodeError field0) decode, + required TResult Function(String field0) invalidSemantics, + required TResult Function(String field0) invalidSignature, + }) { + return invalidBech32Hrp(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidContinuation, + TResult? Function()? invalidBech32Hrp, + TResult? Function(String field0)? bech32, + TResult? Function(DecodeError field0)? decode, + TResult? Function(String field0)? invalidSemantics, + TResult? Function(String field0)? invalidSignature, + }) { + return invalidBech32Hrp?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidContinuation, + TResult Function()? invalidBech32Hrp, + TResult Function(String field0)? bech32, + TResult Function(DecodeError field0)? decode, + TResult Function(String field0)? invalidSemantics, + TResult Function(String field0)? invalidSignature, + required TResult orElse(), + }) { + if (invalidBech32Hrp != null) { + return invalidBech32Hrp(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Bolt12ParseError_InvalidContinuation value) + invalidContinuation, + required TResult Function(Bolt12ParseError_InvalidBech32Hrp value) + invalidBech32Hrp, + required TResult Function(Bolt12ParseError_Bech32 value) bech32, + required TResult Function(Bolt12ParseError_Decode value) decode, + required TResult Function(Bolt12ParseError_InvalidSemantics value) + invalidSemantics, + required TResult Function(Bolt12ParseError_InvalidSignature value) + invalidSignature, + }) { + return invalidBech32Hrp(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult? Function(Bolt12ParseError_InvalidBech32Hrp value)? + invalidBech32Hrp, + TResult? Function(Bolt12ParseError_Bech32 value)? bech32, + TResult? Function(Bolt12ParseError_Decode value)? decode, + TResult? Function(Bolt12ParseError_InvalidSemantics value)? + invalidSemantics, + TResult? Function(Bolt12ParseError_InvalidSignature value)? + invalidSignature, + }) { + return invalidBech32Hrp?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult Function(Bolt12ParseError_InvalidBech32Hrp value)? invalidBech32Hrp, + TResult Function(Bolt12ParseError_Bech32 value)? bech32, + TResult Function(Bolt12ParseError_Decode value)? decode, + TResult Function(Bolt12ParseError_InvalidSemantics value)? invalidSemantics, + TResult Function(Bolt12ParseError_InvalidSignature value)? invalidSignature, + required TResult orElse(), + }) { + if (invalidBech32Hrp != null) { + return invalidBech32Hrp(this); + } + return orElse(); + } +} + +abstract class Bolt12ParseError_InvalidBech32Hrp extends Bolt12ParseError { + const factory Bolt12ParseError_InvalidBech32Hrp() = + _$Bolt12ParseError_InvalidBech32HrpImpl; + const Bolt12ParseError_InvalidBech32Hrp._() : super._(); +} + +/// @nodoc +abstract class _$$Bolt12ParseError_Bech32ImplCopyWith<$Res> { + factory _$$Bolt12ParseError_Bech32ImplCopyWith( + _$Bolt12ParseError_Bech32Impl value, + $Res Function(_$Bolt12ParseError_Bech32Impl) then) = + __$$Bolt12ParseError_Bech32ImplCopyWithImpl<$Res>; + @useResult + $Res call({String field0}); +} + +/// @nodoc +class __$$Bolt12ParseError_Bech32ImplCopyWithImpl<$Res> + extends _$Bolt12ParseErrorCopyWithImpl<$Res, _$Bolt12ParseError_Bech32Impl> + implements _$$Bolt12ParseError_Bech32ImplCopyWith<$Res> { + __$$Bolt12ParseError_Bech32ImplCopyWithImpl( + _$Bolt12ParseError_Bech32Impl _value, + $Res Function(_$Bolt12ParseError_Bech32Impl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? field0 = null, + }) { + return _then(_$Bolt12ParseError_Bech32Impl( + null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc + +class _$Bolt12ParseError_Bech32Impl extends Bolt12ParseError_Bech32 { + const _$Bolt12ParseError_Bech32Impl(this.field0) : super._(); + + @override + final String field0; + + @override + String toString() { + return 'Bolt12ParseError.bech32(field0: $field0)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Bolt12ParseError_Bech32Impl && + (identical(other.field0, field0) || other.field0 == field0)); + } + + @override + int get hashCode => Object.hash(runtimeType, field0); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$Bolt12ParseError_Bech32ImplCopyWith<_$Bolt12ParseError_Bech32Impl> + get copyWith => __$$Bolt12ParseError_Bech32ImplCopyWithImpl< + _$Bolt12ParseError_Bech32Impl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidContinuation, + required TResult Function() invalidBech32Hrp, + required TResult Function(String field0) bech32, + required TResult Function(DecodeError field0) decode, + required TResult Function(String field0) invalidSemantics, + required TResult Function(String field0) invalidSignature, + }) { + return bech32(field0); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidContinuation, + TResult? Function()? invalidBech32Hrp, + TResult? Function(String field0)? bech32, + TResult? Function(DecodeError field0)? decode, + TResult? Function(String field0)? invalidSemantics, + TResult? Function(String field0)? invalidSignature, + }) { + return bech32?.call(field0); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidContinuation, + TResult Function()? invalidBech32Hrp, + TResult Function(String field0)? bech32, + TResult Function(DecodeError field0)? decode, + TResult Function(String field0)? invalidSemantics, + TResult Function(String field0)? invalidSignature, + required TResult orElse(), + }) { + if (bech32 != null) { + return bech32(field0); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Bolt12ParseError_InvalidContinuation value) + invalidContinuation, + required TResult Function(Bolt12ParseError_InvalidBech32Hrp value) + invalidBech32Hrp, + required TResult Function(Bolt12ParseError_Bech32 value) bech32, + required TResult Function(Bolt12ParseError_Decode value) decode, + required TResult Function(Bolt12ParseError_InvalidSemantics value) + invalidSemantics, + required TResult Function(Bolt12ParseError_InvalidSignature value) + invalidSignature, + }) { + return bech32(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult? Function(Bolt12ParseError_InvalidBech32Hrp value)? + invalidBech32Hrp, + TResult? Function(Bolt12ParseError_Bech32 value)? bech32, + TResult? Function(Bolt12ParseError_Decode value)? decode, + TResult? Function(Bolt12ParseError_InvalidSemantics value)? + invalidSemantics, + TResult? Function(Bolt12ParseError_InvalidSignature value)? + invalidSignature, + }) { + return bech32?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult Function(Bolt12ParseError_InvalidBech32Hrp value)? invalidBech32Hrp, + TResult Function(Bolt12ParseError_Bech32 value)? bech32, + TResult Function(Bolt12ParseError_Decode value)? decode, + TResult Function(Bolt12ParseError_InvalidSemantics value)? invalidSemantics, + TResult Function(Bolt12ParseError_InvalidSignature value)? invalidSignature, + required TResult orElse(), + }) { + if (bech32 != null) { + return bech32(this); + } + return orElse(); + } +} + +abstract class Bolt12ParseError_Bech32 extends Bolt12ParseError { + const factory Bolt12ParseError_Bech32(final String field0) = + _$Bolt12ParseError_Bech32Impl; + const Bolt12ParseError_Bech32._() : super._(); + + String get field0; + @JsonKey(ignore: true) + _$$Bolt12ParseError_Bech32ImplCopyWith<_$Bolt12ParseError_Bech32Impl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$Bolt12ParseError_DecodeImplCopyWith<$Res> { + factory _$$Bolt12ParseError_DecodeImplCopyWith( + _$Bolt12ParseError_DecodeImpl value, + $Res Function(_$Bolt12ParseError_DecodeImpl) then) = + __$$Bolt12ParseError_DecodeImplCopyWithImpl<$Res>; + @useResult + $Res call({DecodeError field0}); + + $DecodeErrorCopyWith<$Res> get field0; +} + +/// @nodoc +class __$$Bolt12ParseError_DecodeImplCopyWithImpl<$Res> + extends _$Bolt12ParseErrorCopyWithImpl<$Res, _$Bolt12ParseError_DecodeImpl> + implements _$$Bolt12ParseError_DecodeImplCopyWith<$Res> { + __$$Bolt12ParseError_DecodeImplCopyWithImpl( + _$Bolt12ParseError_DecodeImpl _value, + $Res Function(_$Bolt12ParseError_DecodeImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? field0 = null, + }) { + return _then(_$Bolt12ParseError_DecodeImpl( + null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as DecodeError, + )); + } + + @override + @pragma('vm:prefer-inline') + $DecodeErrorCopyWith<$Res> get field0 { + return $DecodeErrorCopyWith<$Res>(_value.field0, (value) { + return _then(_value.copyWith(field0: value)); + }); + } +} + +/// @nodoc + +class _$Bolt12ParseError_DecodeImpl extends Bolt12ParseError_Decode { + const _$Bolt12ParseError_DecodeImpl(this.field0) : super._(); + + @override + final DecodeError field0; + + @override + String toString() { + return 'Bolt12ParseError.decode(field0: $field0)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Bolt12ParseError_DecodeImpl && + (identical(other.field0, field0) || other.field0 == field0)); + } + + @override + int get hashCode => Object.hash(runtimeType, field0); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$Bolt12ParseError_DecodeImplCopyWith<_$Bolt12ParseError_DecodeImpl> + get copyWith => __$$Bolt12ParseError_DecodeImplCopyWithImpl< + _$Bolt12ParseError_DecodeImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidContinuation, + required TResult Function() invalidBech32Hrp, + required TResult Function(String field0) bech32, + required TResult Function(DecodeError field0) decode, + required TResult Function(String field0) invalidSemantics, + required TResult Function(String field0) invalidSignature, + }) { + return decode(field0); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidContinuation, + TResult? Function()? invalidBech32Hrp, + TResult? Function(String field0)? bech32, + TResult? Function(DecodeError field0)? decode, + TResult? Function(String field0)? invalidSemantics, + TResult? Function(String field0)? invalidSignature, + }) { + return decode?.call(field0); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidContinuation, + TResult Function()? invalidBech32Hrp, + TResult Function(String field0)? bech32, + TResult Function(DecodeError field0)? decode, + TResult Function(String field0)? invalidSemantics, + TResult Function(String field0)? invalidSignature, + required TResult orElse(), + }) { + if (decode != null) { + return decode(field0); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Bolt12ParseError_InvalidContinuation value) + invalidContinuation, + required TResult Function(Bolt12ParseError_InvalidBech32Hrp value) + invalidBech32Hrp, + required TResult Function(Bolt12ParseError_Bech32 value) bech32, + required TResult Function(Bolt12ParseError_Decode value) decode, + required TResult Function(Bolt12ParseError_InvalidSemantics value) + invalidSemantics, + required TResult Function(Bolt12ParseError_InvalidSignature value) + invalidSignature, + }) { + return decode(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult? Function(Bolt12ParseError_InvalidBech32Hrp value)? + invalidBech32Hrp, + TResult? Function(Bolt12ParseError_Bech32 value)? bech32, + TResult? Function(Bolt12ParseError_Decode value)? decode, + TResult? Function(Bolt12ParseError_InvalidSemantics value)? + invalidSemantics, + TResult? Function(Bolt12ParseError_InvalidSignature value)? + invalidSignature, + }) { + return decode?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult Function(Bolt12ParseError_InvalidBech32Hrp value)? invalidBech32Hrp, + TResult Function(Bolt12ParseError_Bech32 value)? bech32, + TResult Function(Bolt12ParseError_Decode value)? decode, + TResult Function(Bolt12ParseError_InvalidSemantics value)? invalidSemantics, + TResult Function(Bolt12ParseError_InvalidSignature value)? invalidSignature, + required TResult orElse(), + }) { + if (decode != null) { + return decode(this); + } + return orElse(); + } +} + +abstract class Bolt12ParseError_Decode extends Bolt12ParseError { + const factory Bolt12ParseError_Decode(final DecodeError field0) = + _$Bolt12ParseError_DecodeImpl; + const Bolt12ParseError_Decode._() : super._(); + + DecodeError get field0; + @JsonKey(ignore: true) + _$$Bolt12ParseError_DecodeImplCopyWith<_$Bolt12ParseError_DecodeImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$Bolt12ParseError_InvalidSemanticsImplCopyWith<$Res> { + factory _$$Bolt12ParseError_InvalidSemanticsImplCopyWith( + _$Bolt12ParseError_InvalidSemanticsImpl value, + $Res Function(_$Bolt12ParseError_InvalidSemanticsImpl) then) = + __$$Bolt12ParseError_InvalidSemanticsImplCopyWithImpl<$Res>; + @useResult + $Res call({String field0}); +} + +/// @nodoc +class __$$Bolt12ParseError_InvalidSemanticsImplCopyWithImpl<$Res> + extends _$Bolt12ParseErrorCopyWithImpl<$Res, + _$Bolt12ParseError_InvalidSemanticsImpl> + implements _$$Bolt12ParseError_InvalidSemanticsImplCopyWith<$Res> { + __$$Bolt12ParseError_InvalidSemanticsImplCopyWithImpl( + _$Bolt12ParseError_InvalidSemanticsImpl _value, + $Res Function(_$Bolt12ParseError_InvalidSemanticsImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? field0 = null, + }) { + return _then(_$Bolt12ParseError_InvalidSemanticsImpl( + null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc + +class _$Bolt12ParseError_InvalidSemanticsImpl + extends Bolt12ParseError_InvalidSemantics { + const _$Bolt12ParseError_InvalidSemanticsImpl(this.field0) : super._(); + + @override + final String field0; + + @override + String toString() { + return 'Bolt12ParseError.invalidSemantics(field0: $field0)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Bolt12ParseError_InvalidSemanticsImpl && + (identical(other.field0, field0) || other.field0 == field0)); + } + + @override + int get hashCode => Object.hash(runtimeType, field0); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$Bolt12ParseError_InvalidSemanticsImplCopyWith< + _$Bolt12ParseError_InvalidSemanticsImpl> + get copyWith => __$$Bolt12ParseError_InvalidSemanticsImplCopyWithImpl< + _$Bolt12ParseError_InvalidSemanticsImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidContinuation, + required TResult Function() invalidBech32Hrp, + required TResult Function(String field0) bech32, + required TResult Function(DecodeError field0) decode, + required TResult Function(String field0) invalidSemantics, + required TResult Function(String field0) invalidSignature, + }) { + return invalidSemantics(field0); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidContinuation, + TResult? Function()? invalidBech32Hrp, + TResult? Function(String field0)? bech32, + TResult? Function(DecodeError field0)? decode, + TResult? Function(String field0)? invalidSemantics, + TResult? Function(String field0)? invalidSignature, + }) { + return invalidSemantics?.call(field0); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidContinuation, + TResult Function()? invalidBech32Hrp, + TResult Function(String field0)? bech32, + TResult Function(DecodeError field0)? decode, + TResult Function(String field0)? invalidSemantics, + TResult Function(String field0)? invalidSignature, + required TResult orElse(), + }) { + if (invalidSemantics != null) { + return invalidSemantics(field0); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Bolt12ParseError_InvalidContinuation value) + invalidContinuation, + required TResult Function(Bolt12ParseError_InvalidBech32Hrp value) + invalidBech32Hrp, + required TResult Function(Bolt12ParseError_Bech32 value) bech32, + required TResult Function(Bolt12ParseError_Decode value) decode, + required TResult Function(Bolt12ParseError_InvalidSemantics value) + invalidSemantics, + required TResult Function(Bolt12ParseError_InvalidSignature value) + invalidSignature, + }) { + return invalidSemantics(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult? Function(Bolt12ParseError_InvalidBech32Hrp value)? + invalidBech32Hrp, + TResult? Function(Bolt12ParseError_Bech32 value)? bech32, + TResult? Function(Bolt12ParseError_Decode value)? decode, + TResult? Function(Bolt12ParseError_InvalidSemantics value)? + invalidSemantics, + TResult? Function(Bolt12ParseError_InvalidSignature value)? + invalidSignature, + }) { + return invalidSemantics?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult Function(Bolt12ParseError_InvalidBech32Hrp value)? invalidBech32Hrp, + TResult Function(Bolt12ParseError_Bech32 value)? bech32, + TResult Function(Bolt12ParseError_Decode value)? decode, + TResult Function(Bolt12ParseError_InvalidSemantics value)? invalidSemantics, + TResult Function(Bolt12ParseError_InvalidSignature value)? invalidSignature, + required TResult orElse(), + }) { + if (invalidSemantics != null) { + return invalidSemantics(this); + } + return orElse(); + } +} + +abstract class Bolt12ParseError_InvalidSemantics extends Bolt12ParseError { + const factory Bolt12ParseError_InvalidSemantics(final String field0) = + _$Bolt12ParseError_InvalidSemanticsImpl; + const Bolt12ParseError_InvalidSemantics._() : super._(); + + String get field0; + @JsonKey(ignore: true) + _$$Bolt12ParseError_InvalidSemanticsImplCopyWith< + _$Bolt12ParseError_InvalidSemanticsImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$Bolt12ParseError_InvalidSignatureImplCopyWith<$Res> { + factory _$$Bolt12ParseError_InvalidSignatureImplCopyWith( + _$Bolt12ParseError_InvalidSignatureImpl value, + $Res Function(_$Bolt12ParseError_InvalidSignatureImpl) then) = + __$$Bolt12ParseError_InvalidSignatureImplCopyWithImpl<$Res>; + @useResult + $Res call({String field0}); +} + +/// @nodoc +class __$$Bolt12ParseError_InvalidSignatureImplCopyWithImpl<$Res> + extends _$Bolt12ParseErrorCopyWithImpl<$Res, + _$Bolt12ParseError_InvalidSignatureImpl> + implements _$$Bolt12ParseError_InvalidSignatureImplCopyWith<$Res> { + __$$Bolt12ParseError_InvalidSignatureImplCopyWithImpl( + _$Bolt12ParseError_InvalidSignatureImpl _value, + $Res Function(_$Bolt12ParseError_InvalidSignatureImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? field0 = null, + }) { + return _then(_$Bolt12ParseError_InvalidSignatureImpl( + null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc + +class _$Bolt12ParseError_InvalidSignatureImpl + extends Bolt12ParseError_InvalidSignature { + const _$Bolt12ParseError_InvalidSignatureImpl(this.field0) : super._(); + + @override + final String field0; + + @override + String toString() { + return 'Bolt12ParseError.invalidSignature(field0: $field0)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Bolt12ParseError_InvalidSignatureImpl && + (identical(other.field0, field0) || other.field0 == field0)); + } + + @override + int get hashCode => Object.hash(runtimeType, field0); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$Bolt12ParseError_InvalidSignatureImplCopyWith< + _$Bolt12ParseError_InvalidSignatureImpl> + get copyWith => __$$Bolt12ParseError_InvalidSignatureImplCopyWithImpl< + _$Bolt12ParseError_InvalidSignatureImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidContinuation, + required TResult Function() invalidBech32Hrp, + required TResult Function(String field0) bech32, + required TResult Function(DecodeError field0) decode, + required TResult Function(String field0) invalidSemantics, + required TResult Function(String field0) invalidSignature, + }) { + return invalidSignature(field0); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidContinuation, + TResult? Function()? invalidBech32Hrp, + TResult? Function(String field0)? bech32, + TResult? Function(DecodeError field0)? decode, + TResult? Function(String field0)? invalidSemantics, + TResult? Function(String field0)? invalidSignature, + }) { + return invalidSignature?.call(field0); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidContinuation, + TResult Function()? invalidBech32Hrp, + TResult Function(String field0)? bech32, + TResult Function(DecodeError field0)? decode, + TResult Function(String field0)? invalidSemantics, + TResult Function(String field0)? invalidSignature, + required TResult orElse(), + }) { + if (invalidSignature != null) { + return invalidSignature(field0); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Bolt12ParseError_InvalidContinuation value) + invalidContinuation, + required TResult Function(Bolt12ParseError_InvalidBech32Hrp value) + invalidBech32Hrp, + required TResult Function(Bolt12ParseError_Bech32 value) bech32, + required TResult Function(Bolt12ParseError_Decode value) decode, + required TResult Function(Bolt12ParseError_InvalidSemantics value) + invalidSemantics, + required TResult Function(Bolt12ParseError_InvalidSignature value) + invalidSignature, + }) { + return invalidSignature(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult? Function(Bolt12ParseError_InvalidBech32Hrp value)? + invalidBech32Hrp, + TResult? Function(Bolt12ParseError_Bech32 value)? bech32, + TResult? Function(Bolt12ParseError_Decode value)? decode, + TResult? Function(Bolt12ParseError_InvalidSemantics value)? + invalidSemantics, + TResult? Function(Bolt12ParseError_InvalidSignature value)? + invalidSignature, + }) { + return invalidSignature?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult Function(Bolt12ParseError_InvalidBech32Hrp value)? invalidBech32Hrp, + TResult Function(Bolt12ParseError_Bech32 value)? bech32, + TResult Function(Bolt12ParseError_Decode value)? decode, + TResult Function(Bolt12ParseError_InvalidSemantics value)? invalidSemantics, + TResult Function(Bolt12ParseError_InvalidSignature value)? invalidSignature, + required TResult orElse(), + }) { + if (invalidSignature != null) { + return invalidSignature(this); + } + return orElse(); + } +} + +abstract class Bolt12ParseError_InvalidSignature extends Bolt12ParseError { + const factory Bolt12ParseError_InvalidSignature(final String field0) = + _$Bolt12ParseError_InvalidSignatureImpl; + const Bolt12ParseError_InvalidSignature._() : super._(); + + String get field0; + @JsonKey(ignore: true) + _$$Bolt12ParseError_InvalidSignatureImplCopyWith< + _$Bolt12ParseError_InvalidSignatureImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +mixin _$DecodeError { + @optionalTypeArgs + TResult when({ + required TResult Function() unknownVersion, + required TResult Function() unknownRequiredFeature, + required TResult Function() invalidValue, + required TResult Function() shortRead, + required TResult Function() badLengthDescriptor, + required TResult Function(String field0) io, + required TResult Function() unsupportedCompression, + required TResult Function() dangerousValue, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? unknownVersion, + TResult? Function()? unknownRequiredFeature, + TResult? Function()? invalidValue, + TResult? Function()? shortRead, + TResult? Function()? badLengthDescriptor, + TResult? Function(String field0)? io, + TResult? Function()? unsupportedCompression, + TResult? Function()? dangerousValue, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? unknownVersion, + TResult Function()? unknownRequiredFeature, + TResult Function()? invalidValue, + TResult Function()? shortRead, + TResult Function()? badLengthDescriptor, + TResult Function(String field0)? io, + TResult Function()? unsupportedCompression, + TResult Function()? dangerousValue, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map({ + required TResult Function(DecodeError_UnknownVersion value) unknownVersion, + required TResult Function(DecodeError_UnknownRequiredFeature value) + unknownRequiredFeature, + required TResult Function(DecodeError_InvalidValue value) invalidValue, + required TResult Function(DecodeError_ShortRead value) shortRead, + required TResult Function(DecodeError_BadLengthDescriptor value) + badLengthDescriptor, + required TResult Function(DecodeError_Io value) io, + required TResult Function(DecodeError_UnsupportedCompression value) + unsupportedCompression, + required TResult Function(DecodeError_DangerousValue value) dangerousValue, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult? Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult? Function(DecodeError_InvalidValue value)? invalidValue, + TResult? Function(DecodeError_ShortRead value)? shortRead, + TResult? Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult? Function(DecodeError_Io value)? io, + TResult? Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult? Function(DecodeError_DangerousValue value)? dangerousValue, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap({ + TResult Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult Function(DecodeError_InvalidValue value)? invalidValue, + TResult Function(DecodeError_ShortRead value)? shortRead, + TResult Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult Function(DecodeError_Io value)? io, + TResult Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult Function(DecodeError_DangerousValue value)? dangerousValue, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $DecodeErrorCopyWith<$Res> { + factory $DecodeErrorCopyWith( + DecodeError value, $Res Function(DecodeError) then) = + _$DecodeErrorCopyWithImpl<$Res, DecodeError>; +} + +/// @nodoc +class _$DecodeErrorCopyWithImpl<$Res, $Val extends DecodeError> + implements $DecodeErrorCopyWith<$Res> { + _$DecodeErrorCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; +} + +/// @nodoc +abstract class _$$DecodeError_UnknownVersionImplCopyWith<$Res> { + factory _$$DecodeError_UnknownVersionImplCopyWith( + _$DecodeError_UnknownVersionImpl value, + $Res Function(_$DecodeError_UnknownVersionImpl) then) = + __$$DecodeError_UnknownVersionImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$DecodeError_UnknownVersionImplCopyWithImpl<$Res> + extends _$DecodeErrorCopyWithImpl<$Res, _$DecodeError_UnknownVersionImpl> + implements _$$DecodeError_UnknownVersionImplCopyWith<$Res> { + __$$DecodeError_UnknownVersionImplCopyWithImpl( + _$DecodeError_UnknownVersionImpl _value, + $Res Function(_$DecodeError_UnknownVersionImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$DecodeError_UnknownVersionImpl extends DecodeError_UnknownVersion { + const _$DecodeError_UnknownVersionImpl() : super._(); + + @override + String toString() { + return 'DecodeError.unknownVersion()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$DecodeError_UnknownVersionImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() unknownVersion, + required TResult Function() unknownRequiredFeature, + required TResult Function() invalidValue, + required TResult Function() shortRead, + required TResult Function() badLengthDescriptor, + required TResult Function(String field0) io, + required TResult Function() unsupportedCompression, + required TResult Function() dangerousValue, + }) { + return unknownVersion(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? unknownVersion, + TResult? Function()? unknownRequiredFeature, + TResult? Function()? invalidValue, + TResult? Function()? shortRead, + TResult? Function()? badLengthDescriptor, + TResult? Function(String field0)? io, + TResult? Function()? unsupportedCompression, + TResult? Function()? dangerousValue, + }) { + return unknownVersion?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? unknownVersion, + TResult Function()? unknownRequiredFeature, + TResult Function()? invalidValue, + TResult Function()? shortRead, + TResult Function()? badLengthDescriptor, + TResult Function(String field0)? io, + TResult Function()? unsupportedCompression, + TResult Function()? dangerousValue, + required TResult orElse(), + }) { + if (unknownVersion != null) { + return unknownVersion(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(DecodeError_UnknownVersion value) unknownVersion, + required TResult Function(DecodeError_UnknownRequiredFeature value) + unknownRequiredFeature, + required TResult Function(DecodeError_InvalidValue value) invalidValue, + required TResult Function(DecodeError_ShortRead value) shortRead, + required TResult Function(DecodeError_BadLengthDescriptor value) + badLengthDescriptor, + required TResult Function(DecodeError_Io value) io, + required TResult Function(DecodeError_UnsupportedCompression value) + unsupportedCompression, + required TResult Function(DecodeError_DangerousValue value) dangerousValue, + }) { + return unknownVersion(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult? Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult? Function(DecodeError_InvalidValue value)? invalidValue, + TResult? Function(DecodeError_ShortRead value)? shortRead, + TResult? Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult? Function(DecodeError_Io value)? io, + TResult? Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult? Function(DecodeError_DangerousValue value)? dangerousValue, + }) { + return unknownVersion?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult Function(DecodeError_InvalidValue value)? invalidValue, + TResult Function(DecodeError_ShortRead value)? shortRead, + TResult Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult Function(DecodeError_Io value)? io, + TResult Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult Function(DecodeError_DangerousValue value)? dangerousValue, + required TResult orElse(), + }) { + if (unknownVersion != null) { + return unknownVersion(this); + } + return orElse(); + } +} + +abstract class DecodeError_UnknownVersion extends DecodeError { + const factory DecodeError_UnknownVersion() = _$DecodeError_UnknownVersionImpl; + const DecodeError_UnknownVersion._() : super._(); +} + +/// @nodoc +abstract class _$$DecodeError_UnknownRequiredFeatureImplCopyWith<$Res> { + factory _$$DecodeError_UnknownRequiredFeatureImplCopyWith( + _$DecodeError_UnknownRequiredFeatureImpl value, + $Res Function(_$DecodeError_UnknownRequiredFeatureImpl) then) = + __$$DecodeError_UnknownRequiredFeatureImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$DecodeError_UnknownRequiredFeatureImplCopyWithImpl<$Res> + extends _$DecodeErrorCopyWithImpl<$Res, + _$DecodeError_UnknownRequiredFeatureImpl> + implements _$$DecodeError_UnknownRequiredFeatureImplCopyWith<$Res> { + __$$DecodeError_UnknownRequiredFeatureImplCopyWithImpl( + _$DecodeError_UnknownRequiredFeatureImpl _value, + $Res Function(_$DecodeError_UnknownRequiredFeatureImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$DecodeError_UnknownRequiredFeatureImpl + extends DecodeError_UnknownRequiredFeature { + const _$DecodeError_UnknownRequiredFeatureImpl() : super._(); + + @override + String toString() { + return 'DecodeError.unknownRequiredFeature()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$DecodeError_UnknownRequiredFeatureImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() unknownVersion, + required TResult Function() unknownRequiredFeature, + required TResult Function() invalidValue, + required TResult Function() shortRead, + required TResult Function() badLengthDescriptor, + required TResult Function(String field0) io, + required TResult Function() unsupportedCompression, + required TResult Function() dangerousValue, + }) { + return unknownRequiredFeature(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? unknownVersion, + TResult? Function()? unknownRequiredFeature, + TResult? Function()? invalidValue, + TResult? Function()? shortRead, + TResult? Function()? badLengthDescriptor, + TResult? Function(String field0)? io, + TResult? Function()? unsupportedCompression, + TResult? Function()? dangerousValue, + }) { + return unknownRequiredFeature?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? unknownVersion, + TResult Function()? unknownRequiredFeature, + TResult Function()? invalidValue, + TResult Function()? shortRead, + TResult Function()? badLengthDescriptor, + TResult Function(String field0)? io, + TResult Function()? unsupportedCompression, + TResult Function()? dangerousValue, + required TResult orElse(), + }) { + if (unknownRequiredFeature != null) { + return unknownRequiredFeature(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(DecodeError_UnknownVersion value) unknownVersion, + required TResult Function(DecodeError_UnknownRequiredFeature value) + unknownRequiredFeature, + required TResult Function(DecodeError_InvalidValue value) invalidValue, + required TResult Function(DecodeError_ShortRead value) shortRead, + required TResult Function(DecodeError_BadLengthDescriptor value) + badLengthDescriptor, + required TResult Function(DecodeError_Io value) io, + required TResult Function(DecodeError_UnsupportedCompression value) + unsupportedCompression, + required TResult Function(DecodeError_DangerousValue value) dangerousValue, + }) { + return unknownRequiredFeature(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult? Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult? Function(DecodeError_InvalidValue value)? invalidValue, + TResult? Function(DecodeError_ShortRead value)? shortRead, + TResult? Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult? Function(DecodeError_Io value)? io, + TResult? Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult? Function(DecodeError_DangerousValue value)? dangerousValue, + }) { + return unknownRequiredFeature?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult Function(DecodeError_InvalidValue value)? invalidValue, + TResult Function(DecodeError_ShortRead value)? shortRead, + TResult Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult Function(DecodeError_Io value)? io, + TResult Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult Function(DecodeError_DangerousValue value)? dangerousValue, + required TResult orElse(), + }) { + if (unknownRequiredFeature != null) { + return unknownRequiredFeature(this); + } + return orElse(); + } +} + +abstract class DecodeError_UnknownRequiredFeature extends DecodeError { + const factory DecodeError_UnknownRequiredFeature() = + _$DecodeError_UnknownRequiredFeatureImpl; + const DecodeError_UnknownRequiredFeature._() : super._(); +} + +/// @nodoc +abstract class _$$DecodeError_InvalidValueImplCopyWith<$Res> { + factory _$$DecodeError_InvalidValueImplCopyWith( + _$DecodeError_InvalidValueImpl value, + $Res Function(_$DecodeError_InvalidValueImpl) then) = + __$$DecodeError_InvalidValueImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$DecodeError_InvalidValueImplCopyWithImpl<$Res> + extends _$DecodeErrorCopyWithImpl<$Res, _$DecodeError_InvalidValueImpl> + implements _$$DecodeError_InvalidValueImplCopyWith<$Res> { + __$$DecodeError_InvalidValueImplCopyWithImpl( + _$DecodeError_InvalidValueImpl _value, + $Res Function(_$DecodeError_InvalidValueImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$DecodeError_InvalidValueImpl extends DecodeError_InvalidValue { + const _$DecodeError_InvalidValueImpl() : super._(); + + @override + String toString() { + return 'DecodeError.invalidValue()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$DecodeError_InvalidValueImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() unknownVersion, + required TResult Function() unknownRequiredFeature, + required TResult Function() invalidValue, + required TResult Function() shortRead, + required TResult Function() badLengthDescriptor, + required TResult Function(String field0) io, + required TResult Function() unsupportedCompression, + required TResult Function() dangerousValue, + }) { + return invalidValue(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? unknownVersion, + TResult? Function()? unknownRequiredFeature, + TResult? Function()? invalidValue, + TResult? Function()? shortRead, + TResult? Function()? badLengthDescriptor, + TResult? Function(String field0)? io, + TResult? Function()? unsupportedCompression, + TResult? Function()? dangerousValue, + }) { + return invalidValue?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? unknownVersion, + TResult Function()? unknownRequiredFeature, + TResult Function()? invalidValue, + TResult Function()? shortRead, + TResult Function()? badLengthDescriptor, + TResult Function(String field0)? io, + TResult Function()? unsupportedCompression, + TResult Function()? dangerousValue, + required TResult orElse(), + }) { + if (invalidValue != null) { + return invalidValue(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(DecodeError_UnknownVersion value) unknownVersion, + required TResult Function(DecodeError_UnknownRequiredFeature value) + unknownRequiredFeature, + required TResult Function(DecodeError_InvalidValue value) invalidValue, + required TResult Function(DecodeError_ShortRead value) shortRead, + required TResult Function(DecodeError_BadLengthDescriptor value) + badLengthDescriptor, + required TResult Function(DecodeError_Io value) io, + required TResult Function(DecodeError_UnsupportedCompression value) + unsupportedCompression, + required TResult Function(DecodeError_DangerousValue value) dangerousValue, + }) { + return invalidValue(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult? Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult? Function(DecodeError_InvalidValue value)? invalidValue, + TResult? Function(DecodeError_ShortRead value)? shortRead, + TResult? Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult? Function(DecodeError_Io value)? io, + TResult? Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult? Function(DecodeError_DangerousValue value)? dangerousValue, + }) { + return invalidValue?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult Function(DecodeError_InvalidValue value)? invalidValue, + TResult Function(DecodeError_ShortRead value)? shortRead, + TResult Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult Function(DecodeError_Io value)? io, + TResult Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult Function(DecodeError_DangerousValue value)? dangerousValue, + required TResult orElse(), + }) { + if (invalidValue != null) { + return invalidValue(this); + } + return orElse(); + } +} + +abstract class DecodeError_InvalidValue extends DecodeError { + const factory DecodeError_InvalidValue() = _$DecodeError_InvalidValueImpl; + const DecodeError_InvalidValue._() : super._(); +} + +/// @nodoc +abstract class _$$DecodeError_ShortReadImplCopyWith<$Res> { + factory _$$DecodeError_ShortReadImplCopyWith( + _$DecodeError_ShortReadImpl value, + $Res Function(_$DecodeError_ShortReadImpl) then) = + __$$DecodeError_ShortReadImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$DecodeError_ShortReadImplCopyWithImpl<$Res> + extends _$DecodeErrorCopyWithImpl<$Res, _$DecodeError_ShortReadImpl> + implements _$$DecodeError_ShortReadImplCopyWith<$Res> { + __$$DecodeError_ShortReadImplCopyWithImpl(_$DecodeError_ShortReadImpl _value, + $Res Function(_$DecodeError_ShortReadImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$DecodeError_ShortReadImpl extends DecodeError_ShortRead { + const _$DecodeError_ShortReadImpl() : super._(); + + @override + String toString() { + return 'DecodeError.shortRead()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$DecodeError_ShortReadImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() unknownVersion, + required TResult Function() unknownRequiredFeature, + required TResult Function() invalidValue, + required TResult Function() shortRead, + required TResult Function() badLengthDescriptor, + required TResult Function(String field0) io, + required TResult Function() unsupportedCompression, + required TResult Function() dangerousValue, + }) { + return shortRead(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? unknownVersion, + TResult? Function()? unknownRequiredFeature, + TResult? Function()? invalidValue, + TResult? Function()? shortRead, + TResult? Function()? badLengthDescriptor, + TResult? Function(String field0)? io, + TResult? Function()? unsupportedCompression, + TResult? Function()? dangerousValue, + }) { + return shortRead?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? unknownVersion, + TResult Function()? unknownRequiredFeature, + TResult Function()? invalidValue, + TResult Function()? shortRead, + TResult Function()? badLengthDescriptor, + TResult Function(String field0)? io, + TResult Function()? unsupportedCompression, + TResult Function()? dangerousValue, + required TResult orElse(), + }) { + if (shortRead != null) { + return shortRead(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(DecodeError_UnknownVersion value) unknownVersion, + required TResult Function(DecodeError_UnknownRequiredFeature value) + unknownRequiredFeature, + required TResult Function(DecodeError_InvalidValue value) invalidValue, + required TResult Function(DecodeError_ShortRead value) shortRead, + required TResult Function(DecodeError_BadLengthDescriptor value) + badLengthDescriptor, + required TResult Function(DecodeError_Io value) io, + required TResult Function(DecodeError_UnsupportedCompression value) + unsupportedCompression, + required TResult Function(DecodeError_DangerousValue value) dangerousValue, + }) { + return shortRead(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult? Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult? Function(DecodeError_InvalidValue value)? invalidValue, + TResult? Function(DecodeError_ShortRead value)? shortRead, + TResult? Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult? Function(DecodeError_Io value)? io, + TResult? Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult? Function(DecodeError_DangerousValue value)? dangerousValue, + }) { + return shortRead?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult Function(DecodeError_InvalidValue value)? invalidValue, + TResult Function(DecodeError_ShortRead value)? shortRead, + TResult Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult Function(DecodeError_Io value)? io, + TResult Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult Function(DecodeError_DangerousValue value)? dangerousValue, + required TResult orElse(), + }) { + if (shortRead != null) { + return shortRead(this); + } + return orElse(); + } +} + +abstract class DecodeError_ShortRead extends DecodeError { + const factory DecodeError_ShortRead() = _$DecodeError_ShortReadImpl; + const DecodeError_ShortRead._() : super._(); +} + +/// @nodoc +abstract class _$$DecodeError_BadLengthDescriptorImplCopyWith<$Res> { + factory _$$DecodeError_BadLengthDescriptorImplCopyWith( + _$DecodeError_BadLengthDescriptorImpl value, + $Res Function(_$DecodeError_BadLengthDescriptorImpl) then) = + __$$DecodeError_BadLengthDescriptorImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$DecodeError_BadLengthDescriptorImplCopyWithImpl<$Res> + extends _$DecodeErrorCopyWithImpl<$Res, + _$DecodeError_BadLengthDescriptorImpl> + implements _$$DecodeError_BadLengthDescriptorImplCopyWith<$Res> { + __$$DecodeError_BadLengthDescriptorImplCopyWithImpl( + _$DecodeError_BadLengthDescriptorImpl _value, + $Res Function(_$DecodeError_BadLengthDescriptorImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$DecodeError_BadLengthDescriptorImpl + extends DecodeError_BadLengthDescriptor { + const _$DecodeError_BadLengthDescriptorImpl() : super._(); + + @override + String toString() { + return 'DecodeError.badLengthDescriptor()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$DecodeError_BadLengthDescriptorImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() unknownVersion, + required TResult Function() unknownRequiredFeature, + required TResult Function() invalidValue, + required TResult Function() shortRead, + required TResult Function() badLengthDescriptor, + required TResult Function(String field0) io, + required TResult Function() unsupportedCompression, + required TResult Function() dangerousValue, + }) { + return badLengthDescriptor(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? unknownVersion, + TResult? Function()? unknownRequiredFeature, + TResult? Function()? invalidValue, + TResult? Function()? shortRead, + TResult? Function()? badLengthDescriptor, + TResult? Function(String field0)? io, + TResult? Function()? unsupportedCompression, + TResult? Function()? dangerousValue, + }) { + return badLengthDescriptor?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? unknownVersion, + TResult Function()? unknownRequiredFeature, + TResult Function()? invalidValue, + TResult Function()? shortRead, + TResult Function()? badLengthDescriptor, + TResult Function(String field0)? io, + TResult Function()? unsupportedCompression, + TResult Function()? dangerousValue, + required TResult orElse(), + }) { + if (badLengthDescriptor != null) { + return badLengthDescriptor(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(DecodeError_UnknownVersion value) unknownVersion, + required TResult Function(DecodeError_UnknownRequiredFeature value) + unknownRequiredFeature, + required TResult Function(DecodeError_InvalidValue value) invalidValue, + required TResult Function(DecodeError_ShortRead value) shortRead, + required TResult Function(DecodeError_BadLengthDescriptor value) + badLengthDescriptor, + required TResult Function(DecodeError_Io value) io, + required TResult Function(DecodeError_UnsupportedCompression value) + unsupportedCompression, + required TResult Function(DecodeError_DangerousValue value) dangerousValue, + }) { + return badLengthDescriptor(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult? Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult? Function(DecodeError_InvalidValue value)? invalidValue, + TResult? Function(DecodeError_ShortRead value)? shortRead, + TResult? Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult? Function(DecodeError_Io value)? io, + TResult? Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult? Function(DecodeError_DangerousValue value)? dangerousValue, + }) { + return badLengthDescriptor?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult Function(DecodeError_InvalidValue value)? invalidValue, + TResult Function(DecodeError_ShortRead value)? shortRead, + TResult Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult Function(DecodeError_Io value)? io, + TResult Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult Function(DecodeError_DangerousValue value)? dangerousValue, + required TResult orElse(), + }) { + if (badLengthDescriptor != null) { + return badLengthDescriptor(this); + } + return orElse(); + } +} + +abstract class DecodeError_BadLengthDescriptor extends DecodeError { + const factory DecodeError_BadLengthDescriptor() = + _$DecodeError_BadLengthDescriptorImpl; + const DecodeError_BadLengthDescriptor._() : super._(); +} + +/// @nodoc +abstract class _$$DecodeError_IoImplCopyWith<$Res> { + factory _$$DecodeError_IoImplCopyWith(_$DecodeError_IoImpl value, + $Res Function(_$DecodeError_IoImpl) then) = + __$$DecodeError_IoImplCopyWithImpl<$Res>; + @useResult + $Res call({String field0}); +} + +/// @nodoc +class __$$DecodeError_IoImplCopyWithImpl<$Res> + extends _$DecodeErrorCopyWithImpl<$Res, _$DecodeError_IoImpl> + implements _$$DecodeError_IoImplCopyWith<$Res> { + __$$DecodeError_IoImplCopyWithImpl( + _$DecodeError_IoImpl _value, $Res Function(_$DecodeError_IoImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? field0 = null, + }) { + return _then(_$DecodeError_IoImpl( + null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc + +class _$DecodeError_IoImpl extends DecodeError_Io { + const _$DecodeError_IoImpl(this.field0) : super._(); + + @override + final String field0; + + @override + String toString() { + return 'DecodeError.io(field0: $field0)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$DecodeError_IoImpl && + (identical(other.field0, field0) || other.field0 == field0)); + } + + @override + int get hashCode => Object.hash(runtimeType, field0); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$DecodeError_IoImplCopyWith<_$DecodeError_IoImpl> get copyWith => + __$$DecodeError_IoImplCopyWithImpl<_$DecodeError_IoImpl>( + this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() unknownVersion, + required TResult Function() unknownRequiredFeature, + required TResult Function() invalidValue, + required TResult Function() shortRead, + required TResult Function() badLengthDescriptor, + required TResult Function(String field0) io, + required TResult Function() unsupportedCompression, + required TResult Function() dangerousValue, + }) { + return io(field0); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? unknownVersion, + TResult? Function()? unknownRequiredFeature, + TResult? Function()? invalidValue, + TResult? Function()? shortRead, + TResult? Function()? badLengthDescriptor, + TResult? Function(String field0)? io, + TResult? Function()? unsupportedCompression, + TResult? Function()? dangerousValue, + }) { + return io?.call(field0); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? unknownVersion, + TResult Function()? unknownRequiredFeature, + TResult Function()? invalidValue, + TResult Function()? shortRead, + TResult Function()? badLengthDescriptor, + TResult Function(String field0)? io, + TResult Function()? unsupportedCompression, + TResult Function()? dangerousValue, + required TResult orElse(), + }) { + if (io != null) { + return io(field0); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(DecodeError_UnknownVersion value) unknownVersion, + required TResult Function(DecodeError_UnknownRequiredFeature value) + unknownRequiredFeature, + required TResult Function(DecodeError_InvalidValue value) invalidValue, + required TResult Function(DecodeError_ShortRead value) shortRead, + required TResult Function(DecodeError_BadLengthDescriptor value) + badLengthDescriptor, + required TResult Function(DecodeError_Io value) io, + required TResult Function(DecodeError_UnsupportedCompression value) + unsupportedCompression, + required TResult Function(DecodeError_DangerousValue value) dangerousValue, + }) { + return io(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult? Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult? Function(DecodeError_InvalidValue value)? invalidValue, + TResult? Function(DecodeError_ShortRead value)? shortRead, + TResult? Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult? Function(DecodeError_Io value)? io, + TResult? Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult? Function(DecodeError_DangerousValue value)? dangerousValue, + }) { + return io?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult Function(DecodeError_InvalidValue value)? invalidValue, + TResult Function(DecodeError_ShortRead value)? shortRead, + TResult Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult Function(DecodeError_Io value)? io, + TResult Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult Function(DecodeError_DangerousValue value)? dangerousValue, + required TResult orElse(), + }) { + if (io != null) { + return io(this); + } + return orElse(); + } +} + +abstract class DecodeError_Io extends DecodeError { + const factory DecodeError_Io(final String field0) = _$DecodeError_IoImpl; + const DecodeError_Io._() : super._(); + + String get field0; + @JsonKey(ignore: true) + _$$DecodeError_IoImplCopyWith<_$DecodeError_IoImpl> get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$DecodeError_UnsupportedCompressionImplCopyWith<$Res> { + factory _$$DecodeError_UnsupportedCompressionImplCopyWith( + _$DecodeError_UnsupportedCompressionImpl value, + $Res Function(_$DecodeError_UnsupportedCompressionImpl) then) = + __$$DecodeError_UnsupportedCompressionImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$DecodeError_UnsupportedCompressionImplCopyWithImpl<$Res> + extends _$DecodeErrorCopyWithImpl<$Res, + _$DecodeError_UnsupportedCompressionImpl> + implements _$$DecodeError_UnsupportedCompressionImplCopyWith<$Res> { + __$$DecodeError_UnsupportedCompressionImplCopyWithImpl( + _$DecodeError_UnsupportedCompressionImpl _value, + $Res Function(_$DecodeError_UnsupportedCompressionImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$DecodeError_UnsupportedCompressionImpl + extends DecodeError_UnsupportedCompression { + const _$DecodeError_UnsupportedCompressionImpl() : super._(); + + @override + String toString() { + return 'DecodeError.unsupportedCompression()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$DecodeError_UnsupportedCompressionImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() unknownVersion, + required TResult Function() unknownRequiredFeature, + required TResult Function() invalidValue, + required TResult Function() shortRead, + required TResult Function() badLengthDescriptor, + required TResult Function(String field0) io, + required TResult Function() unsupportedCompression, + required TResult Function() dangerousValue, + }) { + return unsupportedCompression(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? unknownVersion, + TResult? Function()? unknownRequiredFeature, + TResult? Function()? invalidValue, + TResult? Function()? shortRead, + TResult? Function()? badLengthDescriptor, + TResult? Function(String field0)? io, + TResult? Function()? unsupportedCompression, + TResult? Function()? dangerousValue, + }) { + return unsupportedCompression?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? unknownVersion, + TResult Function()? unknownRequiredFeature, + TResult Function()? invalidValue, + TResult Function()? shortRead, + TResult Function()? badLengthDescriptor, + TResult Function(String field0)? io, + TResult Function()? unsupportedCompression, + TResult Function()? dangerousValue, + required TResult orElse(), + }) { + if (unsupportedCompression != null) { + return unsupportedCompression(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(DecodeError_UnknownVersion value) unknownVersion, + required TResult Function(DecodeError_UnknownRequiredFeature value) + unknownRequiredFeature, + required TResult Function(DecodeError_InvalidValue value) invalidValue, + required TResult Function(DecodeError_ShortRead value) shortRead, + required TResult Function(DecodeError_BadLengthDescriptor value) + badLengthDescriptor, + required TResult Function(DecodeError_Io value) io, + required TResult Function(DecodeError_UnsupportedCompression value) + unsupportedCompression, + required TResult Function(DecodeError_DangerousValue value) dangerousValue, + }) { + return unsupportedCompression(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult? Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult? Function(DecodeError_InvalidValue value)? invalidValue, + TResult? Function(DecodeError_ShortRead value)? shortRead, + TResult? Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult? Function(DecodeError_Io value)? io, + TResult? Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult? Function(DecodeError_DangerousValue value)? dangerousValue, + }) { + return unsupportedCompression?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult Function(DecodeError_InvalidValue value)? invalidValue, + TResult Function(DecodeError_ShortRead value)? shortRead, + TResult Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult Function(DecodeError_Io value)? io, + TResult Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult Function(DecodeError_DangerousValue value)? dangerousValue, + required TResult orElse(), + }) { + if (unsupportedCompression != null) { + return unsupportedCompression(this); + } + return orElse(); + } +} + +abstract class DecodeError_UnsupportedCompression extends DecodeError { + const factory DecodeError_UnsupportedCompression() = + _$DecodeError_UnsupportedCompressionImpl; + const DecodeError_UnsupportedCompression._() : super._(); +} + +/// @nodoc +abstract class _$$DecodeError_DangerousValueImplCopyWith<$Res> { + factory _$$DecodeError_DangerousValueImplCopyWith( + _$DecodeError_DangerousValueImpl value, + $Res Function(_$DecodeError_DangerousValueImpl) then) = + __$$DecodeError_DangerousValueImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$DecodeError_DangerousValueImplCopyWithImpl<$Res> + extends _$DecodeErrorCopyWithImpl<$Res, _$DecodeError_DangerousValueImpl> + implements _$$DecodeError_DangerousValueImplCopyWith<$Res> { + __$$DecodeError_DangerousValueImplCopyWithImpl( + _$DecodeError_DangerousValueImpl _value, + $Res Function(_$DecodeError_DangerousValueImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$DecodeError_DangerousValueImpl extends DecodeError_DangerousValue { + const _$DecodeError_DangerousValueImpl() : super._(); + + @override + String toString() { + return 'DecodeError.dangerousValue()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$DecodeError_DangerousValueImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() unknownVersion, + required TResult Function() unknownRequiredFeature, + required TResult Function() invalidValue, + required TResult Function() shortRead, + required TResult Function() badLengthDescriptor, + required TResult Function(String field0) io, + required TResult Function() unsupportedCompression, + required TResult Function() dangerousValue, + }) { + return dangerousValue(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? unknownVersion, + TResult? Function()? unknownRequiredFeature, + TResult? Function()? invalidValue, + TResult? Function()? shortRead, + TResult? Function()? badLengthDescriptor, + TResult? Function(String field0)? io, + TResult? Function()? unsupportedCompression, + TResult? Function()? dangerousValue, + }) { + return dangerousValue?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? unknownVersion, + TResult Function()? unknownRequiredFeature, + TResult Function()? invalidValue, + TResult Function()? shortRead, + TResult Function()? badLengthDescriptor, + TResult Function(String field0)? io, + TResult Function()? unsupportedCompression, + TResult Function()? dangerousValue, + required TResult orElse(), + }) { + if (dangerousValue != null) { + return dangerousValue(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(DecodeError_UnknownVersion value) unknownVersion, + required TResult Function(DecodeError_UnknownRequiredFeature value) + unknownRequiredFeature, + required TResult Function(DecodeError_InvalidValue value) invalidValue, + required TResult Function(DecodeError_ShortRead value) shortRead, + required TResult Function(DecodeError_BadLengthDescriptor value) + badLengthDescriptor, + required TResult Function(DecodeError_Io value) io, + required TResult Function(DecodeError_UnsupportedCompression value) + unsupportedCompression, + required TResult Function(DecodeError_DangerousValue value) dangerousValue, + }) { + return dangerousValue(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult? Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult? Function(DecodeError_InvalidValue value)? invalidValue, + TResult? Function(DecodeError_ShortRead value)? shortRead, + TResult? Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult? Function(DecodeError_Io value)? io, + TResult? Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult? Function(DecodeError_DangerousValue value)? dangerousValue, + }) { + return dangerousValue?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult Function(DecodeError_InvalidValue value)? invalidValue, + TResult Function(DecodeError_ShortRead value)? shortRead, + TResult Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult Function(DecodeError_Io value)? io, + TResult Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult Function(DecodeError_DangerousValue value)? dangerousValue, + required TResult orElse(), + }) { + if (dangerousValue != null) { + return dangerousValue(this); + } + return orElse(); + } +} + +abstract class DecodeError_DangerousValue extends DecodeError { + const factory DecodeError_DangerousValue() = _$DecodeError_DangerousValueImpl; + const DecodeError_DangerousValue._() : super._(); +} + +/// @nodoc +mixin _$LdkNodeError { + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $LdkNodeErrorCopyWith<$Res> { + factory $LdkNodeErrorCopyWith( + LdkNodeError value, $Res Function(LdkNodeError) then) = + _$LdkNodeErrorCopyWithImpl<$Res, LdkNodeError>; +} + +/// @nodoc +class _$LdkNodeErrorCopyWithImpl<$Res, $Val extends LdkNodeError> + implements $LdkNodeErrorCopyWith<$Res> { + _$LdkNodeErrorCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidTxidImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidTxidImplCopyWith( + _$LdkNodeError_InvalidTxidImpl value, + $Res Function(_$LdkNodeError_InvalidTxidImpl) then) = + __$$LdkNodeError_InvalidTxidImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidTxidImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_InvalidTxidImpl> + implements _$$LdkNodeError_InvalidTxidImplCopyWith<$Res> { + __$$LdkNodeError_InvalidTxidImplCopyWithImpl( + _$LdkNodeError_InvalidTxidImpl _value, + $Res Function(_$LdkNodeError_InvalidTxidImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidTxidImpl extends LdkNodeError_InvalidTxid { + const _$LdkNodeError_InvalidTxidImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidTxid()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidTxidImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidTxid(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidTxid?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidTxid != null) { + return invalidTxid(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidTxid(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidTxid?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidTxid != null) { + return invalidTxid(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidTxid extends LdkNodeError { + const factory LdkNodeError_InvalidTxid() = _$LdkNodeError_InvalidTxidImpl; + const LdkNodeError_InvalidTxid._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_AlreadyRunningImplCopyWith<$Res> { + factory _$$LdkNodeError_AlreadyRunningImplCopyWith( + _$LdkNodeError_AlreadyRunningImpl value, + $Res Function(_$LdkNodeError_AlreadyRunningImpl) then) = + __$$LdkNodeError_AlreadyRunningImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_AlreadyRunningImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_AlreadyRunningImpl> + implements _$$LdkNodeError_AlreadyRunningImplCopyWith<$Res> { + __$$LdkNodeError_AlreadyRunningImplCopyWithImpl( + _$LdkNodeError_AlreadyRunningImpl _value, + $Res Function(_$LdkNodeError_AlreadyRunningImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_AlreadyRunningImpl extends LdkNodeError_AlreadyRunning { + const _$LdkNodeError_AlreadyRunningImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.alreadyRunning()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_AlreadyRunningImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return alreadyRunning(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return alreadyRunning?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (alreadyRunning != null) { + return alreadyRunning(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return alreadyRunning(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return alreadyRunning?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (alreadyRunning != null) { + return alreadyRunning(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_AlreadyRunning extends LdkNodeError { + const factory LdkNodeError_AlreadyRunning() = + _$LdkNodeError_AlreadyRunningImpl; + const LdkNodeError_AlreadyRunning._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_NotRunningImplCopyWith<$Res> { + factory _$$LdkNodeError_NotRunningImplCopyWith( + _$LdkNodeError_NotRunningImpl value, + $Res Function(_$LdkNodeError_NotRunningImpl) then) = + __$$LdkNodeError_NotRunningImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_NotRunningImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_NotRunningImpl> + implements _$$LdkNodeError_NotRunningImplCopyWith<$Res> { + __$$LdkNodeError_NotRunningImplCopyWithImpl( + _$LdkNodeError_NotRunningImpl _value, + $Res Function(_$LdkNodeError_NotRunningImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_NotRunningImpl extends LdkNodeError_NotRunning { + const _$LdkNodeError_NotRunningImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.notRunning()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_NotRunningImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return notRunning(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return notRunning?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (notRunning != null) { + return notRunning(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return notRunning(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return notRunning?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (notRunning != null) { + return notRunning(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_NotRunning extends LdkNodeError { + const factory LdkNodeError_NotRunning() = _$LdkNodeError_NotRunningImpl; + const LdkNodeError_NotRunning._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_OnchainTxCreationFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_OnchainTxCreationFailedImplCopyWith( + _$LdkNodeError_OnchainTxCreationFailedImpl value, + $Res Function(_$LdkNodeError_OnchainTxCreationFailedImpl) then) = + __$$LdkNodeError_OnchainTxCreationFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_OnchainTxCreationFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_OnchainTxCreationFailedImpl> + implements _$$LdkNodeError_OnchainTxCreationFailedImplCopyWith<$Res> { + __$$LdkNodeError_OnchainTxCreationFailedImplCopyWithImpl( + _$LdkNodeError_OnchainTxCreationFailedImpl _value, + $Res Function(_$LdkNodeError_OnchainTxCreationFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_OnchainTxCreationFailedImpl + extends LdkNodeError_OnchainTxCreationFailed { + const _$LdkNodeError_OnchainTxCreationFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.onchainTxCreationFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_OnchainTxCreationFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return onchainTxCreationFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return onchainTxCreationFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (onchainTxCreationFailed != null) { + return onchainTxCreationFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return onchainTxCreationFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return onchainTxCreationFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (onchainTxCreationFailed != null) { + return onchainTxCreationFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_OnchainTxCreationFailed extends LdkNodeError { + const factory LdkNodeError_OnchainTxCreationFailed() = + _$LdkNodeError_OnchainTxCreationFailedImpl; + const LdkNodeError_OnchainTxCreationFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_ConnectionFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_ConnectionFailedImplCopyWith( + _$LdkNodeError_ConnectionFailedImpl value, + $Res Function(_$LdkNodeError_ConnectionFailedImpl) then) = + __$$LdkNodeError_ConnectionFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_ConnectionFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_ConnectionFailedImpl> + implements _$$LdkNodeError_ConnectionFailedImplCopyWith<$Res> { + __$$LdkNodeError_ConnectionFailedImplCopyWithImpl( + _$LdkNodeError_ConnectionFailedImpl _value, + $Res Function(_$LdkNodeError_ConnectionFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_ConnectionFailedImpl + extends LdkNodeError_ConnectionFailed { + const _$LdkNodeError_ConnectionFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.connectionFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_ConnectionFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return connectionFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return connectionFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (connectionFailed != null) { + return connectionFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return connectionFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return connectionFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (connectionFailed != null) { + return connectionFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_ConnectionFailed extends LdkNodeError { + const factory LdkNodeError_ConnectionFailed() = + _$LdkNodeError_ConnectionFailedImpl; + const LdkNodeError_ConnectionFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvoiceCreationFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_InvoiceCreationFailedImplCopyWith( + _$LdkNodeError_InvoiceCreationFailedImpl value, + $Res Function(_$LdkNodeError_InvoiceCreationFailedImpl) then) = + __$$LdkNodeError_InvoiceCreationFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvoiceCreationFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InvoiceCreationFailedImpl> + implements _$$LdkNodeError_InvoiceCreationFailedImplCopyWith<$Res> { + __$$LdkNodeError_InvoiceCreationFailedImplCopyWithImpl( + _$LdkNodeError_InvoiceCreationFailedImpl _value, + $Res Function(_$LdkNodeError_InvoiceCreationFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvoiceCreationFailedImpl + extends LdkNodeError_InvoiceCreationFailed { + const _$LdkNodeError_InvoiceCreationFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invoiceCreationFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvoiceCreationFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invoiceCreationFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invoiceCreationFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invoiceCreationFailed != null) { + return invoiceCreationFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invoiceCreationFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invoiceCreationFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invoiceCreationFailed != null) { + return invoiceCreationFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvoiceCreationFailed extends LdkNodeError { + const factory LdkNodeError_InvoiceCreationFailed() = + _$LdkNodeError_InvoiceCreationFailedImpl; + const LdkNodeError_InvoiceCreationFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_PaymentSendingFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_PaymentSendingFailedImplCopyWith( + _$LdkNodeError_PaymentSendingFailedImpl value, + $Res Function(_$LdkNodeError_PaymentSendingFailedImpl) then) = + __$$LdkNodeError_PaymentSendingFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_PaymentSendingFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_PaymentSendingFailedImpl> + implements _$$LdkNodeError_PaymentSendingFailedImplCopyWith<$Res> { + __$$LdkNodeError_PaymentSendingFailedImplCopyWithImpl( + _$LdkNodeError_PaymentSendingFailedImpl _value, + $Res Function(_$LdkNodeError_PaymentSendingFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_PaymentSendingFailedImpl + extends LdkNodeError_PaymentSendingFailed { + const _$LdkNodeError_PaymentSendingFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.paymentSendingFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_PaymentSendingFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return paymentSendingFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return paymentSendingFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (paymentSendingFailed != null) { + return paymentSendingFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return paymentSendingFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return paymentSendingFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (paymentSendingFailed != null) { + return paymentSendingFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_PaymentSendingFailed extends LdkNodeError { + const factory LdkNodeError_PaymentSendingFailed() = + _$LdkNodeError_PaymentSendingFailedImpl; + const LdkNodeError_PaymentSendingFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_ProbeSendingFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_ProbeSendingFailedImplCopyWith( + _$LdkNodeError_ProbeSendingFailedImpl value, + $Res Function(_$LdkNodeError_ProbeSendingFailedImpl) then) = + __$$LdkNodeError_ProbeSendingFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_ProbeSendingFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_ProbeSendingFailedImpl> + implements _$$LdkNodeError_ProbeSendingFailedImplCopyWith<$Res> { + __$$LdkNodeError_ProbeSendingFailedImplCopyWithImpl( + _$LdkNodeError_ProbeSendingFailedImpl _value, + $Res Function(_$LdkNodeError_ProbeSendingFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_ProbeSendingFailedImpl + extends LdkNodeError_ProbeSendingFailed { + const _$LdkNodeError_ProbeSendingFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.probeSendingFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_ProbeSendingFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return probeSendingFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return probeSendingFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (probeSendingFailed != null) { + return probeSendingFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return probeSendingFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return probeSendingFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (probeSendingFailed != null) { + return probeSendingFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_ProbeSendingFailed extends LdkNodeError { + const factory LdkNodeError_ProbeSendingFailed() = + _$LdkNodeError_ProbeSendingFailedImpl; + const LdkNodeError_ProbeSendingFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_ChannelCreationFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_ChannelCreationFailedImplCopyWith( + _$LdkNodeError_ChannelCreationFailedImpl value, + $Res Function(_$LdkNodeError_ChannelCreationFailedImpl) then) = + __$$LdkNodeError_ChannelCreationFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_ChannelCreationFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_ChannelCreationFailedImpl> + implements _$$LdkNodeError_ChannelCreationFailedImplCopyWith<$Res> { + __$$LdkNodeError_ChannelCreationFailedImplCopyWithImpl( + _$LdkNodeError_ChannelCreationFailedImpl _value, + $Res Function(_$LdkNodeError_ChannelCreationFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_ChannelCreationFailedImpl + extends LdkNodeError_ChannelCreationFailed { + const _$LdkNodeError_ChannelCreationFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.channelCreationFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_ChannelCreationFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return channelCreationFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return channelCreationFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (channelCreationFailed != null) { + return channelCreationFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return channelCreationFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return channelCreationFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (channelCreationFailed != null) { + return channelCreationFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_ChannelCreationFailed extends LdkNodeError { + const factory LdkNodeError_ChannelCreationFailed() = + _$LdkNodeError_ChannelCreationFailedImpl; + const LdkNodeError_ChannelCreationFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_ChannelClosingFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_ChannelClosingFailedImplCopyWith( + _$LdkNodeError_ChannelClosingFailedImpl value, + $Res Function(_$LdkNodeError_ChannelClosingFailedImpl) then) = + __$$LdkNodeError_ChannelClosingFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_ChannelClosingFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_ChannelClosingFailedImpl> + implements _$$LdkNodeError_ChannelClosingFailedImplCopyWith<$Res> { + __$$LdkNodeError_ChannelClosingFailedImplCopyWithImpl( + _$LdkNodeError_ChannelClosingFailedImpl _value, + $Res Function(_$LdkNodeError_ChannelClosingFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_ChannelClosingFailedImpl + extends LdkNodeError_ChannelClosingFailed { + const _$LdkNodeError_ChannelClosingFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.channelClosingFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_ChannelClosingFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return channelClosingFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return channelClosingFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (channelClosingFailed != null) { + return channelClosingFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return channelClosingFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return channelClosingFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (channelClosingFailed != null) { + return channelClosingFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_ChannelClosingFailed extends LdkNodeError { + const factory LdkNodeError_ChannelClosingFailed() = + _$LdkNodeError_ChannelClosingFailedImpl; + const LdkNodeError_ChannelClosingFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_ChannelConfigUpdateFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_ChannelConfigUpdateFailedImplCopyWith( + _$LdkNodeError_ChannelConfigUpdateFailedImpl value, + $Res Function(_$LdkNodeError_ChannelConfigUpdateFailedImpl) then) = + __$$LdkNodeError_ChannelConfigUpdateFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_ChannelConfigUpdateFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_ChannelConfigUpdateFailedImpl> + implements _$$LdkNodeError_ChannelConfigUpdateFailedImplCopyWith<$Res> { + __$$LdkNodeError_ChannelConfigUpdateFailedImplCopyWithImpl( + _$LdkNodeError_ChannelConfigUpdateFailedImpl _value, + $Res Function(_$LdkNodeError_ChannelConfigUpdateFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_ChannelConfigUpdateFailedImpl + extends LdkNodeError_ChannelConfigUpdateFailed { + const _$LdkNodeError_ChannelConfigUpdateFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.channelConfigUpdateFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_ChannelConfigUpdateFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return channelConfigUpdateFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return channelConfigUpdateFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (channelConfigUpdateFailed != null) { + return channelConfigUpdateFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return channelConfigUpdateFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return channelConfigUpdateFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (channelConfigUpdateFailed != null) { + return channelConfigUpdateFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_ChannelConfigUpdateFailed extends LdkNodeError { + const factory LdkNodeError_ChannelConfigUpdateFailed() = + _$LdkNodeError_ChannelConfigUpdateFailedImpl; + const LdkNodeError_ChannelConfigUpdateFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_PersistenceFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_PersistenceFailedImplCopyWith( + _$LdkNodeError_PersistenceFailedImpl value, + $Res Function(_$LdkNodeError_PersistenceFailedImpl) then) = + __$$LdkNodeError_PersistenceFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_PersistenceFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_PersistenceFailedImpl> + implements _$$LdkNodeError_PersistenceFailedImplCopyWith<$Res> { + __$$LdkNodeError_PersistenceFailedImplCopyWithImpl( + _$LdkNodeError_PersistenceFailedImpl _value, + $Res Function(_$LdkNodeError_PersistenceFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_PersistenceFailedImpl + extends LdkNodeError_PersistenceFailed { + const _$LdkNodeError_PersistenceFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.persistenceFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_PersistenceFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return persistenceFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return persistenceFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (persistenceFailed != null) { + return persistenceFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return persistenceFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return persistenceFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (persistenceFailed != null) { + return persistenceFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_PersistenceFailed extends LdkNodeError { + const factory LdkNodeError_PersistenceFailed() = + _$LdkNodeError_PersistenceFailedImpl; + const LdkNodeError_PersistenceFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_WalletOperationFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_WalletOperationFailedImplCopyWith( + _$LdkNodeError_WalletOperationFailedImpl value, + $Res Function(_$LdkNodeError_WalletOperationFailedImpl) then) = + __$$LdkNodeError_WalletOperationFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_WalletOperationFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_WalletOperationFailedImpl> + implements _$$LdkNodeError_WalletOperationFailedImplCopyWith<$Res> { + __$$LdkNodeError_WalletOperationFailedImplCopyWithImpl( + _$LdkNodeError_WalletOperationFailedImpl _value, + $Res Function(_$LdkNodeError_WalletOperationFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_WalletOperationFailedImpl + extends LdkNodeError_WalletOperationFailed { + const _$LdkNodeError_WalletOperationFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.walletOperationFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_WalletOperationFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return walletOperationFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return walletOperationFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (walletOperationFailed != null) { + return walletOperationFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return walletOperationFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return walletOperationFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (walletOperationFailed != null) { + return walletOperationFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_WalletOperationFailed extends LdkNodeError { + const factory LdkNodeError_WalletOperationFailed() = + _$LdkNodeError_WalletOperationFailedImpl; + const LdkNodeError_WalletOperationFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_OnchainTxSigningFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_OnchainTxSigningFailedImplCopyWith( + _$LdkNodeError_OnchainTxSigningFailedImpl value, + $Res Function(_$LdkNodeError_OnchainTxSigningFailedImpl) then) = + __$$LdkNodeError_OnchainTxSigningFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_OnchainTxSigningFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_OnchainTxSigningFailedImpl> + implements _$$LdkNodeError_OnchainTxSigningFailedImplCopyWith<$Res> { + __$$LdkNodeError_OnchainTxSigningFailedImplCopyWithImpl( + _$LdkNodeError_OnchainTxSigningFailedImpl _value, + $Res Function(_$LdkNodeError_OnchainTxSigningFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_OnchainTxSigningFailedImpl + extends LdkNodeError_OnchainTxSigningFailed { + const _$LdkNodeError_OnchainTxSigningFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.onchainTxSigningFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_OnchainTxSigningFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return onchainTxSigningFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return onchainTxSigningFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (onchainTxSigningFailed != null) { + return onchainTxSigningFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return onchainTxSigningFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return onchainTxSigningFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (onchainTxSigningFailed != null) { + return onchainTxSigningFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_OnchainTxSigningFailed extends LdkNodeError { + const factory LdkNodeError_OnchainTxSigningFailed() = + _$LdkNodeError_OnchainTxSigningFailedImpl; + const LdkNodeError_OnchainTxSigningFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_MessageSigningFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_MessageSigningFailedImplCopyWith( + _$LdkNodeError_MessageSigningFailedImpl value, + $Res Function(_$LdkNodeError_MessageSigningFailedImpl) then) = + __$$LdkNodeError_MessageSigningFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_MessageSigningFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_MessageSigningFailedImpl> + implements _$$LdkNodeError_MessageSigningFailedImplCopyWith<$Res> { + __$$LdkNodeError_MessageSigningFailedImplCopyWithImpl( + _$LdkNodeError_MessageSigningFailedImpl _value, + $Res Function(_$LdkNodeError_MessageSigningFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_MessageSigningFailedImpl + extends LdkNodeError_MessageSigningFailed { + const _$LdkNodeError_MessageSigningFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.messageSigningFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_MessageSigningFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return messageSigningFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return messageSigningFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (messageSigningFailed != null) { + return messageSigningFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return messageSigningFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return messageSigningFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (messageSigningFailed != null) { + return messageSigningFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_MessageSigningFailed extends LdkNodeError { + const factory LdkNodeError_MessageSigningFailed() = + _$LdkNodeError_MessageSigningFailedImpl; + const LdkNodeError_MessageSigningFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_TxSyncFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_TxSyncFailedImplCopyWith( + _$LdkNodeError_TxSyncFailedImpl value, + $Res Function(_$LdkNodeError_TxSyncFailedImpl) then) = + __$$LdkNodeError_TxSyncFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_TxSyncFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_TxSyncFailedImpl> + implements _$$LdkNodeError_TxSyncFailedImplCopyWith<$Res> { + __$$LdkNodeError_TxSyncFailedImplCopyWithImpl( + _$LdkNodeError_TxSyncFailedImpl _value, + $Res Function(_$LdkNodeError_TxSyncFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_TxSyncFailedImpl extends LdkNodeError_TxSyncFailed { + const _$LdkNodeError_TxSyncFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.txSyncFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_TxSyncFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return txSyncFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return txSyncFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (txSyncFailed != null) { + return txSyncFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return txSyncFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return txSyncFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (txSyncFailed != null) { + return txSyncFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_TxSyncFailed extends LdkNodeError { + const factory LdkNodeError_TxSyncFailed() = _$LdkNodeError_TxSyncFailedImpl; + const LdkNodeError_TxSyncFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_GossipUpdateFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_GossipUpdateFailedImplCopyWith( + _$LdkNodeError_GossipUpdateFailedImpl value, + $Res Function(_$LdkNodeError_GossipUpdateFailedImpl) then) = + __$$LdkNodeError_GossipUpdateFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_GossipUpdateFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_GossipUpdateFailedImpl> + implements _$$LdkNodeError_GossipUpdateFailedImplCopyWith<$Res> { + __$$LdkNodeError_GossipUpdateFailedImplCopyWithImpl( + _$LdkNodeError_GossipUpdateFailedImpl _value, + $Res Function(_$LdkNodeError_GossipUpdateFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_GossipUpdateFailedImpl + extends LdkNodeError_GossipUpdateFailed { + const _$LdkNodeError_GossipUpdateFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.gossipUpdateFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_GossipUpdateFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return gossipUpdateFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return gossipUpdateFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (gossipUpdateFailed != null) { + return gossipUpdateFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return gossipUpdateFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return gossipUpdateFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (gossipUpdateFailed != null) { + return gossipUpdateFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_GossipUpdateFailed extends LdkNodeError { + const factory LdkNodeError_GossipUpdateFailed() = + _$LdkNodeError_GossipUpdateFailedImpl; + const LdkNodeError_GossipUpdateFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidAddressImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidAddressImplCopyWith( + _$LdkNodeError_InvalidAddressImpl value, + $Res Function(_$LdkNodeError_InvalidAddressImpl) then) = + __$$LdkNodeError_InvalidAddressImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidAddressImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_InvalidAddressImpl> + implements _$$LdkNodeError_InvalidAddressImplCopyWith<$Res> { + __$$LdkNodeError_InvalidAddressImplCopyWithImpl( + _$LdkNodeError_InvalidAddressImpl _value, + $Res Function(_$LdkNodeError_InvalidAddressImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidAddressImpl extends LdkNodeError_InvalidAddress { + const _$LdkNodeError_InvalidAddressImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidAddress()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidAddressImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidAddress(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidAddress?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidAddress != null) { + return invalidAddress(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidAddress(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidAddress?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidAddress != null) { + return invalidAddress(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidAddress extends LdkNodeError { + const factory LdkNodeError_InvalidAddress() = + _$LdkNodeError_InvalidAddressImpl; + const LdkNodeError_InvalidAddress._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidSocketAddressImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidSocketAddressImplCopyWith( + _$LdkNodeError_InvalidSocketAddressImpl value, + $Res Function(_$LdkNodeError_InvalidSocketAddressImpl) then) = + __$$LdkNodeError_InvalidSocketAddressImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidSocketAddressImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InvalidSocketAddressImpl> + implements _$$LdkNodeError_InvalidSocketAddressImplCopyWith<$Res> { + __$$LdkNodeError_InvalidSocketAddressImplCopyWithImpl( + _$LdkNodeError_InvalidSocketAddressImpl _value, + $Res Function(_$LdkNodeError_InvalidSocketAddressImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidSocketAddressImpl + extends LdkNodeError_InvalidSocketAddress { + const _$LdkNodeError_InvalidSocketAddressImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidSocketAddress()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidSocketAddressImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidSocketAddress(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidSocketAddress?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidSocketAddress != null) { + return invalidSocketAddress(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidSocketAddress(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidSocketAddress?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidSocketAddress != null) { + return invalidSocketAddress(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidSocketAddress extends LdkNodeError { + const factory LdkNodeError_InvalidSocketAddress() = + _$LdkNodeError_InvalidSocketAddressImpl; + const LdkNodeError_InvalidSocketAddress._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidPublicKeyImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidPublicKeyImplCopyWith( + _$LdkNodeError_InvalidPublicKeyImpl value, + $Res Function(_$LdkNodeError_InvalidPublicKeyImpl) then) = + __$$LdkNodeError_InvalidPublicKeyImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidPublicKeyImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InvalidPublicKeyImpl> + implements _$$LdkNodeError_InvalidPublicKeyImplCopyWith<$Res> { + __$$LdkNodeError_InvalidPublicKeyImplCopyWithImpl( + _$LdkNodeError_InvalidPublicKeyImpl _value, + $Res Function(_$LdkNodeError_InvalidPublicKeyImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidPublicKeyImpl + extends LdkNodeError_InvalidPublicKey { + const _$LdkNodeError_InvalidPublicKeyImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidPublicKey()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidPublicKeyImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidPublicKey(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidPublicKey?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidPublicKey != null) { + return invalidPublicKey(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidPublicKey(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidPublicKey?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidPublicKey != null) { + return invalidPublicKey(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidPublicKey extends LdkNodeError { + const factory LdkNodeError_InvalidPublicKey() = + _$LdkNodeError_InvalidPublicKeyImpl; + const LdkNodeError_InvalidPublicKey._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidSecretKeyImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidSecretKeyImplCopyWith( + _$LdkNodeError_InvalidSecretKeyImpl value, + $Res Function(_$LdkNodeError_InvalidSecretKeyImpl) then) = + __$$LdkNodeError_InvalidSecretKeyImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidSecretKeyImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InvalidSecretKeyImpl> + implements _$$LdkNodeError_InvalidSecretKeyImplCopyWith<$Res> { + __$$LdkNodeError_InvalidSecretKeyImplCopyWithImpl( + _$LdkNodeError_InvalidSecretKeyImpl _value, + $Res Function(_$LdkNodeError_InvalidSecretKeyImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidSecretKeyImpl + extends LdkNodeError_InvalidSecretKey { + const _$LdkNodeError_InvalidSecretKeyImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidSecretKey()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidSecretKeyImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidSecretKey(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidSecretKey?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidSecretKey != null) { + return invalidSecretKey(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidSecretKey(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidSecretKey?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidSecretKey != null) { + return invalidSecretKey(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidSecretKey extends LdkNodeError { + const factory LdkNodeError_InvalidSecretKey() = + _$LdkNodeError_InvalidSecretKeyImpl; + const LdkNodeError_InvalidSecretKey._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidPaymentHashImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidPaymentHashImplCopyWith( + _$LdkNodeError_InvalidPaymentHashImpl value, + $Res Function(_$LdkNodeError_InvalidPaymentHashImpl) then) = + __$$LdkNodeError_InvalidPaymentHashImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidPaymentHashImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InvalidPaymentHashImpl> + implements _$$LdkNodeError_InvalidPaymentHashImplCopyWith<$Res> { + __$$LdkNodeError_InvalidPaymentHashImplCopyWithImpl( + _$LdkNodeError_InvalidPaymentHashImpl _value, + $Res Function(_$LdkNodeError_InvalidPaymentHashImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidPaymentHashImpl + extends LdkNodeError_InvalidPaymentHash { + const _$LdkNodeError_InvalidPaymentHashImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidPaymentHash()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidPaymentHashImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidPaymentHash(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidPaymentHash?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidPaymentHash != null) { + return invalidPaymentHash(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidPaymentHash(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidPaymentHash?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidPaymentHash != null) { + return invalidPaymentHash(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidPaymentHash extends LdkNodeError { + const factory LdkNodeError_InvalidPaymentHash() = + _$LdkNodeError_InvalidPaymentHashImpl; + const LdkNodeError_InvalidPaymentHash._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidPaymentPreimageImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidPaymentPreimageImplCopyWith( + _$LdkNodeError_InvalidPaymentPreimageImpl value, + $Res Function(_$LdkNodeError_InvalidPaymentPreimageImpl) then) = + __$$LdkNodeError_InvalidPaymentPreimageImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidPaymentPreimageImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InvalidPaymentPreimageImpl> + implements _$$LdkNodeError_InvalidPaymentPreimageImplCopyWith<$Res> { + __$$LdkNodeError_InvalidPaymentPreimageImplCopyWithImpl( + _$LdkNodeError_InvalidPaymentPreimageImpl _value, + $Res Function(_$LdkNodeError_InvalidPaymentPreimageImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidPaymentPreimageImpl + extends LdkNodeError_InvalidPaymentPreimage { + const _$LdkNodeError_InvalidPaymentPreimageImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidPaymentPreimage()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidPaymentPreimageImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidPaymentPreimage(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidPaymentPreimage?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidPaymentPreimage != null) { + return invalidPaymentPreimage(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidPaymentPreimage(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidPaymentPreimage?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidPaymentPreimage != null) { + return invalidPaymentPreimage(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidPaymentPreimage extends LdkNodeError { + const factory LdkNodeError_InvalidPaymentPreimage() = + _$LdkNodeError_InvalidPaymentPreimageImpl; + const LdkNodeError_InvalidPaymentPreimage._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidPaymentSecretImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidPaymentSecretImplCopyWith( + _$LdkNodeError_InvalidPaymentSecretImpl value, + $Res Function(_$LdkNodeError_InvalidPaymentSecretImpl) then) = + __$$LdkNodeError_InvalidPaymentSecretImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidPaymentSecretImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InvalidPaymentSecretImpl> + implements _$$LdkNodeError_InvalidPaymentSecretImplCopyWith<$Res> { + __$$LdkNodeError_InvalidPaymentSecretImplCopyWithImpl( + _$LdkNodeError_InvalidPaymentSecretImpl _value, + $Res Function(_$LdkNodeError_InvalidPaymentSecretImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidPaymentSecretImpl + extends LdkNodeError_InvalidPaymentSecret { + const _$LdkNodeError_InvalidPaymentSecretImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidPaymentSecret()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidPaymentSecretImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidPaymentSecret(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidPaymentSecret?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidPaymentSecret != null) { + return invalidPaymentSecret(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidPaymentSecret(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidPaymentSecret?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidPaymentSecret != null) { + return invalidPaymentSecret(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidPaymentSecret extends LdkNodeError { + const factory LdkNodeError_InvalidPaymentSecret() = + _$LdkNodeError_InvalidPaymentSecretImpl; + const LdkNodeError_InvalidPaymentSecret._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidAmountImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidAmountImplCopyWith( + _$LdkNodeError_InvalidAmountImpl value, + $Res Function(_$LdkNodeError_InvalidAmountImpl) then) = + __$$LdkNodeError_InvalidAmountImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidAmountImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_InvalidAmountImpl> + implements _$$LdkNodeError_InvalidAmountImplCopyWith<$Res> { + __$$LdkNodeError_InvalidAmountImplCopyWithImpl( + _$LdkNodeError_InvalidAmountImpl _value, + $Res Function(_$LdkNodeError_InvalidAmountImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidAmountImpl extends LdkNodeError_InvalidAmount { + const _$LdkNodeError_InvalidAmountImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidAmount()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidAmountImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidAmount(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidAmount?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidAmount != null) { + return invalidAmount(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidAmount(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidAmount?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidAmount != null) { + return invalidAmount(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidAmount extends LdkNodeError { + const factory LdkNodeError_InvalidAmount() = _$LdkNodeError_InvalidAmountImpl; + const LdkNodeError_InvalidAmount._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidInvoiceImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidInvoiceImplCopyWith( + _$LdkNodeError_InvalidInvoiceImpl value, + $Res Function(_$LdkNodeError_InvalidInvoiceImpl) then) = + __$$LdkNodeError_InvalidInvoiceImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidInvoiceImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_InvalidInvoiceImpl> + implements _$$LdkNodeError_InvalidInvoiceImplCopyWith<$Res> { + __$$LdkNodeError_InvalidInvoiceImplCopyWithImpl( + _$LdkNodeError_InvalidInvoiceImpl _value, + $Res Function(_$LdkNodeError_InvalidInvoiceImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidInvoiceImpl extends LdkNodeError_InvalidInvoice { + const _$LdkNodeError_InvalidInvoiceImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidInvoice()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidInvoiceImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidInvoice(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidInvoice?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidInvoice != null) { + return invalidInvoice(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidInvoice(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidInvoice?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidInvoice != null) { + return invalidInvoice(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidInvoice extends LdkNodeError { + const factory LdkNodeError_InvalidInvoice() = + _$LdkNodeError_InvalidInvoiceImpl; + const LdkNodeError_InvalidInvoice._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidChannelIdImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidChannelIdImplCopyWith( + _$LdkNodeError_InvalidChannelIdImpl value, + $Res Function(_$LdkNodeError_InvalidChannelIdImpl) then) = + __$$LdkNodeError_InvalidChannelIdImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidChannelIdImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InvalidChannelIdImpl> + implements _$$LdkNodeError_InvalidChannelIdImplCopyWith<$Res> { + __$$LdkNodeError_InvalidChannelIdImplCopyWithImpl( + _$LdkNodeError_InvalidChannelIdImpl _value, + $Res Function(_$LdkNodeError_InvalidChannelIdImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidChannelIdImpl + extends LdkNodeError_InvalidChannelId { + const _$LdkNodeError_InvalidChannelIdImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidChannelId()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidChannelIdImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidChannelId(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidChannelId?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidChannelId != null) { + return invalidChannelId(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidChannelId(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidChannelId?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidChannelId != null) { + return invalidChannelId(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidChannelId extends LdkNodeError { + const factory LdkNodeError_InvalidChannelId() = + _$LdkNodeError_InvalidChannelIdImpl; + const LdkNodeError_InvalidChannelId._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidNetworkImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidNetworkImplCopyWith( + _$LdkNodeError_InvalidNetworkImpl value, + $Res Function(_$LdkNodeError_InvalidNetworkImpl) then) = + __$$LdkNodeError_InvalidNetworkImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidNetworkImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_InvalidNetworkImpl> + implements _$$LdkNodeError_InvalidNetworkImplCopyWith<$Res> { + __$$LdkNodeError_InvalidNetworkImplCopyWithImpl( + _$LdkNodeError_InvalidNetworkImpl _value, + $Res Function(_$LdkNodeError_InvalidNetworkImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidNetworkImpl extends LdkNodeError_InvalidNetwork { + const _$LdkNodeError_InvalidNetworkImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidNetwork()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidNetworkImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidNetwork(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidNetwork?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidNetwork != null) { + return invalidNetwork(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidNetwork(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidNetwork?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidNetwork != null) { + return invalidNetwork(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidNetwork extends LdkNodeError { + const factory LdkNodeError_InvalidNetwork() = + _$LdkNodeError_InvalidNetworkImpl; + const LdkNodeError_InvalidNetwork._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_DuplicatePaymentImplCopyWith<$Res> { + factory _$$LdkNodeError_DuplicatePaymentImplCopyWith( + _$LdkNodeError_DuplicatePaymentImpl value, + $Res Function(_$LdkNodeError_DuplicatePaymentImpl) then) = + __$$LdkNodeError_DuplicatePaymentImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_DuplicatePaymentImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_DuplicatePaymentImpl> + implements _$$LdkNodeError_DuplicatePaymentImplCopyWith<$Res> { + __$$LdkNodeError_DuplicatePaymentImplCopyWithImpl( + _$LdkNodeError_DuplicatePaymentImpl _value, + $Res Function(_$LdkNodeError_DuplicatePaymentImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_DuplicatePaymentImpl + extends LdkNodeError_DuplicatePayment { + const _$LdkNodeError_DuplicatePaymentImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.duplicatePayment()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_DuplicatePaymentImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return duplicatePayment(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return duplicatePayment?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (duplicatePayment != null) { + return duplicatePayment(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return duplicatePayment(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return duplicatePayment?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (duplicatePayment != null) { + return duplicatePayment(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_DuplicatePayment extends LdkNodeError { + const factory LdkNodeError_DuplicatePayment() = + _$LdkNodeError_DuplicatePaymentImpl; + const LdkNodeError_DuplicatePayment._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InsufficientFundsImplCopyWith<$Res> { + factory _$$LdkNodeError_InsufficientFundsImplCopyWith( + _$LdkNodeError_InsufficientFundsImpl value, + $Res Function(_$LdkNodeError_InsufficientFundsImpl) then) = + __$$LdkNodeError_InsufficientFundsImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InsufficientFundsImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InsufficientFundsImpl> + implements _$$LdkNodeError_InsufficientFundsImplCopyWith<$Res> { + __$$LdkNodeError_InsufficientFundsImplCopyWithImpl( + _$LdkNodeError_InsufficientFundsImpl _value, + $Res Function(_$LdkNodeError_InsufficientFundsImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InsufficientFundsImpl + extends LdkNodeError_InsufficientFunds { + const _$LdkNodeError_InsufficientFundsImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.insufficientFunds()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InsufficientFundsImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return insufficientFunds(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return insufficientFunds?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (insufficientFunds != null) { + return insufficientFunds(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return insufficientFunds(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return insufficientFunds?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (insufficientFunds != null) { + return insufficientFunds(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InsufficientFunds extends LdkNodeError { + const factory LdkNodeError_InsufficientFunds() = + _$LdkNodeError_InsufficientFundsImpl; + const LdkNodeError_InsufficientFunds._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_FeerateEstimationUpdateFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_FeerateEstimationUpdateFailedImplCopyWith( + _$LdkNodeError_FeerateEstimationUpdateFailedImpl value, + $Res Function(_$LdkNodeError_FeerateEstimationUpdateFailedImpl) + then) = + __$$LdkNodeError_FeerateEstimationUpdateFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_FeerateEstimationUpdateFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_FeerateEstimationUpdateFailedImpl> + implements _$$LdkNodeError_FeerateEstimationUpdateFailedImplCopyWith<$Res> { + __$$LdkNodeError_FeerateEstimationUpdateFailedImplCopyWithImpl( + _$LdkNodeError_FeerateEstimationUpdateFailedImpl _value, + $Res Function(_$LdkNodeError_FeerateEstimationUpdateFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_FeerateEstimationUpdateFailedImpl + extends LdkNodeError_FeerateEstimationUpdateFailed { + const _$LdkNodeError_FeerateEstimationUpdateFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.feerateEstimationUpdateFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_FeerateEstimationUpdateFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return feerateEstimationUpdateFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return feerateEstimationUpdateFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (feerateEstimationUpdateFailed != null) { + return feerateEstimationUpdateFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return feerateEstimationUpdateFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return feerateEstimationUpdateFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (feerateEstimationUpdateFailed != null) { + return feerateEstimationUpdateFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_FeerateEstimationUpdateFailed extends LdkNodeError { + const factory LdkNodeError_FeerateEstimationUpdateFailed() = + _$LdkNodeError_FeerateEstimationUpdateFailedImpl; + const LdkNodeError_FeerateEstimationUpdateFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_LiquidityRequestFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_LiquidityRequestFailedImplCopyWith( + _$LdkNodeError_LiquidityRequestFailedImpl value, + $Res Function(_$LdkNodeError_LiquidityRequestFailedImpl) then) = + __$$LdkNodeError_LiquidityRequestFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_LiquidityRequestFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_LiquidityRequestFailedImpl> + implements _$$LdkNodeError_LiquidityRequestFailedImplCopyWith<$Res> { + __$$LdkNodeError_LiquidityRequestFailedImplCopyWithImpl( + _$LdkNodeError_LiquidityRequestFailedImpl _value, + $Res Function(_$LdkNodeError_LiquidityRequestFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_LiquidityRequestFailedImpl + extends LdkNodeError_LiquidityRequestFailed { + const _$LdkNodeError_LiquidityRequestFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.liquidityRequestFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_LiquidityRequestFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return liquidityRequestFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return liquidityRequestFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (liquidityRequestFailed != null) { + return liquidityRequestFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return liquidityRequestFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return liquidityRequestFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (liquidityRequestFailed != null) { + return liquidityRequestFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_LiquidityRequestFailed extends LdkNodeError { + const factory LdkNodeError_LiquidityRequestFailed() = + _$LdkNodeError_LiquidityRequestFailedImpl; + const LdkNodeError_LiquidityRequestFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_LiquiditySourceUnavailableImplCopyWith<$Res> { + factory _$$LdkNodeError_LiquiditySourceUnavailableImplCopyWith( + _$LdkNodeError_LiquiditySourceUnavailableImpl value, + $Res Function(_$LdkNodeError_LiquiditySourceUnavailableImpl) then) = + __$$LdkNodeError_LiquiditySourceUnavailableImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_LiquiditySourceUnavailableImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_LiquiditySourceUnavailableImpl> + implements _$$LdkNodeError_LiquiditySourceUnavailableImplCopyWith<$Res> { + __$$LdkNodeError_LiquiditySourceUnavailableImplCopyWithImpl( + _$LdkNodeError_LiquiditySourceUnavailableImpl _value, + $Res Function(_$LdkNodeError_LiquiditySourceUnavailableImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_LiquiditySourceUnavailableImpl + extends LdkNodeError_LiquiditySourceUnavailable { + const _$LdkNodeError_LiquiditySourceUnavailableImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.liquiditySourceUnavailable()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_LiquiditySourceUnavailableImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return liquiditySourceUnavailable(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return liquiditySourceUnavailable?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (liquiditySourceUnavailable != null) { + return liquiditySourceUnavailable(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return liquiditySourceUnavailable(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return liquiditySourceUnavailable?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (liquiditySourceUnavailable != null) { + return liquiditySourceUnavailable(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_LiquiditySourceUnavailable extends LdkNodeError { + const factory LdkNodeError_LiquiditySourceUnavailable() = + _$LdkNodeError_LiquiditySourceUnavailableImpl; + const LdkNodeError_LiquiditySourceUnavailable._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_LiquidityFeeTooHighImplCopyWith<$Res> { + factory _$$LdkNodeError_LiquidityFeeTooHighImplCopyWith( + _$LdkNodeError_LiquidityFeeTooHighImpl value, + $Res Function(_$LdkNodeError_LiquidityFeeTooHighImpl) then) = + __$$LdkNodeError_LiquidityFeeTooHighImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_LiquidityFeeTooHighImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_LiquidityFeeTooHighImpl> + implements _$$LdkNodeError_LiquidityFeeTooHighImplCopyWith<$Res> { + __$$LdkNodeError_LiquidityFeeTooHighImplCopyWithImpl( + _$LdkNodeError_LiquidityFeeTooHighImpl _value, + $Res Function(_$LdkNodeError_LiquidityFeeTooHighImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_LiquidityFeeTooHighImpl + extends LdkNodeError_LiquidityFeeTooHigh { + const _$LdkNodeError_LiquidityFeeTooHighImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.liquidityFeeTooHigh()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_LiquidityFeeTooHighImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return liquidityFeeTooHigh(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return liquidityFeeTooHigh?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (liquidityFeeTooHigh != null) { + return liquidityFeeTooHigh(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return liquidityFeeTooHigh(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return liquidityFeeTooHigh?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (liquidityFeeTooHigh != null) { + return liquidityFeeTooHigh(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_LiquidityFeeTooHigh extends LdkNodeError { + const factory LdkNodeError_LiquidityFeeTooHigh() = + _$LdkNodeError_LiquidityFeeTooHighImpl; + const LdkNodeError_LiquidityFeeTooHigh._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidPaymentIdImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidPaymentIdImplCopyWith( + _$LdkNodeError_InvalidPaymentIdImpl value, + $Res Function(_$LdkNodeError_InvalidPaymentIdImpl) then) = + __$$LdkNodeError_InvalidPaymentIdImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidPaymentIdImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InvalidPaymentIdImpl> + implements _$$LdkNodeError_InvalidPaymentIdImplCopyWith<$Res> { + __$$LdkNodeError_InvalidPaymentIdImplCopyWithImpl( + _$LdkNodeError_InvalidPaymentIdImpl _value, + $Res Function(_$LdkNodeError_InvalidPaymentIdImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidPaymentIdImpl + extends LdkNodeError_InvalidPaymentId { + const _$LdkNodeError_InvalidPaymentIdImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidPaymentId()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidPaymentIdImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidPaymentId(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidPaymentId?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidPaymentId != null) { + return invalidPaymentId(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidPaymentId(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidPaymentId?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidPaymentId != null) { + return invalidPaymentId(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidPaymentId extends LdkNodeError { + const factory LdkNodeError_InvalidPaymentId() = + _$LdkNodeError_InvalidPaymentIdImpl; + const LdkNodeError_InvalidPaymentId._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_DecodeImplCopyWith<$Res> { + factory _$$LdkNodeError_DecodeImplCopyWith(_$LdkNodeError_DecodeImpl value, + $Res Function(_$LdkNodeError_DecodeImpl) then) = + __$$LdkNodeError_DecodeImplCopyWithImpl<$Res>; + @useResult + $Res call({DecodeError field0}); + + $DecodeErrorCopyWith<$Res> get field0; +} + +/// @nodoc +class __$$LdkNodeError_DecodeImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_DecodeImpl> + implements _$$LdkNodeError_DecodeImplCopyWith<$Res> { + __$$LdkNodeError_DecodeImplCopyWithImpl(_$LdkNodeError_DecodeImpl _value, + $Res Function(_$LdkNodeError_DecodeImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? field0 = null, + }) { + return _then(_$LdkNodeError_DecodeImpl( + null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as DecodeError, + )); + } + + @override + @pragma('vm:prefer-inline') + $DecodeErrorCopyWith<$Res> get field0 { + return $DecodeErrorCopyWith<$Res>(_value.field0, (value) { + return _then(_value.copyWith(field0: value)); + }); + } +} + +/// @nodoc + +class _$LdkNodeError_DecodeImpl extends LdkNodeError_Decode { + const _$LdkNodeError_DecodeImpl(this.field0) : super._(); + + @override + final DecodeError field0; + + @override + String toString() { + return 'LdkNodeError.decode(field0: $field0)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_DecodeImpl && + (identical(other.field0, field0) || other.field0 == field0)); + } + + @override + int get hashCode => Object.hash(runtimeType, field0); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$LdkNodeError_DecodeImplCopyWith<_$LdkNodeError_DecodeImpl> get copyWith => + __$$LdkNodeError_DecodeImplCopyWithImpl<_$LdkNodeError_DecodeImpl>( + this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return decode(field0); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return decode?.call(field0); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (decode != null) { + return decode(field0); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return decode(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return decode?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (decode != null) { + return decode(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_Decode extends LdkNodeError { + const factory LdkNodeError_Decode(final DecodeError field0) = + _$LdkNodeError_DecodeImpl; + const LdkNodeError_Decode._() : super._(); + + DecodeError get field0; + @JsonKey(ignore: true) + _$$LdkNodeError_DecodeImplCopyWith<_$LdkNodeError_DecodeImpl> get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$LdkNodeError_Bolt12ParseImplCopyWith<$Res> { + factory _$$LdkNodeError_Bolt12ParseImplCopyWith( + _$LdkNodeError_Bolt12ParseImpl value, + $Res Function(_$LdkNodeError_Bolt12ParseImpl) then) = + __$$LdkNodeError_Bolt12ParseImplCopyWithImpl<$Res>; + @useResult + $Res call({Bolt12ParseError field0}); + + $Bolt12ParseErrorCopyWith<$Res> get field0; +} + +/// @nodoc +class __$$LdkNodeError_Bolt12ParseImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_Bolt12ParseImpl> + implements _$$LdkNodeError_Bolt12ParseImplCopyWith<$Res> { + __$$LdkNodeError_Bolt12ParseImplCopyWithImpl( + _$LdkNodeError_Bolt12ParseImpl _value, + $Res Function(_$LdkNodeError_Bolt12ParseImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? field0 = null, + }) { + return _then(_$LdkNodeError_Bolt12ParseImpl( + null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as Bolt12ParseError, + )); + } + + @override + @pragma('vm:prefer-inline') + $Bolt12ParseErrorCopyWith<$Res> get field0 { + return $Bolt12ParseErrorCopyWith<$Res>(_value.field0, (value) { + return _then(_value.copyWith(field0: value)); + }); + } +} + +/// @nodoc + +class _$LdkNodeError_Bolt12ParseImpl extends LdkNodeError_Bolt12Parse { + const _$LdkNodeError_Bolt12ParseImpl(this.field0) : super._(); + + @override + final Bolt12ParseError field0; + + @override + String toString() { + return 'LdkNodeError.bolt12Parse(field0: $field0)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_Bolt12ParseImpl && + (identical(other.field0, field0) || other.field0 == field0)); + } + + @override + int get hashCode => Object.hash(runtimeType, field0); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$LdkNodeError_Bolt12ParseImplCopyWith<_$LdkNodeError_Bolt12ParseImpl> + get copyWith => __$$LdkNodeError_Bolt12ParseImplCopyWithImpl< + _$LdkNodeError_Bolt12ParseImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return bolt12Parse(field0); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return bolt12Parse?.call(field0); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (bolt12Parse != null) { + return bolt12Parse(field0); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return bolt12Parse(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return bolt12Parse?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (bolt12Parse != null) { + return bolt12Parse(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_Bolt12Parse extends LdkNodeError { + const factory LdkNodeError_Bolt12Parse(final Bolt12ParseError field0) = + _$LdkNodeError_Bolt12ParseImpl; + const LdkNodeError_Bolt12Parse._() : super._(); + + Bolt12ParseError get field0; + @JsonKey(ignore: true) + _$$LdkNodeError_Bolt12ParseImplCopyWith<_$LdkNodeError_Bolt12ParseImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$LdkNodeError_InvoiceRequestCreationFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_InvoiceRequestCreationFailedImplCopyWith( + _$LdkNodeError_InvoiceRequestCreationFailedImpl value, + $Res Function(_$LdkNodeError_InvoiceRequestCreationFailedImpl) then) = + __$$LdkNodeError_InvoiceRequestCreationFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvoiceRequestCreationFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InvoiceRequestCreationFailedImpl> + implements _$$LdkNodeError_InvoiceRequestCreationFailedImplCopyWith<$Res> { + __$$LdkNodeError_InvoiceRequestCreationFailedImplCopyWithImpl( + _$LdkNodeError_InvoiceRequestCreationFailedImpl _value, + $Res Function(_$LdkNodeError_InvoiceRequestCreationFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvoiceRequestCreationFailedImpl + extends LdkNodeError_InvoiceRequestCreationFailed { + const _$LdkNodeError_InvoiceRequestCreationFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invoiceRequestCreationFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvoiceRequestCreationFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invoiceRequestCreationFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invoiceRequestCreationFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invoiceRequestCreationFailed != null) { + return invoiceRequestCreationFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invoiceRequestCreationFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invoiceRequestCreationFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invoiceRequestCreationFailed != null) { + return invoiceRequestCreationFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvoiceRequestCreationFailed extends LdkNodeError { + const factory LdkNodeError_InvoiceRequestCreationFailed() = + _$LdkNodeError_InvoiceRequestCreationFailedImpl; + const LdkNodeError_InvoiceRequestCreationFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_OfferCreationFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_OfferCreationFailedImplCopyWith( + _$LdkNodeError_OfferCreationFailedImpl value, + $Res Function(_$LdkNodeError_OfferCreationFailedImpl) then) = + __$$LdkNodeError_OfferCreationFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_OfferCreationFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_OfferCreationFailedImpl> + implements _$$LdkNodeError_OfferCreationFailedImplCopyWith<$Res> { + __$$LdkNodeError_OfferCreationFailedImplCopyWithImpl( + _$LdkNodeError_OfferCreationFailedImpl _value, + $Res Function(_$LdkNodeError_OfferCreationFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_OfferCreationFailedImpl + extends LdkNodeError_OfferCreationFailed { + const _$LdkNodeError_OfferCreationFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.offerCreationFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_OfferCreationFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return offerCreationFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return offerCreationFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (offerCreationFailed != null) { + return offerCreationFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return offerCreationFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return offerCreationFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (offerCreationFailed != null) { + return offerCreationFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_OfferCreationFailed extends LdkNodeError { + const factory LdkNodeError_OfferCreationFailed() = + _$LdkNodeError_OfferCreationFailedImpl; + const LdkNodeError_OfferCreationFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_RefundCreationFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_RefundCreationFailedImplCopyWith( + _$LdkNodeError_RefundCreationFailedImpl value, + $Res Function(_$LdkNodeError_RefundCreationFailedImpl) then) = + __$$LdkNodeError_RefundCreationFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_RefundCreationFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_RefundCreationFailedImpl> + implements _$$LdkNodeError_RefundCreationFailedImplCopyWith<$Res> { + __$$LdkNodeError_RefundCreationFailedImplCopyWithImpl( + _$LdkNodeError_RefundCreationFailedImpl _value, + $Res Function(_$LdkNodeError_RefundCreationFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_RefundCreationFailedImpl + extends LdkNodeError_RefundCreationFailed { + const _$LdkNodeError_RefundCreationFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.refundCreationFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_RefundCreationFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return refundCreationFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return refundCreationFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (refundCreationFailed != null) { + return refundCreationFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return refundCreationFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return refundCreationFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (refundCreationFailed != null) { + return refundCreationFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_RefundCreationFailed extends LdkNodeError { + const factory LdkNodeError_RefundCreationFailed() = + _$LdkNodeError_RefundCreationFailedImpl; + const LdkNodeError_RefundCreationFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_FeerateEstimationUpdateTimeoutImplCopyWith< + $Res> { + factory _$$LdkNodeError_FeerateEstimationUpdateTimeoutImplCopyWith( + _$LdkNodeError_FeerateEstimationUpdateTimeoutImpl value, + $Res Function(_$LdkNodeError_FeerateEstimationUpdateTimeoutImpl) + then) = + __$$LdkNodeError_FeerateEstimationUpdateTimeoutImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_FeerateEstimationUpdateTimeoutImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_FeerateEstimationUpdateTimeoutImpl> + implements + _$$LdkNodeError_FeerateEstimationUpdateTimeoutImplCopyWith<$Res> { + __$$LdkNodeError_FeerateEstimationUpdateTimeoutImplCopyWithImpl( + _$LdkNodeError_FeerateEstimationUpdateTimeoutImpl _value, + $Res Function(_$LdkNodeError_FeerateEstimationUpdateTimeoutImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_FeerateEstimationUpdateTimeoutImpl + extends LdkNodeError_FeerateEstimationUpdateTimeout { + const _$LdkNodeError_FeerateEstimationUpdateTimeoutImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.feerateEstimationUpdateTimeout()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_FeerateEstimationUpdateTimeoutImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return feerateEstimationUpdateTimeout(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return feerateEstimationUpdateTimeout?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (feerateEstimationUpdateTimeout != null) { + return feerateEstimationUpdateTimeout(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return feerateEstimationUpdateTimeout(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return feerateEstimationUpdateTimeout?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (feerateEstimationUpdateTimeout != null) { + return feerateEstimationUpdateTimeout(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_FeerateEstimationUpdateTimeout + extends LdkNodeError { + const factory LdkNodeError_FeerateEstimationUpdateTimeout() = + _$LdkNodeError_FeerateEstimationUpdateTimeoutImpl; + const LdkNodeError_FeerateEstimationUpdateTimeout._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_WalletOperationTimeoutImplCopyWith<$Res> { + factory _$$LdkNodeError_WalletOperationTimeoutImplCopyWith( + _$LdkNodeError_WalletOperationTimeoutImpl value, + $Res Function(_$LdkNodeError_WalletOperationTimeoutImpl) then) = + __$$LdkNodeError_WalletOperationTimeoutImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_WalletOperationTimeoutImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_WalletOperationTimeoutImpl> + implements _$$LdkNodeError_WalletOperationTimeoutImplCopyWith<$Res> { + __$$LdkNodeError_WalletOperationTimeoutImplCopyWithImpl( + _$LdkNodeError_WalletOperationTimeoutImpl _value, + $Res Function(_$LdkNodeError_WalletOperationTimeoutImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_WalletOperationTimeoutImpl + extends LdkNodeError_WalletOperationTimeout { + const _$LdkNodeError_WalletOperationTimeoutImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.walletOperationTimeout()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_WalletOperationTimeoutImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return walletOperationTimeout(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return walletOperationTimeout?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (walletOperationTimeout != null) { + return walletOperationTimeout(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return walletOperationTimeout(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return walletOperationTimeout?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (walletOperationTimeout != null) { + return walletOperationTimeout(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_WalletOperationTimeout extends LdkNodeError { + const factory LdkNodeError_WalletOperationTimeout() = + _$LdkNodeError_WalletOperationTimeoutImpl; + const LdkNodeError_WalletOperationTimeout._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_TxSyncTimeoutImplCopyWith<$Res> { + factory _$$LdkNodeError_TxSyncTimeoutImplCopyWith( + _$LdkNodeError_TxSyncTimeoutImpl value, + $Res Function(_$LdkNodeError_TxSyncTimeoutImpl) then) = + __$$LdkNodeError_TxSyncTimeoutImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_TxSyncTimeoutImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_TxSyncTimeoutImpl> + implements _$$LdkNodeError_TxSyncTimeoutImplCopyWith<$Res> { + __$$LdkNodeError_TxSyncTimeoutImplCopyWithImpl( + _$LdkNodeError_TxSyncTimeoutImpl _value, + $Res Function(_$LdkNodeError_TxSyncTimeoutImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_TxSyncTimeoutImpl extends LdkNodeError_TxSyncTimeout { + const _$LdkNodeError_TxSyncTimeoutImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.txSyncTimeout()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_TxSyncTimeoutImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return txSyncTimeout(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return txSyncTimeout?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (txSyncTimeout != null) { + return txSyncTimeout(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return txSyncTimeout(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return txSyncTimeout?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (txSyncTimeout != null) { + return txSyncTimeout(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_TxSyncTimeout extends LdkNodeError { + const factory LdkNodeError_TxSyncTimeout() = _$LdkNodeError_TxSyncTimeoutImpl; + const LdkNodeError_TxSyncTimeout._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_GossipUpdateTimeoutImplCopyWith<$Res> { + factory _$$LdkNodeError_GossipUpdateTimeoutImplCopyWith( + _$LdkNodeError_GossipUpdateTimeoutImpl value, + $Res Function(_$LdkNodeError_GossipUpdateTimeoutImpl) then) = + __$$LdkNodeError_GossipUpdateTimeoutImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_GossipUpdateTimeoutImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_GossipUpdateTimeoutImpl> + implements _$$LdkNodeError_GossipUpdateTimeoutImplCopyWith<$Res> { + __$$LdkNodeError_GossipUpdateTimeoutImplCopyWithImpl( + _$LdkNodeError_GossipUpdateTimeoutImpl _value, + $Res Function(_$LdkNodeError_GossipUpdateTimeoutImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_GossipUpdateTimeoutImpl + extends LdkNodeError_GossipUpdateTimeout { + const _$LdkNodeError_GossipUpdateTimeoutImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.gossipUpdateTimeout()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_GossipUpdateTimeoutImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return gossipUpdateTimeout(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return gossipUpdateTimeout?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (gossipUpdateTimeout != null) { + return gossipUpdateTimeout(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return gossipUpdateTimeout(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return gossipUpdateTimeout?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (gossipUpdateTimeout != null) { + return gossipUpdateTimeout(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_GossipUpdateTimeout extends LdkNodeError { + const factory LdkNodeError_GossipUpdateTimeout() = + _$LdkNodeError_GossipUpdateTimeoutImpl; + const LdkNodeError_GossipUpdateTimeout._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidOfferIdImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidOfferIdImplCopyWith( + _$LdkNodeError_InvalidOfferIdImpl value, + $Res Function(_$LdkNodeError_InvalidOfferIdImpl) then) = + __$$LdkNodeError_InvalidOfferIdImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidOfferIdImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_InvalidOfferIdImpl> + implements _$$LdkNodeError_InvalidOfferIdImplCopyWith<$Res> { + __$$LdkNodeError_InvalidOfferIdImplCopyWithImpl( + _$LdkNodeError_InvalidOfferIdImpl _value, + $Res Function(_$LdkNodeError_InvalidOfferIdImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidOfferIdImpl extends LdkNodeError_InvalidOfferId { + const _$LdkNodeError_InvalidOfferIdImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidOfferId()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidOfferIdImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidOfferId(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidOfferId?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidOfferId != null) { + return invalidOfferId(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidOfferId(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidOfferId?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidOfferId != null) { + return invalidOfferId(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidOfferId extends LdkNodeError { + const factory LdkNodeError_InvalidOfferId() = + _$LdkNodeError_InvalidOfferIdImpl; + const LdkNodeError_InvalidOfferId._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidNodeIdImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidNodeIdImplCopyWith( + _$LdkNodeError_InvalidNodeIdImpl value, + $Res Function(_$LdkNodeError_InvalidNodeIdImpl) then) = + __$$LdkNodeError_InvalidNodeIdImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidNodeIdImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_InvalidNodeIdImpl> + implements _$$LdkNodeError_InvalidNodeIdImplCopyWith<$Res> { + __$$LdkNodeError_InvalidNodeIdImplCopyWithImpl( + _$LdkNodeError_InvalidNodeIdImpl _value, + $Res Function(_$LdkNodeError_InvalidNodeIdImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidNodeIdImpl extends LdkNodeError_InvalidNodeId { + const _$LdkNodeError_InvalidNodeIdImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidNodeId()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidNodeIdImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidNodeId(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidNodeId?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidNodeId != null) { + return invalidNodeId(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidNodeId(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidNodeId?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidNodeId != null) { + return invalidNodeId(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidNodeId extends LdkNodeError { + const factory LdkNodeError_InvalidNodeId() = _$LdkNodeError_InvalidNodeIdImpl; + const LdkNodeError_InvalidNodeId._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidOfferImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidOfferImplCopyWith( + _$LdkNodeError_InvalidOfferImpl value, + $Res Function(_$LdkNodeError_InvalidOfferImpl) then) = + __$$LdkNodeError_InvalidOfferImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidOfferImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_InvalidOfferImpl> + implements _$$LdkNodeError_InvalidOfferImplCopyWith<$Res> { + __$$LdkNodeError_InvalidOfferImplCopyWithImpl( + _$LdkNodeError_InvalidOfferImpl _value, + $Res Function(_$LdkNodeError_InvalidOfferImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidOfferImpl extends LdkNodeError_InvalidOffer { + const _$LdkNodeError_InvalidOfferImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidOffer()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidOfferImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidOffer(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidOffer?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidOffer != null) { + return invalidOffer(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidOffer(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidOffer?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidOffer != null) { + return invalidOffer(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidOffer extends LdkNodeError { + const factory LdkNodeError_InvalidOffer() = _$LdkNodeError_InvalidOfferImpl; + const LdkNodeError_InvalidOffer._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidRefundImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidRefundImplCopyWith( + _$LdkNodeError_InvalidRefundImpl value, + $Res Function(_$LdkNodeError_InvalidRefundImpl) then) = + __$$LdkNodeError_InvalidRefundImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidRefundImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_InvalidRefundImpl> + implements _$$LdkNodeError_InvalidRefundImplCopyWith<$Res> { + __$$LdkNodeError_InvalidRefundImplCopyWithImpl( + _$LdkNodeError_InvalidRefundImpl _value, + $Res Function(_$LdkNodeError_InvalidRefundImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidRefundImpl extends LdkNodeError_InvalidRefund { + const _$LdkNodeError_InvalidRefundImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidRefund()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidRefundImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidRefund(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidRefund?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidRefund != null) { + return invalidRefund(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidRefund(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidRefund?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidRefund != null) { + return invalidRefund(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidRefund extends LdkNodeError { + const factory LdkNodeError_InvalidRefund() = _$LdkNodeError_InvalidRefundImpl; + const LdkNodeError_InvalidRefund._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_UnsupportedCurrencyImplCopyWith<$Res> { + factory _$$LdkNodeError_UnsupportedCurrencyImplCopyWith( + _$LdkNodeError_UnsupportedCurrencyImpl value, + $Res Function(_$LdkNodeError_UnsupportedCurrencyImpl) then) = + __$$LdkNodeError_UnsupportedCurrencyImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_UnsupportedCurrencyImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_UnsupportedCurrencyImpl> + implements _$$LdkNodeError_UnsupportedCurrencyImplCopyWith<$Res> { + __$$LdkNodeError_UnsupportedCurrencyImplCopyWithImpl( + _$LdkNodeError_UnsupportedCurrencyImpl _value, + $Res Function(_$LdkNodeError_UnsupportedCurrencyImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_UnsupportedCurrencyImpl + extends LdkNodeError_UnsupportedCurrency { + const _$LdkNodeError_UnsupportedCurrencyImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.unsupportedCurrency()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_UnsupportedCurrencyImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return unsupportedCurrency(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return unsupportedCurrency?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (unsupportedCurrency != null) { + return unsupportedCurrency(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return unsupportedCurrency(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return unsupportedCurrency?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (unsupportedCurrency != null) { + return unsupportedCurrency(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_UnsupportedCurrency extends LdkNodeError { + const factory LdkNodeError_UnsupportedCurrency() = + _$LdkNodeError_UnsupportedCurrencyImpl; + const LdkNodeError_UnsupportedCurrency._() : super._(); +} diff --git a/lib/src/root.dart b/lib/src/root.dart index fa2461a..33d02df 100644 --- a/lib/src/root.dart +++ b/lib/src/root.dart @@ -1,23 +1,31 @@ -import 'package:ldk_node/src/generated/api/error.dart' as error; +import 'package:flutter_rust_bridge/flutter_rust_bridge.dart'; +import 'package:ldk_node/src/generated/api/bolt11.dart' as bolt11; +import 'package:ldk_node/src/generated/api/bolt12.dart' as bolt12; +import 'package:ldk_node/src/generated/api/graph.dart' as graph; import 'package:ldk_node/src/generated/api/types.dart' as types; +import 'package:ldk_node/src/generated/utils/error.dart' as error; import 'package:ldk_node/src/utils/default_services.dart'; import 'package:ldk_node/src/utils/utils.dart'; import 'package:path_provider/path_provider.dart'; +import 'generated/api/builder.dart' as builder; import 'generated/api/node.dart'; +import 'generated/api/on_chain.dart' as on_chain; +import 'generated/api/spontaneous.dart' as spontaneous; +import 'generated/lib.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 LdkMnemonic { +class Mnemonic extends builder.LdkMnemonic { Mnemonic({required super.seedPhrase}); static Future generate() async { try { await Frb.verifyInit(); - final res = await LdkMnemonic.generate(); + final res = await builder.LdkMnemonic.generate(); return Mnemonic(seedPhrase: res.seedPhrase); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } } @@ -38,8 +46,8 @@ class Node extends LdkNode { Future start({hint}) async { try { return super.start(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -51,32 +59,42 @@ class Node extends LdkNode { Future stop({hint}) async { try { await super.stop(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - // Confirm the last retrieved event handled. + ///Returns the status of the Node. + @override + Future status({hint}) async { + try { + return await super.status(); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + /// Blocks until the next event is available. /// - /// **Note:** This **MUST** be called after each event has been handled. + /// **Note:** this will always return the same event until handling is confirmed via `node.eventHandled()`. @override Future eventHandled({hint}) async { try { await super.eventHandled(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - /// Blocks until the next event is available. + // Confirm the last retrieved event handled. /// - /// **Note:** this will always return the same event until handling is confirmed via `node.eventHandled()`. + /// **Note:** This **MUST** be called after each event has been handled. @override Future nextEvent({hint}) async { try { return await super.nextEvent(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -89,8 +107,20 @@ class Node extends LdkNode { Future waitNextHandled({hint}) async { try { return await super.waitNextEvent(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///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()`. + @override + Future nextEventAsync({hint}) async { + try { + return await super.nextEventAsync(); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -99,8 +129,8 @@ class Node extends LdkNode { Future nodeId({hint}) async { try { return await super.nodeId(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -109,61 +139,28 @@ class Node extends LdkNode { Future?> listeningAddresses({hint}) async { try { return await super.listeningAddresses(); - } on error.NodeException catch (e) { - throw mapNodeException(e); - } - } - - /// Retrieve a new on-chain/funding address. - @override - Future newOnchainAddress({hint}) async { - try { - return await super.newOnchainAddress(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } /// Retrieve the currently spendable on-chain balance in satoshis. @override - Future spendableOnchainBalanceSats({hint}) async { - try { - return await super.spendableOnchainBalanceSats(); - } on error.NodeException catch (e) { - throw mapNodeException(e); - } - } - - /// Retrieve the current total on-chain balance in satoshis. - @override - Future totalOnchainBalanceSats({hint}) async { - try { - return await super.totalOnchainBalanceSats(); - } on error.NodeException catch (e) { - throw mapNodeException(e); - } - } - - /// Send an on-chain payment to the given address. - @override - Future sendToOnchainAddress( - {required types.Address address, required int amountSats, hint}) async { + Future listBalances({hint}) { try { - return await super - .sendToOnchainAddress(address: address, amountSats: amountSats); - } on error.NodeException catch (e) { - throw mapNodeException(e); + return super.listBalances(); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - /// Send an on-chain payment to the given address, draining all the available funds. + ///Returns the config with which the Node was initialized. @override - Future sendAllToOnchainAddress( - {required types.Address address, hint}) async { + Future config({hint}) { try { - return await super.sendAllToOnchainAddress(address: address); - } on error.NodeException catch (e) { - throw mapNodeException(e); + return super.config(); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -172,8 +169,8 @@ class Node extends LdkNode { Future> listChannels({hint}) async { try { return await super.listChannels(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -189,8 +186,8 @@ class Node extends LdkNode { try { return await super .connect(address: address, nodeId: nodeId, persist: persist); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -205,8 +202,8 @@ class Node extends LdkNode { await super.disconnect( counterpartyNodeId: counterpartyNodeId, ); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -220,24 +217,24 @@ class Node extends LdkNode { /// /// Returns a temporary channel id. @override - Future connectOpenChannel( + Future connectOpenChannel( {required types.SocketAddress socketAddress, required types.PublicKey nodeId, - required int channelAmountSats, + required BigInt channelAmountSats, required bool announceChannel, types.ChannelConfig? channelConfig, - int? pushToCounterpartyMsat, + BigInt? pushToCounterpartyMsat, hint}) async { try { - await super.connectOpenChannel( + return await super.connectOpenChannel( socketAddress: socketAddress, nodeId: nodeId, pushToCounterpartyMsat: pushToCounterpartyMsat, channelAmountSats: channelAmountSats, channelConfig: channelConfig, announceChannel: announceChannel); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -247,8 +244,18 @@ class Node extends LdkNode { Future syncWallets({hint}) async { try { await super.syncWallets(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Returns a handler allowing to query the network graph. + Future networkGraph() async { + try { + final res = await LdkNode.networkGraph(ptr: this); + return NetworkGraph._(ptr: res.ptr); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -256,15 +263,34 @@ class Node extends LdkNode { @override Future closeChannel( {required types.PublicKey counterpartyNodeId, - required types.ChannelId channelId, + required types.UserChannelId userChannelId, hint}) async { try { await super.closeChannel( - channelId: channelId, + userChannelId: userChannelId, counterpartyNodeId: counterpartyNodeId, ); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Force-close a previously opened channel. + /// Will force-close the channel, potentially broadcasting our latest state. Note that in contrast to cooperative closure, force-closing will have the channel funds time-locked, i. e., they will only be available after the counterparty had time to contest our claim. + /// Force-closing channels also more costly in terms of on-chain fees. So cooperative closure should always be preferred (and tried first). + /// Broadcasting the closing transactions will be omitted for Anchor channels if we trust the counterparty to broadcast for us. + @override + Future forceCloseChannel( + {required types.PublicKey counterpartyNodeId, + required types.UserChannelId userChannelId, + hint}) async { + try { + await super.forceCloseChannel( + userChannelId: userChannelId, + counterpartyNodeId: counterpartyNodeId, + ); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -273,225 +299,521 @@ class Node extends LdkNode { @override Future updateChannelConfig( {required types.PublicKey counterpartyNodeId, - required types.ChannelId channelId, + required types.UserChannelId userChannelId, required types.ChannelConfig channelConfig, hint}) async { try { await super.updateChannelConfig( - channelId: channelId, + userChannelId: userChannelId, counterpartyNodeId: counterpartyNodeId, channelConfig: channelConfig, ); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - /// Send a payement given an invoice. + /// Retrieve the details of a specific payment with the given hash. + /// + /// Returns `PaymentDetails` if the payment was known and `null` otherwise. @override - Future sendPayment( - {required types.Bolt11Invoice invoice, hint}) async { + Future payment( + {required types.PaymentId paymentId, hint}) async { try { - return await super.sendPayment(invoice: invoice); - } on error.NodeException catch (e) { - throw mapNodeException(e); + return await super.payment(paymentId: paymentId); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - /// Send a payment given an invoice and an amount in millisatoshi. - /// - /// This will fail if the amount given is less than the value required by the given invoice. - /// - /// This can be used to pay a so-called "zero-amount" invoice, i.e., an invoice that leaves the - /// amount paid to be determined by the user. + ///Remove the payment with the given hash from the store. @override - Future sendPaymentUsingAmount( - {required types.Bolt11Invoice invoice, - required int amountMsat, - hint}) async { + Future removePayment({required types.PaymentId paymentId, hint}) async { try { - return await super - .sendPaymentUsingAmount(invoice: invoice, amountMsat: amountMsat); - } on error.NodeException catch (e) { - throw mapNodeException(e); + return await super.removePayment(paymentId: paymentId); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - /// Send a spontaneous, aka. "keysend", payment + ///Retrieves all payments that match the given predicate. @override - Future sendSpontaneousPayment( - {required types.PublicKey nodeId, required int amountMsat, hint}) async { + Future> listPaymentsWithFilter( + {required types.PaymentDirection paymentDirection, hint}) async { try { return await super - .sendSpontaneousPayment(amountMsat: amountMsat, nodeId: nodeId); - } on error.NodeException catch (e) { - throw mapNodeException(e); + .listPaymentsWithFilter(paymentDirection: paymentDirection); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - ///Sends payment probes over all paths of a route that would be used to pay the given amount to the given node_id. + ///Retrieves all payments. @override - Future sendSpontaneousPaymentProbes( - {required types.PublicKey nodeId, required int amountMsat, hint}) async { + Future> listPayments({hint}) async { try { - return await super - .sendSpontaneousPaymentProbes(amountMsat: amountMsat, nodeId: nodeId); - } on error.NodeException catch (e) { - throw mapNodeException(e); + return super.listPayments(); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - // Sends payment probes over all paths of a route that would be used to pay the given invoice. - /// - /// This may be used to send "pre-flight" probes, i.e., to train our scorer before conducting - /// the actual payment. Note this is only useful if there likely is sufficient time for the - /// probe to settle before sending out the actual payment, e.g., when waiting for user - /// confirmation in a wallet UI. - /// - /// Otherwise, there is a chance the probe could take up some liquidity needed to complete the - /// actual payment. Users should therefore be cautious and might avoid sending probes if - /// liquidity is scarce and/or they don't expect the probe to return before they send the - /// payment. To mitigate this issue, channels with available liquidity less than the required - /// amount times "config.probingLiquidityLimitMultiplier" won't be used to send - /// pre-flight probes. + ///Retrieves a list of known peers. + @override + Future> listPeers({hint}) async { + try { + return await super.listPeers(); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + /// Creates a digital ECDSA signature of a message with the node's secret key. /// + /// A receiver knowing the corresponding [types.PublicKey] (e.g. the node’s id) and the message + /// can be sure that the signature was generated by the caller. + /// Signatures are EC recoverable, meaning that given the message and the + /// signature the PublicKey of the signer can be extracted. @override - Future sendPaymentProbes( - {required types.Bolt11Invoice invoice, hint}) async { + Future signMessage({required List msg, hint}) async { try { - return await super.sendPaymentProbes(invoice: invoice); - } on error.NodeException catch (e) { - throw mapNodeException(e); + return await super.signMessage(msg: msg); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } + /// Verifies that the given ECDSA signature was created for the given message with the + /// secret key corresponding to the given public key. @override - Future sendPaymentProbesUsingAmount( - {required types.Bolt11Invoice invoice, - required int amountMsat, + Future verifySignature( + {required List msg, + required String sig, + required types.PublicKey publicKey, hint}) async { try { - return await super.sendPaymentProbesUsingAmount( - invoice: invoice, amountMsat: amountMsat); - } on error.NodeException catch (e) { - throw mapNodeException(e); + return await super + .verifySignature(msg: msg, sig: sig, publicKey: publicKey); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Returns a payment handler allowing to create and pay BOLT 11 invoices. + Future bolt11Payment() async { + try { + final res = await LdkNode.bolt11Payment(ptr: this); + return Bolt11Payment._(ptr: res.ptr); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Returns a payment handler allowing to send and receive on-chain payments. + Future onChainPayment() async { + try { + final res = await LdkNode.onChainPayment(ptr: this); + return OnChainPayment._(ptr: res.ptr); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Returns a payment handler allowing to send spontaneous ("keysend") payments. + Future spontaneousPayment() async { + try { + final res = await LdkNode.spontaneousPayment(ptr: this); + return SpontaneousPayment._(ptr: res.ptr); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } +} + +///A payment handler allowing to send spontaneous ("keysend") payments. +class SpontaneousPayment extends spontaneous.LdkSpontaneousPayment { + SpontaneousPayment._({required super.ptr}); + + ///Sends payment probes over all paths of a route that would be used to pay the given amount to the given node_id. + @override + Future sendProbes( + {required BigInt amountMsat, required types.PublicKey nodeId, hint}) { + try { + return super.sendProbes(amountMsat: amountMsat, nodeId: nodeId); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Send a spontaneous, aka. "keysend", payment + @override + Future send( + {required BigInt amountMsat, + required types.PublicKey nodeId, + dynamic hint}) { + try { + return super.send(amountMsat: amountMsat, nodeId: nodeId); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } +} + +///A payment handler allowing to send and receive on-chain payments. +class OnChainPayment extends on_chain.LdkOnChainPayment { + OnChainPayment._({required super.ptr}); + @override + Future newAddress({hint}) { + try { + return super.newAddress(); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + @override + Future sendAllToAddress({required types.Address address, hint}) { + try { + return super.sendAllToAddress(address: address); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + @override + Future sendToAddress( + {required types.Address address, required BigInt amountSats, hint}) { + try { + return super.sendToAddress(address: address, amountSats: amountSats); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } +} + +///Represents the network as nodes and channels between them. +class NetworkGraph extends graph.LdkNetworkGraph { + NetworkGraph._({required super.ptr}); + + ///Returns information on a channel with the given id. + @override + Future channel({required BigInt shortChannelId}) { + try { + return super.channel(shortChannelId: shortChannelId); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Returns the list of channels in the graph + @override + Future listChannels() { + try { + return super.listChannels(); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Returns the list of nodes in the graph + @override + Future> listNodes() { + try { + return super.listNodes(); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Returns information on a node with the given id. + @override + Future node({required graph.NodeId nodeId}) { + try { + return super.node(nodeId: nodeId); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } +} + +///Represents a syntactically and semantically correct lightning BOLT11 invoice. +class Bolt11Payment extends bolt11.LdkBolt11Payment { + Bolt11Payment._({required super.ptr}); + + ///Allows to attempt manually claiming payments with the given preimage that have previously been registered via + ///`receiveForHash` or `receiveVariableAmountForHash`. + /// This should be called in response to a PaymentClaimable event as soon as the preimage is available. + /// Will check that the payment is known, and that the given preimage and claimable amount match our expectations before attempting to claim the payment, and will return an error otherwise. + /// When claiming the payment has succeeded, a PaymentReceived event will be emitted. + @override + Future claimForHash( + {required types.PaymentHash paymentHash, + required BigInt claimableAmountMsat, + required types.PaymentPreimage preimage}) { + try { + return super.claimForHash( + paymentHash: paymentHash, + claimableAmountMsat: claimableAmountMsat, + preimage: preimage); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Allows to manually fail payments with the given hash that have previously been registered via + ///`receiveForHash` or `receiveVariableAmountForHash`. + /// This should be called in response to a PaymentClaimable event if the payment needs to be failed back, e. g., if the correct preimage can't be retrieved in time before the claim deadline has been reached. + /// Will check that the payment is known before failing the payment, and will return an error otherwise. + @override + Future failForHash({required types.PaymentHash paymentHash}) { + try { + return super.failForHash(paymentHash: paymentHash); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - /// Returns a payable invoice that can be used to request and receive a payment of the amount - /// given. + ///Returns a payable invoice that can be used to request a payment of the amount given for the given payment hash. + /// We will register the given payment hash and emit a PaymentClaimable event once the inbound payment arrives. + /// Note: users MUST handle this event and claim the payment manually via claimForHash as soon as they have obtained access to the preimage of the given payment hash. + /// If they're unable to obtain the preimage, they MUST immediately fail the payment via failForHash. @override - Future receivePayment( - {required int amountMsat, + Future receiveForHash( + {required types.PaymentHash paymentHash, + required BigInt amountMsat, + required String description, + required int expirySecs}) { + try { + return super.receiveForHash( + paymentHash: paymentHash, + amountMsat: amountMsat, + description: description, + expirySecs: expirySecs); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Returns a payable invoice that can be used to request a payment for the given payment hash and the amount to be determined by the user, also known as a "zero-amount" invoice. + /// We will register the given payment hash and emit a PaymentClaimable event once the inbound payment arrives. + /// Note: users MUST handle this event and claim the payment manually via `claimForHash` as soon as they have obtained access to the preimage + /// of the given payment hash. If they're unable to obtain the preimage, they MUST immediately fail the payment via `failForHash`. + @override + Future receiveVariableAmountForHash( + {required String description, required int expirySecs, + required types.PaymentHash paymentHash}) { + try { + return super.receiveVariableAmountForHash( + description: description, + expirySecs: expirySecs, + paymentHash: paymentHash); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Returns a payable invoice that can be used to request and receive a payment of the amount given. + /// The inbound payment will be automatically claimed upon arrival. + @override + Future receive( + {required BigInt amountMsat, required String description, - hint}) async { + required int expirySecs, + hint}) { try { - return await super.receivePayment( + return super.receive( amountMsat: amountMsat, description: description, expirySecs: expirySecs); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - /// Returns a payable invoice that can be used to request and receive a payment for which the - /// amount is to be determined by the user, also known as a "zero-amount" invoice. + ///Returns a payable invoice that can be used to request and receive a payment for which the amount is to be determined by the user, also known as a "zero-amount" invoice. + /// The inbound payment will be automatically claimed upon arrival. @override - Future receiveVariableAmountPayment( - {required int expirySecs, required String description, hint}) async { + Future receiveVariableAmount( + {required String description, required int expirySecs, hint}) { try { - return await super.receiveVariableAmountPayment( + return super.receiveVariableAmount( description: description, expirySecs: expirySecs); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - /// Retrieve the details of a specific payment with the given hash. - /// - /// Returns `PaymentDetails` if the payment was known and `null` otherwise. + ///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 payment( - {required types.PaymentHash paymentHash, hint}) async { + Future receiveVariableAmountViaJitChannel( + {required String description, + required int expirySecs, + BigInt? maxProportionalLspFeeLimitPpmMsat, + hint}) { try { - return await super.payment(paymentHash: paymentHash); - } on error.NodeException catch (e) { - throw mapNodeException(e); + return super.receiveVariableAmountViaJitChannel( + description: description, + expirySecs: expirySecs, + maxProportionalLspFeeLimitPpmMsat: maxProportionalLspFeeLimitPpmMsat); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - ///Remove the payment with the given hash from the store. + ///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, `maxTotalLspFeeLimitMsat` 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 removePayment( - {required types.PaymentHash paymentHash, hint}) async { + Future receiveViaJitChannel( + {required BigInt amountMsat, + required String description, + required int expirySecs, + BigInt? maxTotalLspFeeLimitMsat, + hint}) { try { - return await super.removePayment(paymentHash: paymentHash); - } on error.NodeException catch (e) { - throw mapNodeException(e); + return super.receiveViaJitChannel( + description: description, + expirySecs: expirySecs, + maxTotalLspFeeLimitMsat: maxTotalLspFeeLimitMsat, + amountMsat: amountMsat); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - ///Retrieves all payments that match the given predicate. + ///Send a payment given an invoice. @override - Future> listPaymentsWithFilter( - {required types.PaymentDirection paymentDirection, hint}) async { + Future send({required bolt11.Bolt11Invoice invoice, hint}) { try { - return await super - .listPaymentsWithFilter(paymentDirection: paymentDirection); - } on error.NodeException catch (e) { - throw mapNodeException(e); + return super.send(invoice: invoice); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - ///Retrieves all payments. + ///Sends payment probes over all paths of a route that would be used to pay the given invoice. + /// This may be used to send "pre-flight" probes, i. e., to train our scorer before conducting the actual payment. Note this is only useful if there likely is sufficient time for the probe to settle before sending out the actual payment, e. g., when waiting for user confirmation in a wallet UI. + /// Otherwise, there is a chance the probe could take up some liquidity needed to complete the actual payment. + /// Users should therefore be cautious and might avoid sending probes if liquidity is scarce and/ or they don't expect the probe to return before they send the payment. + /// To mitigate this issue, channels with available liquidity less than the required amount times @override - Future> listPayments({hint}) async { + Future sendProbes({required bolt11.Bolt11Invoice invoice, hint}) { try { - return super.listPayments(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + return super.sendProbes(invoice: invoice); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - ///Retrieves a list of known peers. + ///Sends payment probes over all paths of a route that would be used to pay the given zero-value invoice using the given amount. + /// This can be used to send pre-flight probes for a so-called "zero-amount" invoice, i. e., an invoice that leaves the amount paid to be determined by the user. @override - Future> listPeers({hint}) async { + Future sendProbesUsingAmount( + {required bolt11.Bolt11Invoice invoice, + required BigInt amountMsat, + hint}) { try { - return await super.listPeers(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + return super + .sendProbesUsingAmount(invoice: invoice, amountMsat: amountMsat); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - /// Creates a digital ECDSA signature of a message with the node's secret key. - /// - /// A receiver knowing the corresponding [types.PublicKey] (e.g. the node’s id) and the message - /// can be sure that the signature was generated by the caller. - /// Signatures are EC recoverable, meaning that given the message and the - /// signature the PublicKey of the signer can be extracted. + ///Send a payment given an invoice and an amount in millisatoshi. + /// This will fail if the amount given is less than the value required by the given invoice. + /// This can be used to pay a so-called "zero-amount" invoice, i. e., an invoice that leaves the amount paid to be determined by the user. @override - Future signMessage({required List msg, hint}) async { + Future sendUsingAmount( + {required bolt11.Bolt11Invoice invoice, + required BigInt amountMsat, + hint}) { try { - return await super.signMessage(msg: msg); - } on error.NodeException catch (e) { - throw mapNodeException(e); + return super.sendUsingAmount(invoice: invoice, amountMsat: amountMsat); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } +} - /// Verifies that the given ECDSA signature was created for the given message with the - /// secret key corresponding to the given public key. +///A payment handler allowing to create and pay BOLT 12 offers and refunds. +class Bolt12Payment extends bolt12.LdkBolt12Payment { + Bolt12Payment._({required super.ptr}); + + ///Returns a Refund object that can be used to offer a refund payment of the amount given. @override - Future verifySignature( - {required List msg, - required String sig, - required types.PublicKey pkey, - hint}) async { + Future initiateRefund( + {required BigInt amountMsat, required int expirySecs}) { + try { + return super + .initiateRefund(amountMsat: amountMsat, expirySecs: expirySecs); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Returns a payable offer that can be used to request and receive a payment of the amount given. + @override + Future receive( + {required BigInt amountMsat, required String description}) { + try { + return super.receive(amountMsat: amountMsat, description: description); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Returns a payable offer that can be used to request and receive a payment for which the amount is to be determined by the user, also known as a "zero-amount" offer. + @override + Future receiveVariableAmount({required String description}) { try { - return await super.verifySignature(msg: msg, sig: sig, pkey: pkey); - } on error.NodeException catch (e) { - throw mapNodeException(e); + return super.receiveVariableAmount(description: description); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Requests a refund payment for the given Refund. + /// The returned `Bolt12Invoice` is for informational purposes only (i. e., isn't needed to retrieve the refund). + @override + Future requestRefundPayment( + {required bolt12.Refund refund}) { + try { + return super.requestRefundPayment(refund: refund); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Send a payment given an offer and an amount in millisatoshi. + /// This will fail if the amount given is less than the value required by the given offer. + /// This can be used to pay a so-called "zero-amount" offers, i. e., an offer that leaves the amount paid to be determined by the user. + /// If payer_note is Some it will be seen by the recipient and reflected back in the invoice response. + @override + Future sendUsingAmount( + {required bolt12.Offer offer, + String? payerNote, + required BigInt amountMsat}) { + try { + return super.sendUsingAmount( + offer: offer, payerNote: payerNote, amountMsat: amountMsat); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Send a payment given an offer. + /// If payer_note is Some it will be seen by the recipient and reflected back in the invoice response. + @override + Future send( + {required bolt12.Offer offer, String? payerNote}) { + try { + return super.send(offer: offer, payerNote: payerNote); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } } @@ -509,6 +831,7 @@ class Builder { types.EntropySourceConfig? _entropySource; types.ChainDataSourceConfig? _chainDataSourceConfig; types.GossipSourceConfig? _gossipSourceConfig; + types.LiquiditySourceConfig? _liquiditySourceConfig; /// Creates a new builder instance from an [Config]. /// @@ -521,18 +844,19 @@ class Builder { /// factory Builder() { return Builder._(types.Config( - storageDirPath: '', - network: types.Network.bitcoin, - listeningAddresses: [ - types.SocketAddress.hostname(addr: "0.0.0.0", port: 9735) - ], - onchainWalletSyncIntervalSecs: 60, - walletSyncIntervalSecs: 20, - feeRateCacheUpdateIntervalSecs: 600, - logLevel: types.LogLevel.debug, - defaultCltvExpiryDelta: 144, - trustedPeers0Conf: [], - probingLiquidityLimitMultiplier: 3)); + storageDirPath: '', + network: types.Network.bitcoin, + listeningAddresses: [ + types.SocketAddress.hostname(addr: "0.0.0.0", port: 9735) + ], + onchainWalletSyncIntervalSecs: BigInt.from(60), + walletSyncIntervalSecs: BigInt.from(20), + feeRateCacheUpdateIntervalSecs: BigInt.from(200), + logLevel: types.LogLevel.debug, + defaultCltvExpiryDelta: 144, + trustedPeers0Conf: [], + probingLiquidityLimitMultiplier: BigInt.from(3), + )); } /// Creates a new builder instance with default services configured for testnet. @@ -556,7 +880,17 @@ class Builder { return builder .setNetwork(types.Network.signet) .setEsploraServer(DefaultServicesMutinynet.esploraServerUrl) - .setGossipSourceRgs(DefaultServicesMutinynet.rgsServerUrl); + .setGossipSourceRgs(DefaultServicesMutinynet.rgsServerUrl) + .setLiquiditySourceLsps2( + address: types.SocketAddress.hostname( + addr: DefaultServicesMutinynet.lsps2SourceAddress, + port: DefaultServicesMutinynet.lsps2SourcePort, + ), + publicKey: types.PublicKey( + hex: DefaultServicesMutinynet.lsps2SourcePublicKey, + ), + token: DefaultServicesMutinynet.lsps2SourceToken, + ); } /// Configures the [Node] instance to source its wallet entropy from a seed file on disk. @@ -635,6 +969,22 @@ 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. /// @@ -647,17 +997,38 @@ class Builder { final nodePath = "${directory.path}/ldk_cache/"; _config!.storageDirPath = nodePath; } - final res = await buildWithSqliteStore( - config: _config!, - entropySourceConfig: _entropySource, - chainDataSourceConfig: _chainDataSourceConfig, - gossipSourceConfig: _gossipSourceConfig, - ); + final res = await (await builder.NodeBuilder.createBuilder( + config: _config ?? Builder()._config!, + chainDataSourceConfig: _chainDataSourceConfig, + entropySourceConfig: _entropySource, + liquiditySourceConfig: _liquiditySourceConfig, + gossipSourceConfig: _gossipSourceConfig)) + .build(); + return Node._(ptr: res.ptr); + } on error.LdkBuilderError catch (e) { + throw mapLdkBuilderError(e); + } + } + + ///Builds a Node instance with a FilesystemStore backend and according to the options previously configured. + Future buildWithFsStore() async { + try { + await Frb.verifyInit(); + if (_config!.storageDirPath == '') { + final directory = await getApplicationDocumentsDirectory(); + final nodePath = "${directory.path}/ldk_cache/"; + _config!.storageDirPath = nodePath; + } + final res = await (await builder.NodeBuilder.createBuilder( + config: _config ?? Builder()._config!, + chainDataSourceConfig: _chainDataSourceConfig, + entropySourceConfig: _entropySource, + liquiditySourceConfig: _liquiditySourceConfig, + gossipSourceConfig: _gossipSourceConfig)) + .buildWithFsStore(); return Node._(ptr: res.ptr); - } on error.BuilderException catch (e) { - throw mapBuilderException(e); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkBuilderError catch (e) { + throw mapLdkBuilderError(e); } } } diff --git a/lib/src/utils/default_services.dart b/lib/src/utils/default_services.dart index 21ac712..e1b5637 100644 --- a/lib/src/utils/default_services.dart +++ b/lib/src/utils/default_services.dart @@ -6,4 +6,9 @@ class DefaultServicesTestnet { class DefaultServicesMutinynet { static const String esploraServerUrl = 'https://mutinynet.ltbl.io/api'; static const String rgsServerUrl = 'https://mutinynet.ltbl.io/snapshot'; + static const String lsps2SourceAddress = '44.219.111.31'; + static const int lsps2SourcePort = 39735; + static const String lsps2SourcePublicKey = + '0371d6fd7d75de2d0372d03ea00e8bacdacb50c27d0eaea0a76a0622eff1f5ef2b'; + static const String lsps2SourceToken = 'JZWN9YLW'; } diff --git a/lib/src/utils/exceptions.dart b/lib/src/utils/exceptions.dart index 7e681b9..0af8206 100644 --- a/lib/src/utils/exceptions.dart +++ b/lib/src/utils/exceptions.dart @@ -1,127 +1,164 @@ -import '../generated/api/error.dart' as bridge; +import '../generated/utils/error.dart' as error; -abstract class LdkException implements Exception { +abstract class ExceptionBase implements Exception { String? message; - LdkException({this.message}); + ExceptionBase({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 LdkException { +class NodeException extends ExceptionBase { NodeException({super.message}); } -class BuilderException extends LdkException { +class BuilderException extends ExceptionBase { BuilderException({super.message}); } -BuilderException mapBuilderException(bridge.BuilderException e) { +BuilderException mapLdkBuilderError(error.LdkBuilderError e) { switch (e) { - case bridge.BuilderException.invalidSeedBytes: + case error.LdkBuilderError.invalidSeedBytes: return BuilderException(message: "Given seed bytes are invalid."); - case bridge.BuilderException.invalidSeedFile: + case error.LdkBuilderError.invalidSeedFile: return BuilderException( message: "Given seed file is invalid or could not be read."); - case bridge.BuilderException.invalidSystemTime: + case error.LdkBuilderError.invalidSystemTime: return BuilderException( message: "System time is invalid. Clocks might have gone back in time."); - case bridge.BuilderException.readFailed: + case error.LdkBuilderError.readFailed: return BuilderException(message: "Failed to read from store."); - case bridge.BuilderException.writeFailed: + case error.LdkBuilderError.writeFailed: return BuilderException(message: "Failed to write to store."); - case bridge.BuilderException.storagePathAccessFailed: + case error.LdkBuilderError.storagePathAccessFailed: return BuilderException( message: "Failed to access the given storage path."); - case bridge.BuilderException.walletSetupFailed: + case error.LdkBuilderError.walletSetupFailed: return BuilderException(message: "Failed to setup onchain wallet."); - case bridge.BuilderException.loggerSetupFailed: + case error.LdkBuilderError.loggerSetupFailed: return BuilderException(message: "Failed to setup the logger."); - case bridge.BuilderException.invalidChannelMonitor: + + case error.LdkBuilderError.invalidChannelMonitor: return BuilderException( message: "Failed to watch a deserialized ChannelMonitor."); - case bridge.BuilderException.invalidListeningAddress: + case error.LdkBuilderError.invalidListeningAddress: return BuilderException( message: "Given listening addresses are invalid."); - case bridge.BuilderException.kvStoreSetupFailed: + case error.LdkBuilderError.kvStoreSetupFailed: return BuilderException(message: "Failed to setup KVStore."); - case bridge.BuilderException.socketAddressParseError: - return BuilderException(message: "Failed to parse socket address"); - case bridge.BuilderException.invalidTrustedPeer: - return BuilderException(message: "Invalid trusted peer"); + case error.LdkBuilderError.socketAddressParseError: + return BuilderException(message: "Invalid SocketAddress."); + + case error.LdkBuilderError.invalidPublicKey: + return BuilderException(message: "Invalid PublicKey."); } } -NodeException mapNodeException(bridge.NodeException e) { - switch (e) { - case bridge.NodeException.alreadyRunning: - return NodeException(message: "Node is already running."); - case bridge.NodeException.notRunning: - return NodeException(message: "Node is not running."); - case bridge.NodeException.onchainTxCreationFailed: - return NodeException( - message: "On-chain transaction could not be created."); - case bridge.NodeException.connectionFailed: - return NodeException(message: "Network connection closed."); - case bridge.NodeException.paymentSendingFailed: - return NodeException(message: "Failed to send the given payment."); - case bridge.NodeException.probeSendingFailed: - return NodeException(message: "Failed to send the given payment probe."); - case bridge.NodeException.channelCreationFailed: - return NodeException(message: "Failed to create channel."); - case bridge.NodeException.channelClosingFailed: - return NodeException(message: "Failed to close channel."); - case bridge.NodeException.channelConfigUpdateFailed: - return NodeException(message: "Failed to update channel config."); - case bridge.NodeException.persistenceFailed: - return NodeException(message: "Failed to persist data."); - case bridge.NodeException.walletOperationFailed: - return NodeException(message: "Failed to conduct wallet operation."); - case bridge.NodeException.onchainTxSigningFailed: - return NodeException(message: "Failed to sign given transaction."); - case bridge.NodeException.messageSigningFailed: - return NodeException(message: "Failed to sign given message."); - case bridge.NodeException.txSyncFailed: - return NodeException(message: "Failed to sync transactions."); - case bridge.NodeException.gossipUpdateFailed: - return NodeException(message: "Failed to update gossip data."); - case bridge.NodeException.invalidAddress: - return NodeException(message: "The given address is invalid."); - case bridge.NodeException.invalidSocketAddress: - return NodeException(message: "The given network address is invalid."); - case bridge.NodeException.invalidPublicKey: - return NodeException(message: "The given public key is invalid."); - case bridge.NodeException.invalidSecretKey: - return NodeException(message: "The given secret key is invalid."); - case bridge.NodeException.invalidPaymentHash: - return NodeException(message: "The given payment hash is invalid."); - case bridge.NodeException.invalidPaymentPreimage: - return NodeException(message: "The given payment preimage is invalid."); - case bridge.NodeException.invalidPaymentSecret: - return NodeException(message: "The given payment secret is invalid."); - case bridge.NodeException.invalidAmount: - return NodeException(message: "The given amount is invalid."); - case bridge.NodeException.invalidInvoice: - return NodeException(message: "The given invoice is invalid."); - case bridge.NodeException.invalidChannelId: - return NodeException(message: "The given channel ID is invalid."); - case bridge.NodeException.invoiceCreationFailed: - return NodeException(message: "Failed to create invoice."); - case bridge.NodeException.invalidNetwork: - return NodeException(message: "The given network is invalid."); - case bridge.NodeException.duplicatePayment: - return NodeException( - message: "A payment with the given hash has already been initiated."); +NodeException mapLdkNodeError(error.LdkNodeError e) { + return e.map( + alreadyRunning: (_) => NodeException(message: "Node is already running."), + notRunning: (_) => NodeException(message: "Node is not running."), + onchainTxCreationFailed: (_) => + NodeException(message: "On-chain transaction could not be created."), + connectionFailed: (_) => + NodeException(message: "Network connection closed."), + paymentSendingFailed: (_) => + NodeException(message: "Failed to send the given payment."), + probeSendingFailed: (_) => + NodeException(message: "Failed to send the given payment probe."), + channelCreationFailed: (_) => + NodeException(message: "Failed to create channel."), + channelClosingFailed: (_) => + NodeException(message: "Failed to close channel."), + channelConfigUpdateFailed: (_) => + NodeException(message: "Failed to update channel config."), + persistenceFailed: (_) => + NodeException(message: "Failed to persist data."), + walletOperationFailed: (_) => + NodeException(message: "Failed to conduct wallet operation."), + onchainTxSigningFailed: (_) => + NodeException(message: "Failed to sign given transaction."), + messageSigningFailed: (_) => + NodeException(message: "Failed to sign given message."), + txSyncFailed: (_) => + NodeException(message: "Failed to sync transactions."), + gossipUpdateFailed: (_) => + NodeException(message: "Failed to update gossip data."), + invalidAddress: (_) => + NodeException(message: "The given address is invalid."), + invalidSocketAddress: (_) => + NodeException(message: "The given network address is invalid."), + invalidPublicKey: (_) => + NodeException(message: "The given public key is invalid."), + invalidSecretKey: (_) => + NodeException(message: "The given secret key is invalid."), + invalidPaymentHash: (_) => + NodeException(message: "The given payment hash is invalid."), + invalidPaymentPreimage: (_) => + NodeException(message: "The given payment preimage is invalid."), + invalidPaymentSecret: (_) => + NodeException(message: "The given payment secret is invalid."), + invalidAmount: (_) => + NodeException(message: "The given amount is invalid."), + invalidInvoice: (_) => + NodeException(message: "The given invoice is invalid."), + invalidChannelId: (_) => + NodeException(message: "The given channel ID is invalid."), + invoiceCreationFailed: (_) => + NodeException(message: "Failed to create invoice."), + invalidNetwork: (_) => + NodeException(message: "The given network is invalid."), + duplicatePayment: (_) => NodeException( + message: "A payment with the given hash has already been initiated."), + insufficientFunds: (_) => NodeException( + message: + "There are insufficient funds to complete the given operation."), + feerateEstimationUpdateFailed: (_) => + NodeException(message: "Failed to update fee rate estimation."), + liquidityRequestFailed: (_) => + NodeException(message: "Liquidity request operation failed."), + liquiditySourceUnavailable: (_) => NodeException(message: "Liquidity operation failed due to the required liquidity source being unavailable."), + liquidityFeeTooHigh: (_) => NodeException(message: "Liquidity operation failed due to the LSP's required opening fee being too high."), + invalidTxid: (_) => NodeException(message: "The given transaction id is Invalid."), + invalidPaymentId: (_) => NodeException(message: "The given paymentId is invalid."), + decode: (e) => mapLdkDecodeError(e.field0), + bolt12Parse: (e) => NodeException(message: e.toString()), + walletOperationTimeout: (e) => NodeException(message: "A wallet operation timed out."), + invoiceRequestCreationFailed: (e) => NodeException(message: "Invoice request creation failed."), + offerCreationFailed: (e) => NodeException(message: "Offer creation failed."), + refundCreationFailed: (e) => NodeException(message: "Refund creation failed."), + feerateEstimationUpdateTimeout: (e) => NodeException(message: "A fee rate estimation update timed out."), + txSyncTimeout: (e) => NodeException(message: "A transaction sync operation timed out."), + gossipUpdateTimeout: (e) => NodeException(message: "A gossip updating operation timed out."), + invalidOfferId: (e) => NodeException(message: "The given offer id is invalid."), + invalidNodeId: (e) => NodeException(message: "The given node id is invalid."), + invalidOffer: (e) => NodeException(message: "The given offer is invalid."), + invalidRefund: (e) => NodeException(message: "The given refund is invalid."), + unsupportedCurrency: (e) => NodeException(message: "The provided offer was denominated in an unsupported currency.")); +} - case bridge.NodeException.insufficientFunds: - return NodeException( +NodeException mapLdkDecodeError(error.DecodeError e) { + return e.map( + unknownVersion: (e) => NodeException( message: - "There are insufficient funds to complete the given operation."); - case bridge.NodeException.feerateEstimationUpdateFailed: - return NodeException(message: "Failed to update fee rate estimation. "); - case bridge.NodeException.invalidTxid: - return NodeException(message: "Invalid transaction id"); - } + "A version byte specified something we don’t know how to handle. Includes unknown realm byte in an onion hop data packet."), + unknownRequiredFeature: (e) => NodeException( + message: + "Unknown feature mandating we fail to parse message (e.g., TLV with an even, unknown type)."), + invalidValue: (e) => NodeException( + message: + "Invalid value, a byte which was supposed to be a bool was something other than a 0 or 1, a public key/private key/signature was invalid, text wasn’t UTF-8, TLV was syntactically incorrect, etc."), + shortRead: (e) => + NodeException(message: "The buffer to be read was too short."), + badLengthDescriptor: (e) => NodeException( + message: + "A length descriptor in the packet didn’t describe the later data correctly. "), + io: (e) => NodeException(message: "Io: ${e.toString()}"), + unsupportedCompression: (e) => NodeException( + message: + "The message included zlib-compressed values, which we don’t support. "), + dangerousValue: (e) => NodeException( + message: "Value is validly encoded but is dangerous to use. ")); } diff --git a/lib/src/utils/utils.dart b/lib/src/utils/utils.dart index 0f77fa2..2f58dbf 100644 --- a/lib/src/utils/utils.dart +++ b/lib/src/utils/utils.dart @@ -7,8 +7,8 @@ export 'exceptions.dart'; class Frb { static Future verifyInit() async { try { - if (!LdkCore.instance.initialized) { - await LdkCore.init(); + if (!core.instance.initialized) { + await core.init(); } } catch (e) { debugPrint(e.toString()); diff --git a/makefile b/makefile index 5a42da9..a003e3c 100644 --- a/makefile +++ b/makefile @@ -11,7 +11,7 @@ help: makefile ## init: Install missing dependencies. init: - cargo install flutter_rust_bridge_codegen --version 2.0.0-dev.31 + cargo install flutter_rust_bridge_codegen --version 2.0.0 ## : all: init generate-bindings diff --git a/pubspec.yaml b/pubspec.yaml index 0195250..fa3e563 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: ldk_node description: A ready-to-go Lightning node library built using LDK and BDK. -version: 0.2.2-dev +version: 0.3.0 homepage: https://github.com/LtbLightning/ldk-node-flutter environment: @@ -8,23 +8,22 @@ environment: flutter: ">=2.5.0" dependencies: - collection: ^1.17.1 + collection: ^1.18.0 ffi: ^2.1.0 flutter: sdk: flutter - flutter_rust_bridge: ">2.0.0-dev.30 <= 2.0.0-dev.31" + flutter_rust_bridge: "2.0.0" freezed_annotation: ^2.2.0 - meta: ^1.10.0 + meta: ^1.12.0 uuid: ^4.3.3 path_provider: ^2.1.2 dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^3.0.1 - ffigen: ^9.0.1 - freezed: ^2.4.7 + ffigen: ^12.0.0 + freezed: ^2.5.2 build_runner: ^2.4.8 - lints: ^3.0.0 + lints: ^4.0.0 flutter: plugin: diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 3d2870b..a74fed9 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ "getrandom", "once_cell", @@ -30,9 +30,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.7" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "once_cell", @@ -42,18 +42,18 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "allo-isolate" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f5a5fd28223e6f3cafb7d9cd685f51eafdd71d33ca1229f8316925d5957240" +checksum = "97b6d794345b06592d0ebeed8e477e41b71e5a0a49df4fc0e4184d5938b99509" dependencies = [ "anyhow", "atomic", @@ -62,9 +62,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "android-tzdata" @@ -101,19 +101,19 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.79" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "async-trait" -version = "0.1.77" +version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -124,15 +124,15 @@ checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba" [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ "addr2line", "cc", @@ -161,7 +161,7 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fc1fc1a92e0943bfbcd6eb7d32c1b2a79f2f1357eb1e2eee9d7f36d6d7ca44a" dependencies = [ - "ahash 0.7.7", + "ahash 0.7.8", "async-trait", "bdk-macros", "bip39", @@ -258,9 +258,18 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] [[package]] name = "build-target" @@ -270,15 +279,15 @@ checksum = "832133bbabbbaa9fbdba793456a2827627a7d2b8fb96032fa1e7666d7895832b" [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytemuck" -version = "1.14.1" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed2490600f404f2b94c167e31d3ed1d5f3c225a0f3b80230053b3e0b7b962bd9" +checksum = "78834c15cb5d5efe3452d58b1e8ba890dd62d21907f867f383358198e56ebca5" [[package]] name = "byteorder" @@ -288,18 +297,15 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "cc" -version = "1.0.83" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] +checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" [[package]] name = "cfg-if" @@ -309,14 +315,15 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.33" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", - "windows-targets 0.52.0", + "serde", + "windows-targets 0.52.5", ] [[package]] @@ -345,6 +352,16 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + [[package]] name = "dart-sys-fork" version = "4.1.1" @@ -372,29 +389,30 @@ checksum = "51aac4c99b2e6775164b412ea33ae8441b2fde2dbf05a20bc0052a63d08c475b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] -name = "deranged" -version = "0.3.11" +name = "digest" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "powerfmt", + "block-buffer", + "crypto-common", ] [[package]] name = "either" -version = "1.9.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] @@ -417,9 +435,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -452,9 +470,9 @@ checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" [[package]] name = "fastrand" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "fixedbitset" @@ -464,9 +482,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flutter_rust_bridge" -version = "2.0.0-dev.31" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d9ceb6f8db0bf711a55e20151c6699132bb5975f846ecac2c3bc7d23cc0845d" +checksum = "033e831e28f1077ceae3490fb6d093dfdefefd09c5c6e8544c6579effe7e814f" dependencies = [ "allo-isolate", "android_logger", @@ -491,13 +509,15 @@ dependencies = [ [[package]] name = "flutter_rust_bridge_macros" -version = "2.0.0-dev.31" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e02edfe56f04af804d3145b17dfe7820d46a6753b214160f227dbdfa1073f7cb" +checksum = "0217fc4b7131b52578be60bbe38c76b3edfc2f9fecab46d9f930510f40ef9023" dependencies = [ "hex", + "md-5", + "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -506,21 +526,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -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" @@ -586,7 +591,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -619,11 +624,21 @@ dependencies = [ "slab", ] +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -638,9 +653,9 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "h2" -version = "0.3.24" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", @@ -657,11 +672,11 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ - "ahash 0.8.7", + "ahash 0.8.11", "allocator-api2", ] @@ -682,9 +697,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.4" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hex" @@ -694,9 +709,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-conservative" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ed443af458ccb6d81c1e7e661545f94d3176752fb1df2f543b902a1e0f51e2" +checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" [[package]] name = "hex_lit" @@ -715,9 +730,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", @@ -785,24 +800,11 @@ 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.59" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -833,9 +835,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.1" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "433de089bd45971eecf4668ee0ee8f4cec17db4f8bd8f7bc3197a6ce37aa7d9b" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", "hashbrown", @@ -858,9 +860,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" @@ -879,20 +881,20 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "ldk-node" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "923588872d472775345535cdb87a123730c077b4acbb49f081bb4a91442b4a20" +checksum = "c4a5400043598f1da534abf81bb937739a680663d57a451bf8363d6113211424" dependencies = [ "bdk", "bip39", "bitcoin", "chrono", "esplora-client", - "futures", "libc", "lightning", "lightning-background-processor", "lightning-invoice", + "lightning-liquidity", "lightning-net-tokio", "lightning-persister", "lightning-rapid-gossip-sync", @@ -908,20 +910,18 @@ dependencies = [ [[package]] name = "ldk_node" -version = "0.2.2-dev" +version = "0.3.0" dependencies = [ "anyhow", "flutter_rust_bridge", "ldk-node", - "log", - "simplelog", ] [[package]] name = "libc" -version = "0.2.152" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libsqlite3-sys" @@ -936,9 +936,9 @@ dependencies = [ [[package]] name = "lightning" -version = "0.0.121" +version = "0.0.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0c1f811ae288f86c6767055c55b5f7a721ca1e61bf1897a9ae2ec663e8aba1" +checksum = "5fd92d4aa159374be430c7590e169b4a6c0fb79018f5bc4ea1bffde536384db3" dependencies = [ "bitcoin", "hex-conservative", @@ -946,9 +946,9 @@ dependencies = [ [[package]] name = "lightning-background-processor" -version = "0.0.121" +version = "0.0.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d4711ad9cc33f30c2e8e876fcfd6255523fc250440abb8c374cd98e6c40e79" +checksum = "fb1c2c64050e37cee7c3b6b022106523784055ac3ee572d360780a1d6fe8062c" dependencies = [ "bitcoin", "lightning", @@ -957,22 +957,36 @@ dependencies = [ [[package]] name = "lightning-invoice" -version = "0.29.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b186aca4a605d4db3b85979922be287b9ebd5dedd8132963bb9dbeb8f7d2a04" +checksum = "26d07d01cf197bf2184b929b7dc94aa70d935aac6df896c256a3a9475b7e9d40" dependencies = [ "bech32", "bitcoin", "lightning", - "num-traits", "secp256k1", + "serde", +] + +[[package]] +name = "lightning-liquidity" +version = "0.1.0-alpha.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fa6284740f64672f42145de7b0a242beea3821dae1f0eac7949a8f48799c828" +dependencies = [ + "bitcoin", + "chrono", + "lightning", + "lightning-invoice", + "serde", + "serde_json", ] [[package]] name = "lightning-net-tokio" -version = "0.0.121" +version = "0.0.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4813cca14ed984924a6975895e80cde8673a0a105a1c7ddf3b0fb3d1ce59e6bf" +checksum = "f9e6a4d49c50a1344916d080dc8c012ce3a778cdd45de8def75350b2b40fe018" dependencies = [ "bitcoin", "lightning", @@ -981,9 +995,9 @@ dependencies = [ [[package]] name = "lightning-persister" -version = "0.0.121" +version = "0.0.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82a633e4d08b75e16dc131af2961254b7005c30ab29577e215080d2943c0511" +checksum = "8a8dd33971815fa074b05678e09a6d4b15c78225ea34d66ed4f17c35a53467a9" dependencies = [ "bitcoin", "lightning", @@ -992,9 +1006,9 @@ dependencies = [ [[package]] name = "lightning-rapid-gossip-sync" -version = "0.0.121" +version = "0.0.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "128d6c450cb698b46ecacc6645ebeb2b57d6f9458482635ab523863fa8378314" +checksum = "9d861b0f0cd5f8fe8c63760023c4fd4fd32c384881b41780b62ced2a8a619f91" dependencies = [ "bitcoin", "lightning", @@ -1002,9 +1016,9 @@ dependencies = [ [[package]] name = "lightning-transaction-sync" -version = "0.0.121" +version = "0.0.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0721b05c0230f11e1c96af68304103ad07e146b13b47f7fd9a12e69cacb610d" +checksum = "04c1e88eece28f19b5834fb5aefceabc5d143cfda2dfa9a32f73e66f4d0c84ed" dependencies = [ "bdk-macros", "bitcoin", @@ -1015,21 +1029,31 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "md-5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest", +] [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "mime" @@ -1050,18 +1074,18 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "wasi", @@ -1074,29 +1098,11 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" -[[package]] -name = "native-tls" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" -dependencies = [ - "lazy_static", - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] @@ -1111,15 +1117,6 @@ dependencies = [ "libc", ] -[[package]] -name = "num_threads" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" -dependencies = [ - "libc", -] - [[package]] name = "object" version = "0.32.2" @@ -1135,50 +1132,6 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "openssl" -version = "0.10.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" -dependencies = [ - "bitflags 2.4.2", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.99" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "oslog" version = "0.1.0" @@ -1198,9 +1151,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "petgraph" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", "indexmap", @@ -1208,9 +1161,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -1220,15 +1173,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" - -[[package]] -name = "powerfmt" -version = "0.2.0" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "ppv-lite86" @@ -1248,9 +1195,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6" dependencies = [ "unicode-ident", ] @@ -1311,9 +1258,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -1348,20 +1295,11 @@ dependencies = [ "getrandom", ] -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "regex" -version = "1.10.3" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", @@ -1371,9 +1309,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", @@ -1382,15 +1320,15 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "reqwest" -version = "0.11.23" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ "base64 0.21.7", "bytes", @@ -1402,12 +1340,10 @@ dependencies = [ "http-body", "hyper", "hyper-rustls", - "hyper-tls", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", @@ -1416,9 +1352,9 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", "system-configuration", "tokio", - "tokio-native-tls", "tokio-rustls", "tokio-socks", "tower-service", @@ -1432,16 +1368,17 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.7" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", + "cfg-if", "getrandom", "libc", "spin", "untrusted", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1460,17 +1397,17 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustix" -version = "0.38.30" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "errno", "libc", "linux-raw-sys", @@ -1479,9 +1416,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.10" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", "ring", @@ -1510,18 +1447,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" - -[[package]] -name = "schannel" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" -dependencies = [ - "windows-sys 0.52.0", -] +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "sct" @@ -1554,54 +1482,31 @@ dependencies = [ "cc", ] -[[package]] -name = "security-framework" -version = "2.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" -dependencies = [ - "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.196" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.196" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "serde_json" -version = "1.0.113" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", "ryu", @@ -1620,17 +1525,6 @@ dependencies = [ "serde", ] -[[package]] -name = "simplelog" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acee08041c5de3d5048c8b3f6f13fafb3026b24ba43c6a695a0c76179b844369" -dependencies = [ - "log", - "termcolor", - "time", -] - [[package]] name = "slab" version = "0.4.9" @@ -1642,18 +1536,18 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1675,15 +1569,21 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" 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" @@ -1707,44 +1607,34 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.9.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", "fastrand", - "redox_syscall", "rustix", "windows-sys 0.52.0", ] -[[package]] -name = "termcolor" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" -dependencies = [ - "winapi-util", -] - [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -1756,37 +1646,6 @@ dependencies = [ "num_cpus", ] -[[package]] -name = "time" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" -dependencies = [ - "deranged", - "itoa", - "libc", - "num_threads", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" -dependencies = [ - "time-core", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -1804,9 +1663,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.35.1" +version = "1.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" dependencies = [ "backtrace", "bytes", @@ -1827,17 +1686,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "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", + "syn 2.0.66", ] [[package]] @@ -1864,16 +1713,15 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] @@ -1907,6 +1755,12 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + [[package]] name = "unicode-bidi" version = "0.3.15" @@ -1959,9 +1813,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "vss-client" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3d56cb3a4c815901ee46fcaac027ab1674232eb4f136a17e3b0576a4c77ded7" +checksum = "a62cbd331368125aeb93b67dd4a80826a4ee29a810d4c76d2c9d265c1522a3f2" dependencies = [ "prost", "prost-build", @@ -2006,7 +1860,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", "wasm-bindgen-shared", ] @@ -2040,7 +1894,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2053,9 +1907,9 @@ checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "web-sys" -version = "0.3.67" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -2063,9 +1917,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.3" +version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "which" @@ -2095,15 +1949,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" -dependencies = [ - "winapi", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -2116,7 +1961,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -2134,7 +1979,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -2154,17 +1999,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "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", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -2175,9 +2021,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -2187,9 +2033,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -2199,9 +2045,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -2211,9 +2063,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -2223,9 +2075,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -2235,9 +2087,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -2247,9 +2099,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winreg" @@ -2263,20 +2115,20 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 8c5bd1a..36d8254 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ldk_node" -version = "0.2.2-dev" +version = "0.3.0" edition = "2021" [lib] @@ -10,12 +10,10 @@ crate-type = ["staticlib", "cdylib"] [build-dependencies] anyhow = "1.0.68" [dependencies] -flutter_rust_bridge = "=2.0.0-dev.31" - -log = "0.4.19" -simplelog = "0.12.1" +flutter_rust_bridge = "=2.0.0" anyhow = { version = "1.0.71"} -ldk-node = { version = "= 0.2.2" } +ldk-node = { version = "= 0.3.0" } +# ldk-node = {git = 'https://github.com/lightningdevkit/ldk-node.git', rev = "246775d04dbb2e99528a6a1aa0bc04ad7378e900"} [profile.release] diff --git a/rust/cargokit.yaml b/rust/cargokit.yaml index de2761f..fc12e2c 100644 --- a/rust/cargokit.yaml +++ b/rust/cargokit.yaml @@ -1,7 +1,10 @@ cargo: release: - toolchain: stable + toolchain: nightly + extra_flags: + - -Z + - build-std=panic_abort,std precompiled_binaries: url_prefix: https://github.com/LtbLightning/ldk-node-flutter/releases/download/precompiled_ - public_key: 9ac2de724ed22cc1e1400b7630331f82b99cfc11e76f8d4b04c0cd1f0c9dcfd1 + public_key: 0e43d5e8452d00db7f3000c18fb1ba796babfcb5dc6306bb0629eff24f8be85b diff --git a/rust/src/api/bolt11.rs b/rust/src/api/bolt11.rs new file mode 100644 index 0000000..42ad08a --- /dev/null +++ b/rust/src/api/bolt11.rs @@ -0,0 +1,175 @@ +use crate::api::types::{PaymentHash, PaymentId, PaymentPreimage}; +use crate::frb_generated::RustOpaque; +use crate::utils::error::LdkNodeError; +use std::str::FromStr; + +pub struct LdkBolt11Payment { + pub ptr: RustOpaque, +} +impl From for LdkBolt11Payment { + fn from(value: ldk_node::payment::Bolt11Payment) -> Self { + LdkBolt11Payment { + ptr: RustOpaque::new(value), + } + } +} +#[derive(Debug, Clone, PartialEq, Eq)] +///Represents a syntactically and semantically correct lightning BOLT11 invoice. +/// +pub struct Bolt11Invoice { + pub signed_raw_invoice: String, +} + +impl TryFrom for ldk_node::lightning_invoice::Bolt11Invoice { + type Error = LdkNodeError; + + fn try_from(value: Bolt11Invoice) -> Result { + ldk_node::lightning_invoice::Bolt11Invoice::from_str(value.signed_raw_invoice.as_str()) + .map_err(|_| LdkNodeError::InvalidInvoice) + } +} +impl From for Bolt11Invoice { + fn from(value: ldk_node::lightning_invoice::Bolt11Invoice) -> Self { + Bolt11Invoice { + signed_raw_invoice: value.to_string(), + } + } +} + +impl LdkBolt11Payment { + pub fn send(&self, invoice: Bolt11Invoice) -> Result { + self.ptr + .send(&(invoice.try_into()?)) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + pub fn send_using_amount( + &self, + invoice: Bolt11Invoice, + amount_msat: u64, + ) -> anyhow::Result { + self.ptr + .send_using_amount(&(invoice.try_into()?), amount_msat) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + + pub fn send_probes(&self, invoice: Bolt11Invoice) -> anyhow::Result<(), LdkNodeError> { + self.ptr + .send_probes(&(invoice.try_into()?)) + .map_err(|e| e.into()) + } + + pub fn send_probes_using_amount( + &self, + invoice: Bolt11Invoice, + amount_msat: u64, + ) -> Result<(), LdkNodeError> { + self.ptr + .send_probes_using_amount(&(invoice.try_into()?), amount_msat) + .map_err(|e| e.into()) + } + pub fn claim_for_hash( + &self, + payment_hash: PaymentHash, + claimable_amount_msat: u64, + preimage: PaymentPreimage, + ) -> anyhow::Result<(), LdkNodeError> { + self.ptr + .claim_for_hash(payment_hash.into(), claimable_amount_msat, preimage.into()) + .map_err(|e| e.into()) + } + pub fn fail_for_hash(&self, payment_hash: PaymentHash) -> anyhow::Result<(), LdkNodeError> { + self.ptr + .fail_for_hash(payment_hash.into()) + .map_err(|e| e.into()) + } + pub fn receive( + &self, + amount_msat: u64, + description: String, + expiry_secs: u32, + ) -> anyhow::Result { + self.ptr + .receive(amount_msat, description.as_str(), expiry_secs) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + + pub fn receive_for_hash( + &self, + payment_hash: PaymentHash, + amount_msat: u64, + description: String, + expiry_secs: u32, + ) -> anyhow::Result { + self.ptr + .receive_for_hash( + amount_msat, + description.as_str(), + expiry_secs, + payment_hash.into(), + ) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + pub fn receive_variable_amount( + &self, + description: String, + expiry_secs: u32, + ) -> anyhow::Result { + self.ptr + .receive_variable_amount(description.as_str(), expiry_secs) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + pub fn receive_variable_amount_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_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_variable_amount_for_hash( + &self, + description: String, + expiry_secs: u32, + payment_hash: PaymentHash + ) -> anyhow::Result { + match self.ptr.receive_variable_amount_for_hash( + description.as_str(), + expiry_secs, + payment_hash.into() + ) { + Ok(e) => Ok(e.into()), + Err(e) => Err(e.into()), + } + } + + pub fn receive_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_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()), + } + } +} diff --git a/rust/src/api/bolt12.rs b/rust/src/api/bolt12.rs new file mode 100644 index 0000000..553bb2f --- /dev/null +++ b/rust/src/api/bolt12.rs @@ -0,0 +1,147 @@ +use crate::api::types::PaymentId; +use ldk_node::lightning::util::ser::Writeable; +use std::str::FromStr; +use std::sync::Arc; + +use crate::frb_generated::RustOpaque; +use crate::utils::error::LdkNodeError; +/// An `Offer` is a potentially long-lived proposal for payment of a good or service. +/// +/// An offer is a precursor to an [InvoiceRequest]. A merchant publishes an offer from which a +/// customer may request an [Bolt12Invoice] for a specific quantity and using an amount sufficient +/// to cover that quantity (i.e., at least `quantity * amount`). +/// +/// Offers may be denominated in currency other than bitcoin but are ultimately paid using the +/// latter. +/// + +pub struct Offer { + pub s: String, +} +impl TryFrom for ldk_node::lightning::offers::offer::Offer { + type Error = LdkNodeError; + + fn try_from(value: Offer) -> Result { + ldk_node::lightning::offers::offer::Offer::from_str(value.s.as_str()).map_err(|e| e.into()) + } +} +impl From for Offer { + fn from(value: ldk_node::lightning::offers::offer::Offer) -> Self { + Offer { + s: value.to_string(), + } + } +} +///A Refund is a request to send an `Bolt12Invoice` without a preceding `Offer`. +// +// Typically, after an invoice is paid, the recipient may publish a refund allowing the sender to recoup their funds. +// A refund may be used more generally as an “offer for money”, such as with a bitcoin ATM. + +pub struct Refund { + pub s: String, +} + +impl TryFrom for ldk_node::lightning::offers::refund::Refund { + type Error = LdkNodeError; + + fn try_from(value: Refund) -> Result { + ldk_node::lightning::offers::refund::Refund::from_str(value.s.as_str()) + .map_err(|e| e.into()) + } +} +impl From for Refund { + fn from(value: ldk_node::lightning::offers::refund::Refund) -> Self { + Refund { + s: value.to_string(), + } + } +} + +#[derive(Debug, Clone, PartialEq, Eq)] +///A Bolt12Invoice is a payment request, typically corresponding to an Offer or a Refund. +// An invoice may be sent in response to an InvoiceRequest in the case of an offer or sent directly after scanning a refund. It includes all the information needed to pay a recipient. +pub struct Bolt12Invoice { + pub data: Vec, +} + +impl TryFrom for ldk_node::lightning::offers::invoice::Bolt12Invoice { + type Error = LdkNodeError; + + fn try_from(value: Bolt12Invoice) -> Result { + ldk_node::lightning::offers::invoice::Bolt12Invoice::try_from(value.data) + .map_err(|_| LdkNodeError::InvalidInvoice) + } +} +impl From for Bolt12Invoice { + fn from(value: ldk_node::lightning::offers::invoice::Bolt12Invoice) -> Self { + Bolt12Invoice { + data: value.encode(), + } + } +} +pub struct LdkBolt12Payment { + pub ptr: RustOpaque>, +} +impl LdkBolt12Payment { + pub fn send( + &self, + offer: Offer, + payer_note: Option, + ) -> Result { + self.ptr + .send(&(offer.try_into()?), payer_note) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + pub fn send_using_amount( + &self, + offer: Offer, + payer_note: Option, + amount_msat: u64, + ) -> anyhow::Result { + self.ptr + .send_using_amount(&(offer.try_into()?), payer_note, amount_msat) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + pub fn receive( + &self, + amount_msat: u64, + description: String, + ) -> anyhow::Result { + self.ptr + .receive(amount_msat, description.as_str()) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + pub fn receive_variable_amount( + &self, + description: String, + ) -> anyhow::Result { + self.ptr + .receive_variable_amount(description.as_str()) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + + pub fn request_refund_payment( + &self, + refund: Refund, + ) -> anyhow::Result { + self.ptr + .request_refund_payment(&(refund.try_into()?)) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + + pub fn initiate_refund( + &self, + amount_msat: u64, + expiry_secs: u32, + ) -> anyhow::Result { + self.ptr + .initiate_refund(amount_msat, expiry_secs) + .map_err(|e| e.into()) + .map(|e| e.into()) + } +} diff --git a/rust/src/api/builder.rs b/rust/src/api/builder.rs new file mode 100644 index 0000000..0411f2d --- /dev/null +++ b/rust/src/api/builder.rs @@ -0,0 +1,126 @@ +use crate::api::node::LdkNode; +use crate::api::types::{ + ChainDataSourceConfig, Config, EntropySourceConfig, GossipSourceConfig, LiquiditySourceConfig, +}; +use crate::frb_generated::RustOpaque; +use crate::utils::error::LdkBuilderError; +use flutter_rust_bridge::frb; +use ldk_node::lightning::util::ser::Writeable; +use std::str::FromStr; + +#[derive(Debug, Clone)] +pub struct LdkMnemonic { + pub seed_phrase: String, +} + +impl TryFrom for ldk_node::bip39::Mnemonic { + type Error = LdkBuilderError; + + fn try_from(value: LdkMnemonic) -> Result { + ldk_node::bip39::Mnemonic::from_str(&value.seed_phrase).map_err(|e| e.into()) + } +} +impl From for LdkMnemonic { + fn from(value: ldk_node::bip39::Mnemonic) -> Self { + LdkMnemonic { + seed_phrase: value.to_string(), + } + } +} +impl LdkMnemonic { + pub fn generate() -> LdkMnemonic { + ldk_node::generate_entropy_mnemonic().into() + } +} + +#[frb(opaque)] +pub struct NodeBuilder { + pub builder: RustOpaque, +} + +impl NodeBuilder { + pub fn create_builder( + config: Config, + 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.try_into()?); + if let Some(source) = entropy_source_config { + match source { + EntropySourceConfig::SeedFile(e) => builder.set_entropy_seed_path(e), + EntropySourceConfig::SeedBytes(e) => builder.set_entropy_seed_bytes(e.encode())?, + EntropySourceConfig::Bip39Mnemonic { + mnemonic, + passphrase, + } => builder.set_entropy_bip39_mnemonic( + >::try_into(mnemonic)?, + passphrase, + ), + }; + } + if let Some(source) = chain_data_source_config { + match source { + ChainDataSourceConfig::Esplora(e) => builder.set_esplora_server(e), + }; + } + if let Some(source) = gossip_source_config { + match source { + GossipSourceConfig::P2PNetwork => builder.set_gossip_source_p2p(), + 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.try_into()?, + liquidity + .lsps2_service + .1 + .try_into() + .map_err(|_| LdkBuilderError::InvalidPublicKey)?, + liquidity.lsps2_service.2, + ); + } + Ok(NodeBuilder { + builder: RustOpaque::new(builder), + }) + } + pub fn build(self) -> anyhow::Result { + match self.builder.build() { + Ok(e) => Ok(LdkNode { + ptr: RustOpaque::new(e), + }), + Err(e) => Err(e.into()), + } + } + pub fn build_with_fs_store(self) -> anyhow::Result { + match self.builder.build_with_fs_store() { + Ok(e) => Ok(LdkNode { + ptr: RustOpaque::new(e), + }), + Err(e) => Err(e.into()), + } + } + // fn build_with_store( + // self + // ) -> anyhow::Result { + // match self.builder.build_with_store(Arc::new(())) { + // Ok(e) => Ok(LdkNode { + // ptr: RustOpaque::new(e), + // }), + // Err(e) => Err(e.into()), + // } + // } +} + +// pub fn build_with_vss_store( +// self, url: String, store_id: String +// ) -> anyhow::Result { +// match self.builder.build_with_vss_store(url, store_id) { +// Ok(e) => Ok(LdkNode { +// ptr: RustOpaque::new(e), +// }), +// Err(e) => Err(e.into()), +// } +// } diff --git a/rust/src/api/error.rs b/rust/src/api/error.rs deleted file mode 100644 index 95359e4..0000000 --- a/rust/src/api/error.rs +++ /dev/null @@ -1,162 +0,0 @@ -use ldk_node::{BuildError, NodeError}; - -#[derive(Debug, PartialEq)] -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. - NotRunning, - /// An on-chain transaction could not be created. - OnchainTxCreationFailed, - /// A network connection has been closed. - ConnectionFailed, - /// Invoice creation failed. - InvoiceCreationFailed, - /// Sending a payment has failed. - PaymentSendingFailed, - /// Sending a payment probe has failed. - ProbeSendingFailed, - /// A channel could not be opened. - ChannelCreationFailed, - /// A channel could not be closed. - ChannelClosingFailed, - /// A channel config could not be updated. - ChannelConfigUpdateFailed, - /// Persistence failed. - PersistenceFailed, - /// A wallet operation failed. - WalletOperationFailed, - /// A signing operation for transaction failed. - OnchainTxSigningFailed, - /// A signing operation for message failed. - MessageSigningFailed, - /// A transaction sync operation failed. - TxSyncFailed, - /// A gossip updating operation failed. - GossipUpdateFailed, - /// The given address is invalid. - InvalidAddress, - /// The given network address is invalid. - InvalidSocketAddress, - /// The given public key is invalid. - InvalidPublicKey, - /// The given secret key is invalid. - InvalidSecretKey, - /// The given payment hash is invalid. - InvalidPaymentHash, - /// The given payment preimage is invalid. - InvalidPaymentPreimage, - /// The given payment secret is invalid. - InvalidPaymentSecret, - /// The given amount is invalid. - InvalidAmount, - /// The given invoice is invalid. - InvalidInvoice, - /// The given channel ID is invalid. - InvalidChannelId, - /// The given network is invalid. - InvalidNetwork, - /// A payment with the given hash has already been initiated. - DuplicatePayment, - /// There are insufficient funds to complete the given operation. - InsufficientFunds, - - FeerateEstimationUpdateFailed, -} -#[allow(dead_code)] -#[derive(Debug)] -pub enum BuilderException { - SocketAddressParseError, - /// The given seed bytes are invalid, e.g., have invalid length. - InvalidSeedBytes, - /// The given seed file is invalid, e.g., has invalid length, or could not be read. - InvalidSeedFile, - /// The current system time is invalid, clocks might have gone backwards. - InvalidSystemTime, - /// The a read channel monitor is invalid. - InvalidChannelMonitor, - /// The given listening addresses are invalid, e.g. too many were passed. - InvalidListeningAddress, - /// We failed to read data from the [`KVStore`]. - ReadFailed, - /// We failed to write data to the [`KVStore`]. - WriteFailed, - /// We failed to access the given `storage_dir_path`. - StoragePathAccessFailed, - /// We failed to setup our [`KVStore`]. - KVStoreSetupFailed, - /// We failed to setup the onchain wallet. - WalletSetupFailed, - /// We failed to setup the logger. - LoggerSetupFailed, - InvalidTrustedPeer, -} - -impl From for NodeException { - fn from(value: NodeError) -> Self { - match value { - 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 => { - NodeException::FeerateEstimationUpdateFailed - } - } - } -} -impl From for BuilderException { - fn from(value: BuildError) -> Self { - match value { - 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/graph.rs b/rust/src/api/graph.rs new file mode 100644 index 0000000..f745e4c --- /dev/null +++ b/rust/src/api/graph.rs @@ -0,0 +1,167 @@ +use crate::api::types::SocketAddress; +use crate::frb_generated::RustOpaque; +use crate::utils::error::LdkNodeError; +use ldk_node::lightning::util::ser::Writeable; + +///Represents the compressed public key of a node +pub struct NodeId { + pub compressed: Vec, +} + +impl From for NodeId { + fn from(value: ldk_node::lightning::routing::gossip::NodeId) -> Self { + Self { + compressed: value.encode(), + } + } +} +impl TryFrom for ldk_node::lightning::routing::gossip::NodeId { + type Error = LdkNodeError; + + fn try_from(value: NodeId) -> Result { + ldk_node::lightning::routing::gossip::NodeId::from_slice(value.compressed.as_slice()) + .map_err(|e| e.into()) + } +} +///Fees for routing via a given channel or a node +pub struct RoutingFees { + ///Flat routing fee in millisatoshis. + pub base_msat: u32, + ///Liquidity-based routing fee in millionths of a routed amount. In other words, 10000 is 1%. + pub proportional_millionths: u32, +} +impl From for RoutingFees { + fn from(value: ldk_node::lightning_invoice::RoutingFees) -> Self { + Self { + base_msat: value.base_msat, + proportional_millionths: value.proportional_millionths, + } + } +} +pub struct ChannelUpdateInfo { + ///When the last update to the channel direction was issued. Value is opaque, as set in the announcement. + pub last_update: u32, + ///Whether the channel can be currently used for payments (in this one direction). + pub enabled: bool, + ///The difference in CLTV values that you must have when routing through this channel. + pub cltv_expiry_delta: u16, + ///The minimum value, which must be relayed to the next hop via the channel + pub htlc_minimum_msat: u64, + ///The maximum value which may be relayed to the next hop via the channel. + pub htlc_maximum_msat: u64, + ////Fees charged when the channel is used for routing + pub fees: RoutingFees, +} + +///Details about a channel (both directions). Received within a channel announcement. +pub struct ChannelInfo { + ///Source node of the first direction of a channel + pub node_one: NodeId, + ///Details about the first direction of a channel + pub one_to_two: Option, + ///Source node of the second direction of a channel + pub node_two: NodeId, + ///Details about the second direction of a channel + pub two_to_one: Option, + ///The channel capacity as seen on-chain, if chain lookup is available. + pub capacity_sats: Option, +} +impl From for ChannelInfo { + fn from(value: ldk_node::lightning::routing::gossip::ChannelInfo) -> Self { + Self { + node_one: value.node_one.into(), + one_to_two: value.one_to_two.map(|e| e.into()), + node_two: value.node_two.into(), + two_to_one: value.two_to_one.map(|e| e.into()), + capacity_sats: value.capacity_sats, + } + } +} + +impl From for ChannelUpdateInfo { + fn from(value: ldk_node::lightning::routing::gossip::ChannelUpdateInfo) -> Self { + ChannelUpdateInfo { + last_update: value.last_update, + enabled: value.enabled, + cltv_expiry_delta: value.cltv_expiry_delta, + htlc_minimum_msat: value.htlc_minimum_msat, + htlc_maximum_msat: value.htlc_maximum_msat, + fees: value.fees.into(), + } + } +} +///Details about a node in the network, known from the network announcement. +pub struct NodeInfo { + pub channels: Vec, + ///More information about a node from node_announcement. Optional because we store a Node entry after learning about it from a channel announcement, but before receiving a node announcement. + pub announcement_info: Option, +} + +impl From for NodeInfo { + fn from(value: ldk_node::lightning::routing::gossip::NodeInfo) -> Self { + NodeInfo { + channels: value.channels, + announcement_info: value.announcement_info.map(|e| e.into()), + } + } +} +pub struct NodeAnnouncementInfo { + /// When the last known update to the node state was issued. + /// Value is opaque, as set in the announcement. + pub last_update: u32, + /// Moniker assigned to the node. + /// May be invalid or malicious (eg control chars), + /// should not be exposed to the user. + pub alias: String, + /// List of addresses on which this node is reachable + pub addresses: Vec, +} + +impl From for NodeAnnouncementInfo { + fn from(value: ldk_node::lightning::routing::gossip::NodeAnnouncementInfo) -> Self { + Self { + last_update: value.last_update, + alias: value.alias.to_string(), + addresses: value + .addresses() + .iter() + .map(|e| e.to_owned().into()) + .collect(), + } + } +} +pub struct LdkNetworkGraph { + pub ptr: RustOpaque, +} +impl From for LdkNetworkGraph { + fn from(value: ldk_node::graph::NetworkGraph) -> Self { + LdkNetworkGraph { + ptr: RustOpaque::new(value), + } + } +} + +impl LdkNetworkGraph { + /// Returns the list of channels in the graph + pub fn list_channels(&self) -> Vec { + self.ptr.list_channels() + } + + /// Returns information on a channel with the given id. + pub fn channel(&self, short_channel_id: u64) -> Option { + self.ptr.channel(short_channel_id).map(|e| e.into()) + } + + /// Returns the list of nodes in the graph + pub fn list_nodes(&self) -> Vec { + self.ptr + .list_nodes() + .iter() + .map(|e| e.to_owned().into()) + .collect() + } + + pub fn node(&self, node_id: NodeId) -> Result, LdkNodeError> { + Ok(self.ptr.node(&(node_id.try_into()?)).map(|e| e.into())) + } +} diff --git a/rust/src/api/mod.rs b/rust/src/api/mod.rs index 6f054f8..045ddfe 100644 --- a/rust/src/api/mod.rs +++ b/rust/src/api/mod.rs @@ -1,3 +1,8 @@ -pub mod error; -pub mod types; +pub mod bolt11; +pub mod bolt12; +pub mod builder; +pub mod graph; pub mod node; +pub mod on_chain; +pub mod spontaneous; +pub mod types; diff --git a/rust/src/api/node.rs b/rust/src/api/node.rs index fa291de..e320984 100644 --- a/rust/src/api/node.rs +++ b/rust/src/api/node.rs @@ -1,103 +1,32 @@ -use crate::api::error::{BuilderException, NodeException}; +use crate::api::bolt11::LdkBolt11Payment; +use crate::api::bolt12::LdkBolt12Payment; +use crate::api::graph::LdkNetworkGraph; +use crate::api::on_chain::LdkOnChainPayment; +use crate::api::spontaneous::LdkSpontaneousPayment; use crate::api::types::*; use crate::frb_generated::RustOpaque; +use crate::utils::error::LdkNodeError; pub use ldk_node::io::sqlite_store::SqliteStore; -use ldk_node::lightning::util::ser::Writeable; pub use ldk_node::Node; -use std::str::FromStr; pub use std::sync::{Arc, Mutex}; -#[derive(Debug, Clone)] -pub struct LdkMnemonic { - pub seed_phrase: String, -} - -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 LdkMnemonic { - fn from(value: ldk_node::bip39::Mnemonic) -> Self { - LdkMnemonic { - seed_phrase: value.to_string(), - } - } -} -impl LdkMnemonic { - pub fn generate() -> LdkMnemonic { - ldk_node::generate_entropy_mnemonic().into() - } -} - -pub fn build_with_sqlite_store( - config: Config, - chain_data_source_config: Option, - entropy_source_config: Option, - gossip_source_config: Option, -) -> anyhow::Result { - let builder = create_builder( - config, - chain_data_source_config, - entropy_source_config, - gossip_source_config, - ); - match builder?.build() { - Ok(e) => Ok(LdkNode { - ptr: RustOpaque::new(e), - }), - Err(e) => Err(e.into()), - } -} - -fn create_builder( - config: Config, - chain_data_source_config: Option, - entropy_source_config: Option, - gossip_source_config: Option, -) -> 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), - EntropySourceConfig::SeedBytes(e) => builder.set_entropy_seed_bytes(e.encode())?, - EntropySourceConfig::Bip39Mnemonic { - mnemonic, - passphrase, - } => builder.set_entropy_bip39_mnemonic(mnemonic.try_into()?, passphrase), - }; - } - if let Some(source) = chain_data_source_config { - match source { - ChainDataSourceConfig::Esplora(e) => builder.set_esplora_server(e), - }; - } - if let Some(source) = gossip_source_config { - match source { - GossipSourceConfig::P2PNetwork => builder.set_gossip_source_p2p(), - GossipSourceConfig::RapidGossipSync(e) => builder.set_gossip_source_rgs(e), - }; - } - Ok(builder) -} - pub struct LdkNode { - pub ptr: RustOpaque>, + pub ptr: RustOpaque, } impl LdkNode { - pub fn start(&self) -> anyhow::Result<(), NodeException> { + pub fn start(&self) -> anyhow::Result<(), LdkNodeError> { self.ptr.start().map_err(|e| e.into()) } - pub fn stop(&self) -> anyhow::Result<(), NodeException> { + pub fn stop(&self) -> anyhow::Result<(), LdkNodeError> { self.ptr.stop().map_err(|e| e.into()) } - pub fn is_running(&self) -> bool { - self.ptr.is_running() + pub fn status(&self) -> NodeStatus { + self.ptr.status().into() + } + pub fn config(&self) -> Config { + self.ptr.config().into() } - pub fn event_handled(&self) { self.ptr.event_handled() } @@ -112,7 +41,9 @@ impl LdkNode { pub fn wait_next_event(&self) -> Event { self.ptr.wait_next_event().into() } - + pub async fn next_event_async(&self) -> Event { + self.ptr.next_event_async().await.into() + } pub fn node_id(&self) -> PublicKey { self.ptr.node_id().into() } @@ -126,44 +57,8 @@ impl LdkNode { }) } - pub fn new_onchain_address(&self) -> anyhow::Result { - self.ptr - .new_onchain_address() - .map_err(|e| e.into()) - .map(|e| e.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 { - self.ptr - .send_to_onchain_address(&(address.try_into()?), amount_sats) - .map_err(|e| e.into()) - .map(|e| Txid { - hash: e.to_string(), - }) - } - - pub fn send_all_to_onchain_address( - &self, - address: Address, - ) -> anyhow::Result { - self.ptr - .send_all_to_onchain_address(&(address.try_into()?)) - .map_err(|e| e.into()) - .map(|e| e.into()) + pub fn list_balances(&self) -> anyhow::Result { + Ok(self.ptr.list_balances().into()) } pub fn list_channels(&self) -> Vec { @@ -175,19 +70,19 @@ impl LdkNode { node_id: PublicKey, address: SocketAddress, persist: bool, - ) -> anyhow::Result<(), NodeException> { + ) -> anyhow::Result<(), LdkNodeError> { self.ptr .connect( node_id.try_into()?, address .try_into() - .map_err(|_| NodeException::InvalidAddress)?, + .map_err(|_| LdkNodeError::InvalidAddress)?, persist, ) .map_err(|e| e.into()) } - pub fn disconnect(&self, counterparty_node_id: PublicKey) -> anyhow::Result<(), NodeException> { + pub fn disconnect(&self, counterparty_node_id: PublicKey) -> anyhow::Result<(), LdkNodeError> { self.ptr .disconnect(counterparty_node_id.try_into()?) .map_err(|e| e.into()) @@ -201,144 +96,77 @@ impl LdkNode { push_to_counterparty_msat: Option, announce_channel: bool, channel_config: Option, - ) -> anyhow::Result<(), NodeException> { + ) -> Result { self.ptr .connect_open_channel( node_id.try_into()?, socket_address .try_into() - .map_err(|_| NodeException::InvalidAddress)?, + .map_err(|_| LdkNodeError::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<(), NodeException> { + pub fn sync_wallets(&self) -> anyhow::Result<(), LdkNodeError> { self.ptr.sync_wallets().map_err(|e| e.into()) } pub fn close_channel( &self, - channel_id: ChannelId, + user_channel_id: UserChannelId, counterparty_node_id: PublicKey, - ) -> anyhow::Result<(), NodeException> { + ) -> anyhow::Result<(), LdkNodeError> { self.ptr - .close_channel(&(channel_id.into()), counterparty_node_id.try_into()?) + .close_channel( + &(user_channel_id.try_into()?), + counterparty_node_id.try_into()?, + ) .map_err(|e| e.into()) } - pub fn update_channel_config( + pub fn force_close_channel( &self, - channel_id: ChannelId, + user_channel_id: UserChannelId, counterparty_node_id: PublicKey, - channel_config: ChannelConfig, - ) -> anyhow::Result<(), NodeException> { + ) -> anyhow::Result<(), LdkNodeError> { self.ptr - .update_channel_config( - &channel_id.into(), + .force_close_channel( + &(user_channel_id.try_into()?), counterparty_node_id.try_into()?, - Arc::new(channel_config.into()), ) .map_err(|e| e.into()) } - pub fn send_payment( - &self, - invoice: Bolt11Invoice, - ) -> anyhow::Result { - self.ptr - .send_payment(&(invoice.try_into()?)) - .map_err(|e| e.into()) - .map(|e| e.into()) - } - - pub fn send_payment_using_amount( - &self, - invoice: Bolt11Invoice, - amount_msat: u64, - ) -> anyhow::Result { - self.ptr - .send_payment_using_amount(&(invoice.try_into()?), amount_msat) - .map_err(|e| e.into()) - .map(|e| e.into()) - } - - pub fn send_spontaneous_payment( - &self, - amount_msat: u64, - node_id: PublicKey, - ) -> anyhow::Result { - self.ptr - .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<(), NodeException> { - self.ptr - .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<(), NodeException> { - self.ptr - .send_spontaneous_payment_probes(amount_msat, node_id.try_into()?) - .map_err(|e| e.into()) - } - - pub fn send_payment_probes_using_amount( - &self, - invoice: Bolt11Invoice, - amount_msat: u64, - ) -> Result<(), NodeException> { - self.ptr - .send_payment_probes_using_amount(&(invoice.try_into()?), amount_msat) - .map_err(|e| e.into()) - } - - pub fn receive_payment( - &self, - amount_msat: u64, - description: String, - expiry_secs: u32, - ) -> anyhow::Result { - self.ptr - .receive_payment(amount_msat, description.as_str(), expiry_secs) - .map_err(|e| e.into()) - .map(|e| e.into()) - } - - pub fn receive_variable_amount_payment( + pub fn update_channel_config( &self, - description: String, - expiry_secs: u32, - ) -> anyhow::Result { + user_channel_id: UserChannelId, + counterparty_node_id: PublicKey, + channel_config: ChannelConfig, + ) -> anyhow::Result<(), LdkNodeError> { self.ptr - .receive_variable_amount_payment(description.as_str(), expiry_secs) + .update_channel_config( + &(user_channel_id.try_into()?), + counterparty_node_id.try_into()?, + Arc::new(channel_config.into()), + ) .map_err(|e| e.into()) - .map(|e| Bolt11Invoice { - signed_raw_invoice: e.to_string(), - }) } - pub fn payment(&self, payment_hash: PaymentHash) -> Option { - match self.ptr.payment(&(payment_hash.into())) { + pub fn payment(&self, payment_id: PaymentId) -> Option { + match self.ptr.payment(&(payment_id.into())) { None => None, Some(e) => Some(e.into()), } } - pub fn remove_payment(&self, payment_hash: PaymentHash) -> Result<(), NodeException> { + pub fn remove_payment(&self, payment_id: PaymentId) -> Result<(), LdkNodeError> { self.ptr - .remove_payment(&(payment_hash.into())) + .remove_payment(&(payment_id.into())) .map_err(|e| e.into()) } @@ -369,18 +197,35 @@ impl LdkNode { .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()) } + pub fn network_graph(ptr: Self) -> LdkNetworkGraph { + ptr.ptr.network_graph().into() + } + pub fn bolt11_payment(ptr: Self) -> LdkBolt11Payment { + ptr.ptr.bolt11_payment().into() + } + pub fn on_chain_payment(ptr: Self) -> LdkOnChainPayment { + ptr.ptr.onchain_payment().into() + } + pub fn spontaneous_payment(ptr: Self) -> LdkSpontaneousPayment { + ptr.ptr.spontaneous_payment().into() + } + pub fn bolt12_payment(ptr: Self) -> LdkBolt12Payment { + LdkBolt12Payment { + ptr: RustOpaque::new(ptr.ptr.bolt12_payment()), + } + } pub fn verify_signature( &self, msg: Vec, sig: String, - pkey: PublicKey, - ) -> anyhow::Result { + public_key: PublicKey, + ) -> anyhow::Result { Ok(self .ptr - .verify_signature(msg.as_slice(), sig.as_str(), &pkey.try_into()?)) + .verify_signature(msg.as_slice(), sig.as_str(), &public_key.try_into()?)) } } diff --git a/rust/src/api/on_chain.rs b/rust/src/api/on_chain.rs new file mode 100644 index 0000000..14e5fea --- /dev/null +++ b/rust/src/api/on_chain.rs @@ -0,0 +1,39 @@ +use crate::api::types::{Address, Txid}; +use crate::frb_generated::RustOpaque; +use crate::utils::error::LdkNodeError; + +pub struct LdkOnChainPayment { + pub ptr: RustOpaque, +} +impl From for LdkOnChainPayment { + fn from(value: ldk_node::payment::OnchainPayment) -> Self { + LdkOnChainPayment { + ptr: RustOpaque::new(value), + } + } +} + +impl LdkOnChainPayment { + pub fn new_address(&self) -> Result { + self.ptr + .new_address() + .map_err(|e| e.into()) + .map(|e| e.into()) + } + pub fn send_to_address( + &self, + address: Address, + amount_sats: u64, + ) -> Result { + self.ptr + .send_to_address(&(address.try_into()?), amount_sats) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + pub fn send_all_to_address(&self, address: Address) -> Result { + self.ptr + .send_all_to_address(&(address.try_into()?)) + .map_err(|e| e.into()) + .map(|e| e.into()) + } +} diff --git a/rust/src/api/spontaneous.rs b/rust/src/api/spontaneous.rs new file mode 100644 index 0000000..c46f61b --- /dev/null +++ b/rust/src/api/spontaneous.rs @@ -0,0 +1,28 @@ +use crate::api::types::{PaymentId, PublicKey}; +use crate::frb_generated::RustOpaque; +use crate::utils::error::LdkNodeError; + +pub struct LdkSpontaneousPayment { + pub ptr: RustOpaque, +} +impl From for LdkSpontaneousPayment { + fn from(value: ldk_node::payment::SpontaneousPayment) -> Self { + Self { + ptr: RustOpaque::new(value), + } + } +} +impl LdkSpontaneousPayment { + pub fn send(&self, amount_msat: u64, node_id: PublicKey) -> Result { + self.ptr + .send(amount_msat, node_id.try_into()?) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + pub fn send_probes(&self, amount_msat: u64, node_id: PublicKey) -> Result<(), LdkNodeError> { + self.ptr + .send_probes(amount_msat, node_id.try_into()?) + .map_err(|e| e.into()) + .map(|e| e.into()) + } +} diff --git a/rust/src/api/types.rs b/rust/src/api/types.rs index 35504d3..a9fbf8e 100644 --- a/rust/src/api/types.rs +++ b/rust/src/api/types.rs @@ -1,10 +1,12 @@ -use crate::api::error::{BuilderException, NodeException}; -use crate::api::node::LdkMnemonic; -use flutter_rust_bridge::frb; +use crate::api::builder::LdkMnemonic; +use crate::utils::error::{LdkBuilderError, LdkNodeError}; +use flutter_rust_bridge::*; +use ldk_node::lightning::util::ser::{Readable, Writeable}; +use std::default::Default; use std::str::FromStr; use std::string::ToString; -///An address which can be used to connect to a remote peer. +///The addresses on which the node will listen for incoming connections. #[derive(Debug, Clone, PartialEq, Eq)] pub enum SocketAddress { TcpIpV4 { @@ -27,17 +29,6 @@ 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 { @@ -68,9 +59,8 @@ impl From for SocketAddress { } } } - impl TryFrom for ldk_node::lightning::ln::msgs::SocketAddress { - type Error = BuilderException; + type Error = LdkBuilderError; fn try_from(value: SocketAddress) -> Result { match value { @@ -97,13 +87,14 @@ impl TryFrom for ldk_node::lightning::ln::msgs::SocketAddress { SocketAddress::Hostname { addr, port } => { Ok(ldk_node::lightning::ln::msgs::SocketAddress::Hostname { hostname: ldk_node::lightning::util::ser::Hostname::try_from(addr) - .map_err(|_| BuilderException::SocketAddressParseError)?, + .map_err(|_| LdkBuilderError::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. @@ -123,7 +114,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: MaxDustHTLCExposure, + pub max_dust_htlc_exposure: Option, ///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. @@ -135,10 +126,25 @@ 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. + // 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. 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. // @@ -155,29 +161,27 @@ 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::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(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::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 } } @@ -208,87 +212,334 @@ impl From for ldk_node::lightning::ln::ChannelId { /// #[derive(Debug, Clone, PartialEq, Eq)] pub struct UserChannelId { - pub data: u64, + pub data: Vec, } /// 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.0 as u64, + data: value.encode(), } } } -#[derive(Debug, Clone, PartialEq, Eq)] -/// An event emitted by [Node], which should be handled by the user. +impl TryFrom for ldk_node::UserChannelId { + type Error = LdkNodeError; + + fn try_from(value: UserChannelId) -> Result { + let mut encoded = value.data.as_slice(); + ldk_node::UserChannelId::read(&mut encoded).map_err(|e| e.into()) + } +} +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::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 + } + ldk_node::lightning::events::ClosureReason::LegacyCooperativeClosure => { + ClosureReason::LegacyCooperativeClosure + } + ldk_node::lightning::events::ClosureReason::CounterpartyInitiatedCooperativeClosure => { + ClosureReason::CounterpartyInitiatedCooperativeClosure + } + ldk_node::lightning::events::ClosureReason::LocallyInitiatedCooperativeClosure => { + ClosureReason::LocallyInitiatedCooperativeClosure + } + ldk_node::lightning::events::ClosureReason::HTLCsTimedOut => { + ClosureReason::HTLCsTimedOut + } + } + } +} +/// 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 + } + } + } +} +#[derive(Clone, Debug, PartialEq, Eq)] +/// The reason the channel was closed. See individual variants for more details. +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. + /// + /// [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel. + 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. + /// + /// This was only set in versions of LDK prior to 0.0.122. + // Can be removed once we disallow downgrading to 0.0.121 + LegacyCooperativeClosure, + /// The channel was closed after negotiating a cooperative close and we've now broadcasted + /// the cooperative close transaction. This indicates that the shutdown was initiated by our + /// counterparty. + /// + /// In rare cases where we initiated closure immediately prior to shutting down without + /// persisting, this value may be provided for channels we initiated closure for. + CounterpartyInitiatedCooperativeClosure, + /// The channel was closed after negotiating a cooperative close and we've now broadcasted + /// the cooperative close transaction. This indicates that the shutdown was initiated by us. + LocallyInitiatedCooperativeClosure, + /// 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. + /// + /// [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor + DisconnectedPeer, + /// Closure generated from `ChannelManager::read` if the [`ChannelMonitor`] is newer than + /// the [`ChannelManager`] deserialized. + /// + /// [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor + /// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager + 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, + /// One of our HTLCs timed out in a channel, causing us to force close the channel. + HTLCsTimedOut, +} +///A user-provided identifier in channelManager.sendPayment used to uniquely identify a payment and ensure idempotency in LDK. +#[derive(Eq, PartialEq, Debug, Clone)] +pub struct PaymentId(pub [u8; 32]); + +impl From for PaymentId { + fn from(value: ldk_node::lightning::ln::channelmanager::PaymentId) -> Self { + PaymentId(value.0) + } +} +impl From for ldk_node::lightning::ln::channelmanager::PaymentId { + fn from(value: PaymentId) -> Self { + ldk_node::lightning::ln::channelmanager::PaymentId(value.0) + } +} +/// An event emitted by [`Node`], which should be handled by the user. /// + +#[derive(Debug, Clone, PartialEq, Eq)] pub enum Event { + /// A payment for a previously-registered payment hash has been received. + /// + /// This needs to be manually claimed by supplying the correct preimage to `claimForHash`. + /// + /// If the the provided parameters don't match the expectations or the preimage can't be + /// retrieved in time, should be failed-back via [`failForHash`]. + PaymentClaimable { + /// A local identifier used to track the payment. + payment_id: PaymentId, + /// The hash of the payment. + payment_hash: PaymentHash, + /// The value, in thousandths of a satoshi, that is claimable. + claimable_amount_msat: u64, + /// The block height at which this payment will be failed back and will no longer be + /// eligible for claiming. + claim_deadline: Option, + }, /// A sent payment was successful. PaymentSuccessful { + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + payment_id: Option, /// 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 { + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + payment_id: Option, /// 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 { + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + payment_id: Option, /// The hash of the payment. payment_hash: PaymentHash, /// 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 `channelId` of the channel. + channel_id: ChannelId, + /// The `userChannelId` of the channel. + user_channel_id: UserChannelId, + /// The `temporaryChannelId` this channel used to be known by during channel establishment. + former_temporary_channel_id: ChannelId, + /// The `nodeId` 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 `channelId` of the channel. channel_id: ChannelId, - /// The user_channel_id of the channel. + /// The `userChannelId` of the channel. user_channel_id: UserChannelId, - + /// The `nodeId` 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 `channelId` of the channel. channel_id: ChannelId, - /// The user_channel_id of the channel. + /// The `userChannelId` of the channel. user_channel_id: UserChannelId, + /// The `nodeId` 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 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, + /// This will be `None` for events serialized by LDK Node v0.2.1 and prior. + reason: Option, }, } impl From for Event { fn from(value: ldk_node::Event) -> Self { match value { - ldk_node::Event::PaymentSuccessful { payment_hash } => Event::PaymentSuccessful { + ldk_node::Event::PaymentSuccessful { + payment_id, + payment_hash, + fee_paid_msat, + } => Event::PaymentSuccessful { + payment_id: payment_id.map(|e| e.into()), payment_hash: PaymentHash { data: payment_hash.0, }, + fee_paid_msat, }, - ldk_node::Event::PaymentFailed { payment_hash } => Event::PaymentFailed { + ldk_node::Event::PaymentFailed { + payment_id, + payment_hash, + reason, + } => Event::PaymentFailed { + payment_id: payment_id.map(|e| e.into()), payment_hash: PaymentHash { data: payment_hash.0, }, + reason: reason.map(|e| e.into()), }, ldk_node::Event::PaymentReceived { + payment_id, payment_hash, amount_msat, } => Event::PaymentReceived { + payment_id: payment_id.map(|e| e.into()), payment_hash: PaymentHash { data: payment_hash.0, }, @@ -307,10 +558,12 @@ 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, @@ -327,6 +580,17 @@ impl From for Event { }, funding_txo: funding_txo.into(), }, + ldk_node::Event::PaymentClaimable { + payment_id, + payment_hash, + claimable_amount_msat, + claim_deadline, + } => Event::PaymentClaimable { + payment_id: payment_id.into(), + payment_hash: payment_hash.into(), + claimable_amount_msat: claimable_amount_msat, + claim_deadline: claim_deadline, + }, } } } @@ -339,11 +603,11 @@ pub struct Txid { } impl TryFrom for ldk_node::bitcoin::Txid { - type Error = NodeException; + type Error = LdkNodeError; fn try_from(value: Txid) -> Result { ldk_node::bitcoin::Txid::from_str(value.hash.as_str()) - .map_err(|_| NodeException::InvalidTxid) + .map_err(|_| LdkNodeError::InvalidTxid) } } @@ -385,12 +649,12 @@ pub enum PaymentStatus { Failed, } -impl From for PaymentStatus { - fn from(value: ldk_node::PaymentStatus) -> Self { +impl From for PaymentStatus { + fn from(value: ldk_node::payment::PaymentStatus) -> Self { match value { - ldk_node::PaymentStatus::Pending => PaymentStatus::Pending, - ldk_node::PaymentStatus::Succeeded => PaymentStatus::Succeeded, - ldk_node::PaymentStatus::Failed => PaymentStatus::Failed, + ldk_node::payment::PaymentStatus::Pending => PaymentStatus::Pending, + ldk_node::payment::PaymentStatus::Succeeded => PaymentStatus::Succeeded, + ldk_node::payment::PaymentStatus::Failed => PaymentStatus::Failed, } } } @@ -405,20 +669,20 @@ pub enum PaymentDirection { Outbound, } -impl From for PaymentDirection { - fn from(value: ldk_node::PaymentDirection) -> Self { +impl From for PaymentDirection { + fn from(value: ldk_node::payment::PaymentDirection) -> Self { match value { - ldk_node::PaymentDirection::Inbound => PaymentDirection::Inbound, - ldk_node::PaymentDirection::Outbound => PaymentDirection::Outbound, + ldk_node::payment::PaymentDirection::Inbound => PaymentDirection::Inbound, + ldk_node::payment::PaymentDirection::Outbound => PaymentDirection::Outbound, } } } -impl From for ldk_node::PaymentDirection { +impl From for ldk_node::payment::PaymentDirection { fn from(value: PaymentDirection) -> Self { match value { - PaymentDirection::Inbound => ldk_node::PaymentDirection::Inbound, - PaymentDirection::Outbound => ldk_node::PaymentDirection::Outbound, + PaymentDirection::Inbound => ldk_node::payment::PaymentDirection::Inbound, + PaymentDirection::Outbound => ldk_node::payment::PaymentDirection::Outbound, } } } @@ -449,6 +713,17 @@ pub struct PaymentPreimage { pub data: [u8; 32], } +impl From for PaymentPreimage { + fn from(value: ldk_node::lightning::ln::PaymentPreimage) -> Self { + Self { data: value.0 } + } +} + +impl From for ldk_node::lightning::ln::PaymentPreimage { + fn from(value: PaymentPreimage) -> Self { + ldk_node::lightning::ln::PaymentPreimage(value.data) + } +} /// payment_secret type, use to authenticate sender to the receiver and tie MPP HTLCs together /// #[derive(Hash, Copy, Clone, PartialEq, Eq, Debug)] @@ -456,19 +731,18 @@ pub struct PaymentSecret { pub data: [u8; 32], } -// Structs wrapping the particular information which should easily be -// understandable, parseable, and transformable, i.e., we'll try to avoid -// exposing too many technical detail here. +impl From for PaymentSecret { + fn from(value: ldk_node::lightning_invoice::PaymentSecret) -> Self { + PaymentSecret { data: value.0 } + } +} /// Represents a payment. -/// #[derive(Clone, Debug, PartialEq, Eq)] pub struct PaymentDetails { - /// The payment hash, i.e., the hash of the `preimage`. - pub hash: PaymentHash, - /// The pre-image used by the payment. - pub preimage: Option, - /// The secret used by the payment. - pub secret: Option, + /// The identifier of this payment. + pub id: PaymentId, + /// The kind of the payment. + pub kind: PaymentKind, /// The amount transferred. pub amount_msat: Option, /// The direction of the payment. @@ -477,41 +751,171 @@ pub struct PaymentDetails { pub status: PaymentStatus, } -impl From for PaymentDetails { - fn from(value: ldk_node::PaymentDetails) -> Self { +impl From for PaymentDetails { + fn from(value: ldk_node::payment::PaymentDetails) -> Self { PaymentDetails { - hash: PaymentHash { data: value.hash.0 }, - preimage: value.preimage.map(|x| PaymentPreimage { data: x.0 }), - secret: value.secret.map(|x| PaymentSecret { data: x.0 }), + id: value.id.into(), status: value.status.into(), amount_msat: value.amount_msat, direction: value.direction.into(), + kind: value.kind.into(), } } } - -#[derive(Debug, Clone, PartialEq, Eq)] -///Represents a syntactically and semantically correct lightning BOLT11 invoice. -/// -pub struct Bolt11Invoice { - pub signed_raw_invoice: String, +/// Limits applying to how much fee we allow an LSP to deduct from the payment amount. +#[derive(Copy, Clone, Debug, PartialEq, Eq)] +pub struct LSPFeeLimits { + /// The maximal total amount we allow any configured LSP withhold from us when forwarding the + /// payment. + pub max_total_opening_fee_msat: Option, + /// The maximal proportional fee, in parts-per-million millisatoshi, we allow any configured + /// LSP withhold from us when forwarding the payment. + pub max_proportional_opening_fee_ppm_msat: Option, +} +impl From for LSPFeeLimits { + fn from(value: ldk_node::payment::LSPFeeLimits) -> Self { + LSPFeeLimits { + max_total_opening_fee_msat: value.max_total_opening_fee_msat, + max_proportional_opening_fee_ppm_msat: value.max_proportional_opening_fee_ppm_msat, + } + } } -impl TryFrom for ldk_node::lightning_invoice::Bolt11Invoice { - type Error = NodeException; +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub struct OfferId(pub [u8; 32]); - fn try_from(value: Bolt11Invoice) -> Result { - ldk_node::lightning_invoice::Bolt11Invoice::from_str(value.signed_raw_invoice.as_str()) - .map_err(|_| NodeException::InvalidInvoice) +impl From for OfferId { + fn from(value: ldk_node::lightning::offers::offer::OfferId) -> Self { + Self(value.0) + } +} +impl From for ldk_node::lightning::offers::offer::OfferId { + fn from(value: OfferId) -> Self { + Self(value.0) } } -impl From for Bolt11Invoice { - fn from(value: ldk_node::lightning_invoice::Bolt11Invoice) -> Self { - Bolt11Invoice { - signed_raw_invoice: value.to_string(), +/// Represents the kind of a payment. +#[derive(Clone, Debug, PartialEq, Eq)] +pub enum PaymentKind { + /// An on-chain payment. + Onchain, + /// A [BOLT 11] payment. + /// + /// [BOLT 11]: https://github.com/lightning/bolts/blob/master/11-payment-encoding.md + // TODO: Bolt11 { invoice: Option }, + Bolt11 { + /// The payment hash, i.e., the hash of the `preimage`. + hash: PaymentHash, + /// The pre-image used by the payment. + preimage: Option, + /// The secret used by the payment. + secret: Option, + }, + /// A [BOLT 11] payment intended to open an [LSPS 2] just-in-time channel. + /// + /// [BOLT 11]: https://github.com/lightning/bolts/blob/master/11-payment-encoding.md + /// [LSPS 2]: https://github.com/BitcoinAndLightningLayerSpecs/lsp/blob/main/LSPS2/README.md + Bolt11Jit { + /// The payment hash, i.e., the hash of the `preimage`. + hash: PaymentHash, + /// The pre-image used by the payment. + preimage: Option, + /// The secret used by the payment. + secret: Option, + /// Limits applying to how much fee we allow an LSP to deduct from the payment amount. + /// + /// Allowing them to deduct this fee from the first inbound payment will pay for the LSP's + /// channel opening fees. + /// + lsp_fee_limits: LSPFeeLimits, + }, + /// A spontaneous ("keysend") payment. + Spontaneous { + /// The payment hash, i.e., the hash of the `preimage`. + hash: PaymentHash, + /// The pre-image used by the payment. + preimage: Option, + }, + + /// A [BOLT 12] offer payment, i.e., a payment for an `Offer`. + /// + /// [BOLT 12]: https://github.com/lightning/bolts/blob/master/12-offer-encoding.md + Bolt12Offer { + /// The payment hash, i.e., the hash of the `preimage`. + hash: Option, + /// The pre-image used by the payment. + preimage: Option, + /// The secret used by the payment. + secret: Option, + /// The ID of the offer this payment is for. + offer_id: OfferId, + }, + /// A [BOLT 12] 'refund' payment, i.e., a payment for a `Refund`. + /// + /// [BOLT 12]: https://github.com/lightning/bolts/blob/master/12-offer-encoding.md + Bolt12Refund { + /// The payment hash, i.e., the hash of the `preimage`. + hash: Option, + /// The pre-image used by the payment. + preimage: Option, + /// The secret used by the payment. + secret: Option, + }, +} +impl From for PaymentKind { + fn from(value: ldk_node::payment::PaymentKind) -> Self { + match value { + ldk_node::payment::PaymentKind::Onchain => PaymentKind::Onchain, + ldk_node::payment::PaymentKind::Bolt11 { + hash, + preimage, + secret, + } => PaymentKind::Bolt11 { + hash: hash.into(), + preimage: preimage.map(|e| e.into()), + secret: secret.map(|e| e.into()), + }, + ldk_node::payment::PaymentKind::Bolt11Jit { + hash, + preimage, + secret, + lsp_fee_limits, + } => PaymentKind::Bolt11Jit { + hash: hash.into(), + preimage: preimage.map(|e| e.into()), + secret: secret.map(|e| e.into()), + lsp_fee_limits: lsp_fee_limits.into(), + }, + ldk_node::payment::PaymentKind::Spontaneous { hash, preimage } => { + PaymentKind::Spontaneous { + hash: hash.into(), + preimage: preimage.map(|e| e.into()), + } + } + ldk_node::payment::PaymentKind::Bolt12Offer { + hash, + preimage, + secret, + offer_id, + } => PaymentKind::Bolt12Offer { + hash: hash.map(|e| e.into()), + preimage: preimage.map(|e| e.into()), + secret: secret.map(|e| e.into()), + offer_id: offer_id.into(), + }, + ldk_node::payment::PaymentKind::Bolt12Refund { + hash, + preimage, + secret, + } => PaymentKind::Bolt12Refund { + hash: hash.map(|e| e.into()), + preimage: preimage.map(|e| e.into()), + secret: secret.map(|e| e.into()), + }, } } } + ///A Secp256k1 public key, used for verification of signatures. /// #[derive(Debug, Clone, PartialEq, Eq)] @@ -520,11 +924,11 @@ pub struct PublicKey { } impl TryFrom for ldk_node::bitcoin::secp256k1::PublicKey { - type Error = NodeException; + type Error = LdkNodeError; fn try_from(value: PublicKey) -> Result { ldk_node::bitcoin::secp256k1::PublicKey::from_str(value.hex.as_str()) - .map_err(|_| NodeException::InvalidPublicKey) + .map_err(|_| LdkNodeError::InvalidPublicKey) } } impl From for PublicKey { @@ -541,12 +945,12 @@ pub struct Address { } impl TryFrom
for ldk_node::bitcoin::Address { - type Error = NodeException; + type Error = LdkNodeError; fn try_from(value: Address) -> Result { ldk_node::bitcoin::Address::from_str(value.s.as_str()) .map(|e| e.assume_checked()) - .map_err(|_| NodeException::InvalidAddress) + .map_err(|_| LdkNodeError::InvalidAddress) } } impl From for Address { @@ -557,116 +961,130 @@ impl From for Address { } } -/// Details of a channel, as returned by node.listChannels() -/// -#[derive(Clone, Debug, PartialEq, Eq)] +#[derive(Debug, Clone)] pub struct ChannelDetails { - /// 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). + /// 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). + /// /// 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 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 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. /// - /// This value is not included in `outbound_capacity_msat` as it can never be spent. + /// This value is not included in `outboundCapacityMsat` as it can never be spent. /// - /// This value will be null for outbound channels until the counterparty accepts the channel. + /// This value will be `None` for outbound channels until the counterparty accepts the channel. /// pub unspendable_punishment_reserve: Option, - /// 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. - /// + /// The local `user_channel_id` of this channel. 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, - /// 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 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 + /// The amount does not include any pending HTLCs which are not yet 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 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 available outbound capacity for sending HTLCs to the remote peer. /// + /// 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 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 number of required confirmations on the funding transactions before the funding is + /// considered "locked". The amount is selected by the channel fundee. /// + /// 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, - - /// True if the channel was initiated (and thus funded) by us. - /// + /// Returns `true` if the channel was initiated (and therefore funded) by us. 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 - /// + /// 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, - /// 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 is a strict superset of `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. /// + /// This is a strict superset of `is_channel_ready`. pub is_usable: bool, - /// True if this channel is (or will be) publicly-announced. - /// + /// 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. + /// + /// This value is not included in [`inbound_capacity_msat`] as it can never be spent. + /// + /// [`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 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. + /// + /// 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, } 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.txid.to_string()), + funding_txo: value.clone().funding_txo.map(|x| x.into()), 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, @@ -675,6 +1093,29 @@ 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(), } } } @@ -697,13 +1138,24 @@ pub enum Network { Regtest, } -impl From for ldk_node::Network { +impl From for ldk_node::bitcoin::Network { fn from(value: Network) -> Self { match value { - Network::Bitcoin => ldk_node::Network::Bitcoin, - Network::Testnet => ldk_node::Network::Testnet, - Network::Signet => ldk_node::Network::Signet, - Network::Regtest => ldk_node::Network::Regtest, + 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, } } } @@ -770,9 +1222,192 @@ 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, + } + } +} + +/// Configuration options pertaining to 'Anchor' channels, i.e., channels for which the +/// `optionAnchorsZeroFeeHtlcTx` channel type is negotiated. +/// +/// Prior to the introduction of Anchor channels, the on-chain fees paying for the transactions +/// issued on channel closure were pre-determined and locked-in at the time of the channel +/// opening. This required to estimate what fee rate would be sufficient to still have the +/// closing transactions be spendable on-chain (i.e., not be considered dust). This legacy +/// design of pre-anchor channels proved inadequate in the unpredictable, often turbulent, fee +/// markets we experience today. +/// +/// In contrast, Anchor channels allow to determine an adequate fee rate *at the time of channel +/// closure*, making them much more robust in the face of fee spikes. In turn, they require to +/// maintain a reserve of on-chain funds to have the channel closure transactions confirmed +/// on-chain, at least if the channel counterparty can't be trusted to do this for us. +/// +/// See [BOLT 3] for more technical details on Anchor channels. +/// +/// +/// ### Defaults +/// +/// | Parameter | Value | +/// |----------------------------|--------| +/// | `trustedPeersNoReserve` | [] | +/// | `perChannelReserveSats` | 25000 | +/// +/// +/// [BOLT 3]: https://github.com/lightning/bolts/blob/master/03-transactions.md#htlc-timeout-and-htlc-success-transactions +#[derive(Debug, Clone)] +pub struct AnchorChannelsConfig { + /// A list of peers that we trust to get the required channel closing transactions confirmed + /// on-chain. + /// + /// Channels with these peers won't count towards the retained on-chain reserve and we won't + /// take any action to get the required transactions confirmed ourselves. + /// + /// **Note:** Trusting the channel counterparty to take the necessary actions to get the + /// required Anchor spending and HTLC transactions confirmed on-chain is potentially insecure + /// as the channel may not be closed if they refuse to do so, potentially leaving the user + /// funds stuck *or* even allow the counterparty to steal any in-flight funds after the + /// corresponding HTLCs time out. + pub trusted_peers_no_reserve: Vec, + /// The amount of satoshis per anchors-negotiated channel with an untrusted peer that we keep + /// as an emergency reserve in our on-chain wallet. + /// + /// This allows for having the required Anchor output spending and HTLC transactions confirmed + /// when the channel is closed. + /// + /// If the channel peer is not marked as trusted via trustedPeersNoReserve, + /// we will always try to spend the Anchor + /// outputs with *any* on-chain funds available, i.e., the total reserve value as well as any + /// spendable funds available in the on-chain wallet. Therefore, this per-channel multiplier is + /// really an emergency reserve that we maintain at all time to reduce reduce the risk of + /// insufficient funds at time of a channel closure. To this end, we will refuse to open + /// outbound or accept inbound channels if we don't have sufficient on-chain funds available to + /// cover the additional reserve requirement. + /// + /// **Note:** Depending on the fee market at the time of closure, this reserve amount might or + /// might not suffice to successfully spend the Anchor output and have the HTLC transactions + /// confirmed on-chain, i.e., you may want to adjust this value accordingly. + pub per_channel_reserve_sats: u64, +} + +impl TryFrom for ldk_node::AnchorChannelsConfig { + type Error = LdkBuilderError; + + fn try_from(value: AnchorChannelsConfig) -> Result { + let trusted_peers_no_reserve: Result< + Vec, + LdkBuilderError, + > = value + .trusted_peers_no_reserve + .into_iter() + .map(|x| x.try_into().map_err(|_| LdkBuilderError::InvalidPublicKey)) + .collect(); + Ok(Self { + trusted_peers_no_reserve: trusted_peers_no_reserve?, + per_channel_reserve_sats: value.per_channel_reserve_sats, + }) + } +} + +impl From for AnchorChannelsConfig { + fn from(value: ldk_node::AnchorChannelsConfig) -> Self { + Self { + trusted_peers_no_reserve: value + .trusted_peers_no_reserve + .into_iter() + .map(|e| e.into()) + .collect(), + per_channel_reserve_sats: value.per_channel_reserve_sats, + } + } +} + +impl TryFrom for ldk_node::Config { + type Error = LdkBuilderError; + + fn try_from(value: Config) -> Result { + let addresses = if let Some(addresses) = value.listening_addresses { + let addr_vec: Result< + Vec, + LdkBuilderError, + > = addresses + .into_iter() + .map(|socket_addr| socket_addr.try_into()) + .collect(); + Some(addr_vec?) + } else { + None + }; + let anchor_channels_config = + if let Some(anchor_channels_config) = value.anchor_channels_config { + let anchr_channels_config: Result = + anchor_channels_config.try_into(); + Some(anchr_channels_config?) + } else { + None + }; + let trusted_peers_0conf: Result< + Vec, + LdkBuilderError, + > = value + .trusted_peers_0conf + .into_iter() + .map(|x| x.try_into().map_err(|_| LdkBuilderError::InvalidPublicKey)) + .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, + anchor_channels_config, + }) + } +} +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, + anchor_channels_config: value.anchor_channels_config.map(|e| e.into()), + } + } +} /// Represents the configuration of an [Node] instance. /// -#[frb] +#[frb(serialize)] #[derive(Debug, Clone)] pub struct Config { #[frb(non_final)] @@ -819,50 +1454,18 @@ pub struct Config { /// #[frb(non_final)] pub log_level: LogLevel, + #[frb(non_final)] + pub anchor_channels_config: Option, } -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 AnchorChannelsConfig { + fn default() -> Self { + AnchorChannelsConfig { + trusted_peers_no_reserve: vec![], + per_channel_reserve_sats: 25000, + } } } + impl Default for Config { fn default() -> Self { Self { @@ -877,6 +1480,7 @@ impl Default for Config { trusted_peers_0conf: vec![], probing_liquidity_limit_multiplier: 3, log_level: DEFAULT_LOG_LEVEL, + anchor_channels_config: Some(Default::default()), } } } @@ -902,6 +1506,384 @@ 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.listBalances`. +/// +#[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::lightning::chain::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 22a3cb7..bdef0c3 100644 --- a/rust/src/frb_generated.io.rs +++ b/rust/src/frb_generated.io.rs @@ -1,12 +1,15 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. +// Generated by `flutter_rust_bridge`@ 2.0.0. // Section: imports use super::*; +use crate::api::bolt12::*; +use crate::api::builder::*; use crate::api::node::*; +use crate::*; use flutter_rust_bridge::for_generated::byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt}; -use flutter_rust_bridge::for_generated::transform_result_dco; +use flutter_rust_bridge::for_generated::{transform_result_dco, Lifetimeable, Lockable}; use flutter_rust_bridge::{Handler, IntoIntoDart}; // Section: boilerplate @@ -15,9 +18,65 @@ flutter_rust_bridge::frb_generated_boilerplate_io!(); // Section: dart2rust -impl CstDecode>> for usize { +impl CstDecode for usize { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> RustOpaqueNom> { + fn cst_decode(self) -> NodeBuilder { + flutter_rust_bridge::for_generated::rust_auto_opaque_decode_owned(CstDecode::< + RustOpaqueNom>, + >::cst_decode( + self + )) + } +} +impl CstDecode>> for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> RustOpaqueNom> { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode> for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> RustOpaqueNom { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode>> + for usize +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode( + self, + ) -> RustOpaqueNom> { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode> for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> RustOpaqueNom { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode> for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> RustOpaqueNom { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode> for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> RustOpaqueNom { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode> for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> RustOpaqueNom { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode> for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> RustOpaqueNom { unsafe { decode_rust_opaque_nom(self as _) } } } @@ -36,14 +95,80 @@ impl CstDecode for wire_cst_address { } } } -impl CstDecode for wire_cst_bolt_11_invoice { +impl CstDecode for wire_cst_anchor_channels_config { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::Bolt11Invoice { - crate::api::types::Bolt11Invoice { + fn cst_decode(self) -> crate::api::types::AnchorChannelsConfig { + crate::api::types::AnchorChannelsConfig { + trusted_peers_no_reserve: self.trusted_peers_no_reserve.cst_decode(), + per_channel_reserve_sats: self.per_channel_reserve_sats.cst_decode(), + } + } +} +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::bolt11::Bolt11Invoice { + crate::api::bolt11::Bolt11Invoice { signed_raw_invoice: self.signed_raw_invoice.cst_decode(), } } } +impl CstDecode for wire_cst_bolt_12_invoice { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::bolt12::Bolt12Invoice { + crate::api::bolt12::Bolt12Invoice { + data: self.data.cst_decode(), + } + } +} +impl CstDecode for wire_cst_bolt_12_parse_error { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::utils::error::Bolt12ParseError { + match self.tag { + 0 => crate::utils::error::Bolt12ParseError::InvalidContinuation, + 1 => crate::utils::error::Bolt12ParseError::InvalidBech32Hrp, + 2 => { + let ans = unsafe { self.kind.Bech32 }; + crate::utils::error::Bolt12ParseError::Bech32(ans.field0.cst_decode()) + } + 3 => { + let ans = unsafe { self.kind.Decode }; + crate::utils::error::Bolt12ParseError::Decode(ans.field0.cst_decode()) + } + 4 => { + let ans = unsafe { self.kind.InvalidSemantics }; + crate::utils::error::Bolt12ParseError::InvalidSemantics(ans.field0.cst_decode()) + } + 5 => { + let ans = unsafe { self.kind.InvalidSignature }; + crate::utils::error::Bolt12ParseError::InvalidSignature(ans.field0.cst_decode()) + } + _ => unreachable!(), + } + } +} impl CstDecode for *mut wire_cst_address { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::Address { @@ -51,11 +176,25 @@ impl CstDecode for *mut wire_cst_address { CstDecode::::cst_decode(*wrap).into() } } -impl CstDecode for *mut wire_cst_bolt_11_invoice { +impl CstDecode for *mut wire_cst_anchor_channels_config { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::Bolt11Invoice { + fn cst_decode(self) -> crate::api::types::AnchorChannelsConfig { 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_bolt_11_invoice { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::bolt11::Bolt11Invoice { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} +impl CstDecode for *mut wire_cst_bolt_12_parse_error { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::utils::error::Bolt12ParseError { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() } } impl CstDecode @@ -81,6 +220,27 @@ impl CstDecode for *mut wire_cst_channel_id { CstDecode::::cst_decode(*wrap).into() } } +impl CstDecode for *mut wire_cst_channel_info { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::ChannelInfo { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} +impl CstDecode for *mut wire_cst_channel_update_info { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::ChannelUpdateInfo { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + 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 { @@ -88,6 +248,13 @@ impl CstDecode for *mut wire_cst_config { CstDecode::::cst_decode(*wrap).into() } } +impl CstDecode for *mut wire_cst_decode_error { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::utils::error::DecodeError { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} impl CstDecode for *mut wire_cst_entropy_source_config { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::EntropySourceConfig { @@ -109,11 +276,32 @@ impl CstDecode for *mut wire_cst_gossip_s CstDecode::::cst_decode(*wrap).into() } } -impl CstDecode for *mut wire_cst_ldk_mnemonic { +impl CstDecode for *mut wire_cst_ldk_bolt_11_payment { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::bolt11::LdkBolt11Payment { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} +impl CstDecode for *mut wire_cst_ldk_bolt_12_payment { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::bolt12::LdkBolt12Payment { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} +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::LdkMnemonic { + fn cst_decode(self) -> crate::api::builder::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_ldk_network_graph { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::LdkNetworkGraph { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() } } impl CstDecode for *mut wire_cst_ldk_node { @@ -123,6 +311,78 @@ impl CstDecode for *mut wire_cst_ldk_node { CstDecode::::cst_decode(*wrap).into() } } +impl CstDecode for *mut wire_cst_ldk_on_chain_payment { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::on_chain::LdkOnChainPayment { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} +impl CstDecode + for *mut wire_cst_ldk_spontaneous_payment +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::spontaneous::LdkSpontaneousPayment { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + 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_lsp_fee_limits { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::LSPFeeLimits { + 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_node_announcement_info { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::NodeAnnouncementInfo { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} +impl CstDecode for *mut wire_cst_node_id { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::NodeId { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} +impl CstDecode for *mut wire_cst_node_info { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::NodeInfo { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} +impl CstDecode for *mut wire_cst_offer { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::bolt12::Offer { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} +impl CstDecode for *mut wire_cst_offer_id { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::OfferId { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} impl CstDecode for *mut wire_cst_out_point { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::OutPoint { @@ -137,6 +397,13 @@ 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 { @@ -144,6 +411,13 @@ impl CstDecode for *mut wire_cst_payment_hash { CstDecode::::cst_decode(*wrap).into() } } +impl CstDecode for *mut wire_cst_payment_id { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::PaymentId { + 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_preimage { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::PaymentPreimage { @@ -165,6 +439,13 @@ impl CstDecode for *mut wire_cst_public_key { CstDecode::::cst_decode(*wrap).into() } } +impl CstDecode for *mut wire_cst_refund { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::bolt12::Refund { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} impl CstDecode for *mut wire_cst_socket_address { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::SocketAddress { @@ -172,6 +453,19 @@ 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 { @@ -231,7 +525,6 @@ 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(), @@ -240,6 +533,31 @@ 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(), } } } @@ -251,6 +569,62 @@ impl CstDecode for wire_cst_channel_id { } } } +impl CstDecode for wire_cst_channel_info { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::ChannelInfo { + crate::api::graph::ChannelInfo { + node_one: self.node_one.cst_decode(), + one_to_two: self.one_to_two.cst_decode(), + node_two: self.node_two.cst_decode(), + two_to_one: self.two_to_one.cst_decode(), + capacity_sats: self.capacity_sats.cst_decode(), + } + } +} +impl CstDecode for wire_cst_channel_update_info { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::ChannelUpdateInfo { + crate::api::graph::ChannelUpdateInfo { + last_update: self.last_update.cst_decode(), + enabled: self.enabled.cst_decode(), + cltv_expiry_delta: self.cltv_expiry_delta.cst_decode(), + htlc_minimum_msat: self.htlc_minimum_msat.cst_decode(), + htlc_maximum_msat: self.htlc_maximum_msat.cst_decode(), + fees: self.fees.cst_decode(), + } + } +} +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::LegacyCooperativeClosure, + 3 => crate::api::types::ClosureReason::CounterpartyInitiatedCooperativeClosure, + 4 => crate::api::types::ClosureReason::LocallyInitiatedCooperativeClosure, + 5 => crate::api::types::ClosureReason::CommitmentTxConfirmed, + 6 => crate::api::types::ClosureReason::FundingTimedOut, + 7 => { + let ans = unsafe { self.kind.ProcessingError }; + crate::api::types::ClosureReason::ProcessingError { + err: ans.err.cst_decode(), + } + } + 8 => crate::api::types::ClosureReason::DisconnectedPeer, + 9 => crate::api::types::ClosureReason::OutdatedChannelManager, + 10 => crate::api::types::ClosureReason::CounterpartyCoopClosedUnfundedChannel, + 11 => crate::api::types::ClosureReason::FundingBatchClosure, + 12 => crate::api::types::ClosureReason::HTLCsTimedOut, + _ => 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 { @@ -270,6 +644,26 @@ impl CstDecode for wire_cst_config { .probing_liquidity_limit_multiplier .cst_decode(), log_level: self.log_level.cst_decode(), + anchor_channels_config: self.anchor_channels_config.cst_decode(), + } + } +} +impl CstDecode for wire_cst_decode_error { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::utils::error::DecodeError { + match self.tag { + 0 => crate::utils::error::DecodeError::UnknownVersion, + 1 => crate::utils::error::DecodeError::UnknownRequiredFeature, + 2 => crate::utils::error::DecodeError::InvalidValue, + 3 => crate::utils::error::DecodeError::ShortRead, + 4 => crate::utils::error::DecodeError::BadLengthDescriptor, + 5 => { + let ans = unsafe { self.kind.Io }; + crate::utils::error::DecodeError::Io(ans.field0.cst_decode()) + } + 6 => crate::utils::error::DecodeError::UnsupportedCompression, + 7 => crate::utils::error::DecodeError::DangerousValue, + _ => unreachable!(), } } } @@ -301,48 +695,63 @@ impl CstDecode for wire_cst_event { fn cst_decode(self) -> crate::api::types::Event { match self.tag { 0 => { + let ans = unsafe { self.kind.PaymentClaimable }; + crate::api::types::Event::PaymentClaimable { + payment_id: ans.payment_id.cst_decode(), + payment_hash: ans.payment_hash.cst_decode(), + claimable_amount_msat: ans.claimable_amount_msat.cst_decode(), + claim_deadline: ans.claim_deadline.cst_decode(), + } + } + 1 => { let ans = unsafe { self.kind.PaymentSuccessful }; crate::api::types::Event::PaymentSuccessful { + payment_id: ans.payment_id.cst_decode(), payment_hash: ans.payment_hash.cst_decode(), + fee_paid_msat: ans.fee_paid_msat.cst_decode(), } } - 1 => { + 2 => { let ans = unsafe { self.kind.PaymentFailed }; crate::api::types::Event::PaymentFailed { + payment_id: ans.payment_id.cst_decode(), payment_hash: ans.payment_hash.cst_decode(), + reason: ans.reason.cst_decode(), } } - 2 => { + 3 => { let ans = unsafe { self.kind.PaymentReceived }; crate::api::types::Event::PaymentReceived { + payment_id: ans.payment_id.cst_decode(), payment_hash: ans.payment_hash.cst_decode(), amount_msat: ans.amount_msat.cst_decode(), } } - 3 => { - let ans = unsafe { self.kind.ChannelReady }; - crate::api::types::Event::ChannelReady { + 4 => { + 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(), + funding_txo: ans.funding_txo.cst_decode(), } } - 4 => { - let ans = unsafe { self.kind.ChannelClosed }; - crate::api::types::Event::ChannelClosed { + 5 => { + 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(), counterparty_node_id: ans.counterparty_node_id.cst_decode(), } } - 5 => { - let ans = unsafe { self.kind.ChannelPending }; - crate::api::types::Event::ChannelPending { + 6 => { + 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(), - 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(), + reason: ans.reason.cst_decode(), } } _ => unreachable!(), @@ -362,14 +771,38 @@ impl CstDecode for wire_cst_gossip_source } } } -impl CstDecode for wire_cst_ldk_mnemonic { +impl CstDecode for wire_cst_ldk_bolt_11_payment { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::bolt11::LdkBolt11Payment { + crate::api::bolt11::LdkBolt11Payment { + ptr: self.ptr.cst_decode(), + } + } +} +impl CstDecode for wire_cst_ldk_bolt_12_payment { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::node::LdkMnemonic { - crate::api::node::LdkMnemonic { + fn cst_decode(self) -> crate::api::bolt12::LdkBolt12Payment { + crate::api::bolt12::LdkBolt12Payment { + ptr: self.ptr.cst_decode(), + } + } +} +impl CstDecode for wire_cst_ldk_mnemonic { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::builder::LdkMnemonic { + crate::api::builder::LdkMnemonic { seed_phrase: self.seed_phrase.cst_decode(), } } } +impl CstDecode for wire_cst_ldk_network_graph { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::LdkNetworkGraph { + crate::api::graph::LdkNetworkGraph { + ptr: self.ptr.cst_decode(), + } + } +} impl CstDecode for wire_cst_ldk_node { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::node::LdkNode { @@ -378,19 +811,192 @@ impl CstDecode for wire_cst_ldk_node { } } } -impl CstDecode> for *mut wire_cst_list_channel_details { +impl CstDecode for wire_cst_ldk_node_error { // 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() + fn cst_decode(self) -> crate::utils::error::LdkNodeError { + match self.tag { + 0 => crate::utils::error::LdkNodeError::InvalidTxid, + 1 => crate::utils::error::LdkNodeError::AlreadyRunning, + 2 => crate::utils::error::LdkNodeError::NotRunning, + 3 => crate::utils::error::LdkNodeError::OnchainTxCreationFailed, + 4 => crate::utils::error::LdkNodeError::ConnectionFailed, + 5 => crate::utils::error::LdkNodeError::InvoiceCreationFailed, + 6 => crate::utils::error::LdkNodeError::PaymentSendingFailed, + 7 => crate::utils::error::LdkNodeError::ProbeSendingFailed, + 8 => crate::utils::error::LdkNodeError::ChannelCreationFailed, + 9 => crate::utils::error::LdkNodeError::ChannelClosingFailed, + 10 => crate::utils::error::LdkNodeError::ChannelConfigUpdateFailed, + 11 => crate::utils::error::LdkNodeError::PersistenceFailed, + 12 => crate::utils::error::LdkNodeError::WalletOperationFailed, + 13 => crate::utils::error::LdkNodeError::OnchainTxSigningFailed, + 14 => crate::utils::error::LdkNodeError::MessageSigningFailed, + 15 => crate::utils::error::LdkNodeError::TxSyncFailed, + 16 => crate::utils::error::LdkNodeError::GossipUpdateFailed, + 17 => crate::utils::error::LdkNodeError::InvalidAddress, + 18 => crate::utils::error::LdkNodeError::InvalidSocketAddress, + 19 => crate::utils::error::LdkNodeError::InvalidPublicKey, + 20 => crate::utils::error::LdkNodeError::InvalidSecretKey, + 21 => crate::utils::error::LdkNodeError::InvalidPaymentHash, + 22 => crate::utils::error::LdkNodeError::InvalidPaymentPreimage, + 23 => crate::utils::error::LdkNodeError::InvalidPaymentSecret, + 24 => crate::utils::error::LdkNodeError::InvalidAmount, + 25 => crate::utils::error::LdkNodeError::InvalidInvoice, + 26 => crate::utils::error::LdkNodeError::InvalidChannelId, + 27 => crate::utils::error::LdkNodeError::InvalidNetwork, + 28 => crate::utils::error::LdkNodeError::DuplicatePayment, + 29 => crate::utils::error::LdkNodeError::InsufficientFunds, + 30 => crate::utils::error::LdkNodeError::FeerateEstimationUpdateFailed, + 31 => crate::utils::error::LdkNodeError::LiquidityRequestFailed, + 32 => crate::utils::error::LdkNodeError::LiquiditySourceUnavailable, + 33 => crate::utils::error::LdkNodeError::LiquidityFeeTooHigh, + 34 => crate::utils::error::LdkNodeError::InvalidPaymentId, + 35 => { + let ans = unsafe { self.kind.Decode }; + crate::utils::error::LdkNodeError::Decode(ans.field0.cst_decode()) + } + 36 => { + let ans = unsafe { self.kind.Bolt12Parse }; + crate::utils::error::LdkNodeError::Bolt12Parse(ans.field0.cst_decode()) + } + 37 => crate::utils::error::LdkNodeError::InvoiceRequestCreationFailed, + 38 => crate::utils::error::LdkNodeError::OfferCreationFailed, + 39 => crate::utils::error::LdkNodeError::RefundCreationFailed, + 40 => crate::utils::error::LdkNodeError::FeerateEstimationUpdateTimeout, + 41 => crate::utils::error::LdkNodeError::WalletOperationTimeout, + 42 => crate::utils::error::LdkNodeError::TxSyncTimeout, + 43 => crate::utils::error::LdkNodeError::GossipUpdateTimeout, + 44 => crate::utils::error::LdkNodeError::InvalidOfferId, + 45 => crate::utils::error::LdkNodeError::InvalidNodeId, + 46 => crate::utils::error::LdkNodeError::InvalidOffer, + 47 => crate::utils::error::LdkNodeError::InvalidRefund, + 48 => crate::utils::error::LdkNodeError::UnsupportedCurrency, + _ => unreachable!(), + } } } -impl CstDecode> for *mut wire_cst_list_payment_details { +impl CstDecode for wire_cst_ldk_on_chain_payment { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> Vec { + fn cst_decode(self) -> crate::api::on_chain::LdkOnChainPayment { + crate::api::on_chain::LdkOnChainPayment { + ptr: self.ptr.cst_decode(), + } + } +} +impl CstDecode + for wire_cst_ldk_spontaneous_payment +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::spontaneous::LdkSpontaneousPayment { + crate::api::spontaneous::LdkSpontaneousPayment { + ptr: self.ptr.cst_decode(), + } + } +} +impl CstDecode for wire_cst_lightning_balance { + // 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!(), + } + } +} +impl CstDecode for wire_cst_liquidity_source_config { + // 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(), + } + } +} +impl CstDecode> for *mut wire_cst_list_channel_details { + // 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_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_node_id { + // 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 { 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) @@ -408,6 +1014,27 @@ 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_64_strict { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> 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) + } + } +} 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 { @@ -446,6 +1073,17 @@ impl CstDecode> for *mut wire_cst_list_soc vec.into_iter().map(CstDecode::cst_decode).collect() } } +impl CstDecode for wire_cst_lsp_fee_limits { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::LSPFeeLimits { + crate::api::types::LSPFeeLimits { + max_total_opening_fee_msat: self.max_total_opening_fee_msat.cst_decode(), + max_proportional_opening_fee_ppm_msat: self + .max_proportional_opening_fee_ppm_msat + .cst_decode(), + } + } +} impl CstDecode for 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 { @@ -462,6 +1100,68 @@ impl CstDecode for wire_cst_max_dust_htl } } } +impl CstDecode for wire_cst_node_announcement_info { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::NodeAnnouncementInfo { + crate::api::graph::NodeAnnouncementInfo { + last_update: self.last_update.cst_decode(), + alias: self.alias.cst_decode(), + addresses: self.addresses.cst_decode(), + } + } +} +impl CstDecode for wire_cst_node_id { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::NodeId { + crate::api::graph::NodeId { + compressed: self.compressed.cst_decode(), + } + } +} +impl CstDecode for wire_cst_node_info { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::NodeInfo { + crate::api::graph::NodeInfo { + channels: self.channels.cst_decode(), + announcement_info: self.announcement_info.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_offer { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::bolt12::Offer { + crate::api::bolt12::Offer { + s: self.s.cst_decode(), + } + } +} +impl CstDecode for wire_cst_offer_id { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::OfferId { + crate::api::types::OfferId(self.field0.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 { @@ -475,9 +1175,8 @@ impl CstDecode for wire_cst_payment_details { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::PaymentDetails { crate::api::types::PaymentDetails { - hash: self.hash.cst_decode(), - preimage: self.preimage.cst_decode(), - secret: self.secret.cst_decode(), + id: self.id.cst_decode(), + kind: self.kind.cst_decode(), amount_msat: self.amount_msat.cst_decode(), direction: self.direction.cst_decode(), status: self.status.cst_decode(), @@ -492,6 +1191,62 @@ impl CstDecode for wire_cst_payment_hash { } } } +impl CstDecode for wire_cst_payment_id { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::PaymentId { + crate::api::types::PaymentId(self.field0.cst_decode()) + } +} +impl CstDecode for wire_cst_payment_kind { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::PaymentKind { + match self.tag { + 0 => crate::api::types::PaymentKind::Onchain, + 1 => { + let ans = unsafe { self.kind.Bolt11 }; + crate::api::types::PaymentKind::Bolt11 { + hash: ans.hash.cst_decode(), + preimage: ans.preimage.cst_decode(), + secret: ans.secret.cst_decode(), + } + } + 2 => { + let ans = unsafe { self.kind.Bolt11Jit }; + crate::api::types::PaymentKind::Bolt11Jit { + hash: ans.hash.cst_decode(), + preimage: ans.preimage.cst_decode(), + secret: ans.secret.cst_decode(), + lsp_fee_limits: ans.lsp_fee_limits.cst_decode(), + } + } + 3 => { + let ans = unsafe { self.kind.Spontaneous }; + crate::api::types::PaymentKind::Spontaneous { + hash: ans.hash.cst_decode(), + preimage: ans.preimage.cst_decode(), + } + } + 4 => { + let ans = unsafe { self.kind.Bolt12Offer }; + crate::api::types::PaymentKind::Bolt12Offer { + hash: ans.hash.cst_decode(), + preimage: ans.preimage.cst_decode(), + secret: ans.secret.cst_decode(), + offer_id: ans.offer_id.cst_decode(), + } + } + 5 => { + let ans = unsafe { self.kind.Bolt12Refund }; + crate::api::types::PaymentKind::Bolt12Refund { + hash: ans.hash.cst_decode(), + preimage: ans.preimage.cst_decode(), + secret: ans.secret.cst_decode(), + } + } + _ => unreachable!(), + } + } +} impl CstDecode for wire_cst_payment_preimage { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::PaymentPreimage { @@ -518,6 +1273,40 @@ 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 { @@ -526,6 +1315,45 @@ impl CstDecode for wire_cst_public_key { } } } +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_refund { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::bolt12::Refund { + crate::api::bolt12::Refund { + s: self.s.cst_decode(), + } + } +} +impl CstDecode for wire_cst_routing_fees { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::RoutingFees { + crate::api::graph::RoutingFees { + base_msat: self.base_msat.cst_decode(), + proportional_millionths: self.proportional_millionths.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 { @@ -631,6 +1459,48 @@ impl Default for wire_cst_address { Self::new_with_null_ptr() } } +impl NewWithNullPtr for wire_cst_anchor_channels_config { + fn new_with_null_ptr() -> Self { + Self { + trusted_peers_no_reserve: core::ptr::null_mut(), + per_channel_reserve_sats: Default::default(), + } + } +} +impl Default for wire_cst_anchor_channels_config { + fn default() -> Self { + 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 { @@ -643,6 +1513,31 @@ impl Default for wire_cst_bolt_11_invoice { Self::new_with_null_ptr() } } +impl NewWithNullPtr for wire_cst_bolt_12_invoice { + fn new_with_null_ptr() -> Self { + Self { + data: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_bolt_12_invoice { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_bolt_12_parse_error { + fn new_with_null_ptr() -> Self { + Self { + tag: -1, + kind: Bolt12ParseErrorKind { nil__: () }, + } + } +} +impl Default for wire_cst_bolt_12_parse_error { + fn default() -> Self { + Self::new_with_null_ptr() + } +} impl NewWithNullPtr for wire_cst_chain_data_source_config { fn new_with_null_ptr() -> Self { Self { @@ -662,7 +1557,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: Default::default(), + max_dust_htlc_exposure: core::ptr::null_mut(), force_close_avoidance_max_fee_satoshis: Default::default(), accept_underpaying_htlcs: Default::default(), } @@ -683,7 +1578,6 @@ 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(), @@ -692,6 +1586,19 @@ 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(), } } } @@ -712,55 +1619,115 @@ impl Default for wire_cst_channel_id { Self::new_with_null_ptr() } } -impl NewWithNullPtr for wire_cst_config { +impl NewWithNullPtr for wire_cst_channel_info { fn new_with_null_ptr() -> Self { Self { - storage_dir_path: core::ptr::null_mut(), - log_dir_path: core::ptr::null_mut(), - network: Default::default(), - listening_addresses: core::ptr::null_mut(), - default_cltv_expiry_delta: Default::default(), - onchain_wallet_sync_interval_secs: Default::default(), - wallet_sync_interval_secs: Default::default(), - fee_rate_cache_update_interval_secs: Default::default(), - trusted_peers_0conf: core::ptr::null_mut(), - probing_liquidity_limit_multiplier: Default::default(), - log_level: Default::default(), + node_one: Default::default(), + one_to_two: core::ptr::null_mut(), + node_two: Default::default(), + two_to_one: core::ptr::null_mut(), + capacity_sats: core::ptr::null_mut(), } } } -impl Default for wire_cst_config { +impl Default for wire_cst_channel_info { fn default() -> Self { Self::new_with_null_ptr() } } -impl NewWithNullPtr for wire_cst_entropy_source_config { +impl NewWithNullPtr for wire_cst_channel_update_info { fn new_with_null_ptr() -> Self { Self { - tag: -1, - kind: EntropySourceConfigKind { nil__: () }, + last_update: Default::default(), + enabled: Default::default(), + cltv_expiry_delta: Default::default(), + htlc_minimum_msat: Default::default(), + htlc_maximum_msat: Default::default(), + fees: Default::default(), } } } -impl Default for wire_cst_entropy_source_config { +impl Default for wire_cst_channel_update_info { fn default() -> Self { Self::new_with_null_ptr() } } -impl NewWithNullPtr for wire_cst_event { +impl NewWithNullPtr for wire_cst_closure_reason { fn new_with_null_ptr() -> Self { Self { tag: -1, - kind: EventKind { nil__: () }, + kind: ClosureReasonKind { nil__: () }, } } } -impl Default for wire_cst_event { +impl Default for wire_cst_closure_reason { fn default() -> Self { Self::new_with_null_ptr() } } -impl NewWithNullPtr for wire_cst_gossip_source_config { +impl NewWithNullPtr for wire_cst_config { + fn new_with_null_ptr() -> Self { + Self { + storage_dir_path: core::ptr::null_mut(), + log_dir_path: core::ptr::null_mut(), + network: Default::default(), + listening_addresses: core::ptr::null_mut(), + default_cltv_expiry_delta: Default::default(), + onchain_wallet_sync_interval_secs: Default::default(), + wallet_sync_interval_secs: Default::default(), + fee_rate_cache_update_interval_secs: Default::default(), + trusted_peers_0conf: core::ptr::null_mut(), + probing_liquidity_limit_multiplier: Default::default(), + log_level: Default::default(), + anchor_channels_config: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_config { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_decode_error { + fn new_with_null_ptr() -> Self { + Self { + tag: -1, + kind: DecodeErrorKind { nil__: () }, + } + } +} +impl Default for wire_cst_decode_error { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_entropy_source_config { + fn new_with_null_ptr() -> Self { + Self { + tag: -1, + kind: EntropySourceConfigKind { nil__: () }, + } + } +} +impl Default for wire_cst_entropy_source_config { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_event { + fn new_with_null_ptr() -> Self { + Self { + tag: -1, + kind: EventKind { nil__: () }, + } + } +} +impl Default for wire_cst_event { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_gossip_source_config { fn new_with_null_ptr() -> Self { Self { tag: -1, @@ -773,6 +1740,30 @@ impl Default for wire_cst_gossip_source_config { Self::new_with_null_ptr() } } +impl NewWithNullPtr for wire_cst_ldk_bolt_11_payment { + fn new_with_null_ptr() -> Self { + Self { + ptr: Default::default(), + } + } +} +impl Default for wire_cst_ldk_bolt_11_payment { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_ldk_bolt_12_payment { + fn new_with_null_ptr() -> Self { + Self { + ptr: Default::default(), + } + } +} +impl Default for wire_cst_ldk_bolt_12_payment { + fn default() -> Self { + Self::new_with_null_ptr() + } +} impl NewWithNullPtr for wire_cst_ldk_mnemonic { fn new_with_null_ptr() -> Self { Self { @@ -785,6 +1776,18 @@ impl Default for wire_cst_ldk_mnemonic { Self::new_with_null_ptr() } } +impl NewWithNullPtr for wire_cst_ldk_network_graph { + fn new_with_null_ptr() -> Self { + Self { + ptr: Default::default(), + } + } +} +impl Default for wire_cst_ldk_network_graph { + fn default() -> Self { + Self::new_with_null_ptr() + } +} impl NewWithNullPtr for wire_cst_ldk_node { fn new_with_null_ptr() -> Self { Self { @@ -797,6 +1800,81 @@ impl Default for wire_cst_ldk_node { Self::new_with_null_ptr() } } +impl NewWithNullPtr for wire_cst_ldk_node_error { + fn new_with_null_ptr() -> Self { + Self { + tag: -1, + kind: LdkNodeErrorKind { nil__: () }, + } + } +} +impl Default for wire_cst_ldk_node_error { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_ldk_on_chain_payment { + fn new_with_null_ptr() -> Self { + Self { + ptr: Default::default(), + } + } +} +impl Default for wire_cst_ldk_on_chain_payment { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_ldk_spontaneous_payment { + fn new_with_null_ptr() -> Self { + Self { + ptr: Default::default(), + } + } +} +impl Default for wire_cst_ldk_spontaneous_payment { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_lightning_balance { + fn new_with_null_ptr() -> Self { + Self { + tag: -1, + kind: LightningBalanceKind { nil__: () }, + } + } +} +impl Default for wire_cst_lightning_balance { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_liquidity_source_config { + fn new_with_null_ptr() -> Self { + Self { + lsps2_service: Default::default(), + } + } +} +impl Default for wire_cst_liquidity_source_config { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_lsp_fee_limits { + fn new_with_null_ptr() -> Self { + Self { + max_total_opening_fee_msat: core::ptr::null_mut(), + max_proportional_opening_fee_ppm_msat: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_lsp_fee_limits { + fn default() -> Self { + Self::new_with_null_ptr() + } +} impl NewWithNullPtr for wire_cst_max_dust_htlc_exposure { fn new_with_null_ptr() -> Self { Self { @@ -810,6 +1888,88 @@ impl Default for wire_cst_max_dust_htlc_exposure { Self::new_with_null_ptr() } } +impl NewWithNullPtr for wire_cst_node_announcement_info { + fn new_with_null_ptr() -> Self { + Self { + last_update: Default::default(), + alias: core::ptr::null_mut(), + addresses: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_node_announcement_info { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_node_id { + fn new_with_null_ptr() -> Self { + Self { + compressed: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_node_id { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_node_info { + fn new_with_null_ptr() -> Self { + Self { + channels: core::ptr::null_mut(), + announcement_info: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_node_info { + 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_offer { + fn new_with_null_ptr() -> Self { + Self { + s: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_offer { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_offer_id { + fn new_with_null_ptr() -> Self { + Self { + field0: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_offer_id { + fn default() -> Self { + Self::new_with_null_ptr() + } +} impl NewWithNullPtr for wire_cst_out_point { fn new_with_null_ptr() -> Self { Self { @@ -826,9 +1986,8 @@ impl Default for wire_cst_out_point { impl NewWithNullPtr for wire_cst_payment_details { fn new_with_null_ptr() -> Self { Self { - hash: Default::default(), - preimage: core::ptr::null_mut(), - secret: core::ptr::null_mut(), + id: Default::default(), + kind: Default::default(), amount_msat: core::ptr::null_mut(), direction: Default::default(), status: Default::default(), @@ -852,6 +2011,31 @@ impl Default for wire_cst_payment_hash { Self::new_with_null_ptr() } } +impl NewWithNullPtr for wire_cst_payment_id { + fn new_with_null_ptr() -> Self { + Self { + field0: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_payment_id { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_payment_kind { + fn new_with_null_ptr() -> Self { + Self { + tag: -1, + kind: PaymentKindKind { nil__: () }, + } + } +} +impl Default for wire_cst_payment_kind { + fn default() -> Self { + Self::new_with_null_ptr() + } +} impl NewWithNullPtr for wire_cst_payment_preimage { fn new_with_null_ptr() -> Self { Self { @@ -871,120 +2055,525 @@ impl NewWithNullPtr for wire_cst_payment_secret { } } } -impl Default for wire_cst_payment_secret { - fn default() -> Self { - Self::new_with_null_ptr() - } +impl Default for wire_cst_payment_secret { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_peer_details { + fn new_with_null_ptr() -> Self { + Self { + node_id: Default::default(), + address: Default::default(), + is_connected: Default::default(), + } + } +} +impl Default for wire_cst_peer_details { + fn default() -> Self { + 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: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_public_key { + fn default() -> Self { + 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_refund { + fn new_with_null_ptr() -> Self { + Self { + s: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_refund { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_routing_fees { + fn new_with_null_ptr() -> Self { + Self { + base_msat: Default::default(), + proportional_millionths: Default::default(), + } + } +} +impl Default for wire_cst_routing_fees { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_socket_address { + fn new_with_null_ptr() -> Self { + Self { + tag: -1, + kind: SocketAddressKind { nil__: () }, + } + } +} +impl Default for wire_cst_socket_address { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_txid { + fn new_with_null_ptr() -> Self { + Self { + hash: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_txid { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_user_channel_id { + fn new_with_null_ptr() -> Self { + Self { + data: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_user_channel_id { + fn default() -> Self { + Self::new_with_null_ptr() + } +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hash( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + payment_hash: *mut wire_cst_payment_hash, + claimable_amount_msat: u64, + preimage: *mut wire_cst_payment_preimage, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hash_impl( + port_, + that, + payment_hash, + claimable_amount_msat, + preimage, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hash( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + payment_hash: *mut wire_cst_payment_hash, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hash_impl(port_, that, payment_hash) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + amount_msat: u64, + description: *mut wire_cst_list_prim_u_8_strict, + expiry_secs: u32, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_impl( + port_, + that, + amount_msat, + description, + expiry_secs, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hash( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + payment_hash: *mut wire_cst_payment_hash, + amount_msat: u64, + description: *mut wire_cst_list_prim_u_8_strict, + expiry_secs: u32, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hash_impl( + port_, + that, + payment_hash, + amount_msat, + description, + expiry_secs, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + description: *mut wire_cst_list_prim_u_8_strict, + expiry_secs: u32, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_impl( + port_, + that, + description, + expiry_secs, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hash( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + description: *mut wire_cst_list_prim_u_8_strict, + expiry_secs: u32, + payment_hash: *mut wire_cst_payment_hash, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hash_impl( + port_, + that, + description, + expiry_secs, + payment_hash, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + description: *mut wire_cst_list_prim_u_8_strict, + expiry_secs: u32, + max_proportional_lsp_fee_limit_ppm_msat: *mut u64, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel_impl( + port_, + that, + description, + expiry_secs, + max_proportional_lsp_fee_limit_ppm_msat, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + amount_msat: u64, + description: *mut wire_cst_list_prim_u_8_strict, + expiry_secs: u32, + max_total_lsp_fee_limit_msat: *mut u64, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_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__crate__api__bolt11__ldk_bolt_11_payment_send( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + invoice: *mut wire_cst_bolt_11_invoice, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_send_impl(port_, that, invoice) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + invoice: *mut wire_cst_bolt_11_invoice, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_impl(port_, that, invoice) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + invoice: *mut wire_cst_bolt_11_invoice, + amount_msat: u64, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount_impl( + port_, + that, + invoice, + amount_msat, + ) } -impl NewWithNullPtr for wire_cst_peer_details { - fn new_with_null_ptr() -> Self { - Self { - node_id: Default::default(), - address: Default::default(), - is_connected: Default::default(), - } - } + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + invoice: *mut wire_cst_bolt_11_invoice, + amount_msat: u64, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount_impl( + port_, + that, + invoice, + amount_msat, + ) } -impl Default for wire_cst_peer_details { - fn default() -> Self { - Self::new_with_null_ptr() - } + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refund( + port_: i64, + that: *mut wire_cst_ldk_bolt_12_payment, + amount_msat: u64, + expiry_secs: u32, +) { + wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refund_impl( + port_, + that, + amount_msat, + expiry_secs, + ) } -impl NewWithNullPtr for wire_cst_public_key { - fn new_with_null_ptr() -> Self { - Self { - hex: core::ptr::null_mut(), - } - } + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_receive( + port_: i64, + that: *mut wire_cst_ldk_bolt_12_payment, + amount_msat: u64, + description: *mut wire_cst_list_prim_u_8_strict, +) { + wire__crate__api__bolt12__ldk_bolt_12_payment_receive_impl( + port_, + that, + amount_msat, + description, + ) } -impl Default for wire_cst_public_key { - fn default() -> Self { - Self::new_with_null_ptr() - } + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amount( + port_: i64, + that: *mut wire_cst_ldk_bolt_12_payment, + description: *mut wire_cst_list_prim_u_8_strict, +) { + wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amount_impl( + port_, + that, + description, + ) } -impl NewWithNullPtr for wire_cst_socket_address { - fn new_with_null_ptr() -> Self { - Self { - tag: -1, - kind: SocketAddressKind { nil__: () }, - } - } + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_payment( + port_: i64, + that: *mut wire_cst_ldk_bolt_12_payment, + refund: *mut wire_cst_refund, +) { + wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_payment_impl(port_, that, refund) } -impl Default for wire_cst_socket_address { - fn default() -> Self { - Self::new_with_null_ptr() - } + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_send( + port_: i64, + that: *mut wire_cst_ldk_bolt_12_payment, + offer: *mut wire_cst_offer, + payer_note: *mut wire_cst_list_prim_u_8_strict, +) { + wire__crate__api__bolt12__ldk_bolt_12_payment_send_impl(port_, that, offer, payer_note) } -impl NewWithNullPtr for wire_cst_txid { - fn new_with_null_ptr() -> Self { - Self { - hash: core::ptr::null_mut(), - } - } + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amount( + port_: i64, + that: *mut wire_cst_ldk_bolt_12_payment, + offer: *mut wire_cst_offer, + payer_note: *mut wire_cst_list_prim_u_8_strict, + amount_msat: u64, +) { + wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amount_impl( + port_, + that, + offer, + payer_note, + amount_msat, + ) } -impl Default for wire_cst_txid { - fn default() -> Self { - Self::new_with_null_ptr() - } + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder( + that: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder_impl(that) } -impl NewWithNullPtr for wire_cst_user_channel_id { - fn new_with_null_ptr() -> Self { - Self { - data: Default::default(), - } - } + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder( + that: usize, + builder: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder_impl(that, builder) } -impl Default for wire_cst_user_channel_id { - fn default() -> Self { - Self::new_with_null_ptr() - } + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_build( + port_: i64, + that: usize, +) { + wire__crate__api__builder__NodeBuilder_build_impl(port_, that) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_build_with_fs_store( + port_: i64, + that: usize, +) { + wire__crate__api__builder__NodeBuilder_build_with_fs_store_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_build_with_sqlite_store( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_create_builder( 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, ) { - wire_build_with_sqlite_store_impl( + wire__crate__api__builder__NodeBuilder_create_builder_impl( port_, config, chain_data_source_config, entropy_source_config, gossip_source_config, + liquidity_source_config, ) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_mnemonic_generate(port_: i64) { - wire_ldk_mnemonic_generate_impl(port_) +pub extern "C" fn frbgen_ldk_node_wire__crate__api__builder__ldk_mnemonic_generate(port_: i64) { + wire__crate__api__builder__ldk_mnemonic_generate_impl(port_) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_channel( + port_: i64, + that: *mut wire_cst_ldk_network_graph, + short_channel_id: u64, +) { + wire__crate__api__graph__ldk_network_graph_channel_impl(port_, that, short_channel_id) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_list_channels( + port_: i64, + that: *mut wire_cst_ldk_network_graph, +) { + wire__crate__api__graph__ldk_network_graph_list_channels_impl(port_, that) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_list_nodes( + port_: i64, + that: *mut wire_cst_ldk_network_graph, +) { + wire__crate__api__graph__ldk_network_graph_list_nodes_impl(port_, that) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_node( + port_: i64, + that: *mut wire_cst_ldk_network_graph, + node_id: *mut wire_cst_node_id, +) { + wire__crate__api__graph__ldk_network_graph_node_impl(port_, that, node_id) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_bolt11_payment( + port_: i64, + ptr: *mut wire_cst_ldk_node, +) { + wire__crate__api__node__ldk_node_bolt11_payment_impl(port_, ptr) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_bolt12_payment( + port_: i64, + ptr: *mut wire_cst_ldk_node, +) { + wire__crate__api__node__ldk_node_bolt12_payment_impl(port_, ptr) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_close_channel( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_close_channel( port_: i64, that: *mut wire_cst_ldk_node, - channel_id: *mut wire_cst_channel_id, + user_channel_id: *mut wire_cst_user_channel_id, counterparty_node_id: *mut wire_cst_public_key, ) { - wire_ldk_node_close_channel_impl(port_, that, channel_id, counterparty_node_id) + wire__crate__api__node__ldk_node_close_channel_impl( + port_, + that, + user_channel_id, + counterparty_node_id, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_config( + port_: i64, + that: *mut wire_cst_ldk_node, +) { + wire__crate__api__node__ldk_node_config_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_connect( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_connect( port_: i64, that: *mut wire_cst_ldk_node, node_id: *mut wire_cst_public_key, address: *mut wire_cst_socket_address, persist: bool, ) { - wire_ldk_node_connect_impl(port_, that, node_id, address, persist) + wire__crate__api__node__ldk_node_connect_impl(port_, that, node_id, address, persist) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_connect_open_channel( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_connect_open_channel( port_: i64, that: *mut wire_cst_ldk_node, socket_address: *mut wire_cst_socket_address, @@ -994,7 +2583,7 @@ pub extern "C" fn frbgen_ldk_node_wire_ldk_node_connect_open_channel( announce_channel: bool, channel_config: *mut wire_cst_channel_config, ) { - wire_ldk_node_connect_open_channel_impl( + wire__crate__api__node__ldk_node_connect_open_channel_impl( port_, that, socket_address, @@ -1007,318 +2596,432 @@ pub extern "C" fn frbgen_ldk_node_wire_ldk_node_connect_open_channel( } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_disconnect( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_disconnect( port_: i64, that: *mut wire_cst_ldk_node, counterparty_node_id: *mut wire_cst_public_key, ) { - wire_ldk_node_disconnect_impl(port_, that, counterparty_node_id) + wire__crate__api__node__ldk_node_disconnect_impl(port_, that, counterparty_node_id) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_event_handled( + port_: i64, + that: *mut wire_cst_ldk_node, +) { + wire__crate__api__node__ldk_node_event_handled_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_event_handled( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_force_close_channel( port_: i64, that: *mut wire_cst_ldk_node, + user_channel_id: *mut wire_cst_user_channel_id, + counterparty_node_id: *mut wire_cst_public_key, ) { - wire_ldk_node_event_handled_impl(port_, that) + wire__crate__api__node__ldk_node_force_close_channel_impl( + port_, + that, + user_channel_id, + counterparty_node_id, + ) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_is_running( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_list_balances( port_: i64, that: *mut wire_cst_ldk_node, ) { - wire_ldk_node_is_running_impl(port_, that) + wire__crate__api__node__ldk_node_list_balances_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_list_channels( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_list_channels( port_: i64, that: *mut wire_cst_ldk_node, ) { - wire_ldk_node_list_channels_impl(port_, that) + wire__crate__api__node__ldk_node_list_channels_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_list_payments( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_list_payments( port_: i64, that: *mut wire_cst_ldk_node, ) { - wire_ldk_node_list_payments_impl(port_, that) + wire__crate__api__node__ldk_node_list_payments_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_list_payments_with_filter( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_list_payments_with_filter( port_: i64, that: *mut wire_cst_ldk_node, payment_direction: i32, ) { - wire_ldk_node_list_payments_with_filter_impl(port_, that, payment_direction) + wire__crate__api__node__ldk_node_list_payments_with_filter_impl(port_, that, payment_direction) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_list_peers( + port_: i64, + that: *mut wire_cst_ldk_node, +) { + wire__crate__api__node__ldk_node_list_peers_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_list_peers( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_listening_addresses( port_: i64, that: *mut wire_cst_ldk_node, ) { - wire_ldk_node_list_peers_impl(port_, that) + wire__crate__api__node__ldk_node_listening_addresses_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_listening_addresses( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_network_graph( + port_: i64, + ptr: *mut wire_cst_ldk_node, +) { + wire__crate__api__node__ldk_node_network_graph_impl(port_, ptr) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_next_event( port_: i64, that: *mut wire_cst_ldk_node, ) { - wire_ldk_node_listening_addresses_impl(port_, that) + wire__crate__api__node__ldk_node_next_event_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_new_onchain_address( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_next_event_async( port_: i64, that: *mut wire_cst_ldk_node, ) { - wire_ldk_node_new_onchain_address_impl(port_, that) + wire__crate__api__node__ldk_node_next_event_async_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_next_event( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_node_id( port_: i64, that: *mut wire_cst_ldk_node, ) { - wire_ldk_node_next_event_impl(port_, that) + wire__crate__api__node__ldk_node_node_id_impl(port_, that) } #[no_mangle] -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) +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_on_chain_payment( + port_: i64, + ptr: *mut wire_cst_ldk_node, +) { + wire__crate__api__node__ldk_node_on_chain_payment_impl(port_, ptr) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_payment( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_payment( port_: i64, that: *mut wire_cst_ldk_node, - payment_hash: *mut wire_cst_payment_hash, + payment_id: *mut wire_cst_payment_id, ) { - wire_ldk_node_payment_impl(port_, that, payment_hash) + wire__crate__api__node__ldk_node_payment_impl(port_, that, payment_id) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_receive_payment( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_remove_payment( port_: i64, that: *mut wire_cst_ldk_node, - amount_msat: u64, - description: *mut wire_cst_list_prim_u_8_strict, - expiry_secs: u32, + payment_id: *mut wire_cst_payment_id, ) { - wire_ldk_node_receive_payment_impl(port_, that, amount_msat, description, expiry_secs) + wire__crate__api__node__ldk_node_remove_payment_impl(port_, that, payment_id) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_receive_variable_amount_payment( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_sign_message( port_: i64, that: *mut wire_cst_ldk_node, - description: *mut wire_cst_list_prim_u_8_strict, - expiry_secs: u32, + msg: *mut wire_cst_list_prim_u_8_loose, +) { + wire__crate__api__node__ldk_node_sign_message_impl(port_, that, msg) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_spontaneous_payment( + port_: i64, + ptr: *mut wire_cst_ldk_node, ) { - wire_ldk_node_receive_variable_amount_payment_impl(port_, that, description, expiry_secs) + wire__crate__api__node__ldk_node_spontaneous_payment_impl(port_, ptr) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_remove_payment( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_start( port_: i64, that: *mut wire_cst_ldk_node, - payment_hash: *mut wire_cst_payment_hash, ) { - wire_ldk_node_remove_payment_impl(port_, that, payment_hash) + wire__crate__api__node__ldk_node_start_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_send_all_to_onchain_address( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_status( port_: i64, that: *mut wire_cst_ldk_node, - address: *mut wire_cst_address, ) { - wire_ldk_node_send_all_to_onchain_address_impl(port_, that, address) + wire__crate__api__node__ldk_node_status_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_send_payment( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_stop( port_: i64, that: *mut wire_cst_ldk_node, - invoice: *mut wire_cst_bolt_11_invoice, ) { - wire_ldk_node_send_payment_impl(port_, that, invoice) + wire__crate__api__node__ldk_node_stop_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_send_payment_probes( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_sync_wallets( port_: i64, that: *mut wire_cst_ldk_node, - invoice: *mut wire_cst_bolt_11_invoice, ) { - wire_ldk_node_send_payment_probes_impl(port_, that, invoice) + wire__crate__api__node__ldk_node_sync_wallets_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_send_payment_probes_using_amount( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_update_channel_config( port_: i64, that: *mut wire_cst_ldk_node, - invoice: *mut wire_cst_bolt_11_invoice, - amount_msat: u64, + user_channel_id: *mut wire_cst_user_channel_id, + counterparty_node_id: *mut wire_cst_public_key, + channel_config: *mut wire_cst_channel_config, +) { + wire__crate__api__node__ldk_node_update_channel_config_impl( + port_, + that, + user_channel_id, + counterparty_node_id, + channel_config, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_verify_signature( + port_: i64, + that: *mut wire_cst_ldk_node, + msg: *mut wire_cst_list_prim_u_8_loose, + sig: *mut wire_cst_list_prim_u_8_strict, + public_key: *mut wire_cst_public_key, ) { - wire_ldk_node_send_payment_probes_using_amount_impl(port_, that, invoice, amount_msat) + wire__crate__api__node__ldk_node_verify_signature_impl(port_, that, msg, sig, public_key) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_send_payment_using_amount( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_wait_next_event( port_: i64, that: *mut wire_cst_ldk_node, - invoice: *mut wire_cst_bolt_11_invoice, - amount_msat: u64, ) { - wire_ldk_node_send_payment_using_amount_impl(port_, that, invoice, amount_msat) + wire__crate__api__node__ldk_node_wait_next_event_impl(port_, that) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_new_address( + port_: i64, + that: *mut wire_cst_ldk_on_chain_payment, +) { + wire__crate__api__on_chain__ldk_on_chain_payment_new_address_impl(port_, that) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address( + port_: i64, + that: *mut wire_cst_ldk_on_chain_payment, + address: *mut wire_cst_address, +) { + wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address_impl(port_, that, address) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address( + port_: i64, + that: *mut wire_cst_ldk_on_chain_payment, + address: *mut wire_cst_address, + amount_sats: u64, +) { + wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address_impl( + port_, + that, + address, + amount_sats, + ) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_send_spontaneous_payment( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__spontaneous__ldk_spontaneous_payment_send( port_: i64, - that: *mut wire_cst_ldk_node, + that: *mut wire_cst_ldk_spontaneous_payment, amount_msat: u64, node_id: *mut wire_cst_public_key, ) { - wire_ldk_node_send_spontaneous_payment_impl(port_, that, amount_msat, node_id) + wire__crate__api__spontaneous__ldk_spontaneous_payment_send_impl( + port_, + that, + amount_msat, + node_id, + ) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_send_spontaneous_payment_probes( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes( port_: i64, - that: *mut wire_cst_ldk_node, + that: *mut wire_cst_ldk_spontaneous_payment, amount_msat: u64, node_id: *mut wire_cst_public_key, ) { - wire_ldk_node_send_spontaneous_payment_probes_impl(port_, that, amount_msat, node_id) + wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes_impl( + port_, + that, + amount_msat, + node_id, + ) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_send_to_onchain_address( - port_: i64, - that: *mut wire_cst_ldk_node, - address: *mut wire_cst_address, - amount_sats: u64, +pub extern "C" fn frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ptr: *const std::ffi::c_void, ) { - wire_ldk_node_send_to_onchain_address_impl(port_, that, address, amount_sats) + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_sign_message( - port_: i64, - that: *mut wire_cst_ldk_node, - msg: *mut wire_cst_list_prim_u_8_loose, +pub extern "C" fn frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ptr: *const std::ffi::c_void, ) { - wire_ldk_node_sign_message_impl(port_, that, msg) + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_spendable_onchain_balance_sats( - port_: i64, - that: *mut wire_cst_ldk_node, +pub extern "C" fn frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_Node( + ptr: *const std::ffi::c_void, ) { - wire_ldk_node_spendable_onchain_balance_sats_impl(port_, that) + unsafe { + StdArc::::increment_strong_count(ptr as _); + } } #[no_mangle] -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) +pub extern "C" fn frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_Node( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::::decrement_strong_count(ptr as _); + } } #[no_mangle] -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) +pub extern "C" fn frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_sync_wallets( - port_: i64, - that: *mut wire_cst_ldk_node, +pub extern "C" fn frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + ptr: *const std::ffi::c_void, ) { - wire_ldk_node_sync_wallets_impl(port_, that) + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_total_onchain_balance_sats( - port_: i64, - that: *mut wire_cst_ldk_node, +pub extern "C" fn frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilder( + ptr: *const std::ffi::c_void, ) { - wire_ldk_node_total_onchain_balance_sats_impl(port_, that) + unsafe { + StdArc::::increment_strong_count(ptr as _); + } } #[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, +pub extern "C" fn frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilder( + ptr: *const std::ffi::c_void, ) { - wire_ldk_node_update_channel_config_impl( - port_, - that, - channel_id, - counterparty_node_id, - channel_config, - ) + unsafe { + StdArc::::decrement_strong_count(ptr as _); + } } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_verify_signature( - port_: i64, - 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, +pub extern "C" fn frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraph( + ptr: *const std::ffi::c_void, ) { - wire_ldk_node_verify_signature_impl(port_, that, msg, sig, pkey) + unsafe { + StdArc::::increment_strong_count(ptr as _); + } } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_wait_next_event( - port_: i64, - that: *mut wire_cst_ldk_node, +pub extern "C" fn frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraph( + ptr: *const std::ffi::c_void, ) { - wire_ldk_node_wait_next_event_impl(port_, that) + unsafe { + StdArc::::decrement_strong_count(ptr as _); + } } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_socket_address_as_string( - port_: i64, - that: *mut wire_cst_socket_address, +pub extern "C" fn frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( + ptr: *const std::ffi::c_void, ) { - wire_socket_address_as_string_impl(port_, that) + unsafe { + StdArc::::increment_strong_count(ptr as _); + } } #[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, +pub extern "C" fn frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::::decrement_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::::increment_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( + ptr: *const std::ffi::c_void, ) { - wire_socket_address_from_str_impl(port_, address) + unsafe { + StdArc::::decrement_strong_count(ptr as _); + } } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore( +pub extern "C" fn frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( ptr: *const std::ffi::c_void, ) { unsafe { - StdArc::>::increment_strong_count(ptr as _); + StdArc::::increment_strong_count(ptr as _); } } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore( +pub extern "C" fn frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( ptr: *const std::ffi::c_void, ) { unsafe { - StdArc::>::decrement_strong_count(ptr as _); + StdArc::::decrement_strong_count(ptr as _); } } @@ -1327,6 +3030,14 @@ pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_address() -> *mut wire_cst flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_address::new_with_null_ptr()) } +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_anchor_channels_config( +) -> *mut wire_cst_anchor_channels_config { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_anchor_channels_config::new_with_null_ptr(), + ) +} + #[no_mangle] pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_bolt_11_invoice( ) -> *mut wire_cst_bolt_11_invoice { @@ -1335,6 +3046,14 @@ pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_bolt_11_invoice( ) } +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_bolt_12_parse_error( +) -> *mut wire_cst_bolt_12_parse_error { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_bolt_12_parse_error::new_with_null_ptr(), + ) +} + #[no_mangle] pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_chain_data_source_config( ) -> *mut wire_cst_chain_data_source_config { @@ -1356,11 +3075,37 @@ 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_channel_info() -> *mut wire_cst_channel_info { + flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_channel_info::new_with_null_ptr()) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_channel_update_info( +) -> *mut wire_cst_channel_update_info { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_channel_update_info::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()) } +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_decode_error() -> *mut wire_cst_decode_error { + flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_decode_error::new_with_null_ptr()) +} + #[no_mangle] pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_entropy_source_config( ) -> *mut wire_cst_entropy_source_config { @@ -1382,16 +3127,108 @@ 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_ldk_bolt_11_payment( +) -> *mut wire_cst_ldk_bolt_11_payment { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_ldk_bolt_11_payment::new_with_null_ptr(), + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_ldk_bolt_12_payment( +) -> *mut wire_cst_ldk_bolt_12_payment { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_ldk_bolt_12_payment::new_with_null_ptr(), + ) +} + #[no_mangle] 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_ldk_network_graph( +) -> *mut wire_cst_ldk_network_graph { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_ldk_network_graph::new_with_null_ptr(), + ) +} + #[no_mangle] 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] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_ldk_on_chain_payment( +) -> *mut wire_cst_ldk_on_chain_payment { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_ldk_on_chain_payment::new_with_null_ptr(), + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_ldk_spontaneous_payment( +) -> *mut wire_cst_ldk_spontaneous_payment { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_ldk_spontaneous_payment::new_with_null_ptr(), + ) +} + +#[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(), + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_lsp_fee_limits( +) -> *mut wire_cst_lsp_fee_limits { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_lsp_fee_limits::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_node_announcement_info( +) -> *mut wire_cst_node_announcement_info { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_node_announcement_info::new_with_null_ptr(), + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_node_id() -> *mut wire_cst_node_id { + flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_node_id::new_with_null_ptr()) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_node_info() -> *mut wire_cst_node_info { + flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_node_info::new_with_null_ptr()) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_offer() -> *mut wire_cst_offer { + flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_offer::new_with_null_ptr()) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_offer_id() -> *mut wire_cst_offer_id { + flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_offer_id::new_with_null_ptr()) +} + #[no_mangle] pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_out_point() -> *mut wire_cst_out_point { flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_out_point::new_with_null_ptr()) @@ -1405,11 +3242,23 @@ 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()) } +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_payment_id() -> *mut wire_cst_payment_id { + flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_payment_id::new_with_null_ptr()) +} + #[no_mangle] pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_payment_preimage( ) -> *mut wire_cst_payment_preimage { @@ -1431,6 +3280,11 @@ pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_public_key() -> *mut wire_ flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_public_key::new_with_null_ptr()) } +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_refund() -> *mut wire_cst_refund { + flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_refund::new_with_null_ptr()) +} + #[no_mangle] pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_socket_address( ) -> *mut wire_cst_socket_address { @@ -1439,6 +3293,16 @@ 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) @@ -1471,6 +3335,32 @@ 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_node_id(len: i32) -> *mut wire_cst_list_node_id { + let wrap = wire_cst_list_node_id { + 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, @@ -1499,6 +3389,31 @@ 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_64_strict( + len: i32, +) -> *mut wire_cst_list_prim_u_64_strict { + let ans = wire_cst_list_prim_u_64_strict { + ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr(Default::default(), len), + len, + }; + flutter_rust_bridge::for_generated::new_leak_box_ptr(ans) +} + #[no_mangle] pub extern "C" fn frbgen_ldk_node_cst_new_list_prim_u_8_loose( len: i32, @@ -1548,16 +3463,77 @@ pub extern "C" fn frbgen_ldk_node_cst_new_list_socket_address( }; flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) } - + +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_address { + s: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_anchor_channels_config { + trusted_peers_no_reserve: *mut wire_cst_list_public_key, + per_channel_reserve_sats: u64, +} +#[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, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_bolt_12_invoice { + data: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_bolt_12_parse_error { + tag: i32, + kind: Bolt12ParseErrorKind, +} #[repr(C)] #[derive(Clone, Copy)] -pub struct wire_cst_address { - s: *mut wire_cst_list_prim_u_8_strict, +pub union Bolt12ParseErrorKind { + Bech32: wire_cst_Bolt12ParseError_Bech32, + Decode: wire_cst_Bolt12ParseError_Decode, + InvalidSemantics: wire_cst_Bolt12ParseError_InvalidSemantics, + InvalidSignature: wire_cst_Bolt12ParseError_InvalidSignature, + nil__: (), } #[repr(C)] #[derive(Clone, Copy)] -pub struct wire_cst_bolt_11_invoice { - signed_raw_invoice: *mut wire_cst_list_prim_u_8_strict, +pub struct wire_cst_Bolt12ParseError_Bech32 { + field0: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_Bolt12ParseError_Decode { + field0: *mut wire_cst_decode_error, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_Bolt12ParseError_InvalidSemantics { + field0: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_Bolt12ParseError_InvalidSignature { + field0: *mut wire_cst_list_prim_u_8_strict, } #[repr(C)] #[derive(Clone, Copy)] @@ -1582,7 +3558,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: wire_cst_max_dust_htlc_exposure, + max_dust_htlc_exposure: *mut wire_cst_max_dust_htlc_exposure, force_close_avoidance_max_fee_satoshis: u64, accept_underpaying_htlcs: bool, } @@ -1591,12 +3567,11 @@ 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_list_prim_u_8_strict, + funding_txo: *mut wire_cst_out_point, 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, @@ -1605,6 +3580,19 @@ 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)] @@ -1613,6 +3601,48 @@ pub struct wire_cst_channel_id { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_channel_info { + node_one: wire_cst_node_id, + one_to_two: *mut wire_cst_channel_update_info, + node_two: wire_cst_node_id, + two_to_one: *mut wire_cst_channel_update_info, + capacity_sats: *mut u64, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_channel_update_info { + last_update: u32, + enabled: bool, + cltv_expiry_delta: u16, + htlc_minimum_msat: u64, + htlc_maximum_msat: u64, + fees: wire_cst_routing_fees, +} +#[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, @@ -1625,6 +3655,24 @@ pub struct wire_cst_config { trusted_peers_0conf: *mut wire_cst_list_public_key, probing_liquidity_limit_multiplier: u64, log_level: i32, + anchor_channels_config: *mut wire_cst_anchor_channels_config, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_decode_error { + tag: i32, + kind: DecodeErrorKind, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub union DecodeErrorKind { + Io: wire_cst_DecodeError_Io, + nil__: (), +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_DecodeError_Io { + field0: *mut wire_cst_list_prim_u_8_strict, } #[repr(C)] #[derive(Clone, Copy)] @@ -1665,52 +3713,67 @@ pub struct wire_cst_event { #[repr(C)] #[derive(Clone, Copy)] pub union EventKind { + PaymentClaimable: wire_cst_Event_PaymentClaimable, 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_PaymentClaimable { + payment_id: *mut wire_cst_payment_id, + payment_hash: *mut wire_cst_payment_hash, + claimable_amount_msat: u64, + claim_deadline: *mut u32, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_Event_PaymentSuccessful { + payment_id: *mut wire_cst_payment_id, payment_hash: *mut wire_cst_payment_hash, + fee_paid_msat: *mut u64, } #[repr(C)] #[derive(Clone, Copy)] pub struct wire_cst_Event_PaymentFailed { + payment_id: *mut wire_cst_payment_id, payment_hash: *mut wire_cst_payment_hash, + reason: *mut i32, } #[repr(C)] #[derive(Clone, Copy)] pub struct wire_cst_Event_PaymentReceived { + payment_id: *mut wire_cst_payment_id, payment_hash: *mut wire_cst_payment_hash, amount_msat: u64, } #[repr(C)] #[derive(Clone, Copy)] -pub struct wire_cst_Event_ChannelReady { +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, + funding_txo: *mut wire_cst_out_point, } #[repr(C)] #[derive(Clone, Copy)] -pub struct wire_cst_Event_ChannelClosed { +pub struct wire_cst_Event_ChannelReady { 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_ChannelPending { +pub struct wire_cst_Event_ChannelClosed { 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, + reason: *mut wire_cst_closure_reason, } #[repr(C)] #[derive(Clone, Copy)] @@ -1731,22 +3794,155 @@ pub struct wire_cst_GossipSourceConfig_RapidGossipSync { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_ldk_bolt_11_payment { + ptr: usize, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_ldk_bolt_12_payment { + ptr: usize, +} +#[repr(C)] +#[derive(Clone, Copy)] 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_ldk_network_graph { + ptr: usize, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_ldk_node { ptr: usize, } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_ldk_node_error { + tag: i32, + kind: LdkNodeErrorKind, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub union LdkNodeErrorKind { + Decode: wire_cst_LdkNodeError_Decode, + Bolt12Parse: wire_cst_LdkNodeError_Bolt12Parse, + nil__: (), +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_LdkNodeError_Decode { + field0: *mut wire_cst_decode_error, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_LdkNodeError_Bolt12Parse { + field0: *mut wire_cst_bolt_12_parse_error, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_ldk_on_chain_payment { + ptr: usize, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_ldk_spontaneous_payment { + ptr: usize, +} +#[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, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_liquidity_source_config { + lsps2_service: wire_cst_record_socket_address_public_key_opt_string, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_list_channel_details { ptr: *mut wire_cst_channel_details, len: i32, } #[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_node_id { + ptr: *mut wire_cst_node_id, + len: i32, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_list_payment_details { ptr: *mut wire_cst_payment_details, len: i32, @@ -1759,6 +3955,18 @@ 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_64_strict { + ptr: *mut u64, + len: i32, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_list_prim_u_8_loose { ptr: *mut u8, len: i32, @@ -1783,6 +3991,12 @@ pub struct wire_cst_list_socket_address { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_lsp_fee_limits { + max_total_opening_fee_msat: *mut u64, + max_proportional_opening_fee_ppm_msat: *mut u64, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_max_dust_htlc_exposure { tag: i32, kind: MaxDustHTLCExposureKind, @@ -1806,6 +4020,46 @@ pub struct wire_cst_MaxDustHTLCExposure_FeeRateMultiplier { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_node_announcement_info { + last_update: u32, + alias: *mut wire_cst_list_prim_u_8_strict, + addresses: *mut wire_cst_list_socket_address, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_node_id { + compressed: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_node_info { + channels: *mut wire_cst_list_prim_u_64_strict, + announcement_info: *mut wire_cst_node_announcement_info, +} +#[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_offer { + s: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_offer_id { + field0: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_out_point { txid: wire_cst_txid, vout: u32, @@ -1813,9 +4067,8 @@ pub struct wire_cst_out_point { #[repr(C)] #[derive(Clone, Copy)] pub struct wire_cst_payment_details { - hash: wire_cst_payment_hash, - preimage: *mut wire_cst_payment_preimage, - secret: *mut wire_cst_payment_secret, + id: wire_cst_payment_id, + kind: wire_cst_payment_kind, amount_msat: *mut u64, direction: i32, status: i32, @@ -1827,6 +4080,63 @@ pub struct wire_cst_payment_hash { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_payment_id { + field0: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_payment_kind { + tag: i32, + kind: PaymentKindKind, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub union PaymentKindKind { + Bolt11: wire_cst_PaymentKind_Bolt11, + Bolt11Jit: wire_cst_PaymentKind_Bolt11Jit, + Spontaneous: wire_cst_PaymentKind_Spontaneous, + Bolt12Offer: wire_cst_PaymentKind_Bolt12Offer, + Bolt12Refund: wire_cst_PaymentKind_Bolt12Refund, + nil__: (), +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_PaymentKind_Bolt11 { + hash: *mut wire_cst_payment_hash, + preimage: *mut wire_cst_payment_preimage, + secret: *mut wire_cst_payment_secret, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_PaymentKind_Bolt11Jit { + hash: *mut wire_cst_payment_hash, + preimage: *mut wire_cst_payment_preimage, + secret: *mut wire_cst_payment_secret, + lsp_fee_limits: *mut wire_cst_lsp_fee_limits, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_PaymentKind_Spontaneous { + hash: *mut wire_cst_payment_hash, + preimage: *mut wire_cst_payment_preimage, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_PaymentKind_Bolt12Offer { + hash: *mut wire_cst_payment_hash, + preimage: *mut wire_cst_payment_preimage, + secret: *mut wire_cst_payment_secret, + offer_id: *mut wire_cst_offer_id, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_PaymentKind_Bolt12Refund { + hash: *mut wire_cst_payment_hash, + preimage: *mut wire_cst_payment_preimage, + secret: *mut wire_cst_payment_secret, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_payment_preimage { data: *mut wire_cst_list_prim_u_8_strict, } @@ -1844,11 +4154,66 @@ 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: *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, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_refund { + s: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_routing_fees { + base_msat: u32, + proportional_millionths: u32, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_socket_address { tag: i32, kind: SocketAddressKind, @@ -1902,5 +4267,5 @@ pub struct wire_cst_txid { #[repr(C)] #[derive(Clone, Copy)] pub struct wire_cst_user_channel_id { - data: u64, + data: *mut wire_cst_list_prim_u_8_strict, } diff --git a/rust/src/frb_generated.rs b/rust/src/frb_generated.rs index 1478aaa..025f9e4 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.31. +// Generated by `flutter_rust_bridge`@ 2.0.0. #![allow( non_camel_case_types, @@ -14,14 +14,23 @@ clippy::double_parens, clippy::let_and_return, clippy::too_many_arguments, - clippy::match_single_binding + clippy::match_single_binding, + clippy::clone_on_copy, + clippy::let_unit_value, + clippy::deref_addrof, + clippy::explicit_auto_deref, + clippy::borrow_deref_ref, + clippy::needless_borrow )] // Section: imports +use crate::api::bolt12::*; +use crate::api::builder::*; use crate::api::node::*; +use crate::*; use flutter_rust_bridge::for_generated::byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt}; -use flutter_rust_bridge::for_generated::transform_result_dco; +use flutter_rust_bridge::for_generated::{transform_result_dco, Lifetimeable, Lockable}; use flutter_rust_bridge::{Handler, IntoIntoDart}; // Section: boilerplate @@ -31,7 +40,8 @@ flutter_rust_bridge::frb_generated_boilerplate!( default_rust_opaque = RustOpaqueNom, default_rust_auto_opaque = RustAutoOpaqueNom, ); -pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.0.0-dev.31"; +pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.0.0"; +pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = 1761952349; // Section: executor @@ -39,1150 +49,4074 @@ flutter_rust_bridge::frb_generated_default_handler!(); // Section: wire_funcs -fn wire_build_with_sqlite_store_impl( +fn wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hash_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>, + that: impl CstDecode, + payment_hash: impl CstDecode, + claimable_amount_msat: impl CstDecode, + preimage: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "build_with_sqlite_store", + debug_name: "ldk_bolt_11_payment_claim_for_hash", 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_that = that.cst_decode(); + let api_payment_hash = payment_hash.cst_decode(); + let api_claimable_amount_msat = claimable_amount_msat.cst_decode(); + let api_preimage = preimage.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::build_with_sqlite_store( - api_config, - api_chain_data_source_config, - api_entropy_source_config, - api_gossip_source_config, - ) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt11::LdkBolt11Payment::claim_for_hash( + &api_that, + api_payment_hash, + api_claimable_amount_msat, + api_preimage, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_mnemonic_generate_impl(port_: flutter_rust_bridge::for_generated::MessagePort) { +fn wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hash_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode, + payment_hash: impl CstDecode, +) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_mnemonic_generate", + debug_name: "ldk_bolt_11_payment_fail_for_hash", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { + let api_that = that.cst_decode(); + let api_payment_hash = payment_hash.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkMnemonic::generate()) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt11::LdkBolt11Payment::fail_for_hash( + &api_that, + api_payment_hash, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_close_channel_impl( +fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - channel_id: impl CstDecode, - counterparty_node_id: impl CstDecode, + 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: "ldk_node_close_channel", + debug_name: "ldk_bolt_11_payment_receive", 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(); + 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::LdkNode::close_channel( + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt11::LdkBolt11Payment::receive( &api_that, - api_channel_id, - api_counterparty_node_id, - ) - })()) + api_amount_msat, + api_description, + api_expiry_secs, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_connect_impl( +fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hash_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - node_id: impl CstDecode, - address: impl CstDecode, - persist: impl CstDecode, + that: impl CstDecode, + payment_hash: 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: "ldk_node_connect", + debug_name: "ldk_bolt_11_payment_receive_for_hash", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_node_id = node_id.cst_decode(); - let api_address = address.cst_decode(); - let api_persist = persist.cst_decode(); + let api_payment_hash = payment_hash.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::LdkNode::connect( + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt11::LdkBolt11Payment::receive_for_hash( &api_that, - api_node_id, - api_address, - api_persist, - ) - })()) + api_payment_hash, + api_amount_msat, + api_description, + api_expiry_secs, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_connect_open_channel_impl( +fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - socket_address: impl CstDecode, - node_id: impl CstDecode, - channel_amount_sats: impl CstDecode, - push_to_counterparty_msat: impl CstDecode>, - announce_channel: impl CstDecode, - channel_config: impl CstDecode>, + that: impl CstDecode, + description: impl CstDecode, + expiry_secs: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_connect_open_channel", + debug_name: "ldk_bolt_11_payment_receive_variable_amount", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.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(); - let api_announce_channel = announce_channel.cst_decode(); - let api_channel_config = channel_config.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::LdkNode::connect_open_channel( + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt11::LdkBolt11Payment::receive_variable_amount( &api_that, - api_socket_address, - api_node_id, - api_channel_amount_sats, - api_push_to_counterparty_msat, - api_announce_channel, - api_channel_config, - ) - })()) + api_description, + api_expiry_secs, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_disconnect_impl( +fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hash_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - counterparty_node_id: impl CstDecode, + that: impl CstDecode, + description: impl CstDecode, + expiry_secs: impl CstDecode, + payment_hash: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_disconnect", + debug_name: "ldk_bolt_11_payment_receive_variable_amount_for_hash", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_counterparty_node_id = counterparty_node_id.cst_decode(); + let api_description = description.cst_decode(); + let api_expiry_secs = expiry_secs.cst_decode(); + let api_payment_hash = payment_hash.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::disconnect(&api_that, api_counterparty_node_id) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = + crate::api::bolt11::LdkBolt11Payment::receive_variable_amount_for_hash( + &api_that, + api_description, + api_expiry_secs, + api_payment_hash, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_event_handled_impl( +fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel_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: "ldk_bolt_11_payment_receive_variable_amount_via_jit_channel", 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();let api_max_proportional_lsp_fee_limit_ppm_msat = max_proportional_lsp_fee_limit_ppm_msat.cst_decode(); move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt11::LdkBolt11Payment::receive_variable_amount_via_jit_channel(&api_that, api_description, api_expiry_secs, api_max_proportional_lsp_fee_limit_ppm_msat)?; Ok(output_ok) + })()) + } }) +} +fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + 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: "ldk_node_event_handled", + debug_name: "ldk_bolt_11_payment_receive_via_jit_channel", 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(); + let api_max_total_lsp_fee_limit_msat = max_total_lsp_fee_limit_msat.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::event_handled(&api_that)) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt11::LdkBolt11Payment::receive_via_jit_channel( + &api_that, + api_amount_msat, + api_description, + api_expiry_secs, + api_max_total_lsp_fee_limit_msat, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_is_running_impl( +fn wire__crate__api__bolt11__ldk_bolt_11_payment_send_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: "ldk_node_is_running", + debug_name: "ldk_bolt_11_payment_send", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); + let api_invoice = invoice.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::is_running(&api_that)) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = + crate::api::bolt11::LdkBolt11Payment::send(&api_that, api_invoice)?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_list_channels_impl( +fn wire__crate__api__bolt11__ldk_bolt_11_payment_send_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: "ldk_node_list_channels", + debug_name: "ldk_bolt_11_payment_send_probes", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); + let api_invoice = invoice.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::list_channels(&api_that)) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = + crate::api::bolt11::LdkBolt11Payment::send_probes(&api_that, api_invoice)?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_list_payments_impl( +fn wire__crate__api__bolt11__ldk_bolt_11_payment_send_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: "ldk_node_list_payments", + debug_name: "ldk_bolt_11_payment_send_probes_using_amount", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); + let api_invoice = invoice.cst_decode(); + let api_amount_msat = amount_msat.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::list_payments(&api_that)) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt11::LdkBolt11Payment::send_probes_using_amount( + &api_that, + api_invoice, + api_amount_msat, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_list_payments_with_filter_impl( +fn wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - payment_direction: 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: "ldk_node_list_payments_with_filter", + debug_name: "ldk_bolt_11_payment_send_using_amount", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_payment_direction = payment_direction.cst_decode(); + let api_invoice = invoice.cst_decode(); + let api_amount_msat = amount_msat.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::list_payments_with_filter( + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt11::LdkBolt11Payment::send_using_amount( &api_that, - api_payment_direction, - )) - })()) + api_invoice, + api_amount_msat, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_list_peers_impl( +fn wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refund_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, + amount_msat: impl CstDecode, + expiry_secs: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_list_peers", + debug_name: "ldk_bolt_12_payment_initiate_refund", 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_expiry_secs = expiry_secs.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::list_peers(&api_that)) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt12::LdkBolt12Payment::initiate_refund( + &api_that, + api_amount_msat, + api_expiry_secs, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_listening_addresses_impl( +fn wire__crate__api__bolt12__ldk_bolt_12_payment_receive_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, + amount_msat: impl CstDecode, + description: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_listening_addresses", + debug_name: "ldk_bolt_12_payment_receive", 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(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::listening_addresses(&api_that)) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt12::LdkBolt12Payment::receive( + &api_that, + api_amount_msat, + api_description, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_new_onchain_address_impl( +fn wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amount_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, + description: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_new_onchain_address", + debug_name: "ldk_bolt_12_payment_receive_variable_amount", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); + let api_description = description.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::new_onchain_address(&api_that) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt12::LdkBolt12Payment::receive_variable_amount( + &api_that, + api_description, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_next_event_impl( +fn wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_payment_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, + refund: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_next_event", + debug_name: "ldk_bolt_12_payment_request_refund_payment", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); + let api_refund = refund.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::next_event(&api_that)) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt12::LdkBolt12Payment::request_refund_payment( + &api_that, api_refund, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_node_id_impl( +fn wire__crate__api__bolt12__ldk_bolt_12_payment_send_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, + offer: impl CstDecode, + payer_note: impl CstDecode>, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_node_id", + debug_name: "ldk_bolt_12_payment_send", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); + let api_offer = offer.cst_decode(); + let api_payer_note = payer_note.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::node_id(&api_that)) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt12::LdkBolt12Payment::send( + &api_that, + api_offer, + api_payer_note, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_payment_impl( +fn wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amount_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - payment_hash: impl CstDecode, + that: impl CstDecode, + offer: impl CstDecode, + payer_note: impl CstDecode>, + amount_msat: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_payment", + debug_name: "ldk_bolt_12_payment_send_using_amount", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_payment_hash = payment_hash.cst_decode(); + let api_offer = offer.cst_decode(); + let api_payer_note = payer_note.cst_decode(); + let api_amount_msat = amount_msat.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::payment( + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt12::LdkBolt12Payment::send_using_amount( &api_that, - api_payment_hash, - )) - })()) + api_offer, + api_payer_note, + api_amount_msat, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_receive_payment_impl( +fn wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "NodeBuilder_auto_accessor_get_builder", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + transform_result_dco::<_, _, ()>((move || { + let mut api_that_guard = None; + let decode_indices_ = + flutter_rust_bridge::for_generated::lockable_compute_decode_order(vec![ + flutter_rust_bridge::for_generated::LockableOrderInfo::new( + &api_that, 0, false, + ), + ]); + for i in decode_indices_ { + match i { + 0 => api_that_guard = Some(api_that.lockable_decode_sync_ref()), + _ => unreachable!(), + } + } + let api_that_guard = api_that_guard.unwrap(); + let output_ok = Result::<_, ()>::Ok(api_that_guard.builder.clone())?; + Ok(output_ok) + })()) + }, + ) +} +fn wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, + builder: impl CstDecode>, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "NodeBuilder_auto_accessor_set_builder", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + let api_builder = builder.cst_decode(); + transform_result_dco::<_, _, ()>((move || { + let mut api_that_guard = None; + let decode_indices_ = + flutter_rust_bridge::for_generated::lockable_compute_decode_order(vec![ + flutter_rust_bridge::for_generated::LockableOrderInfo::new( + &api_that, 0, true, + ), + ]); + for i in decode_indices_ { + match i { + 0 => api_that_guard = Some(api_that.lockable_decode_sync_ref_mut()), + _ => unreachable!(), + } + } + let mut api_that_guard = api_that_guard.unwrap(); + let output_ok = Result::<_, ()>::Ok({ + { + api_that_guard.builder = api_builder; + }; + })?; + Ok(output_ok) + })()) + }, + ) +} +fn wire__crate__api__builder__NodeBuilder_build_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - amount_msat: impl CstDecode, - description: impl CstDecode, - expiry_secs: impl CstDecode, + that: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_receive_payment", + debug_name: "NodeBuilder_build", 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::LdkNode::receive_payment( - &api_that, - api_amount_msat, - api_description, - api_expiry_secs, - ) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkBuilderError>((move || { + let output_ok = crate::api::builder::NodeBuilder::build(api_that)?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_receive_variable_amount_payment_impl( +fn wire__crate__api__builder__NodeBuilder_build_with_fs_store_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - description: impl CstDecode, - expiry_secs: impl CstDecode, + that: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_receive_variable_amount_payment", + debug_name: "NodeBuilder_build_with_fs_store", 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::LdkNode::receive_variable_amount_payment( - &api_that, - api_description, - api_expiry_secs, - ) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkBuilderError>((move || { + let output_ok = + crate::api::builder::NodeBuilder::build_with_fs_store(api_that)?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_remove_payment_impl( +fn wire__crate__api__builder__NodeBuilder_create_builder_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - payment_hash: impl CstDecode, + config: impl CstDecode, + chain_data_source_config: impl CstDecode>, + entropy_source_config: impl CstDecode>, + gossip_source_config: impl CstDecode>, + liquidity_source_config: impl CstDecode>, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_remove_payment", + debug_name: "NodeBuilder_create_builder", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { - let api_that = that.cst_decode(); - let api_payment_hash = payment_hash.cst_decode(); + 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(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::remove_payment(&api_that, api_payment_hash) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkBuilderError>((move || { + let output_ok = crate::api::builder::NodeBuilder::create_builder( + api_config, + api_chain_data_source_config, + api_entropy_source_config, + api_gossip_source_config, + api_liquidity_source_config, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_send_all_to_onchain_address_impl( +fn wire__crate__api__builder__ldk_mnemonic_generate_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - address: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_send_all_to_onchain_address", + 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_address = address.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::send_all_to_onchain_address(&api_that, api_address) + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::builder::LdkMnemonic::generate())?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_send_payment_impl( +fn wire__crate__api__graph__ldk_network_graph_channel_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - invoice: impl CstDecode, + that: impl CstDecode, + short_channel_id: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_send_payment", + debug_name: "ldk_network_graph_channel", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_invoice = invoice.cst_decode(); + let api_short_channel_id = short_channel_id.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::send_payment(&api_that, api_invoice) + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::graph::LdkNetworkGraph::channel( + &api_that, + api_short_channel_id, + ))?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_send_payment_probes_impl( +fn wire__crate__api__graph__ldk_network_graph_list_channels_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - invoice: impl CstDecode, + that: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_send_payment_probes", + debug_name: "ldk_network_graph_list_channels", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_invoice = invoice.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::send_payment_probes(&api_that, api_invoice) + transform_result_dco::<_, _, ()>((move || { + let output_ok = Result::<_, ()>::Ok( + crate::api::graph::LdkNetworkGraph::list_channels(&api_that), + )?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_send_payment_probes_using_amount_impl( +fn wire__crate__api__graph__ldk_network_graph_list_nodes_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - invoice: impl CstDecode, - amount_msat: impl CstDecode, + that: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_send_payment_probes_using_amount", + debug_name: "ldk_network_graph_list_nodes", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_invoice = invoice.cst_decode(); - let api_amount_msat = amount_msat.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::send_payment_probes_using_amount( - &api_that, - api_invoice, - api_amount_msat, - ) + transform_result_dco::<_, _, ()>((move || { + let output_ok = Result::<_, ()>::Ok( + crate::api::graph::LdkNetworkGraph::list_nodes(&api_that), + )?; + Ok(output_ok) + })()) + } + }, + ) +} +fn wire__crate__api__graph__ldk_network_graph_node_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode, + node_id: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ldk_network_graph_node", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_node_id = node_id.cst_decode(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = + crate::api::graph::LdkNetworkGraph::node(&api_that, api_node_id)?; + Ok(output_ok) + })( + )) + } + }, + ) +} +fn wire__crate__api__node__ldk_node_bolt11_payment_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + ptr: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ldk_node_bolt11_payment", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_ptr = ptr.cst_decode(); + move |context| { + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::bolt11_payment(api_ptr))?; + Ok(output_ok) + })()) + } + }, + ) +} +fn wire__crate__api__node__ldk_node_bolt12_payment_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + ptr: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ldk_node_bolt12_payment", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_ptr = ptr.cst_decode(); + move |context| { + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::bolt12_payment(api_ptr))?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_send_payment_using_amount_impl( +fn wire__crate__api__node__ldk_node_close_channel_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, - invoice: impl CstDecode, - amount_msat: impl CstDecode, + user_channel_id: impl CstDecode, + counterparty_node_id: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_send_payment_using_amount", + 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_invoice = invoice.cst_decode(); - let api_amount_msat = amount_msat.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::LdkNode::send_payment_using_amount( + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::close_channel( &api_that, - api_invoice, - api_amount_msat, - ) + api_user_channel_id, + api_counterparty_node_id, + )?; + Ok(output_ok) + })( + )) + } + }, + ) +} +fn wire__crate__api__node__ldk_node_config_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_config", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + move |context| { + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::config(&api_that))?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_send_spontaneous_payment_impl( +fn wire__crate__api__node__ldk_node_connect_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, - amount_msat: 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: "ldk_node_send_spontaneous_payment", + debug_name: "ldk_node_connect", 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_node_id = node_id.cst_decode(); + let api_address = address.cst_decode(); + let api_persist = persist.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::send_spontaneous_payment( + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::connect( &api_that, - api_amount_msat, api_node_id, - ) - })()) + api_address, + api_persist, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_send_spontaneous_payment_probes_impl( +fn wire__crate__api__node__ldk_node_connect_open_channel_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, - amount_msat: impl CstDecode, + socket_address: impl CstDecode, node_id: impl CstDecode, + channel_amount_sats: impl CstDecode, + push_to_counterparty_msat: impl CstDecode>, + announce_channel: impl CstDecode, + channel_config: impl CstDecode>, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_send_spontaneous_payment_probes", + 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_amount_msat = amount_msat.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(); + let api_announce_channel = announce_channel.cst_decode(); + let api_channel_config = channel_config.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::send_spontaneous_payment_probes( + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::connect_open_channel( &api_that, - api_amount_msat, + api_socket_address, api_node_id, - ) - })()) + api_channel_amount_sats, + api_push_to_counterparty_msat, + api_announce_channel, + api_channel_config, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_send_to_onchain_address_impl( +fn wire__crate__api__node__ldk_node_disconnect_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, - address: impl CstDecode, - amount_sats: impl CstDecode, + counterparty_node_id: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_send_to_onchain_address", + debug_name: "ldk_node_disconnect", 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_amount_sats = amount_sats.cst_decode(); + let api_counterparty_node_id = counterparty_node_id.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::send_to_onchain_address( - &api_that, - api_address, - api_amount_sats, - ) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = + crate::api::node::LdkNode::disconnect(&api_that, api_counterparty_node_id)?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_sign_message_impl( +fn wire__crate__api__node__ldk_node_event_handled_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, - msg: impl CstDecode>, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_sign_message", + debug_name: "ldk_node_event_handled", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_msg = msg.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::sign_message(&api_that, api_msg) + transform_result_dco::<_, _, ()>((move || { + let output_ok = Result::<_, ()>::Ok({ + crate::api::node::LdkNode::event_handled(&api_that); + })?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_spendable_onchain_balance_sats_impl( +fn wire__crate__api__node__ldk_node_force_close_channel_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, + user_channel_id: impl CstDecode, + counterparty_node_id: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_spendable_onchain_balance_sats", + debug_name: "ldk_node_force_close_channel", 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::LdkNode::spendable_onchain_balance_sats(&api_that) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::force_close_channel( + &api_that, + api_user_channel_id, + api_counterparty_node_id, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_start_impl( +fn wire__crate__api__node__ldk_node_list_balances_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_start", + debug_name: "ldk_node_list_balances", 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::start(&api_that))()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::list_balances(&api_that)?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_stop_impl( +fn wire__crate__api__node__ldk_node_list_channels_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_stop", + debug_name: "ldk_node_list_channels", 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::stop(&api_that))()) + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::list_channels(&api_that))?; + Ok(output_ok) + })()) } }, ) } -fn wire_ldk_node_sync_wallets_impl( +fn wire__crate__api__node__ldk_node_list_payments_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_sync_wallets", + debug_name: "ldk_node_list_payments", 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::sync_wallets(&api_that))()) + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::list_payments(&api_that))?; + Ok(output_ok) + })()) } }, ) } -fn wire_ldk_node_total_onchain_balance_sats_impl( +fn wire__crate__api__node__ldk_node_list_payments_with_filter_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, + payment_direction: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_total_onchain_balance_sats", + debug_name: "ldk_node_list_payments_with_filter", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); + let api_payment_direction = payment_direction.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::total_onchain_balance_sats(&api_that) + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::list_payments_with_filter( + &api_that, + api_payment_direction, + ))?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_update_channel_config_impl( +fn wire__crate__api__node__ldk_node_list_peers_impl( port_: flutter_rust_bridge::for_generated::MessagePort, 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: "ldk_node_update_channel_config", + debug_name: "ldk_node_list_peers", 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(); - let api_channel_config = channel_config.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::update_channel_config( - &api_that, - api_channel_id, - api_counterparty_node_id, - api_channel_config, - ) + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::list_peers(&api_that))?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_verify_signature_impl( +fn wire__crate__api__node__ldk_node_listening_addresses_impl( port_: flutter_rust_bridge::for_generated::MessagePort, 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: "ldk_node_verify_signature", + debug_name: "ldk_node_listening_addresses", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_msg = msg.cst_decode(); - let api_sig = sig.cst_decode(); - let api_pkey = pkey.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::verify_signature( - &api_that, api_msg, api_sig, api_pkey, - ) + transform_result_dco::<_, _, ()>((move || { + let output_ok = Result::<_, ()>::Ok( + crate::api::node::LdkNode::listening_addresses(&api_that), + )?; + Ok(output_ok) + })()) + } + }, + ) +} +fn wire__crate__api__node__ldk_node_network_graph_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + ptr: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ldk_node_network_graph", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_ptr = ptr.cst_decode(); + move |context| { + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::network_graph(api_ptr))?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_wait_next_event_impl( +fn wire__crate__api__node__ldk_node_next_event_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_wait_next_event", + debug_name: "ldk_node_next_event", 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::LdkNode::wait_next_event(&api_that)) + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::next_event(&api_that))?; + Ok(output_ok) })()) } }, ) } -fn wire_socket_address_as_string_impl( +fn wire__crate__api__node__ldk_node_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: "ldk_node_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 { + let output_ok = Result::<_, ()>::Ok( + crate::api::node::LdkNode::next_event_async(&api_that).await, + )?; + Ok(output_ok) + })() + .await, + ) + } + }, + ) +} +fn wire__crate__api__node__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: "socket_address_as_string", + debug_name: "ldk_node_node_id", 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::types::SocketAddress::as_string(&api_that)) + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::node_id(&api_that))?; + Ok(output_ok) })()) } }, ) } -fn wire_socket_address_from_str_impl( +fn wire__crate__api__node__ldk_node_on_chain_payment_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - address: impl CstDecode, + ptr: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "socket_address_from_str", + debug_name: "ldk_node_on_chain_payment", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { - let api_address = address.cst_decode(); + let api_ptr = ptr.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::types::SocketAddress::from_str(api_address) + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::on_chain_payment(api_ptr))?; + Ok(output_ok) })()) } }, ) } - -// Section: dart2rust - -impl CstDecode for bool { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> bool { - self - } +fn wire__crate__api__node__ldk_node_payment_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode, + payment_id: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ldk_node_payment", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_payment_id = payment_id.cst_decode(); + move |context| { + transform_result_dco::<_, _, ()>((move || { + let output_ok = Result::<_, ()>::Ok(crate::api::node::LdkNode::payment( + &api_that, + api_payment_id, + ))?; + Ok(output_ok) + })()) + } + }, + ) } -impl CstDecode for i32 { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::error::BuilderException { - match 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), - } - } +fn wire__crate__api__node__ldk_node_remove_payment_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode, + payment_id: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ldk_node_remove_payment", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_payment_id = payment_id.cst_decode(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = + crate::api::node::LdkNode::remove_payment(&api_that, api_payment_id)?; + Ok(output_ok) + })( + )) + } + }, + ) } -impl CstDecode for i32 { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> i32 { - self - } +fn wire__crate__api__node__ldk_node_sign_message_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode, + msg: impl CstDecode>, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ldk_node_sign_message", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_msg = msg.cst_decode(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::sign_message(&api_that, api_msg)?; + Ok(output_ok) + })( + )) + } + }, + ) } -impl CstDecode for i32 { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::LogLevel { - match self { - 0 => crate::api::types::LogLevel::Gossip, - 1 => crate::api::types::LogLevel::Trace, - 2 => crate::api::types::LogLevel::Debug, - 3 => crate::api::types::LogLevel::Info, - 4 => crate::api::types::LogLevel::Warn, - 5 => crate::api::types::LogLevel::Error, - _ => unreachable!("Invalid variant for LogLevel: {}", self), - } +fn wire__crate__api__node__ldk_node_spontaneous_payment_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + ptr: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ldk_node_spontaneous_payment", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_ptr = ptr.cst_decode(); + move |context| { + transform_result_dco::<_, _, ()>((move || { + let output_ok = Result::<_, ()>::Ok( + crate::api::node::LdkNode::spontaneous_payment(api_ptr), + )?; + Ok(output_ok) + })()) + } + }, + ) +} +fn wire__crate__api__node__ldk_node_start_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_start", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::start(&api_that)?; + Ok(output_ok) + })( + )) + } + }, + ) +} +fn wire__crate__api__node__ldk_node_status_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_status", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + move |context| { + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::status(&api_that))?; + Ok(output_ok) + })()) + } + }, + ) +} +fn wire__crate__api__node__ldk_node_stop_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_stop", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::stop(&api_that)?; + Ok(output_ok) + })( + )) + } + }, + ) +} +fn wire__crate__api__node__ldk_node_sync_wallets_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_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::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::sync_wallets(&api_that)?; + Ok(output_ok) + })( + )) + } + }, + ) +} +fn wire__crate__api__node__ldk_node_update_channel_config_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode, + user_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: "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_counterparty_node_id = counterparty_node_id.cst_decode(); + let api_channel_config = channel_config.cst_decode(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::update_channel_config( + &api_that, + api_user_channel_id, + api_counterparty_node_id, + api_channel_config, + )?; + Ok(output_ok) + })( + )) + } + }, + ) +} +fn wire__crate__api__node__ldk_node_verify_signature_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode, + msg: impl CstDecode>, + sig: impl CstDecode, + public_key: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ldk_node_verify_signature", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_msg = msg.cst_decode(); + let api_sig = sig.cst_decode(); + let api_public_key = public_key.cst_decode(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::verify_signature( + &api_that, + api_msg, + api_sig, + api_public_key, + )?; + Ok(output_ok) + })( + )) + } + }, + ) +} +fn wire__crate__api__node__ldk_node_wait_next_event_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_wait_next_event", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + move |context| { + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::wait_next_event(&api_that))?; + Ok(output_ok) + })()) + } + }, + ) +} +fn wire__crate__api__on_chain__ldk_on_chain_payment_new_address_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_on_chain_payment_new_address", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = + crate::api::on_chain::LdkOnChainPayment::new_address(&api_that)?; + Ok(output_ok) + })( + )) + } + }, + ) +} +fn wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode, + address: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ldk_on_chain_payment_send_all_to_address", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_address = address.cst_decode(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::on_chain::LdkOnChainPayment::send_all_to_address( + &api_that, + api_address, + )?; + Ok(output_ok) + })( + )) + } + }, + ) +} +fn wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode, + address: impl CstDecode, + amount_sats: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ldk_on_chain_payment_send_to_address", + 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_amount_sats = amount_sats.cst_decode(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::on_chain::LdkOnChainPayment::send_to_address( + &api_that, + api_address, + api_amount_sats, + )?; + Ok(output_ok) + })( + )) + } + }, + ) +} +fn wire__crate__api__spontaneous__ldk_spontaneous_payment_send_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + 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: "ldk_spontaneous_payment_send", + 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_node_id = node_id.cst_decode(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::spontaneous::LdkSpontaneousPayment::send( + &api_that, + api_amount_msat, + api_node_id, + )?; + Ok(output_ok) + })( + )) + } + }, + ) +} +fn wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + 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: "ldk_spontaneous_payment_send_probes", + 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_node_id = node_id.cst_decode(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::spontaneous::LdkSpontaneousPayment::send_probes( + &api_that, + api_amount_msat, + api_node_id, + )?; + Ok(output_ok) + })( + )) + } + }, + ) +} + +// Section: dart2rust + +impl CstDecode for bool { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> 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::types::Network { - match self { - 0 => crate::api::types::Network::Bitcoin, - 1 => crate::api::types::Network::Testnet, - 2 => crate::api::types::Network::Signet, - 3 => crate::api::types::Network::Regtest, - _ => unreachable!("Invalid variant for Network: {}", self), - } + fn cst_decode(self) -> i32 { + 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::NodeException { + fn cst_decode(self) -> crate::utils::error::LdkBuilderError { match 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), + 0 => crate::utils::error::LdkBuilderError::SocketAddressParseError, + 1 => crate::utils::error::LdkBuilderError::InvalidSeedBytes, + 2 => crate::utils::error::LdkBuilderError::InvalidSeedFile, + 3 => crate::utils::error::LdkBuilderError::InvalidSystemTime, + 4 => crate::utils::error::LdkBuilderError::InvalidChannelMonitor, + 5 => crate::utils::error::LdkBuilderError::InvalidListeningAddress, + 6 => crate::utils::error::LdkBuilderError::ReadFailed, + 7 => crate::utils::error::LdkBuilderError::WriteFailed, + 8 => crate::utils::error::LdkBuilderError::StoragePathAccessFailed, + 9 => crate::utils::error::LdkBuilderError::KVStoreSetupFailed, + 10 => crate::utils::error::LdkBuilderError::WalletSetupFailed, + 11 => crate::utils::error::LdkBuilderError::LoggerSetupFailed, + 12 => crate::utils::error::LdkBuilderError::InvalidPublicKey, + _ => unreachable!("Invalid variant for LdkBuilderError: {}", self), } } } -impl CstDecode for i32 { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::PaymentDirection { - match self { - 0 => crate::api::types::PaymentDirection::Inbound, - 1 => crate::api::types::PaymentDirection::Outbound, - _ => unreachable!("Invalid variant for PaymentDirection: {}", self), - } +impl CstDecode for i32 { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::LogLevel { + match self { + 0 => crate::api::types::LogLevel::Gossip, + 1 => crate::api::types::LogLevel::Trace, + 2 => crate::api::types::LogLevel::Debug, + 3 => crate::api::types::LogLevel::Info, + 4 => crate::api::types::LogLevel::Warn, + 5 => crate::api::types::LogLevel::Error, + _ => unreachable!("Invalid variant for LogLevel: {}", self), + } + } +} +impl CstDecode for i32 { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::Network { + match self { + 0 => crate::api::types::Network::Bitcoin, + 1 => crate::api::types::Network::Testnet, + 2 => crate::api::types::Network::Signet, + 3 => crate::api::types::Network::Regtest, + _ => unreachable!("Invalid variant for Network: {}", self), + } + } +} +impl CstDecode for i32 { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::PaymentDirection { + match self { + 0 => crate::api::types::PaymentDirection::Inbound, + 1 => crate::api::types::PaymentDirection::Outbound, + _ => unreachable!("Invalid variant for PaymentDirection: {}", self), + } + } +} +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 { + match self { + 0 => crate::api::types::PaymentStatus::Pending, + 1 => crate::api::types::PaymentStatus::Succeeded, + 2 => crate::api::types::PaymentStatus::Failed, + _ => unreachable!("Invalid variant for PaymentStatus: {}", self), + } + } +} +impl CstDecode for u16 { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> u16 { + self + } +} +impl CstDecode for u32 { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> u32 { + self + } +} +impl CstDecode for u64 { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> u64 { + self + } +} +impl CstDecode for u8 { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> u8 { + self + } +} +impl CstDecode for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> usize { + self + } +} +impl SseDecode for NodeBuilder { + // 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 flutter_rust_bridge::for_generated::rust_auto_opaque_decode_owned(inner); + } +} + +impl SseDecode for RustOpaqueNom> { + // 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 unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode for RustOpaqueNom { + // 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 unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode + for RustOpaqueNom> +{ + // 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 unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode for RustOpaqueNom { + // 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 unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode for RustOpaqueNom { + // 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 unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode for RustOpaqueNom { + // 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 unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode for RustOpaqueNom { + // 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 unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode for RustOpaqueNom { + // 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 unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode for String { + // 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 String::from_utf8(inner).unwrap(); + } +} + +impl SseDecode for crate::api::types::Address { + // 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_s = ::sse_decode(deserializer); + return crate::api::types::Address { s: var_s }; + } +} + +impl SseDecode for crate::api::types::AnchorChannelsConfig { + // 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_trustedPeersNoReserve = + >::sse_decode(deserializer); + let mut var_perChannelReserveSats = ::sse_decode(deserializer); + return crate::api::types::AnchorChannelsConfig { + trusted_peers_no_reserve: var_trustedPeersNoReserve, + per_channel_reserve_sats: var_perChannelReserveSats, + }; + } +} + +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::bolt11::Bolt11Invoice { + // 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_signedRawInvoice = ::sse_decode(deserializer); + return crate::api::bolt11::Bolt11Invoice { + signed_raw_invoice: var_signedRawInvoice, + }; + } +} + +impl SseDecode for crate::api::bolt12::Bolt12Invoice { + // 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); + return crate::api::bolt12::Bolt12Invoice { data: var_data }; + } +} + +impl SseDecode for crate::utils::error::Bolt12ParseError { + // 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 => { + return crate::utils::error::Bolt12ParseError::InvalidContinuation; + } + 1 => { + return crate::utils::error::Bolt12ParseError::InvalidBech32Hrp; + } + 2 => { + let mut var_field0 = ::sse_decode(deserializer); + return crate::utils::error::Bolt12ParseError::Bech32(var_field0); + } + 3 => { + let mut var_field0 = ::sse_decode(deserializer); + return crate::utils::error::Bolt12ParseError::Decode(var_field0); + } + 4 => { + let mut var_field0 = ::sse_decode(deserializer); + return crate::utils::error::Bolt12ParseError::InvalidSemantics(var_field0); + } + 5 => { + let mut var_field0 = ::sse_decode(deserializer); + return crate::utils::error::Bolt12ParseError::InvalidSignature(var_field0); + } + _ => { + unimplemented!(""); + } + } + } +} + +impl SseDecode for bool { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + deserializer.cursor.read_u8().unwrap() != 0 + } +} + +impl SseDecode for crate::api::types::ChainDataSourceConfig { + // 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_field0 = ::sse_decode(deserializer); + return crate::api::types::ChainDataSourceConfig::Esplora(var_field0); + } + _ => { + unimplemented!(""); + } + } + } +} + +impl SseDecode for crate::api::types::ChannelConfig { + // 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_forwardingFeeProportionalMillionths = ::sse_decode(deserializer); + let mut var_forwardingFeeBaseMsat = ::sse_decode(deserializer); + let mut var_cltvExpiryDelta = ::sse_decode(deserializer); + let mut var_maxDustHtlcExposure = + >::sse_decode(deserializer); + let mut var_forceCloseAvoidanceMaxFeeSatoshis = ::sse_decode(deserializer); + let mut var_acceptUnderpayingHtlcs = ::sse_decode(deserializer); + return crate::api::types::ChannelConfig { + forwarding_fee_proportional_millionths: var_forwardingFeeProportionalMillionths, + forwarding_fee_base_msat: var_forwardingFeeBaseMsat, + cltv_expiry_delta: var_cltvExpiryDelta, + max_dust_htlc_exposure: var_maxDustHtlcExposure, + force_close_avoidance_max_fee_satoshis: var_forceCloseAvoidanceMaxFeeSatoshis, + accept_underpaying_htlcs: var_acceptUnderpayingHtlcs, + }; + } +} + +impl SseDecode for crate::api::types::ChannelDetails { + // 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_channelId = ::sse_decode(deserializer); + let mut var_counterpartyNodeId = ::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_outboundCapacityMsat = ::sse_decode(deserializer); + let mut var_inboundCapacityMsat = ::sse_decode(deserializer); + let mut var_confirmationsRequired = >::sse_decode(deserializer); + let mut var_confirmations = >::sse_decode(deserializer); + let mut var_isOutbound = ::sse_decode(deserializer); + 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, + funding_txo: var_fundingTxo, + channel_value_sats: var_channelValueSats, + unspendable_punishment_reserve: var_unspendablePunishmentReserve, + user_channel_id: var_userChannelId, + feerate_sat_per_1000_weight: var_feerateSatPer1000Weight, + outbound_capacity_msat: var_outboundCapacityMsat, + inbound_capacity_msat: var_inboundCapacityMsat, + confirmations_required: var_confirmationsRequired, + confirmations: var_confirmations, + is_outbound: var_isOutbound, + 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, + }; + } +} + +impl SseDecode for crate::api::types::ChannelId { + // 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 = <[u8; 32]>::sse_decode(deserializer); + return crate::api::types::ChannelId { data: var_data }; + } +} + +impl SseDecode for crate::api::graph::ChannelInfo { + // 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_nodeOne = ::sse_decode(deserializer); + let mut var_oneToTwo = + >::sse_decode(deserializer); + let mut var_nodeTwo = ::sse_decode(deserializer); + let mut var_twoToOne = + >::sse_decode(deserializer); + let mut var_capacitySats = >::sse_decode(deserializer); + return crate::api::graph::ChannelInfo { + node_one: var_nodeOne, + one_to_two: var_oneToTwo, + node_two: var_nodeTwo, + two_to_one: var_twoToOne, + capacity_sats: var_capacitySats, + }; + } +} + +impl SseDecode for crate::api::graph::ChannelUpdateInfo { + // 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_lastUpdate = ::sse_decode(deserializer); + let mut var_enabled = ::sse_decode(deserializer); + let mut var_cltvExpiryDelta = ::sse_decode(deserializer); + let mut var_htlcMinimumMsat = ::sse_decode(deserializer); + let mut var_htlcMaximumMsat = ::sse_decode(deserializer); + let mut var_fees = ::sse_decode(deserializer); + return crate::api::graph::ChannelUpdateInfo { + last_update: var_lastUpdate, + enabled: var_enabled, + cltv_expiry_delta: var_cltvExpiryDelta, + htlc_minimum_msat: var_htlcMinimumMsat, + htlc_maximum_msat: var_htlcMaximumMsat, + fees: var_fees, + }; + } +} + +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::LegacyCooperativeClosure; + } + 3 => { + return crate::api::types::ClosureReason::CounterpartyInitiatedCooperativeClosure; + } + 4 => { + return crate::api::types::ClosureReason::LocallyInitiatedCooperativeClosure; + } + 5 => { + return crate::api::types::ClosureReason::CommitmentTxConfirmed; + } + 6 => { + return crate::api::types::ClosureReason::FundingTimedOut; + } + 7 => { + let mut var_err = ::sse_decode(deserializer); + return crate::api::types::ClosureReason::ProcessingError { err: var_err }; + } + 8 => { + return crate::api::types::ClosureReason::DisconnectedPeer; + } + 9 => { + return crate::api::types::ClosureReason::OutdatedChannelManager; + } + 10 => { + return crate::api::types::ClosureReason::CounterpartyCoopClosedUnfundedChannel; + } + 11 => { + return crate::api::types::ClosureReason::FundingBatchClosure; + } + 12 => { + return crate::api::types::ClosureReason::HTLCsTimedOut; + } + _ => { + 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 { + let mut var_storageDirPath = ::sse_decode(deserializer); + let mut var_logDirPath = >::sse_decode(deserializer); + let mut var_network = ::sse_decode(deserializer); + let mut var_listeningAddresses = + >>::sse_decode(deserializer); + let mut var_defaultCltvExpiryDelta = ::sse_decode(deserializer); + let mut var_onchainWalletSyncIntervalSecs = ::sse_decode(deserializer); + let mut var_walletSyncIntervalSecs = ::sse_decode(deserializer); + let mut var_feeRateCacheUpdateIntervalSecs = ::sse_decode(deserializer); + let mut var_trustedPeers0Conf = + >::sse_decode(deserializer); + let mut var_probingLiquidityLimitMultiplier = ::sse_decode(deserializer); + let mut var_logLevel = ::sse_decode(deserializer); + let mut var_anchorChannelsConfig = + >::sse_decode(deserializer); + return crate::api::types::Config { + storage_dir_path: var_storageDirPath, + log_dir_path: var_logDirPath, + network: var_network, + listening_addresses: var_listeningAddresses, + default_cltv_expiry_delta: var_defaultCltvExpiryDelta, + onchain_wallet_sync_interval_secs: var_onchainWalletSyncIntervalSecs, + wallet_sync_interval_secs: var_walletSyncIntervalSecs, + fee_rate_cache_update_interval_secs: var_feeRateCacheUpdateIntervalSecs, + trusted_peers_0conf: var_trustedPeers0Conf, + probing_liquidity_limit_multiplier: var_probingLiquidityLimitMultiplier, + log_level: var_logLevel, + anchor_channels_config: var_anchorChannelsConfig, + }; + } +} + +impl SseDecode for crate::utils::error::DecodeError { + // 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 => { + return crate::utils::error::DecodeError::UnknownVersion; + } + 1 => { + return crate::utils::error::DecodeError::UnknownRequiredFeature; + } + 2 => { + return crate::utils::error::DecodeError::InvalidValue; + } + 3 => { + return crate::utils::error::DecodeError::ShortRead; + } + 4 => { + return crate::utils::error::DecodeError::BadLengthDescriptor; + } + 5 => { + let mut var_field0 = ::sse_decode(deserializer); + return crate::utils::error::DecodeError::Io(var_field0); + } + 6 => { + return crate::utils::error::DecodeError::UnsupportedCompression; + } + 7 => { + return crate::utils::error::DecodeError::DangerousValue; + } + _ => { + unimplemented!(""); + } + } + } +} + +impl SseDecode for crate::api::types::EntropySourceConfig { + // 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_field0 = ::sse_decode(deserializer); + return crate::api::types::EntropySourceConfig::SeedFile(var_field0); + } + 1 => { + let mut var_field0 = <[u8; 64]>::sse_decode(deserializer); + return crate::api::types::EntropySourceConfig::SeedBytes(var_field0); + } + 2 => { + let mut var_mnemonic = ::sse_decode(deserializer); + let mut var_passphrase = >::sse_decode(deserializer); + return crate::api::types::EntropySourceConfig::Bip39Mnemonic { + mnemonic: var_mnemonic, + passphrase: var_passphrase, + }; + } + _ => { + unimplemented!(""); + } + } + } +} + +impl SseDecode for crate::api::types::Event { + // 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_paymentId = ::sse_decode(deserializer); + let mut var_paymentHash = + ::sse_decode(deserializer); + let mut var_claimableAmountMsat = ::sse_decode(deserializer); + let mut var_claimDeadline = >::sse_decode(deserializer); + return crate::api::types::Event::PaymentClaimable { + payment_id: var_paymentId, + payment_hash: var_paymentHash, + claimable_amount_msat: var_claimableAmountMsat, + claim_deadline: var_claimDeadline, + }; + } + 1 => { + let mut var_paymentId = + >::sse_decode(deserializer); + let mut var_paymentHash = + ::sse_decode(deserializer); + let mut var_feePaidMsat = >::sse_decode(deserializer); + return crate::api::types::Event::PaymentSuccessful { + payment_id: var_paymentId, + payment_hash: var_paymentHash, + fee_paid_msat: var_feePaidMsat, + }; + } + 2 => { + let mut var_paymentId = + >::sse_decode(deserializer); + let mut var_paymentHash = + ::sse_decode(deserializer); + let mut var_reason = + >::sse_decode(deserializer); + return crate::api::types::Event::PaymentFailed { + payment_id: var_paymentId, + payment_hash: var_paymentHash, + reason: var_reason, + }; + } + 3 => { + let mut var_paymentId = + >::sse_decode(deserializer); + let mut var_paymentHash = + ::sse_decode(deserializer); + let mut var_amountMsat = ::sse_decode(deserializer); + return crate::api::types::Event::PaymentReceived { + payment_id: var_paymentId, + payment_hash: var_paymentHash, + amount_msat: var_amountMsat, + }; + } + 4 => { + 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 { + channel_id: var_channelId, + user_channel_id: var_userChannelId, + former_temporary_channel_id: var_formerTemporaryChannelId, + counterparty_node_id: var_counterpartyNodeId, + funding_txo: var_fundingTxo, + }; + } + 5 => { + let mut var_channelId = ::sse_decode(deserializer); + let mut var_userChannelId = + ::sse_decode(deserializer); + let mut var_counterpartyNodeId = + >::sse_decode(deserializer); + return crate::api::types::Event::ChannelReady { + channel_id: var_channelId, + user_channel_id: var_userChannelId, + counterparty_node_id: var_counterpartyNodeId, + }; + } + 6 => { + let mut var_channelId = ::sse_decode(deserializer); + let mut var_userChannelId = + ::sse_decode(deserializer); + let mut var_counterpartyNodeId = + >::sse_decode(deserializer); + let mut var_reason = + >::sse_decode(deserializer); + return crate::api::types::Event::ChannelClosed { + channel_id: var_channelId, + user_channel_id: var_userChannelId, + counterparty_node_id: var_counterpartyNodeId, + reason: var_reason, + }; + } + _ => { + unimplemented!(""); + } + } + } +} + +impl SseDecode for crate::api::types::GossipSourceConfig { + // 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 => { + return crate::api::types::GossipSourceConfig::P2PNetwork; + } + 1 => { + let mut var_field0 = ::sse_decode(deserializer); + return crate::api::types::GossipSourceConfig::RapidGossipSync(var_field0); + } + _ => { + unimplemented!(""); + } + } + } +} + +impl SseDecode for i32 { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + deserializer.cursor.read_i32::().unwrap() + } +} + +impl SseDecode for crate::api::bolt11::LdkBolt11Payment { + // 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::bolt11::LdkBolt11Payment { ptr: var_ptr }; + } +} + +impl SseDecode for crate::api::bolt12::LdkBolt12Payment { + // 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::bolt12::LdkBolt12Payment { ptr: var_ptr }; + } +} + +impl SseDecode for crate::utils::error::LdkBuilderError { + // 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::utils::error::LdkBuilderError::SocketAddressParseError, + 1 => crate::utils::error::LdkBuilderError::InvalidSeedBytes, + 2 => crate::utils::error::LdkBuilderError::InvalidSeedFile, + 3 => crate::utils::error::LdkBuilderError::InvalidSystemTime, + 4 => crate::utils::error::LdkBuilderError::InvalidChannelMonitor, + 5 => crate::utils::error::LdkBuilderError::InvalidListeningAddress, + 6 => crate::utils::error::LdkBuilderError::ReadFailed, + 7 => crate::utils::error::LdkBuilderError::WriteFailed, + 8 => crate::utils::error::LdkBuilderError::StoragePathAccessFailed, + 9 => crate::utils::error::LdkBuilderError::KVStoreSetupFailed, + 10 => crate::utils::error::LdkBuilderError::WalletSetupFailed, + 11 => crate::utils::error::LdkBuilderError::LoggerSetupFailed, + 12 => crate::utils::error::LdkBuilderError::InvalidPublicKey, + _ => unreachable!("Invalid variant for LdkBuilderError: {}", inner), + }; + } +} + +impl SseDecode for crate::api::builder::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 var_seedPhrase = ::sse_decode(deserializer); + return crate::api::builder::LdkMnemonic { + seed_phrase: var_seedPhrase, + }; + } +} + +impl SseDecode for crate::api::graph::LdkNetworkGraph { + // 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::graph::LdkNetworkGraph { ptr: var_ptr }; + } +} + +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_ptr = >::sse_decode(deserializer); + return crate::api::node::LdkNode { ptr: var_ptr }; + } +} + +impl SseDecode for crate::utils::error::LdkNodeError { + // 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 => { + return crate::utils::error::LdkNodeError::InvalidTxid; + } + 1 => { + return crate::utils::error::LdkNodeError::AlreadyRunning; + } + 2 => { + return crate::utils::error::LdkNodeError::NotRunning; + } + 3 => { + return crate::utils::error::LdkNodeError::OnchainTxCreationFailed; + } + 4 => { + return crate::utils::error::LdkNodeError::ConnectionFailed; + } + 5 => { + return crate::utils::error::LdkNodeError::InvoiceCreationFailed; + } + 6 => { + return crate::utils::error::LdkNodeError::PaymentSendingFailed; + } + 7 => { + return crate::utils::error::LdkNodeError::ProbeSendingFailed; + } + 8 => { + return crate::utils::error::LdkNodeError::ChannelCreationFailed; + } + 9 => { + return crate::utils::error::LdkNodeError::ChannelClosingFailed; + } + 10 => { + return crate::utils::error::LdkNodeError::ChannelConfigUpdateFailed; + } + 11 => { + return crate::utils::error::LdkNodeError::PersistenceFailed; + } + 12 => { + return crate::utils::error::LdkNodeError::WalletOperationFailed; + } + 13 => { + return crate::utils::error::LdkNodeError::OnchainTxSigningFailed; + } + 14 => { + return crate::utils::error::LdkNodeError::MessageSigningFailed; + } + 15 => { + return crate::utils::error::LdkNodeError::TxSyncFailed; + } + 16 => { + return crate::utils::error::LdkNodeError::GossipUpdateFailed; + } + 17 => { + return crate::utils::error::LdkNodeError::InvalidAddress; + } + 18 => { + return crate::utils::error::LdkNodeError::InvalidSocketAddress; + } + 19 => { + return crate::utils::error::LdkNodeError::InvalidPublicKey; + } + 20 => { + return crate::utils::error::LdkNodeError::InvalidSecretKey; + } + 21 => { + return crate::utils::error::LdkNodeError::InvalidPaymentHash; + } + 22 => { + return crate::utils::error::LdkNodeError::InvalidPaymentPreimage; + } + 23 => { + return crate::utils::error::LdkNodeError::InvalidPaymentSecret; + } + 24 => { + return crate::utils::error::LdkNodeError::InvalidAmount; + } + 25 => { + return crate::utils::error::LdkNodeError::InvalidInvoice; + } + 26 => { + return crate::utils::error::LdkNodeError::InvalidChannelId; + } + 27 => { + return crate::utils::error::LdkNodeError::InvalidNetwork; + } + 28 => { + return crate::utils::error::LdkNodeError::DuplicatePayment; + } + 29 => { + return crate::utils::error::LdkNodeError::InsufficientFunds; + } + 30 => { + return crate::utils::error::LdkNodeError::FeerateEstimationUpdateFailed; + } + 31 => { + return crate::utils::error::LdkNodeError::LiquidityRequestFailed; + } + 32 => { + return crate::utils::error::LdkNodeError::LiquiditySourceUnavailable; + } + 33 => { + return crate::utils::error::LdkNodeError::LiquidityFeeTooHigh; + } + 34 => { + return crate::utils::error::LdkNodeError::InvalidPaymentId; + } + 35 => { + let mut var_field0 = ::sse_decode(deserializer); + return crate::utils::error::LdkNodeError::Decode(var_field0); + } + 36 => { + let mut var_field0 = + ::sse_decode(deserializer); + return crate::utils::error::LdkNodeError::Bolt12Parse(var_field0); + } + 37 => { + return crate::utils::error::LdkNodeError::InvoiceRequestCreationFailed; + } + 38 => { + return crate::utils::error::LdkNodeError::OfferCreationFailed; + } + 39 => { + return crate::utils::error::LdkNodeError::RefundCreationFailed; + } + 40 => { + return crate::utils::error::LdkNodeError::FeerateEstimationUpdateTimeout; + } + 41 => { + return crate::utils::error::LdkNodeError::WalletOperationTimeout; + } + 42 => { + return crate::utils::error::LdkNodeError::TxSyncTimeout; + } + 43 => { + return crate::utils::error::LdkNodeError::GossipUpdateTimeout; + } + 44 => { + return crate::utils::error::LdkNodeError::InvalidOfferId; + } + 45 => { + return crate::utils::error::LdkNodeError::InvalidNodeId; + } + 46 => { + return crate::utils::error::LdkNodeError::InvalidOffer; + } + 47 => { + return crate::utils::error::LdkNodeError::InvalidRefund; + } + 48 => { + return crate::utils::error::LdkNodeError::UnsupportedCurrency; + } + _ => { + unimplemented!(""); + } + } + } +} + +impl SseDecode for crate::api::on_chain::LdkOnChainPayment { + // 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::on_chain::LdkOnChainPayment { ptr: var_ptr }; + } +} + +impl SseDecode for crate::api::spontaneous::LdkSpontaneousPayment { + // 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::spontaneous::LdkSpontaneousPayment { ptr: var_ptr }; + } +} + +impl SseDecode for crate::api::types::LightningBalance { + // 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!(""); + } + } + } +} + +impl SseDecode for crate::api::types::LiquiditySourceConfig { + // 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, + }; + } +} + +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 { + 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 { + 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 { + 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 { + 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 { + 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 { + 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 { + 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 { + 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 { + 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 crate::api::types::LogLevel { + // 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::LogLevel::Gossip, + 1 => crate::api::types::LogLevel::Trace, + 2 => crate::api::types::LogLevel::Debug, + 3 => crate::api::types::LogLevel::Info, + 4 => crate::api::types::LogLevel::Warn, + 5 => crate::api::types::LogLevel::Error, + _ => unreachable!("Invalid variant for LogLevel: {}", inner), + }; + } +} + +impl SseDecode for crate::api::types::LSPFeeLimits { + // 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_maxTotalOpeningFeeMsat = >::sse_decode(deserializer); + let mut var_maxProportionalOpeningFeePpmMsat = >::sse_decode(deserializer); + return crate::api::types::LSPFeeLimits { + max_total_opening_fee_msat: var_maxTotalOpeningFeeMsat, + max_proportional_opening_fee_ppm_msat: var_maxProportionalOpeningFeePpmMsat, + }; + } +} + +impl SseDecode for crate::api::types::MaxDustHTLCExposure { + // 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_field0 = ::sse_decode(deserializer); + return crate::api::types::MaxDustHTLCExposure::FixedLimitMsat(var_field0); + } + 1 => { + let mut var_field0 = ::sse_decode(deserializer); + return crate::api::types::MaxDustHTLCExposure::FeeRateMultiplier(var_field0); + } + _ => { + unimplemented!(""); + } + } + } +} + +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 { + let mut inner = ::sse_decode(deserializer); + return match inner { + 0 => crate::api::types::Network::Bitcoin, + 1 => crate::api::types::Network::Testnet, + 2 => crate::api::types::Network::Signet, + 3 => crate::api::types::Network::Regtest, + _ => unreachable!("Invalid variant for Network: {}", inner), + }; + } +} + +impl SseDecode for crate::api::graph::NodeAnnouncementInfo { + // 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_lastUpdate = ::sse_decode(deserializer); + let mut var_alias = ::sse_decode(deserializer); + let mut var_addresses = >::sse_decode(deserializer); + return crate::api::graph::NodeAnnouncementInfo { + last_update: var_lastUpdate, + alias: var_alias, + addresses: var_addresses, + }; + } +} + +impl SseDecode for crate::api::graph::NodeId { + // 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_compressed = >::sse_decode(deserializer); + return crate::api::graph::NodeId { + compressed: var_compressed, + }; + } +} + +impl SseDecode for crate::api::graph::NodeInfo { + // 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_channels = >::sse_decode(deserializer); + let mut var_announcementInfo = + >::sse_decode(deserializer); + return crate::api::graph::NodeInfo { + channels: var_channels, + announcement_info: var_announcementInfo, + }; + } +} + +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, + }; + } +} + +impl SseDecode for crate::api::bolt12::Offer { + // 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_s = ::sse_decode(deserializer); + return crate::api::bolt12::Offer { s: var_s }; + } +} + +impl SseDecode for crate::api::types::OfferId { + // 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 = <[u8; 32]>::sse_decode(deserializer); + return crate::api::types::OfferId(var_field0); + } +} + +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 { + 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 { + 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 { + 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 { + 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 { + 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 { + 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 { + 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 { + 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 crate::api::types::OutPoint { + // 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_txid = ::sse_decode(deserializer); + let mut var_vout = ::sse_decode(deserializer); + return crate::api::types::OutPoint { + txid: var_txid, + vout: var_vout, + }; + } +} + +impl SseDecode for crate::api::types::PaymentDetails { + // 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_id = ::sse_decode(deserializer); + let mut var_kind = ::sse_decode(deserializer); + let mut var_amountMsat = >::sse_decode(deserializer); + let mut var_direction = ::sse_decode(deserializer); + let mut var_status = ::sse_decode(deserializer); + return crate::api::types::PaymentDetails { + id: var_id, + kind: var_kind, + amount_msat: var_amountMsat, + direction: var_direction, + status: var_status, + }; + } +} + +impl SseDecode for crate::api::types::PaymentDirection { + // 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::PaymentDirection::Inbound, + 1 => crate::api::types::PaymentDirection::Outbound, + _ => unreachable!("Invalid variant for PaymentDirection: {}", inner), + }; + } +} + +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 { + let mut var_data = <[u8; 32]>::sse_decode(deserializer); + return crate::api::types::PaymentHash { data: var_data }; + } +} + +impl SseDecode for crate::api::types::PaymentId { + // 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 = <[u8; 32]>::sse_decode(deserializer); + return crate::api::types::PaymentId(var_field0); + } +} + +impl SseDecode for crate::api::types::PaymentKind { + // 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 => { + return crate::api::types::PaymentKind::Onchain; + } + 1 => { + let mut var_hash = ::sse_decode(deserializer); + let mut var_preimage = + >::sse_decode(deserializer); + let mut var_secret = + >::sse_decode(deserializer); + return crate::api::types::PaymentKind::Bolt11 { + hash: var_hash, + preimage: var_preimage, + secret: var_secret, + }; + } + 2 => { + let mut var_hash = ::sse_decode(deserializer); + let mut var_preimage = + >::sse_decode(deserializer); + let mut var_secret = + >::sse_decode(deserializer); + let mut var_lspFeeLimits = + ::sse_decode(deserializer); + return crate::api::types::PaymentKind::Bolt11Jit { + hash: var_hash, + preimage: var_preimage, + secret: var_secret, + lsp_fee_limits: var_lspFeeLimits, + }; + } + 3 => { + let mut var_hash = ::sse_decode(deserializer); + let mut var_preimage = + >::sse_decode(deserializer); + return crate::api::types::PaymentKind::Spontaneous { + hash: var_hash, + preimage: var_preimage, + }; + } + 4 => { + let mut var_hash = + >::sse_decode(deserializer); + let mut var_preimage = + >::sse_decode(deserializer); + let mut var_secret = + >::sse_decode(deserializer); + let mut var_offerId = ::sse_decode(deserializer); + return crate::api::types::PaymentKind::Bolt12Offer { + hash: var_hash, + preimage: var_preimage, + secret: var_secret, + offer_id: var_offerId, + }; + } + 5 => { + let mut var_hash = + >::sse_decode(deserializer); + let mut var_preimage = + >::sse_decode(deserializer); + let mut var_secret = + >::sse_decode(deserializer); + return crate::api::types::PaymentKind::Bolt12Refund { + hash: var_hash, + preimage: var_preimage, + secret: var_secret, + }; + } + _ => { + unimplemented!(""); + } + } + } +} + +impl SseDecode for crate::api::types::PaymentPreimage { + // 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 = <[u8; 32]>::sse_decode(deserializer); + return crate::api::types::PaymentPreimage { data: var_data }; + } +} + +impl SseDecode for crate::api::types::PaymentSecret { + // 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 = <[u8; 32]>::sse_decode(deserializer); + return crate::api::types::PaymentSecret { data: var_data }; + } +} + +impl SseDecode for crate::api::types::PaymentStatus { + // 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::PaymentStatus::Pending, + 1 => crate::api::types::PaymentStatus::Succeeded, + 2 => crate::api::types::PaymentStatus::Failed, + _ => unreachable!("Invalid variant for PaymentStatus: {}", inner), + }; + } +} + +impl SseDecode for crate::api::types::PeerDetails { + // 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_nodeId = ::sse_decode(deserializer); + let mut var_address = ::sse_decode(deserializer); + let mut var_isConnected = ::sse_decode(deserializer); + return crate::api::types::PeerDetails { + node_id: var_nodeId, + address: var_address, + is_connected: var_isConnected, + }; + } +} + +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_hex = ::sse_decode(deserializer); + return crate::api::types::PublicKey { hex: var_hex }; + } +} + +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); + } +} + +impl SseDecode for crate::api::bolt12::Refund { + // 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_s = ::sse_decode(deserializer); + return crate::api::bolt12::Refund { s: var_s }; + } +} + +impl SseDecode for crate::api::graph::RoutingFees { + // 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_baseMsat = ::sse_decode(deserializer); + let mut var_proportionalMillionths = ::sse_decode(deserializer); + return crate::api::graph::RoutingFees { + base_msat: var_baseMsat, + proportional_millionths: var_proportionalMillionths, + }; + } +} + +impl SseDecode for crate::api::types::SocketAddress { + // 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_addr = <[u8; 4]>::sse_decode(deserializer); + let mut var_port = ::sse_decode(deserializer); + return crate::api::types::SocketAddress::TcpIpV4 { + addr: var_addr, + port: var_port, + }; + } + 1 => { + let mut var_addr = <[u8; 16]>::sse_decode(deserializer); + let mut var_port = ::sse_decode(deserializer); + return crate::api::types::SocketAddress::TcpIpV6 { + addr: var_addr, + port: var_port, + }; + } + 2 => { + let mut var_field0 = <[u8; 12]>::sse_decode(deserializer); + return crate::api::types::SocketAddress::OnionV2(var_field0); + } + 3 => { + let mut var_ed25519Pubkey = <[u8; 32]>::sse_decode(deserializer); + let mut var_checksum = ::sse_decode(deserializer); + let mut var_version = ::sse_decode(deserializer); + let mut var_port = ::sse_decode(deserializer); + return crate::api::types::SocketAddress::OnionV3 { + ed25519_pubkey: var_ed25519Pubkey, + checksum: var_checksum, + version: var_version, + port: var_port, + }; + } + 4 => { + let mut var_addr = ::sse_decode(deserializer); + let mut var_port = ::sse_decode(deserializer); + return crate::api::types::SocketAddress::Hostname { + addr: var_addr, + port: var_port, + }; + } + _ => { + unimplemented!(""); + } + } + } +} + +impl SseDecode for crate::api::types::Txid { + // 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_hash = ::sse_decode(deserializer); + return crate::api::types::Txid { hash: var_hash }; + } +} + +impl SseDecode for u16 { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + deserializer.cursor.read_u16::().unwrap() + } +} + +impl SseDecode for u32 { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + deserializer.cursor.read_u32::().unwrap() + } +} + +impl SseDecode for u64 { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + deserializer.cursor.read_u64::().unwrap() + } +} + +impl SseDecode for u8 { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + deserializer.cursor.read_u8().unwrap() + } +} + +impl SseDecode for [u8; 12] { + // 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 flutter_rust_bridge::for_generated::from_vec_to_array(inner); + } +} + +impl SseDecode for [u8; 16] { + // 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 flutter_rust_bridge::for_generated::from_vec_to_array(inner); + } +} + +impl SseDecode for [u8; 32] { + // 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 flutter_rust_bridge::for_generated::from_vec_to_array(inner); + } +} + +impl SseDecode for [u8; 4] { + // 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 flutter_rust_bridge::for_generated::from_vec_to_array(inner); + } +} + +impl SseDecode for [u8; 64] { + // 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 flutter_rust_bridge::for_generated::from_vec_to_array(inner); + } +} + +impl SseDecode for () { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {} +} + +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); + return crate::api::types::UserChannelId { data: var_data }; + } +} + +impl SseDecode for usize { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + deserializer.cursor.read_u64::().unwrap() as _ + } +} + +fn pde_ffi_dispatcher_primary_impl( + func_id: i32, + port: flutter_rust_bridge::for_generated::MessagePort, + ptr: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, + rust_vec_len: i32, + data_len: i32, +) { + // Codec=Pde (Serialization + dispatch), see doc to use other codecs + match func_id { + _ => unreachable!(), + } +} + +fn pde_ffi_dispatcher_sync_impl( + func_id: i32, + ptr: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, + rust_vec_len: i32, + data_len: i32, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartSse { + // Codec=Pde (Serialization + dispatch), see doc to use other codecs + match func_id { + _ => unreachable!(), + } +} + +// Section: rust2dart + +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for FrbWrapper { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self.0) + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for FrbWrapper {} + +impl flutter_rust_bridge::IntoIntoDart> for NodeBuilder { + fn into_into_dart(self) -> FrbWrapper { + self.into() + } +} + +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::Address { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.s.into_into_dart().into_dart()].into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::Address {} +impl flutter_rust_bridge::IntoIntoDart for crate::api::types::Address { + fn into_into_dart(self) -> crate::api::types::Address { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::AnchorChannelsConfig { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [ + self.trusted_peers_no_reserve.into_into_dart().into_dart(), + self.per_channel_reserve_sats.into_into_dart().into_dart(), + ] + .into_dart() } } -impl CstDecode for i32 { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::PaymentStatus { - match self { - 0 => crate::api::types::PaymentStatus::Pending, - 1 => crate::api::types::PaymentStatus::Succeeded, - 2 => crate::api::types::PaymentStatus::Failed, - _ => unreachable!("Invalid variant for PaymentStatus: {}", self), - } - } +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::AnchorChannelsConfig +{ } -impl CstDecode for u16 { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> u16 { +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::AnchorChannelsConfig +{ + fn into_into_dart(self) -> crate::api::types::AnchorChannelsConfig { self } } -impl CstDecode for u32 { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> u32 { - self +// 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 CstDecode for u64 { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> u64 { +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 } } -impl CstDecode for u8 { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> u8 { - 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 CstDecode for usize { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> usize { +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 } } -impl SseDecode for RustOpaqueNom> { - // 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 unsafe { decode_rust_opaque_nom(inner) }; +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::bolt11::Bolt11Invoice { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.signed_raw_invoice.into_into_dart().into_dart()].into_dart() } } - -impl SseDecode for String { - // 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 String::from_utf8(inner).unwrap(); +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::bolt11::Bolt11Invoice +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::bolt11::Bolt11Invoice +{ + fn into_into_dart(self) -> crate::api::bolt11::Bolt11Invoice { + self } } - -impl SseDecode for crate::api::types::Address { - // 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_s = ::sse_decode(deserializer); - return crate::api::types::Address { s: var_s }; +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::bolt12::Bolt12Invoice { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.data.into_into_dart().into_dart()].into_dart() } } - -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 { - let mut var_signedRawInvoice = ::sse_decode(deserializer); - return crate::api::types::Bolt11Invoice { - signed_raw_invoice: var_signedRawInvoice, - }; +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::bolt12::Bolt12Invoice +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::bolt12::Bolt12Invoice +{ + fn into_into_dart(self) -> crate::api::bolt12::Bolt12Invoice { + self } } - -impl SseDecode for bool { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - deserializer.cursor.read_u8().unwrap() != 0 +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::utils::error::Bolt12ParseError { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + match self { + crate::utils::error::Bolt12ParseError::InvalidContinuation => { + [0.into_dart()].into_dart() + } + crate::utils::error::Bolt12ParseError::InvalidBech32Hrp => [1.into_dart()].into_dart(), + crate::utils::error::Bolt12ParseError::Bech32(field0) => { + [2.into_dart(), field0.into_into_dart().into_dart()].into_dart() + } + crate::utils::error::Bolt12ParseError::Decode(field0) => { + [3.into_dart(), field0.into_into_dart().into_dart()].into_dart() + } + crate::utils::error::Bolt12ParseError::InvalidSemantics(field0) => { + [4.into_dart(), field0.into_into_dart().into_dart()].into_dart() + } + crate::utils::error::Bolt12ParseError::InvalidSignature(field0) => { + [5.into_dart(), field0.into_into_dart().into_dart()].into_dart() + } + _ => { + unimplemented!(""); + } + } } } - -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::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), - }; +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::utils::error::Bolt12ParseError +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::utils::error::Bolt12ParseError +{ + fn into_into_dart(self) -> crate::utils::error::Bolt12ParseError { + self } } - -impl SseDecode for crate::api::types::ChainDataSourceConfig { - // 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_field0 = ::sse_decode(deserializer); - return crate::api::types::ChainDataSourceConfig::Esplora(var_field0); +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::ChainDataSourceConfig { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + match self { + crate::api::types::ChainDataSourceConfig::Esplora(field0) => { + [0.into_dart(), field0.into_into_dart().into_dart()].into_dart() } _ => { unimplemented!(""); @@ -1190,726 +4124,863 @@ impl SseDecode for crate::api::types::ChainDataSourceConfig { } } } - -impl SseDecode for crate::api::types::ChannelConfig { - // 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_forwardingFeeProportionalMillionths = ::sse_decode(deserializer); - let mut var_forwardingFeeBaseMsat = ::sse_decode(deserializer); - let mut var_cltvExpiryDelta = ::sse_decode(deserializer); - let mut var_maxDustHtlcExposure = - ::sse_decode(deserializer); - let mut var_forceCloseAvoidanceMaxFeeSatoshis = ::sse_decode(deserializer); - let mut var_acceptUnderpayingHtlcs = ::sse_decode(deserializer); - return crate::api::types::ChannelConfig { - forwarding_fee_proportional_millionths: var_forwardingFeeProportionalMillionths, - forwarding_fee_base_msat: var_forwardingFeeBaseMsat, - cltv_expiry_delta: var_cltvExpiryDelta, - max_dust_htlc_exposure: var_maxDustHtlcExposure, - force_close_avoidance_max_fee_satoshis: var_forceCloseAvoidanceMaxFeeSatoshis, - accept_underpaying_htlcs: var_acceptUnderpayingHtlcs, - }; +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::ChainDataSourceConfig +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::ChainDataSourceConfig +{ + fn into_into_dart(self) -> crate::api::types::ChainDataSourceConfig { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::ChannelConfig { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [ + self.forwarding_fee_proportional_millionths + .into_into_dart() + .into_dart(), + self.forwarding_fee_base_msat.into_into_dart().into_dart(), + self.cltv_expiry_delta.into_into_dart().into_dart(), + self.max_dust_htlc_exposure.into_into_dart().into_dart(), + self.force_close_avoidance_max_fee_satoshis + .into_into_dart() + .into_dart(), + self.accept_underpaying_htlcs.into_into_dart().into_dart(), + ] + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::ChannelConfig +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::ChannelConfig +{ + fn into_into_dart(self) -> crate::api::types::ChannelConfig { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::ChannelDetails { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [ + self.channel_id.into_into_dart().into_dart(), + self.counterparty_node_id.into_into_dart().into_dart(), + self.funding_txo.into_into_dart().into_dart(), + self.channel_value_sats.into_into_dart().into_dart(), + self.unspendable_punishment_reserve + .into_into_dart() + .into_dart(), + self.user_channel_id.into_into_dart().into_dart(), + self.feerate_sat_per_1000_weight + .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(), + self.confirmations.into_into_dart().into_dart(), + self.is_outbound.into_into_dart().into_dart(), + 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() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::ChannelDetails +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::ChannelDetails +{ + fn into_into_dart(self) -> crate::api::types::ChannelDetails { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::ChannelId { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.data.into_into_dart().into_dart()].into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::ChannelId {} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::ChannelId +{ + fn into_into_dart(self) -> crate::api::types::ChannelId { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::graph::ChannelInfo { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [ + self.node_one.into_into_dart().into_dart(), + self.one_to_two.into_into_dart().into_dart(), + self.node_two.into_into_dart().into_dart(), + self.two_to_one.into_into_dart().into_dart(), + self.capacity_sats.into_into_dart().into_dart(), + ] + .into_dart() } } - -impl SseDecode for crate::api::types::ChannelDetails { - // 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_channelId = ::sse_decode(deserializer); - let mut var_counterpartyNodeId = ::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); - let mut var_confirmations = >::sse_decode(deserializer); - let mut var_isOutbound = ::sse_decode(deserializer); - let mut var_isChannelReady = ::sse_decode(deserializer); - let mut var_isUsable = ::sse_decode(deserializer); - let mut var_isPublic = ::sse_decode(deserializer); - return crate::api::types::ChannelDetails { - channel_id: var_channelId, - counterparty_node_id: var_counterpartyNodeId, - funding_txo: var_fundingTxo, - channel_value_sats: var_channelValueSats, - 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, - confirmations: var_confirmations, - is_outbound: var_isOutbound, - is_channel_ready: var_isChannelReady, - is_usable: var_isUsable, - is_public: var_isPublic, - }; - } +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::graph::ChannelInfo +{ } - -impl SseDecode for crate::api::types::ChannelId { - // 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 = <[u8; 32]>::sse_decode(deserializer); - return crate::api::types::ChannelId { data: var_data }; +impl flutter_rust_bridge::IntoIntoDart + for crate::api::graph::ChannelInfo +{ + fn into_into_dart(self) -> crate::api::graph::ChannelInfo { + self } } - -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 { - let mut var_storageDirPath = ::sse_decode(deserializer); - let mut var_logDirPath = >::sse_decode(deserializer); - let mut var_network = ::sse_decode(deserializer); - let mut var_listeningAddresses = - >>::sse_decode(deserializer); - let mut var_defaultCltvExpiryDelta = ::sse_decode(deserializer); - let mut var_onchainWalletSyncIntervalSecs = ::sse_decode(deserializer); - let mut var_walletSyncIntervalSecs = ::sse_decode(deserializer); - let mut var_feeRateCacheUpdateIntervalSecs = ::sse_decode(deserializer); - let mut var_trustedPeers0Conf = - >::sse_decode(deserializer); - let mut var_probingLiquidityLimitMultiplier = ::sse_decode(deserializer); - let mut var_logLevel = ::sse_decode(deserializer); - return crate::api::types::Config { - storage_dir_path: var_storageDirPath, - log_dir_path: var_logDirPath, - network: var_network, - listening_addresses: var_listeningAddresses, - default_cltv_expiry_delta: var_defaultCltvExpiryDelta, - onchain_wallet_sync_interval_secs: var_onchainWalletSyncIntervalSecs, - wallet_sync_interval_secs: var_walletSyncIntervalSecs, - fee_rate_cache_update_interval_secs: var_feeRateCacheUpdateIntervalSecs, - trusted_peers_0conf: var_trustedPeers0Conf, - probing_liquidity_limit_multiplier: var_probingLiquidityLimitMultiplier, - log_level: var_logLevel, - }; +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::graph::ChannelUpdateInfo { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [ + self.last_update.into_into_dart().into_dart(), + self.enabled.into_into_dart().into_dart(), + self.cltv_expiry_delta.into_into_dart().into_dart(), + self.htlc_minimum_msat.into_into_dart().into_dart(), + self.htlc_maximum_msat.into_into_dart().into_dart(), + self.fees.into_into_dart().into_dart(), + ] + .into_dart() } } - -impl SseDecode for crate::api::types::EntropySourceConfig { - // 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_field0 = ::sse_decode(deserializer); - return crate::api::types::EntropySourceConfig::SeedFile(var_field0); - } - 1 => { - let mut var_field0 = <[u8; 64]>::sse_decode(deserializer); - return crate::api::types::EntropySourceConfig::SeedBytes(var_field0); - } - 2 => { - let mut var_mnemonic = ::sse_decode(deserializer); - let mut var_passphrase = >::sse_decode(deserializer); - return crate::api::types::EntropySourceConfig::Bip39Mnemonic { - mnemonic: var_mnemonic, - passphrase: var_passphrase, - }; - } - _ => { - unimplemented!(""); - } - } +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::graph::ChannelUpdateInfo +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::graph::ChannelUpdateInfo +{ + fn into_into_dart(self) -> crate::api::graph::ChannelUpdateInfo { + self } } - -impl SseDecode for crate::api::types::Event { - // 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_paymentHash = - ::sse_decode(deserializer); - return crate::api::types::Event::PaymentSuccessful { - payment_hash: var_paymentHash, - }; +// 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() } - 1 => { - let mut var_paymentHash = - ::sse_decode(deserializer); - return crate::api::types::Event::PaymentFailed { - payment_hash: var_paymentHash, - }; + crate::api::types::ClosureReason::HolderForceClosed => [1.into_dart()].into_dart(), + crate::api::types::ClosureReason::LegacyCooperativeClosure => { + [2.into_dart()].into_dart() } - 2 => { - let mut var_paymentHash = - ::sse_decode(deserializer); - let mut var_amountMsat = ::sse_decode(deserializer); - return crate::api::types::Event::PaymentReceived { - payment_hash: var_paymentHash, - amount_msat: var_amountMsat, - }; + crate::api::types::ClosureReason::CounterpartyInitiatedCooperativeClosure => { + [3.into_dart()].into_dart() } - 3 => { - let mut var_channelId = ::sse_decode(deserializer); - let mut var_userChannelId = - ::sse_decode(deserializer); - let mut var_counterpartyNodeId = - >::sse_decode(deserializer); - return crate::api::types::Event::ChannelReady { - channel_id: var_channelId, - user_channel_id: var_userChannelId, - counterparty_node_id: var_counterpartyNodeId, - }; + crate::api::types::ClosureReason::LocallyInitiatedCooperativeClosure => { + [4.into_dart()].into_dart() } - 4 => { - let mut var_channelId = ::sse_decode(deserializer); - let mut var_userChannelId = - ::sse_decode(deserializer); - let mut var_counterpartyNodeId = - >::sse_decode(deserializer); - return crate::api::types::Event::ChannelClosed { - channel_id: var_channelId, - user_channel_id: var_userChannelId, - counterparty_node_id: var_counterpartyNodeId, - }; + crate::api::types::ClosureReason::CommitmentTxConfirmed => [5.into_dart()].into_dart(), + crate::api::types::ClosureReason::FundingTimedOut => [6.into_dart()].into_dart(), + crate::api::types::ClosureReason::ProcessingError { err } => { + [7.into_dart(), err.into_into_dart().into_dart()].into_dart() } - 5 => { - 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 { - channel_id: var_channelId, - user_channel_id: var_userChannelId, - former_temporary_channel_id: var_formerTemporaryChannelId, - counterparty_node_id: var_counterpartyNodeId, - funding_txo: var_fundingTxo, - }; + crate::api::types::ClosureReason::DisconnectedPeer => [8.into_dart()].into_dart(), + crate::api::types::ClosureReason::OutdatedChannelManager => [9.into_dart()].into_dart(), + crate::api::types::ClosureReason::CounterpartyCoopClosedUnfundedChannel => { + [10.into_dart()].into_dart() } + crate::api::types::ClosureReason::FundingBatchClosure => [11.into_dart()].into_dart(), + crate::api::types::ClosureReason::HTLCsTimedOut => [12.into_dart()].into_dart(), _ => { unimplemented!(""); } } } } - -impl SseDecode for crate::api::types::GossipSourceConfig { - // 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 => { - return crate::api::types::GossipSourceConfig::P2PNetwork; - } - 1 => { - let mut var_field0 = ::sse_decode(deserializer); - return crate::api::types::GossipSourceConfig::RapidGossipSync(var_field0); +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 { + [ + self.storage_dir_path.into_into_dart().into_dart(), + self.log_dir_path.into_into_dart().into_dart(), + self.network.into_into_dart().into_dart(), + self.listening_addresses.into_into_dart().into_dart(), + self.default_cltv_expiry_delta.into_into_dart().into_dart(), + self.onchain_wallet_sync_interval_secs + .into_into_dart() + .into_dart(), + self.wallet_sync_interval_secs.into_into_dart().into_dart(), + self.fee_rate_cache_update_interval_secs + .into_into_dart() + .into_dart(), + self.trusted_peers_0conf.into_into_dart().into_dart(), + self.probing_liquidity_limit_multiplier + .into_into_dart() + .into_dart(), + self.log_level.into_into_dart().into_dart(), + self.anchor_channels_config.into_into_dart().into_dart(), + ] + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::Config {} +impl flutter_rust_bridge::IntoIntoDart for crate::api::types::Config { + fn into_into_dart(self) -> crate::api::types::Config { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::utils::error::DecodeError { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + match self { + crate::utils::error::DecodeError::UnknownVersion => [0.into_dart()].into_dart(), + crate::utils::error::DecodeError::UnknownRequiredFeature => [1.into_dart()].into_dart(), + crate::utils::error::DecodeError::InvalidValue => [2.into_dart()].into_dart(), + crate::utils::error::DecodeError::ShortRead => [3.into_dart()].into_dart(), + crate::utils::error::DecodeError::BadLengthDescriptor => [4.into_dart()].into_dart(), + crate::utils::error::DecodeError::Io(field0) => { + [5.into_dart(), field0.into_into_dart().into_dart()].into_dart() } + crate::utils::error::DecodeError::UnsupportedCompression => [6.into_dart()].into_dart(), + crate::utils::error::DecodeError::DangerousValue => [7.into_dart()].into_dart(), _ => { unimplemented!(""); } } } } - -impl SseDecode for i32 { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - deserializer.cursor.read_i32::().unwrap() +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::utils::error::DecodeError +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::utils::error::DecodeError +{ + fn into_into_dart(self) -> crate::utils::error::DecodeError { + self } } - -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 var_seedPhrase = ::sse_decode(deserializer); - return crate::api::node::LdkMnemonic { - seed_phrase: var_seedPhrase, - }; +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::EntropySourceConfig { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + match self { + crate::api::types::EntropySourceConfig::SeedFile(field0) => { + [0.into_dart(), field0.into_into_dart().into_dart()].into_dart() + } + crate::api::types::EntropySourceConfig::SeedBytes(field0) => { + [1.into_dart(), field0.into_into_dart().into_dart()].into_dart() + } + crate::api::types::EntropySourceConfig::Bip39Mnemonic { + mnemonic, + passphrase, + } => [ + 2.into_dart(), + mnemonic.into_into_dart().into_dart(), + passphrase.into_into_dart().into_dart(), + ] + .into_dart(), + _ => { + unimplemented!(""); + } + } } } - -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_ptr = >>::sse_decode(deserializer); - return crate::api::node::LdkNode { ptr: var_ptr }; +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::EntropySourceConfig +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::EntropySourceConfig +{ + fn into_into_dart(self) -> crate::api::types::EntropySourceConfig { + self } } - -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, - )); +// Codec=Dco (DartCObject based), see doc to use other codecs +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::PaymentClaimable { + payment_id, + payment_hash, + claimable_amount_msat, + claim_deadline, + } => [ + 0.into_dart(), + payment_id.into_into_dart().into_dart(), + payment_hash.into_into_dart().into_dart(), + claimable_amount_msat.into_into_dart().into_dart(), + claim_deadline.into_into_dart().into_dart(), + ] + .into_dart(), + crate::api::types::Event::PaymentSuccessful { + payment_id, + payment_hash, + fee_paid_msat, + } => [ + 1.into_dart(), + payment_id.into_into_dart().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_id, + payment_hash, + reason, + } => [ + 2.into_dart(), + payment_id.into_into_dart().into_dart(), + payment_hash.into_into_dart().into_dart(), + reason.into_into_dart().into_dart(), + ] + .into_dart(), + crate::api::types::Event::PaymentReceived { + payment_id, + payment_hash, + amount_msat, + } => [ + 3.into_dart(), + payment_id.into_into_dart().into_dart(), + payment_hash.into_into_dart().into_dart(), + amount_msat.into_into_dart().into_dart(), + ] + .into_dart(), + crate::api::types::Event::ChannelPending { + channel_id, + user_channel_id, + former_temporary_channel_id, + counterparty_node_id, + funding_txo, + } => [ + 4.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 { + channel_id, + user_channel_id, + counterparty_node_id, + } => [ + 5.into_dart(), + channel_id.into_into_dart().into_dart(), + user_channel_id.into_into_dart().into_dart(), + counterparty_node_id.into_into_dart().into_dart(), + ] + .into_dart(), + crate::api::types::Event::ChannelClosed { + channel_id, + user_channel_id, + counterparty_node_id, + reason, + } => [ + 6.into_dart(), + channel_id.into_into_dart().into_dart(), + user_channel_id.into_into_dart().into_dart(), + counterparty_node_id.into_into_dart().into_dart(), + reason.into_into_dart().into_dart(), + ] + .into_dart(), + _ => { + unimplemented!(""); + } } - 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 { - let mut len_ = ::sse_decode(deserializer); - let mut ans_ = vec![]; - for idx_ in 0..len_ { - ans_.push(::sse_decode( - deserializer, - )); - } - return ans_; +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::Event {} +impl flutter_rust_bridge::IntoIntoDart for crate::api::types::Event { + fn into_into_dart(self) -> crate::api::types::Event { + self } } - -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)); +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::GossipSourceConfig { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + match self { + crate::api::types::GossipSourceConfig::P2PNetwork => [0.into_dart()].into_dart(), + crate::api::types::GossipSourceConfig::RapidGossipSync(field0) => { + [1.into_dart(), field0.into_into_dart().into_dart()].into_dart() + } + _ => { + unimplemented!(""); + } } - 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 { - let mut len_ = ::sse_decode(deserializer); - let mut ans_ = vec![]; - for idx_ in 0..len_ { - ans_.push(::sse_decode(deserializer)); - } - return ans_; +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::GossipSourceConfig +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::GossipSourceConfig +{ + fn into_into_dart(self) -> crate::api::types::GossipSourceConfig { + self } } - -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_; +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::bolt11::LdkBolt11Payment { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.ptr.into_into_dart().into_dart()].into_dart() } } - -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 flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::bolt11::LdkBolt11Payment +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::bolt11::LdkBolt11Payment +{ + fn into_into_dart(self) -> crate::api::bolt11::LdkBolt11Payment { + self } } - -impl SseDecode for crate::api::types::LogLevel { - // 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::LogLevel::Gossip, - 1 => crate::api::types::LogLevel::Trace, - 2 => crate::api::types::LogLevel::Debug, - 3 => crate::api::types::LogLevel::Info, - 4 => crate::api::types::LogLevel::Warn, - 5 => crate::api::types::LogLevel::Error, - _ => unreachable!("Invalid variant for LogLevel: {}", inner), - }; +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::bolt12::LdkBolt12Payment { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.ptr.into_into_dart().into_dart()].into_dart() } } - -impl SseDecode for crate::api::types::MaxDustHTLCExposure { - // 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_field0 = ::sse_decode(deserializer); - return crate::api::types::MaxDustHTLCExposure::FixedLimitMsat(var_field0); - } - 1 => { - let mut var_field0 = ::sse_decode(deserializer); - return crate::api::types::MaxDustHTLCExposure::FeeRateMultiplier(var_field0); - } - _ => { - unimplemented!(""); - } +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::bolt12::LdkBolt12Payment +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::bolt12::LdkBolt12Payment +{ + fn into_into_dart(self) -> crate::api::bolt12::LdkBolt12Payment { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::utils::error::LdkBuilderError { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + match self { + Self::SocketAddressParseError => 0.into_dart(), + Self::InvalidSeedBytes => 1.into_dart(), + Self::InvalidSeedFile => 2.into_dart(), + Self::InvalidSystemTime => 3.into_dart(), + Self::InvalidChannelMonitor => 4.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::InvalidPublicKey => 12.into_dart(), + _ => unreachable!(), } } } - -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 { - let mut inner = ::sse_decode(deserializer); - return match inner { - 0 => crate::api::types::Network::Bitcoin, - 1 => crate::api::types::Network::Testnet, - 2 => crate::api::types::Network::Signet, - 3 => crate::api::types::Network::Regtest, - _ => unreachable!("Invalid variant for Network: {}", inner), - }; +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::utils::error::LdkBuilderError +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::utils::error::LdkBuilderError +{ + fn into_into_dart(self) -> crate::utils::error::LdkBuilderError { + self } } - -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::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), - }; +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::builder::LdkMnemonic { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.seed_phrase.into_into_dart().into_dart()].into_dart() } } - -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 flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::builder::LdkMnemonic +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::builder::LdkMnemonic +{ + fn into_into_dart(self) -> crate::api::builder::LdkMnemonic { + self } } - -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; - } +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::graph::LdkNetworkGraph { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.ptr.into_into_dart().into_dart()].into_dart() } } - -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 flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::graph::LdkNetworkGraph +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::graph::LdkNetworkGraph +{ + fn into_into_dart(self) -> crate::api::graph::LdkNetworkGraph { + self } } - -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; - } +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::node::LdkNode { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.ptr.into_into_dart().into_dart()].into_dart() } } - -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 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 } } - -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; +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::utils::error::LdkNodeError { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + match self { + crate::utils::error::LdkNodeError::InvalidTxid => [0.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::AlreadyRunning => [1.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::NotRunning => [2.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::OnchainTxCreationFailed => { + [3.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::ConnectionFailed => [4.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvoiceCreationFailed => [5.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::PaymentSendingFailed => [6.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::ProbeSendingFailed => [7.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::ChannelCreationFailed => [8.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::ChannelClosingFailed => [9.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::ChannelConfigUpdateFailed => { + [10.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::PersistenceFailed => [11.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::WalletOperationFailed => { + [12.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::OnchainTxSigningFailed => { + [13.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::MessageSigningFailed => [14.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::TxSyncFailed => [15.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::GossipUpdateFailed => [16.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidAddress => [17.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidSocketAddress => [18.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidPublicKey => [19.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidSecretKey => [20.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidPaymentHash => [21.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidPaymentPreimage => { + [22.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::InvalidPaymentSecret => [23.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidAmount => [24.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidInvoice => [25.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidChannelId => [26.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidNetwork => [27.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::DuplicatePayment => [28.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InsufficientFunds => [29.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::FeerateEstimationUpdateFailed => { + [30.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::LiquidityRequestFailed => { + [31.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::LiquiditySourceUnavailable => { + [32.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::LiquidityFeeTooHigh => [33.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidPaymentId => [34.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::Decode(field0) => { + [35.into_dart(), field0.into_into_dart().into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::Bolt12Parse(field0) => { + [36.into_dart(), field0.into_into_dart().into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::InvoiceRequestCreationFailed => { + [37.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::OfferCreationFailed => [38.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::RefundCreationFailed => [39.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::FeerateEstimationUpdateTimeout => { + [40.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::WalletOperationTimeout => { + [41.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::TxSyncTimeout => [42.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::GossipUpdateTimeout => [43.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidOfferId => [44.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidNodeId => [45.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidOffer => [46.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidRefund => [47.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::UnsupportedCurrency => [48.into_dart()].into_dart(), + _ => { + unimplemented!(""); + } } } } - -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 flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::utils::error::LdkNodeError +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::utils::error::LdkNodeError +{ + fn into_into_dart(self) -> crate::utils::error::LdkNodeError { + self } } - -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; - } +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::on_chain::LdkOnChainPayment { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.ptr.into_into_dart().into_dart()].into_dart() } } - -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 flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::on_chain::LdkOnChainPayment +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::on_chain::LdkOnChainPayment +{ + fn into_into_dart(self) -> crate::api::on_chain::LdkOnChainPayment { + self } } - -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; - } +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::spontaneous::LdkSpontaneousPayment { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.ptr.into_into_dart().into_dart()].into_dart() } } - -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 flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::spontaneous::LdkSpontaneousPayment +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::spontaneous::LdkSpontaneousPayment +{ + fn into_into_dart(self) -> crate::api::spontaneous::LdkSpontaneousPayment { + self } } - -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; +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::LightningBalance { + 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(), + _ => { + unimplemented!(""); + } } } } - -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 flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::LightningBalance +{ } - -impl SseDecode for crate::api::types::OutPoint { - // 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_txid = ::sse_decode(deserializer); - let mut var_vout = ::sse_decode(deserializer); - return crate::api::types::OutPoint { - txid: var_txid, - vout: var_vout, - }; +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::LightningBalance +{ + fn into_into_dart(self) -> crate::api::types::LightningBalance { + self } } - -impl SseDecode for crate::api::types::PaymentDetails { - // 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_hash = ::sse_decode(deserializer); - let mut var_preimage = - >::sse_decode(deserializer); - let mut var_secret = >::sse_decode(deserializer); - let mut var_amountMsat = >::sse_decode(deserializer); - let mut var_direction = ::sse_decode(deserializer); - let mut var_status = ::sse_decode(deserializer); - return crate::api::types::PaymentDetails { - hash: var_hash, - preimage: var_preimage, - secret: var_secret, - amount_msat: var_amountMsat, - direction: var_direction, - status: var_status, - }; +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::LiquiditySourceConfig { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.lsps2_service.into_into_dart().into_dart()].into_dart() } } - -impl SseDecode for crate::api::types::PaymentDirection { - // 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::PaymentDirection::Inbound, - 1 => crate::api::types::PaymentDirection::Outbound, - _ => unreachable!("Invalid variant for PaymentDirection: {}", inner), - }; - } +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::LiquiditySourceConfig +{ } - -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 { - let mut var_data = <[u8; 32]>::sse_decode(deserializer); - return crate::api::types::PaymentHash { data: var_data }; +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::LiquiditySourceConfig +{ + fn into_into_dart(self) -> crate::api::types::LiquiditySourceConfig { + self } } - -impl SseDecode for crate::api::types::PaymentPreimage { - // 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 = <[u8; 32]>::sse_decode(deserializer); - return crate::api::types::PaymentPreimage { data: var_data }; +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::LogLevel { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + match self { + Self::Gossip => 0.into_dart(), + Self::Trace => 1.into_dart(), + Self::Debug => 2.into_dart(), + Self::Info => 3.into_dart(), + Self::Warn => 4.into_dart(), + Self::Error => 5.into_dart(), + _ => unreachable!(), + } } } - -impl SseDecode for crate::api::types::PaymentSecret { - // 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 = <[u8; 32]>::sse_decode(deserializer); - return crate::api::types::PaymentSecret { data: var_data }; +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::LogLevel {} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::LogLevel +{ + fn into_into_dart(self) -> crate::api::types::LogLevel { + self } } - -impl SseDecode for crate::api::types::PaymentStatus { - // 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::PaymentStatus::Pending, - 1 => crate::api::types::PaymentStatus::Succeeded, - 2 => crate::api::types::PaymentStatus::Failed, - _ => unreachable!("Invalid variant for PaymentStatus: {}", inner), - }; +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::LSPFeeLimits { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [ + self.max_total_opening_fee_msat.into_into_dart().into_dart(), + self.max_proportional_opening_fee_ppm_msat + .into_into_dart() + .into_dart(), + ] + .into_dart() } } - -impl SseDecode for crate::api::types::PeerDetails { - // 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_nodeId = ::sse_decode(deserializer); - let mut var_address = ::sse_decode(deserializer); - let mut var_isConnected = ::sse_decode(deserializer); - return crate::api::types::PeerDetails { - node_id: var_nodeId, - address: var_address, - is_connected: var_isConnected, - }; - } +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::LSPFeeLimits +{ } - -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_hex = ::sse_decode(deserializer); - return crate::api::types::PublicKey { hex: var_hex }; +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::LSPFeeLimits +{ + fn into_into_dart(self) -> crate::api::types::LSPFeeLimits { + self } } - -impl SseDecode for crate::api::types::SocketAddress { - // 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_addr = <[u8; 4]>::sse_decode(deserializer); - let mut var_port = ::sse_decode(deserializer); - return crate::api::types::SocketAddress::TcpIpV4 { - addr: var_addr, - port: var_port, - }; - } - 1 => { - let mut var_addr = <[u8; 16]>::sse_decode(deserializer); - let mut var_port = ::sse_decode(deserializer); - return crate::api::types::SocketAddress::TcpIpV6 { - addr: var_addr, - port: var_port, - }; - } - 2 => { - let mut var_field0 = <[u8; 12]>::sse_decode(deserializer); - return crate::api::types::SocketAddress::OnionV2(var_field0); - } - 3 => { - let mut var_ed25519Pubkey = <[u8; 32]>::sse_decode(deserializer); - let mut var_checksum = ::sse_decode(deserializer); - let mut var_version = ::sse_decode(deserializer); - let mut var_port = ::sse_decode(deserializer); - return crate::api::types::SocketAddress::OnionV3 { - ed25519_pubkey: var_ed25519Pubkey, - checksum: var_checksum, - version: var_version, - port: var_port, - }; +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::MaxDustHTLCExposure { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + match self { + crate::api::types::MaxDustHTLCExposure::FixedLimitMsat(field0) => { + [0.into_dart(), field0.into_into_dart().into_dart()].into_dart() } - 4 => { - let mut var_addr = ::sse_decode(deserializer); - let mut var_port = ::sse_decode(deserializer); - return crate::api::types::SocketAddress::Hostname { - addr: var_addr, - port: var_port, - }; + crate::api::types::MaxDustHTLCExposure::FeeRateMultiplier(field0) => { + [1.into_dart(), field0.into_into_dart().into_dart()].into_dart() } _ => { unimplemented!(""); @@ -1917,889 +4988,1178 @@ impl SseDecode for crate::api::types::SocketAddress { } } } - -impl SseDecode for crate::api::types::Txid { - // 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_hash = ::sse_decode(deserializer); - return crate::api::types::Txid { hash: var_hash }; +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::MaxDustHTLCExposure +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::MaxDustHTLCExposure +{ + fn into_into_dart(self) -> crate::api::types::MaxDustHTLCExposure { + self } } - -impl SseDecode for u16 { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - deserializer.cursor.read_u16::().unwrap() +// 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 { + Self::Bitcoin => 0.into_dart(), + Self::Testnet => 1.into_dart(), + Self::Signet => 2.into_dart(), + Self::Regtest => 3.into_dart(), + _ => unreachable!(), + } } } - -impl SseDecode for u32 { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - deserializer.cursor.read_u32::().unwrap() +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::Network {} +impl flutter_rust_bridge::IntoIntoDart for crate::api::types::Network { + fn into_into_dart(self) -> crate::api::types::Network { + self } } - -impl SseDecode for u64 { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - deserializer.cursor.read_u64::().unwrap() +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::graph::NodeAnnouncementInfo { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [ + self.last_update.into_into_dart().into_dart(), + self.alias.into_into_dart().into_dart(), + self.addresses.into_into_dart().into_dart(), + ] + .into_dart() } } - -impl SseDecode for u8 { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - deserializer.cursor.read_u8().unwrap() +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::graph::NodeAnnouncementInfo +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::graph::NodeAnnouncementInfo +{ + fn into_into_dart(self) -> crate::api::graph::NodeAnnouncementInfo { + self } } - -impl SseDecode for [u8; 12] { - // 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 flutter_rust_bridge::for_generated::from_vec_to_array(inner); +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::graph::NodeId { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.compressed.into_into_dart().into_dart()].into_dart() } } - -impl SseDecode for [u8; 16] { - // 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 flutter_rust_bridge::for_generated::from_vec_to_array(inner); +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::graph::NodeId {} +impl flutter_rust_bridge::IntoIntoDart for crate::api::graph::NodeId { + fn into_into_dart(self) -> crate::api::graph::NodeId { + self } } - -impl SseDecode for [u8; 32] { - // 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 flutter_rust_bridge::for_generated::from_vec_to_array(inner); +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::graph::NodeInfo { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [ + self.channels.into_into_dart().into_dart(), + self.announcement_info.into_into_dart().into_dart(), + ] + .into_dart() } } - -impl SseDecode for [u8; 4] { - // 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 flutter_rust_bridge::for_generated::from_vec_to_array(inner); +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::graph::NodeInfo {} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::graph::NodeInfo +{ + fn into_into_dart(self) -> crate::api::graph::NodeInfo { + self } } - -impl SseDecode for [u8; 64] { - // 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 flutter_rust_bridge::for_generated::from_vec_to_array(inner); +// 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 SseDecode for () { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::NodeStatus {} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::NodeStatus +{ + fn into_into_dart(self) -> crate::api::types::NodeStatus { + self + } } - -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); - return crate::api::types::UserChannelId { data: var_data }; +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::bolt12::Offer { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.s.into_into_dart().into_dart()].into_dart() } } - -impl SseDecode for usize { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - deserializer.cursor.read_u64::().unwrap() as _ +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::bolt12::Offer {} +impl flutter_rust_bridge::IntoIntoDart for crate::api::bolt12::Offer { + fn into_into_dart(self) -> crate::api::bolt12::Offer { + self } } - -fn pde_ffi_dispatcher_primary_impl( - func_id: i32, - port: flutter_rust_bridge::for_generated::MessagePort, - ptr: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, - rust_vec_len: i32, - data_len: i32, -) { - // Codec=Pde (Serialization + dispatch), see doc to use other codecs - match func_id { - _ => unreachable!(), +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::OfferId { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.0.into_into_dart().into_dart()].into_dart() } } - -fn pde_ffi_dispatcher_sync_impl( - func_id: i32, - ptr: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, - rust_vec_len: i32, - data_len: i32, -) -> flutter_rust_bridge::for_generated::WireSyncRust2DartSse { - // Codec=Pde (Serialization + dispatch), see doc to use other codecs - match func_id { - _ => unreachable!(), +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::OfferId {} +impl flutter_rust_bridge::IntoIntoDart for crate::api::types::OfferId { + fn into_into_dart(self) -> crate::api::types::OfferId { + self } } - -// Section: rust2dart - // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::Address { +impl flutter_rust_bridge::IntoDart for crate::api::types::OutPoint { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [self.s.into_into_dart().into_dart()].into_dart() + [ + self.txid.into_into_dart().into_dart(), + self.vout.into_into_dart().into_dart(), + ] + .into_dart() } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::Address {} -impl flutter_rust_bridge::IntoIntoDart for crate::api::types::Address { - fn into_into_dart(self) -> crate::api::types::Address { +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::OutPoint {} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::OutPoint +{ + fn into_into_dart(self) -> crate::api::types::OutPoint { self } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::Bolt11Invoice { +impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentDetails { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [self.signed_raw_invoice.into_into_dart().into_dart()].into_dart() + [ + self.id.into_into_dart().into_dart(), + self.kind.into_into_dart().into_dart(), + self.amount_msat.into_into_dart().into_dart(), + self.direction.into_into_dart().into_dart(), + self.status.into_into_dart().into_dart(), + ] + .into_dart() } } impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::Bolt11Invoice + for crate::api::types::PaymentDetails { } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::Bolt11Invoice +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::PaymentDetails { - fn into_into_dart(self) -> crate::api::types::Bolt11Invoice { + fn into_into_dart(self) -> crate::api::types::PaymentDetails { self } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::error::BuilderException { +impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentDirection { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { match self { - Self::SocketAddressParseError => 0.into_dart(), - Self::InvalidSeedBytes => 1.into_dart(), - Self::InvalidSeedFile => 2.into_dart(), - Self::InvalidSystemTime => 3.into_dart(), - Self::InvalidChannelMonitor => 4.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(), + Self::Inbound => 0.into_dart(), + Self::Outbound => 1.into_dart(), + _ => unreachable!(), } } } impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::error::BuilderException + for crate::api::types::PaymentDirection { } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::error::BuilderException +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::PaymentDirection { - fn into_into_dart(self) -> crate::api::error::BuilderException { + fn into_into_dart(self) -> crate::api::types::PaymentDirection { self } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::ChainDataSourceConfig { +impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentFailureReason { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { match self { - crate::api::types::ChainDataSourceConfig::Esplora(field0) => { - [0.into_dart(), field0.into_into_dart().into_dart()].into_dart() - } + 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(), + _ => unreachable!(), } } } impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::ChainDataSourceConfig + for crate::api::types::PaymentFailureReason { } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::ChainDataSourceConfig +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::PaymentFailureReason { - fn into_into_dart(self) -> crate::api::types::ChainDataSourceConfig { + 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::ChannelConfig { +impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentHash { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [ - self.forwarding_fee_proportional_millionths - .into_into_dart() - .into_dart(), - self.forwarding_fee_base_msat.into_into_dart().into_dart(), - self.cltv_expiry_delta.into_into_dart().into_dart(), - self.max_dust_htlc_exposure.into_into_dart().into_dart(), - self.force_close_avoidance_max_fee_satoshis - .into_into_dart() - .into_dart(), - self.accept_underpaying_htlcs.into_into_dart().into_dart(), - ] - .into_dart() + [self.data.into_into_dart().into_dart()].into_dart() } } impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::ChannelConfig + for crate::api::types::PaymentHash { } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::ChannelConfig +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::PaymentHash { - fn into_into_dart(self) -> crate::api::types::ChannelConfig { + fn into_into_dart(self) -> crate::api::types::PaymentHash { self } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::ChannelDetails { +impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentId { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [ - self.channel_id.into_into_dart().into_dart(), - self.counterparty_node_id.into_into_dart().into_dart(), - self.funding_txo.into_into_dart().into_dart(), - self.channel_value_sats.into_into_dart().into_dart(), - self.unspendable_punishment_reserve - .into_into_dart() - .into_dart(), - self.user_channel_id.into_into_dart().into_dart(), - 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(), - self.confirmations.into_into_dart().into_dart(), - self.is_outbound.into_into_dart().into_dart(), - 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(), - ] - .into_dart() + [self.0.into_into_dart().into_dart()].into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::PaymentId {} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::PaymentId +{ + fn into_into_dart(self) -> crate::api::types::PaymentId { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentKind { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + match self { + crate::api::types::PaymentKind::Onchain => [0.into_dart()].into_dart(), + crate::api::types::PaymentKind::Bolt11 { + hash, + preimage, + secret, + } => [ + 1.into_dart(), + hash.into_into_dart().into_dart(), + preimage.into_into_dart().into_dart(), + secret.into_into_dart().into_dart(), + ] + .into_dart(), + crate::api::types::PaymentKind::Bolt11Jit { + hash, + preimage, + secret, + lsp_fee_limits, + } => [ + 2.into_dart(), + hash.into_into_dart().into_dart(), + preimage.into_into_dart().into_dart(), + secret.into_into_dart().into_dart(), + lsp_fee_limits.into_into_dart().into_dart(), + ] + .into_dart(), + crate::api::types::PaymentKind::Spontaneous { hash, preimage } => [ + 3.into_dart(), + hash.into_into_dart().into_dart(), + preimage.into_into_dart().into_dart(), + ] + .into_dart(), + crate::api::types::PaymentKind::Bolt12Offer { + hash, + preimage, + secret, + offer_id, + } => [ + 4.into_dart(), + hash.into_into_dart().into_dart(), + preimage.into_into_dart().into_dart(), + secret.into_into_dart().into_dart(), + offer_id.into_into_dart().into_dart(), + ] + .into_dart(), + crate::api::types::PaymentKind::Bolt12Refund { + hash, + preimage, + secret, + } => [ + 5.into_dart(), + hash.into_into_dart().into_dart(), + preimage.into_into_dart().into_dart(), + secret.into_into_dart().into_dart(), + ] + .into_dart(), + _ => { + unimplemented!(""); + } + } + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::PaymentKind +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::PaymentKind +{ + fn into_into_dart(self) -> crate::api::types::PaymentKind { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentPreimage { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.data.into_into_dart().into_dart()].into_dart() } } impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::ChannelDetails + for crate::api::types::PaymentPreimage { } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::ChannelDetails +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::PaymentPreimage { - fn into_into_dart(self) -> crate::api::types::ChannelDetails { + fn into_into_dart(self) -> crate::api::types::PaymentPreimage { self } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::ChannelId { +impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentSecret { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { [self.data.into_into_dart().into_dart()].into_dart() } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::ChannelId {} -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::ChannelId +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::PaymentSecret { - fn into_into_dart(self) -> crate::api::types::ChannelId { +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::PaymentSecret +{ + fn into_into_dart(self) -> crate::api::types::PaymentSecret { self } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::Config { +impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentStatus { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [ - self.storage_dir_path.into_into_dart().into_dart(), - self.log_dir_path.into_into_dart().into_dart(), - self.network.into_into_dart().into_dart(), - self.listening_addresses.into_into_dart().into_dart(), - self.default_cltv_expiry_delta.into_into_dart().into_dart(), - self.onchain_wallet_sync_interval_secs - .into_into_dart() - .into_dart(), - self.wallet_sync_interval_secs.into_into_dart().into_dart(), - self.fee_rate_cache_update_interval_secs - .into_into_dart() - .into_dart(), - self.trusted_peers_0conf.into_into_dart().into_dart(), - self.probing_liquidity_limit_multiplier - .into_into_dart() - .into_dart(), - self.log_level.into_into_dart().into_dart(), - ] - .into_dart() + match self { + Self::Pending => 0.into_dart(), + Self::Succeeded => 1.into_dart(), + Self::Failed => 2.into_dart(), + _ => unreachable!(), + } } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::Config {} -impl flutter_rust_bridge::IntoIntoDart for crate::api::types::Config { - fn into_into_dart(self) -> crate::api::types::Config { +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::PaymentStatus +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::PaymentStatus +{ + fn into_into_dart(self) -> crate::api::types::PaymentStatus { self } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::EntropySourceConfig { +impl flutter_rust_bridge::IntoDart for crate::api::types::PeerDetails { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - match self { - crate::api::types::EntropySourceConfig::SeedFile(field0) => { - [0.into_dart(), field0.into_into_dart().into_dart()].into_dart() - } - crate::api::types::EntropySourceConfig::SeedBytes(field0) => { - [1.into_dart(), field0.into_into_dart().into_dart()].into_dart() - } - crate::api::types::EntropySourceConfig::Bip39Mnemonic { - mnemonic, - passphrase, - } => [ - 2.into_dart(), - mnemonic.into_into_dart().into_dart(), - passphrase.into_into_dart().into_dart(), - ] - .into_dart(), - } + [ + self.node_id.into_into_dart().into_dart(), + self.address.into_into_dart().into_dart(), + self.is_connected.into_into_dart().into_dart(), + ] + .into_dart() } } impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::EntropySourceConfig + for crate::api::types::PeerDetails { } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::EntropySourceConfig +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::PeerDetails { - fn into_into_dart(self) -> crate::api::types::EntropySourceConfig { + fn into_into_dart(self) -> crate::api::types::PeerDetails { self } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::Event { +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::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, - } => [ - 2.into_dart(), - payment_hash.into_into_dart().into_dart(), - amount_msat.into_into_dart().into_dart(), - ] - .into_dart(), - crate::api::types::Event::ChannelReady { + crate::api::types::PendingSweepBalance::PendingBroadcast { channel_id, - user_channel_id, - counterparty_node_id, + amount_satoshis, } => [ - 3.into_dart(), + 0.into_dart(), channel_id.into_into_dart().into_dart(), - user_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::Event::ChannelClosed { + crate::api::types::PendingSweepBalance::BroadcastAwaitingConfirmation { channel_id, - user_channel_id, - counterparty_node_id, + latest_broadcast_height, + latest_spending_txid, + amount_satoshis, } => [ - 4.into_dart(), + 1.into_dart(), channel_id.into_into_dart().into_dart(), - user_channel_id.into_into_dart().into_dart(), - counterparty_node_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::Event::ChannelPending { + crate::api::types::PendingSweepBalance::AwaitingThresholdConfirmations { channel_id, - user_channel_id, - former_temporary_channel_id, - counterparty_node_id, - funding_txo, + latest_spending_txid, + confirmation_hash, + confirmation_height, + amount_satoshis, } => [ - 5.into_dart(), + 2.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(), + 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::Event {} -impl flutter_rust_bridge::IntoIntoDart for crate::api::types::Event { - fn into_into_dart(self) -> crate::api::types::Event { - self - } -} -// Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::GossipSourceConfig { - fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - match self { - crate::api::types::GossipSourceConfig::P2PNetwork => [0.into_dart()].into_dart(), - crate::api::types::GossipSourceConfig::RapidGossipSync(field0) => { - [1.into_dart(), field0.into_into_dart().into_dart()].into_dart() + _ => { + unimplemented!(""); } } } } impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::GossipSourceConfig + for crate::api::types::PendingSweepBalance { } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::GossipSourceConfig +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::PendingSweepBalance { - fn into_into_dart(self) -> crate::api::types::GossipSourceConfig { + 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::node::LdkMnemonic { +impl flutter_rust_bridge::IntoDart for crate::api::types::PublicKey { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [self.seed_phrase.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::node::LdkMnemonic {} -impl flutter_rust_bridge::IntoIntoDart - for crate::api::node::LdkMnemonic +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::PublicKey {} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::PublicKey { - 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::node::LdkNode { - 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::LdkNode {} -impl flutter_rust_bridge::IntoIntoDart for crate::api::node::LdkNode { - fn into_into_dart(self) -> crate::api::node::LdkNode { + fn into_into_dart(self) -> crate::api::types::PublicKey { self } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::LogLevel { +impl flutter_rust_bridge::IntoDart for crate::api::bolt12::Refund { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - match self { - Self::Gossip => 0.into_dart(), - Self::Trace => 1.into_dart(), - Self::Debug => 2.into_dart(), - Self::Info => 3.into_dart(), - Self::Warn => 4.into_dart(), - Self::Error => 5.into_dart(), - } + [self.s.into_into_dart().into_dart()].into_dart() } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::LogLevel {} -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::LogLevel -{ - fn into_into_dart(self) -> crate::api::types::LogLevel { +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::bolt12::Refund {} +impl flutter_rust_bridge::IntoIntoDart for crate::api::bolt12::Refund { + fn into_into_dart(self) -> crate::api::bolt12::Refund { self } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::MaxDustHTLCExposure { +impl flutter_rust_bridge::IntoDart for crate::api::graph::RoutingFees { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - match self { - crate::api::types::MaxDustHTLCExposure::FixedLimitMsat(field0) => { - [0.into_dart(), field0.into_into_dart().into_dart()].into_dart() - } - crate::api::types::MaxDustHTLCExposure::FeeRateMultiplier(field0) => { - [1.into_dart(), field0.into_into_dart().into_dart()].into_dart() - } - } + [ + self.base_msat.into_into_dart().into_dart(), + self.proportional_millionths.into_into_dart().into_dart(), + ] + .into_dart() } } impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::MaxDustHTLCExposure + for crate::api::graph::RoutingFees { } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::MaxDustHTLCExposure +impl flutter_rust_bridge::IntoIntoDart + for crate::api::graph::RoutingFees { - fn into_into_dart(self) -> crate::api::types::MaxDustHTLCExposure { - 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 { - Self::Bitcoin => 0.into_dart(), - Self::Testnet => 1.into_dart(), - Self::Signet => 2.into_dart(), - Self::Regtest => 3.into_dart(), - } - } -} -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::Network {} -impl flutter_rust_bridge::IntoIntoDart for crate::api::types::Network { - fn into_into_dart(self) -> crate::api::types::Network { + fn into_into_dart(self) -> crate::api::graph::RoutingFees { self } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::error::NodeException { +impl flutter_rust_bridge::IntoDart for crate::api::types::SocketAddress { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { match self { - 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(), + crate::api::types::SocketAddress::TcpIpV4 { addr, port } => [ + 0.into_dart(), + addr.into_into_dart().into_dart(), + port.into_into_dart().into_dart(), + ] + .into_dart(), + crate::api::types::SocketAddress::TcpIpV6 { addr, port } => [ + 1.into_dart(), + addr.into_into_dart().into_dart(), + port.into_into_dart().into_dart(), + ] + .into_dart(), + crate::api::types::SocketAddress::OnionV2(field0) => { + [2.into_dart(), field0.into_into_dart().into_dart()].into_dart() + } + crate::api::types::SocketAddress::OnionV3 { + ed25519_pubkey, + checksum, + version, + port, + } => [ + 3.into_dart(), + ed25519_pubkey.into_into_dart().into_dart(), + checksum.into_into_dart().into_dart(), + version.into_into_dart().into_dart(), + port.into_into_dart().into_dart(), + ] + .into_dart(), + crate::api::types::SocketAddress::Hostname { addr, port } => [ + 4.into_dart(), + addr.into_into_dart().into_dart(), + port.into_into_dart().into_dart(), + ] + .into_dart(), + _ => { + unimplemented!(""); + } } } } impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::error::NodeException + for crate::api::types::SocketAddress { } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::error::NodeException +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::SocketAddress { - fn into_into_dart(self) -> crate::api::error::NodeException { + fn into_into_dart(self) -> crate::api::types::SocketAddress { self } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::OutPoint { +impl flutter_rust_bridge::IntoDart for crate::api::types::Txid { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [ - self.txid.into_into_dart().into_dart(), - self.vout.into_into_dart().into_dart(), - ] - .into_dart() + [self.hash.into_into_dart().into_dart()].into_dart() } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::OutPoint {} -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::OutPoint -{ - fn into_into_dart(self) -> crate::api::types::OutPoint { +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::Txid {} +impl flutter_rust_bridge::IntoIntoDart for crate::api::types::Txid { + fn into_into_dart(self) -> crate::api::types::Txid { self } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentDetails { +impl flutter_rust_bridge::IntoDart for crate::api::types::UserChannelId { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [ - self.hash.into_into_dart().into_dart(), - self.preimage.into_into_dart().into_dart(), - self.secret.into_into_dart().into_dart(), - self.amount_msat.into_into_dart().into_dart(), - self.direction.into_into_dart().into_dart(), - self.status.into_into_dart().into_dart(), - ] - .into_dart() + [self.data.into_into_dart().into_dart()].into_dart() } } impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::PaymentDetails + for crate::api::types::UserChannelId { } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::PaymentDetails +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::UserChannelId { - fn into_into_dart(self) -> crate::api::types::PaymentDetails { + fn into_into_dart(self) -> crate::api::types::UserChannelId { self } } -// Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentDirection { - fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - match self { - Self::Inbound => 0.into_dart(), - Self::Outbound => 1.into_dart(), - } + +impl SseEncode for NodeBuilder { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + >>::sse_encode(flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self), serializer); } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::PaymentDirection -{ + +impl SseEncode for RustOpaqueNom> { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::PaymentDirection + +impl SseEncode for RustOpaqueNom { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode + for RustOpaqueNom> { - fn into_into_dart(self) -> crate::api::types::PaymentDirection { - self + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); } } -// 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() + +impl SseEncode for RustOpaqueNom { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::PaymentHash -{ + +impl SseEncode for RustOpaqueNom { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::PaymentHash -{ - fn into_into_dart(self) -> crate::api::types::PaymentHash { - self + +impl SseEncode for RustOpaqueNom { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); } } -// Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentPreimage { - fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [self.data.into_into_dart().into_dart()].into_dart() + +impl SseEncode for RustOpaqueNom { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::PaymentPreimage -{ + +impl SseEncode for RustOpaqueNom { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::PaymentPreimage -{ - fn into_into_dart(self) -> crate::api::types::PaymentPreimage { - self + +impl SseEncode for String { + // 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.into_bytes(), serializer); } } -// Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentSecret { - fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [self.data.into_into_dart().into_dart()].into_dart() + +impl SseEncode for crate::api::types::Address { + // 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.s, serializer); } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::PaymentSecret -{ + +impl SseEncode for crate::api::types::AnchorChannelsConfig { + // 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.trusted_peers_no_reserve, serializer); + ::sse_encode(self.per_channel_reserve_sats, serializer); + } } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::PaymentSecret -{ - fn into_into_dart(self) -> crate::api::types::PaymentSecret { - self + +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, + ); } } -// Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentStatus { - fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + +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::bolt11::Bolt11Invoice { + // 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.signed_raw_invoice, serializer); + } +} + +impl SseEncode for crate::api::bolt12::Bolt12Invoice { + // 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); + } +} + +impl SseEncode for crate::utils::error::Bolt12ParseError { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { match self { - Self::Pending => 0.into_dart(), - Self::Succeeded => 1.into_dart(), - Self::Failed => 2.into_dart(), + crate::utils::error::Bolt12ParseError::InvalidContinuation => { + ::sse_encode(0, serializer); + } + crate::utils::error::Bolt12ParseError::InvalidBech32Hrp => { + ::sse_encode(1, serializer); + } + crate::utils::error::Bolt12ParseError::Bech32(field0) => { + ::sse_encode(2, serializer); + ::sse_encode(field0, serializer); + } + crate::utils::error::Bolt12ParseError::Decode(field0) => { + ::sse_encode(3, serializer); + ::sse_encode(field0, serializer); + } + crate::utils::error::Bolt12ParseError::InvalidSemantics(field0) => { + ::sse_encode(4, serializer); + ::sse_encode(field0, serializer); + } + crate::utils::error::Bolt12ParseError::InvalidSignature(field0) => { + ::sse_encode(5, serializer); + ::sse_encode(field0, serializer); + } + _ => { + unimplemented!(""); + } } } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::PaymentStatus -{ + +impl SseEncode for bool { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + serializer.cursor.write_u8(self as _).unwrap(); + } } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::PaymentStatus -{ - fn into_into_dart(self) -> crate::api::types::PaymentStatus { - self + +impl SseEncode for crate::api::types::ChainDataSourceConfig { + // 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::ChainDataSourceConfig::Esplora(field0) => { + ::sse_encode(0, serializer); + ::sse_encode(field0, serializer); + } + _ => { + unimplemented!(""); + } + } } } -// Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::PeerDetails { - fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [ - self.node_id.into_into_dart().into_dart(), - self.address.into_into_dart().into_dart(), - self.is_connected.into_into_dart().into_dart(), - ] - .into_dart() + +impl SseEncode for crate::api::types::ChannelConfig { + // 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.forwarding_fee_proportional_millionths, serializer); + ::sse_encode(self.forwarding_fee_base_msat, serializer); + ::sse_encode(self.cltv_expiry_delta, serializer); + >::sse_encode( + self.max_dust_htlc_exposure, + serializer, + ); + ::sse_encode(self.force_close_avoidance_max_fee_satoshis, serializer); + ::sse_encode(self.accept_underpaying_htlcs, serializer); } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::PeerDetails -{ + +impl SseEncode for crate::api::types::ChannelDetails { + // 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.channel_id, serializer); + ::sse_encode(self.counterparty_node_id, 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.outbound_capacity_msat, serializer); + ::sse_encode(self.inbound_capacity_msat, serializer); + >::sse_encode(self.confirmations_required, serializer); + >::sse_encode(self.confirmations, serializer); + ::sse_encode(self.is_outbound, serializer); + ::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); + } } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::PeerDetails -{ - fn into_into_dart(self) -> crate::api::types::PeerDetails { - self + +impl SseEncode for crate::api::types::ChannelId { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + <[u8; 32]>::sse_encode(self.data, serializer); } } -// 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.into_into_dart().into_dart()].into_dart() + +impl SseEncode for crate::api::graph::ChannelInfo { + // 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.node_one, serializer); + >::sse_encode(self.one_to_two, serializer); + ::sse_encode(self.node_two, serializer); + >::sse_encode(self.two_to_one, serializer); + >::sse_encode(self.capacity_sats, serializer); } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::PublicKey {} -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::PublicKey -{ - fn into_into_dart(self) -> crate::api::types::PublicKey { - self + +impl SseEncode for crate::api::graph::ChannelUpdateInfo { + // 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.last_update, serializer); + ::sse_encode(self.enabled, serializer); + ::sse_encode(self.cltv_expiry_delta, serializer); + ::sse_encode(self.htlc_minimum_msat, serializer); + ::sse_encode(self.htlc_maximum_msat, serializer); + ::sse_encode(self.fees, serializer); } } -// Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::SocketAddress { - fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + +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::SocketAddress::TcpIpV4 { addr, port } => [ - 0.into_dart(), - addr.into_into_dart().into_dart(), - port.into_into_dart().into_dart(), - ] - .into_dart(), - crate::api::types::SocketAddress::TcpIpV6 { addr, port } => [ - 1.into_dart(), - addr.into_into_dart().into_dart(), - port.into_into_dart().into_dart(), - ] - .into_dart(), - crate::api::types::SocketAddress::OnionV2(field0) => { - [2.into_dart(), field0.into_into_dart().into_dart()].into_dart() + 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::LegacyCooperativeClosure => { + ::sse_encode(2, serializer); + } + crate::api::types::ClosureReason::CounterpartyInitiatedCooperativeClosure => { + ::sse_encode(3, serializer); + } + crate::api::types::ClosureReason::LocallyInitiatedCooperativeClosure => { + ::sse_encode(4, serializer); + } + crate::api::types::ClosureReason::CommitmentTxConfirmed => { + ::sse_encode(5, serializer); + } + crate::api::types::ClosureReason::FundingTimedOut => { + ::sse_encode(6, serializer); + } + crate::api::types::ClosureReason::ProcessingError { err } => { + ::sse_encode(7, serializer); + ::sse_encode(err, serializer); + } + crate::api::types::ClosureReason::DisconnectedPeer => { + ::sse_encode(8, serializer); + } + crate::api::types::ClosureReason::OutdatedChannelManager => { + ::sse_encode(9, serializer); + } + crate::api::types::ClosureReason::CounterpartyCoopClosedUnfundedChannel => { + ::sse_encode(10, serializer); + } + crate::api::types::ClosureReason::FundingBatchClosure => { + ::sse_encode(11, serializer); + } + crate::api::types::ClosureReason::HTLCsTimedOut => { + ::sse_encode(12, serializer); + } + _ => { + unimplemented!(""); } - crate::api::types::SocketAddress::OnionV3 { - ed25519_pubkey, - checksum, - version, - port, - } => [ - 3.into_dart(), - ed25519_pubkey.into_into_dart().into_dart(), - checksum.into_into_dart().into_dart(), - version.into_into_dart().into_dart(), - port.into_into_dart().into_dart(), - ] - .into_dart(), - crate::api::types::SocketAddress::Hostname { addr, port } => [ - 4.into_dart(), - addr.into_into_dart().into_dart(), - port.into_into_dart().into_dart(), - ] - .into_dart(), } } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::SocketAddress -{ -} -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::SocketAddress -{ - fn into_into_dart(self) -> crate::api::types::SocketAddress { - self - } -} -// Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::Txid { - fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [self.hash.into_into_dart().into_dart()].into_dart() - } -} -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::Txid {} -impl flutter_rust_bridge::IntoIntoDart for crate::api::types::Txid { - fn into_into_dart(self) -> crate::api::types::Txid { - self + +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) { + ::sse_encode(self.storage_dir_path, serializer); + >::sse_encode(self.log_dir_path, serializer); + ::sse_encode(self.network, serializer); + >>::sse_encode( + self.listening_addresses, + serializer, + ); + ::sse_encode(self.default_cltv_expiry_delta, serializer); + ::sse_encode(self.onchain_wallet_sync_interval_secs, serializer); + ::sse_encode(self.wallet_sync_interval_secs, serializer); + ::sse_encode(self.fee_rate_cache_update_interval_secs, serializer); + >::sse_encode(self.trusted_peers_0conf, serializer); + ::sse_encode(self.probing_liquidity_limit_multiplier, serializer); + ::sse_encode(self.log_level, serializer); + >::sse_encode( + self.anchor_channels_config, + serializer, + ); } } -// Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::UserChannelId { - fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [self.data.into_into_dart().into_dart()].into_dart() + +impl SseEncode for crate::utils::error::DecodeError { + // 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::utils::error::DecodeError::UnknownVersion => { + ::sse_encode(0, serializer); + } + crate::utils::error::DecodeError::UnknownRequiredFeature => { + ::sse_encode(1, serializer); + } + crate::utils::error::DecodeError::InvalidValue => { + ::sse_encode(2, serializer); + } + crate::utils::error::DecodeError::ShortRead => { + ::sse_encode(3, serializer); + } + crate::utils::error::DecodeError::BadLengthDescriptor => { + ::sse_encode(4, serializer); + } + crate::utils::error::DecodeError::Io(field0) => { + ::sse_encode(5, serializer); + ::sse_encode(field0, serializer); + } + crate::utils::error::DecodeError::UnsupportedCompression => { + ::sse_encode(6, serializer); + } + crate::utils::error::DecodeError::DangerousValue => { + ::sse_encode(7, serializer); + } + _ => { + unimplemented!(""); + } + } } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::UserChannelId -{ -} -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::UserChannelId -{ - fn into_into_dart(self) -> crate::api::types::UserChannelId { - self + +impl SseEncode for crate::api::types::EntropySourceConfig { + // 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::EntropySourceConfig::SeedFile(field0) => { + ::sse_encode(0, serializer); + ::sse_encode(field0, serializer); + } + crate::api::types::EntropySourceConfig::SeedBytes(field0) => { + ::sse_encode(1, serializer); + <[u8; 64]>::sse_encode(field0, serializer); + } + crate::api::types::EntropySourceConfig::Bip39Mnemonic { + mnemonic, + passphrase, + } => { + ::sse_encode(2, serializer); + ::sse_encode(mnemonic, serializer); + >::sse_encode(passphrase, serializer); + } + _ => { + unimplemented!(""); + } + } } } -impl SseEncode for RustOpaqueNom> { +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) { - let (ptr, size) = self.sse_encode_raw(); - ::sse_encode(ptr, serializer); - ::sse_encode(size, serializer); + match self { + crate::api::types::Event::PaymentClaimable { + payment_id, + payment_hash, + claimable_amount_msat, + claim_deadline, + } => { + ::sse_encode(0, serializer); + ::sse_encode(payment_id, serializer); + ::sse_encode(payment_hash, serializer); + ::sse_encode(claimable_amount_msat, serializer); + >::sse_encode(claim_deadline, serializer); + } + crate::api::types::Event::PaymentSuccessful { + payment_id, + payment_hash, + fee_paid_msat, + } => { + ::sse_encode(1, serializer); + >::sse_encode(payment_id, serializer); + ::sse_encode(payment_hash, serializer); + >::sse_encode(fee_paid_msat, serializer); + } + crate::api::types::Event::PaymentFailed { + payment_id, + payment_hash, + reason, + } => { + ::sse_encode(2, serializer); + >::sse_encode(payment_id, serializer); + ::sse_encode(payment_hash, serializer); + >::sse_encode(reason, serializer); + } + crate::api::types::Event::PaymentReceived { + payment_id, + payment_hash, + amount_msat, + } => { + ::sse_encode(3, serializer); + >::sse_encode(payment_id, serializer); + ::sse_encode(payment_hash, serializer); + ::sse_encode(amount_msat, serializer); + } + crate::api::types::Event::ChannelPending { + channel_id, + user_channel_id, + former_temporary_channel_id, + counterparty_node_id, + funding_txo, + } => { + ::sse_encode(4, 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); + } + crate::api::types::Event::ChannelReady { + channel_id, + user_channel_id, + counterparty_node_id, + } => { + ::sse_encode(5, serializer); + ::sse_encode(channel_id, serializer); + ::sse_encode(user_channel_id, serializer); + >::sse_encode( + counterparty_node_id, + serializer, + ); + } + crate::api::types::Event::ChannelClosed { + channel_id, + user_channel_id, + counterparty_node_id, + reason, + } => { + ::sse_encode(6, serializer); + ::sse_encode(channel_id, serializer); + ::sse_encode(user_channel_id, serializer); + >::sse_encode( + counterparty_node_id, + serializer, + ); + >::sse_encode(reason, serializer); + } + _ => { + unimplemented!(""); + } + } } } -impl SseEncode for String { +impl SseEncode for crate::api::types::GossipSourceConfig { // 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.into_bytes(), serializer); + match self { + crate::api::types::GossipSourceConfig::P2PNetwork => { + ::sse_encode(0, serializer); + } + crate::api::types::GossipSourceConfig::RapidGossipSync(field0) => { + ::sse_encode(1, serializer); + ::sse_encode(field0, serializer); + } + _ => { + unimplemented!(""); + } + } } } -impl SseEncode for crate::api::types::Address { +impl SseEncode for i32 { // 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.s, serializer); + serializer.cursor.write_i32::(self).unwrap(); } } -impl SseEncode for crate::api::types::Bolt11Invoice { +impl SseEncode for crate::api::bolt11::LdkBolt11Payment { // 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.signed_raw_invoice, serializer); + >::sse_encode(self.ptr, serializer); } } -impl SseEncode for bool { +impl SseEncode for crate::api::bolt12::LdkBolt12Payment { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - serializer.cursor.write_u8(self as _).unwrap(); + >>::sse_encode(self.ptr, serializer); } } -impl SseEncode for crate::api::error::BuilderException { +impl SseEncode for crate::utils::error::LdkBuilderError { // 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::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, + crate::utils::error::LdkBuilderError::SocketAddressParseError => 0, + crate::utils::error::LdkBuilderError::InvalidSeedBytes => 1, + crate::utils::error::LdkBuilderError::InvalidSeedFile => 2, + crate::utils::error::LdkBuilderError::InvalidSystemTime => 3, + crate::utils::error::LdkBuilderError::InvalidChannelMonitor => 4, + crate::utils::error::LdkBuilderError::InvalidListeningAddress => 5, + crate::utils::error::LdkBuilderError::ReadFailed => 6, + crate::utils::error::LdkBuilderError::WriteFailed => 7, + crate::utils::error::LdkBuilderError::StoragePathAccessFailed => 8, + crate::utils::error::LdkBuilderError::KVStoreSetupFailed => 9, + crate::utils::error::LdkBuilderError::WalletSetupFailed => 10, + crate::utils::error::LdkBuilderError::LoggerSetupFailed => 11, + crate::utils::error::LdkBuilderError::InvalidPublicKey => 12, _ => { unimplemented!(""); } @@ -2809,232 +6169,365 @@ impl SseEncode for crate::api::error::BuilderException { } } -impl SseEncode for crate::api::types::ChainDataSourceConfig { +impl SseEncode for crate::api::builder::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::ChainDataSourceConfig::Esplora(field0) => { - ::sse_encode(0, serializer); - ::sse_encode(field0, serializer); - } - } + ::sse_encode(self.seed_phrase, serializer); } } -impl SseEncode for crate::api::types::ChannelConfig { +impl SseEncode for crate::api::graph::LdkNetworkGraph { // 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.forwarding_fee_proportional_millionths, serializer); - ::sse_encode(self.forwarding_fee_base_msat, serializer); - ::sse_encode(self.cltv_expiry_delta, serializer); - ::sse_encode( - self.max_dust_htlc_exposure, - serializer, - ); - ::sse_encode(self.force_close_avoidance_max_fee_satoshis, serializer); - ::sse_encode(self.accept_underpaying_htlcs, serializer); + >::sse_encode(self.ptr, serializer); } } -impl SseEncode for crate::api::types::ChannelDetails { +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) { - ::sse_encode(self.channel_id, serializer); - ::sse_encode(self.counterparty_node_id, 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); - >::sse_encode(self.confirmations, serializer); - ::sse_encode(self.is_outbound, serializer); - ::sse_encode(self.is_channel_ready, serializer); - ::sse_encode(self.is_usable, serializer); - ::sse_encode(self.is_public, serializer); + >::sse_encode(self.ptr, serializer); } } -impl SseEncode for crate::api::types::ChannelId { +impl SseEncode for crate::utils::error::LdkNodeError { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - <[u8; 32]>::sse_encode(self.data, serializer); + match self { + crate::utils::error::LdkNodeError::InvalidTxid => { + ::sse_encode(0, serializer); + } + crate::utils::error::LdkNodeError::AlreadyRunning => { + ::sse_encode(1, serializer); + } + crate::utils::error::LdkNodeError::NotRunning => { + ::sse_encode(2, serializer); + } + crate::utils::error::LdkNodeError::OnchainTxCreationFailed => { + ::sse_encode(3, serializer); + } + crate::utils::error::LdkNodeError::ConnectionFailed => { + ::sse_encode(4, serializer); + } + crate::utils::error::LdkNodeError::InvoiceCreationFailed => { + ::sse_encode(5, serializer); + } + crate::utils::error::LdkNodeError::PaymentSendingFailed => { + ::sse_encode(6, serializer); + } + crate::utils::error::LdkNodeError::ProbeSendingFailed => { + ::sse_encode(7, serializer); + } + crate::utils::error::LdkNodeError::ChannelCreationFailed => { + ::sse_encode(8, serializer); + } + crate::utils::error::LdkNodeError::ChannelClosingFailed => { + ::sse_encode(9, serializer); + } + crate::utils::error::LdkNodeError::ChannelConfigUpdateFailed => { + ::sse_encode(10, serializer); + } + crate::utils::error::LdkNodeError::PersistenceFailed => { + ::sse_encode(11, serializer); + } + crate::utils::error::LdkNodeError::WalletOperationFailed => { + ::sse_encode(12, serializer); + } + crate::utils::error::LdkNodeError::OnchainTxSigningFailed => { + ::sse_encode(13, serializer); + } + crate::utils::error::LdkNodeError::MessageSigningFailed => { + ::sse_encode(14, serializer); + } + crate::utils::error::LdkNodeError::TxSyncFailed => { + ::sse_encode(15, serializer); + } + crate::utils::error::LdkNodeError::GossipUpdateFailed => { + ::sse_encode(16, serializer); + } + crate::utils::error::LdkNodeError::InvalidAddress => { + ::sse_encode(17, serializer); + } + crate::utils::error::LdkNodeError::InvalidSocketAddress => { + ::sse_encode(18, serializer); + } + crate::utils::error::LdkNodeError::InvalidPublicKey => { + ::sse_encode(19, serializer); + } + crate::utils::error::LdkNodeError::InvalidSecretKey => { + ::sse_encode(20, serializer); + } + crate::utils::error::LdkNodeError::InvalidPaymentHash => { + ::sse_encode(21, serializer); + } + crate::utils::error::LdkNodeError::InvalidPaymentPreimage => { + ::sse_encode(22, serializer); + } + crate::utils::error::LdkNodeError::InvalidPaymentSecret => { + ::sse_encode(23, serializer); + } + crate::utils::error::LdkNodeError::InvalidAmount => { + ::sse_encode(24, serializer); + } + crate::utils::error::LdkNodeError::InvalidInvoice => { + ::sse_encode(25, serializer); + } + crate::utils::error::LdkNodeError::InvalidChannelId => { + ::sse_encode(26, serializer); + } + crate::utils::error::LdkNodeError::InvalidNetwork => { + ::sse_encode(27, serializer); + } + crate::utils::error::LdkNodeError::DuplicatePayment => { + ::sse_encode(28, serializer); + } + crate::utils::error::LdkNodeError::InsufficientFunds => { + ::sse_encode(29, serializer); + } + crate::utils::error::LdkNodeError::FeerateEstimationUpdateFailed => { + ::sse_encode(30, serializer); + } + crate::utils::error::LdkNodeError::LiquidityRequestFailed => { + ::sse_encode(31, serializer); + } + crate::utils::error::LdkNodeError::LiquiditySourceUnavailable => { + ::sse_encode(32, serializer); + } + crate::utils::error::LdkNodeError::LiquidityFeeTooHigh => { + ::sse_encode(33, serializer); + } + crate::utils::error::LdkNodeError::InvalidPaymentId => { + ::sse_encode(34, serializer); + } + crate::utils::error::LdkNodeError::Decode(field0) => { + ::sse_encode(35, serializer); + ::sse_encode(field0, serializer); + } + crate::utils::error::LdkNodeError::Bolt12Parse(field0) => { + ::sse_encode(36, serializer); + ::sse_encode(field0, serializer); + } + crate::utils::error::LdkNodeError::InvoiceRequestCreationFailed => { + ::sse_encode(37, serializer); + } + crate::utils::error::LdkNodeError::OfferCreationFailed => { + ::sse_encode(38, serializer); + } + crate::utils::error::LdkNodeError::RefundCreationFailed => { + ::sse_encode(39, serializer); + } + crate::utils::error::LdkNodeError::FeerateEstimationUpdateTimeout => { + ::sse_encode(40, serializer); + } + crate::utils::error::LdkNodeError::WalletOperationTimeout => { + ::sse_encode(41, serializer); + } + crate::utils::error::LdkNodeError::TxSyncTimeout => { + ::sse_encode(42, serializer); + } + crate::utils::error::LdkNodeError::GossipUpdateTimeout => { + ::sse_encode(43, serializer); + } + crate::utils::error::LdkNodeError::InvalidOfferId => { + ::sse_encode(44, serializer); + } + crate::utils::error::LdkNodeError::InvalidNodeId => { + ::sse_encode(45, serializer); + } + crate::utils::error::LdkNodeError::InvalidOffer => { + ::sse_encode(46, serializer); + } + crate::utils::error::LdkNodeError::InvalidRefund => { + ::sse_encode(47, serializer); + } + crate::utils::error::LdkNodeError::UnsupportedCurrency => { + ::sse_encode(48, serializer); + } + _ => { + unimplemented!(""); + } + } } } -impl SseEncode for crate::api::types::Config { +impl SseEncode for crate::api::on_chain::LdkOnChainPayment { // 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.storage_dir_path, serializer); - >::sse_encode(self.log_dir_path, serializer); - ::sse_encode(self.network, serializer); - >>::sse_encode( - self.listening_addresses, - serializer, - ); - ::sse_encode(self.default_cltv_expiry_delta, serializer); - ::sse_encode(self.onchain_wallet_sync_interval_secs, serializer); - ::sse_encode(self.wallet_sync_interval_secs, serializer); - ::sse_encode(self.fee_rate_cache_update_interval_secs, serializer); - >::sse_encode(self.trusted_peers_0conf, serializer); - ::sse_encode(self.probing_liquidity_limit_multiplier, serializer); - ::sse_encode(self.log_level, serializer); + >::sse_encode(self.ptr, serializer); } } -impl SseEncode for crate::api::types::EntropySourceConfig { +impl SseEncode for crate::api::spontaneous::LdkSpontaneousPayment { // 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::EntropySourceConfig::SeedFile(field0) => { - ::sse_encode(0, serializer); - ::sse_encode(field0, serializer); - } - crate::api::types::EntropySourceConfig::SeedBytes(field0) => { - ::sse_encode(1, serializer); - <[u8; 64]>::sse_encode(field0, serializer); - } - crate::api::types::EntropySourceConfig::Bip39Mnemonic { - mnemonic, - passphrase, - } => { - ::sse_encode(2, serializer); - ::sse_encode(mnemonic, serializer); - >::sse_encode(passphrase, serializer); - } - } + >::sse_encode(self.ptr, serializer); } } -impl SseEncode for crate::api::types::Event { +impl SseEncode for crate::api::types::LightningBalance { // 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 } => { + crate::api::types::LightningBalance::ClaimableOnChannelClose { + channel_id, + counterparty_node_id, + amount_satoshis, + } => { ::sse_encode(0, serializer); - ::sse_encode(payment_hash, serializer); + ::sse_encode(channel_id, serializer); + ::sse_encode(counterparty_node_id, serializer); + ::sse_encode(amount_satoshis, serializer); } - crate::api::types::Event::PaymentFailed { payment_hash } => { + crate::api::types::LightningBalance::ClaimableAwaitingConfirmations { + channel_id, + counterparty_node_id, + amount_satoshis, + confirmation_height, + } => { ::sse_encode(1, serializer); - ::sse_encode(payment_hash, 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::Event::PaymentReceived { + crate::api::types::LightningBalance::ContentiousClaimable { + channel_id, + counterparty_node_id, + amount_satoshis, + timeout_height, payment_hash, - amount_msat, + 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(amount_msat, serializer); + ::sse_encode(payment_preimage, serializer); } - crate::api::types::Event::ChannelReady { + crate::api::types::LightningBalance::MaybeTimeoutClaimableHTLC { channel_id, - user_channel_id, counterparty_node_id, + amount_satoshis, + claimable_height, + payment_hash, } => { ::sse_encode(3, serializer); ::sse_encode(channel_id, serializer); - ::sse_encode(user_channel_id, serializer); - >::sse_encode( - counterparty_node_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::Event::ChannelClosed { + crate::api::types::LightningBalance::MaybePreimageClaimableHTLC { channel_id, - user_channel_id, counterparty_node_id, + amount_satoshis, + expiry_height, + payment_hash, } => { ::sse_encode(4, serializer); ::sse_encode(channel_id, serializer); - ::sse_encode(user_channel_id, serializer); - >::sse_encode( - counterparty_node_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::Event::ChannelPending { + crate::api::types::LightningBalance::CounterpartyRevokedOutputClaimable { channel_id, - user_channel_id, - former_temporary_channel_id, counterparty_node_id, - funding_txo, + amount_satoshis, } => { ::sse_encode(5, 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(amount_satoshis, serializer); + } + _ => { + unimplemented!(""); } } } } -impl SseEncode for crate::api::types::GossipSourceConfig { +impl SseEncode for crate::api::types::LiquiditySourceConfig { // 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::GossipSourceConfig::P2PNetwork => { - ::sse_encode(0, serializer); - } - crate::api::types::GossipSourceConfig::RapidGossipSync(field0) => { - ::sse_encode(1, serializer); - ::sse_encode(field0, serializer); - } + <( + crate::api::types::SocketAddress, + crate::api::types::PublicKey, + Option, + )>::sse_encode(self.lsps2_service, 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) { + ::sse_encode(self.len() as _, serializer); + for item in self { + ::sse_encode(item, serializer); } } } -impl SseEncode for i32 { +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) { - serializer.cursor.write_i32::(self).unwrap(); + ::sse_encode(self.len() as _, serializer); + for item in self { + ::sse_encode(item, serializer); + } } } -impl SseEncode for crate::api::node::LdkMnemonic { +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.seed_phrase, serializer); + ::sse_encode(self.len() as _, serializer); + for item in self { + ::sse_encode(item, serializer); + } } } -impl SseEncode for crate::api::node::LdkNode { +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.ptr, serializer); + ::sse_encode(self.len() as _, serializer); + for item in self { + ::sse_encode(item, serializer); + } } } -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); + ::sse_encode(item, serializer); } } } -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); + ::sse_encode(item, serializer); } } } -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); + ::sse_encode(item, serializer); } } } @@ -3089,6 +6582,14 @@ impl SseEncode for crate::api::types::LogLevel { } } +impl SseEncode for crate::api::types::LSPFeeLimits { + // 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.max_total_opening_fee_msat, serializer); + >::sse_encode(self.max_proportional_opening_fee_ppm_msat, serializer); + } +} + impl SseEncode for crate::api::types::MaxDustHTLCExposure { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -3101,6 +6602,9 @@ impl SseEncode for crate::api::types::MaxDustHTLCExposure { ::sse_encode(1, serializer); ::sse_encode(field0, serializer); } + _ => { + unimplemented!(""); + } } } } @@ -3123,51 +6627,64 @@ impl SseEncode for crate::api::types::Network { } } -impl SseEncode for crate::api::error::NodeException { +impl SseEncode for crate::api::graph::NodeAnnouncementInfo { // 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::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!(""); - } - }, + ::sse_encode(self.last_update, serializer); + ::sse_encode(self.alias, serializer); + >::sse_encode(self.addresses, serializer); + } +} + +impl SseEncode for crate::api::graph::NodeId { + // 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.compressed, serializer); + } +} + +impl SseEncode for crate::api::graph::NodeInfo { + // 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.channels, serializer); + >::sse_encode( + self.announcement_info, + serializer, + ); + } +} + +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 crate::api::bolt12::Offer { + // 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.s, serializer); + } +} + +impl SseEncode for crate::api::types::OfferId { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + <[u8; 32]>::sse_encode(self.0, 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) { @@ -3178,6 +6695,16 @@ 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) { @@ -3198,6 +6725,46 @@ 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) { + ::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) { @@ -3228,6 +6795,56 @@ 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) { + ::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) { @@ -3238,6 +6855,36 @@ 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) { @@ -3268,6 +6915,16 @@ 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) { @@ -3309,9 +6966,8 @@ impl SseEncode for crate::api::types::OutPoint { impl SseEncode for crate::api::types::PaymentDetails { // 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.hash, serializer); - >::sse_encode(self.preimage, serializer); - >::sse_encode(self.secret, serializer); + ::sse_encode(self.id, serializer); + ::sse_encode(self.kind, serializer); >::sse_encode(self.amount_msat, serializer); ::sse_encode(self.direction, serializer); ::sse_encode(self.status, serializer); @@ -3334,6 +6990,26 @@ 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) { @@ -3341,6 +7017,76 @@ impl SseEncode for crate::api::types::PaymentHash { } } +impl SseEncode for crate::api::types::PaymentId { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + <[u8; 32]>::sse_encode(self.0, serializer); + } +} + +impl SseEncode for crate::api::types::PaymentKind { + // 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::PaymentKind::Onchain => { + ::sse_encode(0, serializer); + } + crate::api::types::PaymentKind::Bolt11 { + hash, + preimage, + secret, + } => { + ::sse_encode(1, serializer); + ::sse_encode(hash, serializer); + >::sse_encode(preimage, serializer); + >::sse_encode(secret, serializer); + } + crate::api::types::PaymentKind::Bolt11Jit { + hash, + preimage, + secret, + lsp_fee_limits, + } => { + ::sse_encode(2, serializer); + ::sse_encode(hash, serializer); + >::sse_encode(preimage, serializer); + >::sse_encode(secret, serializer); + ::sse_encode(lsp_fee_limits, serializer); + } + crate::api::types::PaymentKind::Spontaneous { hash, preimage } => { + ::sse_encode(3, serializer); + ::sse_encode(hash, serializer); + >::sse_encode(preimage, serializer); + } + crate::api::types::PaymentKind::Bolt12Offer { + hash, + preimage, + secret, + offer_id, + } => { + ::sse_encode(4, serializer); + >::sse_encode(hash, serializer); + >::sse_encode(preimage, serializer); + >::sse_encode(secret, serializer); + ::sse_encode(offer_id, serializer); + } + crate::api::types::PaymentKind::Bolt12Refund { + hash, + preimage, + secret, + } => { + ::sse_encode(5, serializer); + >::sse_encode(hash, serializer); + >::sse_encode(preimage, serializer); + >::sse_encode(secret, serializer); + } + _ => { + unimplemented!(""); + } + } + } +} + impl SseEncode for crate::api::types::PaymentPreimage { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -3381,6 +7127,51 @@ 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); + } + _ => { + unimplemented!(""); + } + } + } +} + 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) { @@ -3388,6 +7179,36 @@ impl SseEncode for crate::api::types::PublicKey { } } +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); + } +} + +impl SseEncode for crate::api::bolt12::Refund { + // 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.s, serializer); + } +} + +impl SseEncode for crate::api::graph::RoutingFees { + // 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.base_msat, serializer); + ::sse_encode(self.proportional_millionths, serializer); + } +} + impl SseEncode for crate::api::types::SocketAddress { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -3423,6 +7244,9 @@ impl SseEncode for crate::api::types::SocketAddress { ::sse_encode(addr, serializer); ::sse_encode(port, serializer); } + _ => { + unimplemented!(""); + } } } } @@ -3535,7 +7359,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); } } @@ -3554,10 +7378,3 @@ impl SseEncode for usize { mod io; #[cfg(not(target_family = "wasm"))] pub use io::*; - -/// cbindgen:ignore -#[cfg(target_family = "wasm")] -#[path = "frb_generated.web.rs"] -mod web; -#[cfg(target_family = "wasm")] -pub use web::*; diff --git a/rust/src/frb_generated.web.rs b/rust/src/frb_generated.web.rs index 1785bd2..e91baec 100644 --- a/rust/src/frb_generated.web.rs +++ b/rust/src/frb_generated.web.rs @@ -1,14 +1,16 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. +// Generated by `flutter_rust_bridge`@ 2.0.0. // Section: imports use super::*; +use crate::api::builder::*; use crate::api::node::*; +use crate::*; use flutter_rust_bridge::for_generated::byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt}; -use flutter_rust_bridge::for_generated::transform_result_dco; use flutter_rust_bridge::for_generated::wasm_bindgen; use flutter_rust_bridge::for_generated::wasm_bindgen::prelude::*; +use flutter_rust_bridge::for_generated::{transform_result_dco, Lifetimeable, Lockable}; use flutter_rust_bridge::{Handler, IntoIntoDart}; // Section: boilerplate @@ -42,6 +44,69 @@ 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::AnchorChannelsConfig { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 2, + "Expected 2 elements, got {}", + self_.length() + ); + crate::api::types::AnchorChannelsConfig { + trusted_peers_no_reserve: self_.get(0).cst_decode(), + per_channel_reserve_sats: self_.get(1).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::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 { @@ -61,6 +126,23 @@ 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::utils::error::Bolt12ParseError { + let self_ = self.unchecked_into::(); + match self_.get(0).unchecked_into_f64() as _ { + 0 => crate::utils::error::Bolt12ParseError::InvalidContinuation, + 1 => crate::utils::error::Bolt12ParseError::InvalidBech32Hrp, + 2 => crate::utils::error::Bolt12ParseError::Bech32(self_.get(1).cst_decode()), + 3 => crate::utils::error::Bolt12ParseError::Decode(self_.get(1).cst_decode()), + 4 => crate::utils::error::Bolt12ParseError::InvalidSemantics(self_.get(1).cst_decode()), + 5 => crate::utils::error::Bolt12ParseError::InvalidSignature(self_.get(1).cst_decode()), + _ => unreachable!(), + } + } +} impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { @@ -107,8 +189,8 @@ impl CstDecode .unwrap(); assert_eq!( self_.length(), - 16, - "Expected 16 elements, got {}", + 28, + "Expected 28 elements, got {}", self_.length() ); crate::api::types::ChannelDetails { @@ -119,15 +201,27 @@ 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(), - 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(), + 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(), } } } @@ -150,6 +244,81 @@ 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::graph::ChannelInfo { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 5, + "Expected 5 elements, got {}", + self_.length() + ); + crate::api::graph::ChannelInfo { + node_one: self_.get(0).cst_decode(), + one_to_two: self_.get(1).cst_decode(), + node_two: self_.get(2).cst_decode(), + two_to_one: self_.get(3).cst_decode(), + capacity_sats: 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::graph::ChannelUpdateInfo { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 6, + "Expected 6 elements, got {}", + self_.length() + ); + crate::api::graph::ChannelUpdateInfo { + last_update: self_.get(0).cst_decode(), + enabled: self_.get(1).cst_decode(), + cltv_expiry_delta: self_.get(2).cst_decode(), + htlc_minimum_msat: self_.get(3).cst_decode(), + htlc_maximum_msat: self_.get(4).cst_decode(), + fees: self_.get(5).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::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::LegacyCooperativeClosure, + 3 => crate::api::types::ClosureReason::CounterpartyInitiatedCooperativeClosure, + 4 => crate::api::types::ClosureReason::LocallyInitiatedCooperativeClosure, + 5 => crate::api::types::ClosureReason::CommitmentTxConfirmed, + 6 => crate::api::types::ClosureReason::FundingTimedOut, + 7 => crate::api::types::ClosureReason::ProcessingError { + err: self_.get(1).cst_decode(), + }, + 8 => crate::api::types::ClosureReason::DisconnectedPeer, + 9 => crate::api::types::ClosureReason::OutdatedChannelManager, + 10 => crate::api::types::ClosureReason::CounterpartyCoopClosedUnfundedChannel, + 11 => crate::api::types::ClosureReason::FundingBatchClosure, + 12 => crate::api::types::ClosureReason::HTLCsTimedOut, + _ => unreachable!(), + } + } +} impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { @@ -160,8 +329,8 @@ impl CstDecode .unwrap(); assert_eq!( self_.length(), - 11, - "Expected 11 elements, got {}", + 12, + "Expected 12 elements, got {}", self_.length() ); crate::api::types::Config { @@ -176,6 +345,26 @@ impl CstDecode trusted_peers_0conf: self_.get(8).cst_decode(), probing_liquidity_limit_multiplier: self_.get(9).cst_decode(), log_level: self_.get(10).cst_decode(), + anchor_channels_config: self_.get(11).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::utils::error::DecodeError { + let self_ = self.unchecked_into::(); + match self_.get(0).unchecked_into_f64() as _ { + 0 => crate::utils::error::DecodeError::UnknownVersion, + 1 => crate::utils::error::DecodeError::UnknownRequiredFeature, + 2 => crate::utils::error::DecodeError::InvalidValue, + 3 => crate::utils::error::DecodeError::ShortRead, + 4 => crate::utils::error::DecodeError::BadLengthDescriptor, + 5 => crate::utils::error::DecodeError::Io(self_.get(1).cst_decode()), + 6 => crate::utils::error::DecodeError::UnsupportedCompression, + 7 => crate::utils::error::DecodeError::DangerousValue, + _ => unreachable!(), } } } @@ -203,32 +392,44 @@ impl CstDecode fn cst_decode(self) -> crate::api::types::Event { let self_ = self.unchecked_into::(); match self_.get(0).unchecked_into_f64() as _ { - 0 => crate::api::types::Event::PaymentSuccessful { - payment_hash: self_.get(1).cst_decode(), + 0 => crate::api::types::Event::PaymentClaimable { + payment_id: self_.get(1).cst_decode(), + payment_hash: self_.get(2).cst_decode(), + claimable_amount_msat: self_.get(3).cst_decode(), + claim_deadline: self_.get(4).cst_decode(), + }, + 1 => crate::api::types::Event::PaymentSuccessful { + payment_id: self_.get(1).cst_decode(), + payment_hash: self_.get(2).cst_decode(), + fee_paid_msat: self_.get(3).cst_decode(), }, - 1 => crate::api::types::Event::PaymentFailed { - payment_hash: self_.get(1).cst_decode(), + 2 => crate::api::types::Event::PaymentFailed { + payment_id: self_.get(1).cst_decode(), + payment_hash: self_.get(2).cst_decode(), + reason: self_.get(3).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::PaymentReceived { + payment_id: self_.get(1).cst_decode(), + payment_hash: self_.get(2).cst_decode(), + amount_msat: self_.get(3).cst_decode(), }, - 3 => crate::api::types::Event::ChannelReady { + 4 => 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(), + former_temporary_channel_id: self_.get(3).cst_decode(), + counterparty_node_id: self_.get(4).cst_decode(), + funding_txo: self_.get(5).cst_decode(), }, - 4 => crate::api::types::Event::ChannelClosed { + 5 => crate::api::types::Event::ChannelReady { 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::ChannelPending { + 6 => crate::api::types::Event::ChannelClosed { 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(), + reason: self_.get(4).cst_decode(), }, _ => unreachable!(), } @@ -247,11 +448,11 @@ 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::node::LdkMnemonic { + fn cst_decode(self) -> crate::api::bolt11::LdkBolt11Payment { let self_ = self .dyn_into::() .unwrap(); @@ -261,16 +462,16 @@ impl CstDecode "Expected 1 elements, got {}", self_.length() ); - crate::api::node::LdkMnemonic { - seed_phrase: self_.get(0).cst_decode(), + crate::api::bolt11::LdkBolt11Payment { + ptr: 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::node::LdkNode { + fn cst_decode(self) -> crate::api::bolt12::LdkBolt12Payment { let self_ = self .dyn_into::() .unwrap(); @@ -280,147 +481,54 @@ impl CstDecode "Expected 1 elements, got {}", self_.length() ); - crate::api::node::LdkNode { + crate::api::bolt12::LdkBolt12Payment { 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) -> Vec { - self.dyn_into::() - .unwrap() - .iter() - .map(CstDecode::cst_decode) - .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 -{ - // 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 { - self.into_vec() - } -} -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 -{ - // 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 -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::MaxDustHTLCExposure { - let self_ = self.unchecked_into::(); - match self_.get(0).unchecked_into_f64() as _ { - 0 => crate::api::types::MaxDustHTLCExposure::FixedLimitMsat(self_.get(1).cst_decode()), - 1 => { - crate::api::types::MaxDustHTLCExposure::FeeRateMultiplier(self_.get(1).cst_decode()) - } - _ => unreachable!(), - } - } -} -impl CstDecode> for Option { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> Option { - self.map(CstDecode::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::OutPoint { + fn cst_decode(self) -> crate::api::builder::LdkMnemonic { let self_ = self .dyn_into::() .unwrap(); assert_eq!( self_.length(), - 2, - "Expected 2 elements, got {}", + 1, + "Expected 1 elements, got {}", self_.length() ); - crate::api::types::OutPoint { - txid: self_.get(0).cst_decode(), - vout: self_.get(1).cst_decode(), + crate::api::builder::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::PaymentDetails { + fn cst_decode(self) -> crate::api::graph::LdkNetworkGraph { let self_ = self .dyn_into::() .unwrap(); assert_eq!( self_.length(), - 6, - "Expected 6 elements, got {}", + 1, + "Expected 1 elements, got {}", self_.length() ); - crate::api::types::PaymentDetails { - hash: self_.get(0).cst_decode(), - preimage: self_.get(1).cst_decode(), - secret: self_.get(2).cst_decode(), - amount_msat: self_.get(3).cst_decode(), - direction: self_.get(4).cst_decode(), - status: self_.get(5).cst_decode(), + crate::api::graph::LdkNetworkGraph { + inner: 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::PaymentHash { + fn cst_decode(self) -> crate::api::node::LdkNode { let self_ = self .dyn_into::() .unwrap(); @@ -430,16 +538,76 @@ impl CstDecode "Expected 1 elements, got {}", self_.length() ); - crate::api::types::PaymentHash { - data: self_.get(0).cst_decode(), + crate::api::node::LdkNode { + ptr: 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::PaymentPreimage { + fn cst_decode(self) -> crate::utils::error::LdkNodeError { + let self_ = self.unchecked_into::(); + match self_.get(0).unchecked_into_f64() as _ { + 0 => crate::utils::error::LdkNodeError::InvalidTxid, + 1 => crate::utils::error::LdkNodeError::AlreadyRunning, + 2 => crate::utils::error::LdkNodeError::NotRunning, + 3 => crate::utils::error::LdkNodeError::OnchainTxCreationFailed, + 4 => crate::utils::error::LdkNodeError::ConnectionFailed, + 5 => crate::utils::error::LdkNodeError::InvoiceCreationFailed, + 6 => crate::utils::error::LdkNodeError::PaymentSendingFailed, + 7 => crate::utils::error::LdkNodeError::ProbeSendingFailed, + 8 => crate::utils::error::LdkNodeError::ChannelCreationFailed, + 9 => crate::utils::error::LdkNodeError::ChannelClosingFailed, + 10 => crate::utils::error::LdkNodeError::ChannelConfigUpdateFailed, + 11 => crate::utils::error::LdkNodeError::PersistenceFailed, + 12 => crate::utils::error::LdkNodeError::WalletOperationFailed, + 13 => crate::utils::error::LdkNodeError::OnchainTxSigningFailed, + 14 => crate::utils::error::LdkNodeError::MessageSigningFailed, + 15 => crate::utils::error::LdkNodeError::TxSyncFailed, + 16 => crate::utils::error::LdkNodeError::GossipUpdateFailed, + 17 => crate::utils::error::LdkNodeError::InvalidAddress, + 18 => crate::utils::error::LdkNodeError::InvalidSocketAddress, + 19 => crate::utils::error::LdkNodeError::InvalidPublicKey, + 20 => crate::utils::error::LdkNodeError::InvalidSecretKey, + 21 => crate::utils::error::LdkNodeError::InvalidPaymentHash, + 22 => crate::utils::error::LdkNodeError::InvalidPaymentPreimage, + 23 => crate::utils::error::LdkNodeError::InvalidPaymentSecret, + 24 => crate::utils::error::LdkNodeError::InvalidAmount, + 25 => crate::utils::error::LdkNodeError::InvalidInvoice, + 26 => crate::utils::error::LdkNodeError::InvalidChannelId, + 27 => crate::utils::error::LdkNodeError::InvalidNetwork, + 28 => crate::utils::error::LdkNodeError::DuplicatePayment, + 29 => crate::utils::error::LdkNodeError::InsufficientFunds, + 30 => crate::utils::error::LdkNodeError::FeerateEstimationUpdateFailed, + 31 => crate::utils::error::LdkNodeError::LiquidityRequestFailed, + 32 => crate::utils::error::LdkNodeError::LiquiditySourceUnavailable, + 33 => crate::utils::error::LdkNodeError::LiquidityFeeTooHigh, + 34 => crate::utils::error::LdkNodeError::InvalidPaymentId, + 35 => crate::utils::error::LdkNodeError::Decode(self_.get(1).cst_decode()), + 36 => crate::utils::error::LdkNodeError::Bolt12Parse(self_.get(1).cst_decode()), + 37 => crate::utils::error::LdkNodeError::InvoiceRequestCreationFailed, + 38 => crate::utils::error::LdkNodeError::OfferCreationFailed, + 39 => crate::utils::error::LdkNodeError::RefundCreationFailed, + 40 => crate::utils::error::LdkNodeError::FeerateEstimationUpdateTimeout, + 41 => crate::utils::error::LdkNodeError::WalletOperationTimeout, + 42 => crate::utils::error::LdkNodeError::TxSyncTimeout, + 43 => crate::utils::error::LdkNodeError::GossipUpdateTimeout, + 44 => crate::utils::error::LdkNodeError::InvalidOfferId, + 45 => crate::utils::error::LdkNodeError::InvalidNodeId, + 46 => crate::utils::error::LdkNodeError::InvalidOffer, + 47 => crate::utils::error::LdkNodeError::InvalidRefund, + 48 => crate::utils::error::LdkNodeError::UnsupportedCurrency, + _ => unreachable!(), + } + } +} +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::on_chain::LdkOnChainPayment { let self_ = self .dyn_into::() .unwrap(); @@ -449,16 +617,16 @@ impl CstDecode "Expected 1 elements, got {}", self_.length() ); - crate::api::types::PaymentPreimage { - data: self_.get(0).cst_decode(), + crate::api::on_chain::LdkOnChainPayment { + ptr: 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::PaymentSecret { + fn cst_decode(self) -> crate::api::spontaneous::LdkSpontaneousPayment { let self_ = self .dyn_into::() .unwrap(); @@ -468,23 +636,457 @@ impl CstDecode "Expected 1 elements, got {}", self_.length() ); - crate::api::types::PaymentSecret { - data: self_.get(0).cst_decode(), + crate::api::spontaneous::LdkSpontaneousPayment { + ptr: 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::PeerDetails { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 3, - "Expected 3 elements, got {}", + 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!(), + } + } +} +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 { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 1, + "Expected 1 elements, got {}", + self_.length() + ); + crate::api::types::LiquiditySourceConfig { + lsps2_service: 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) -> Vec { + self.dyn_into::() + .unwrap() + .iter() + .map(CstDecode::cst_decode) + .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 +{ + // 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 +{ + // 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 +{ + // 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 +{ + // 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<[u64]> { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Vec { + self.into_vec() + } +} +impl CstDecode> for Box<[u8]> { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Vec { + self.into_vec() + } +} +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 +{ + // 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 +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::LSPFeeLimits { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 2, + "Expected 2 elements, got {}", + self_.length() + ); + crate::api::types::LSPFeeLimits { + max_total_opening_fee_msat: self_.get(0).cst_decode(), + max_proportional_opening_fee_ppm_msat: self_.get(1).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::MaxDustHTLCExposure { + let self_ = self.unchecked_into::(); + match self_.get(0).unchecked_into_f64() as _ { + 0 => crate::api::types::MaxDustHTLCExposure::FixedLimitMsat(self_.get(1).cst_decode()), + 1 => { + crate::api::types::MaxDustHTLCExposure::FeeRateMultiplier(self_.get(1).cst_decode()) + } + _ => unreachable!(), + } + } +} +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::graph::NodeId { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 1, + "Expected 1 elements, got {}", + self_.length() + ); + crate::api::graph::NodeId { + compressed: 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 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::OfferId { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 1, + "Expected 1 elements, got {}", + self_.length() + ); + crate::api::types::OfferId(self_.get(0).cst_decode()) + } +} +impl CstDecode> for Option { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Option { + self.map(CstDecode::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::OutPoint { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 2, + "Expected 2 elements, got {}", + self_.length() + ); + crate::api::types::OutPoint { + txid: self_.get(0).cst_decode(), + vout: self_.get(1).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::PaymentDetails { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 5, + "Expected 5 elements, got {}", + self_.length() + ); + crate::api::types::PaymentDetails { + id: self_.get(0).cst_decode(), + kind: self_.get(1).cst_decode(), + amount_msat: self_.get(2).cst_decode(), + direction: self_.get(3).cst_decode(), + status: 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::PaymentHash { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 1, + "Expected 1 elements, got {}", + self_.length() + ); + crate::api::types::PaymentHash { + data: 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::PaymentId { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 1, + "Expected 1 elements, got {}", + self_.length() + ); + crate::api::types::PaymentId(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::PaymentKind { + let self_ = self.unchecked_into::(); + match self_.get(0).unchecked_into_f64() as _ { + 0 => crate::api::types::PaymentKind::Onchain, + 1 => crate::api::types::PaymentKind::Bolt11 { + hash: self_.get(1).cst_decode(), + preimage: self_.get(2).cst_decode(), + secret: self_.get(3).cst_decode(), + }, + 2 => crate::api::types::PaymentKind::Bolt11Jit { + hash: self_.get(1).cst_decode(), + preimage: self_.get(2).cst_decode(), + secret: self_.get(3).cst_decode(), + lsp_fee_limits: self_.get(4).cst_decode(), + }, + 3 => crate::api::types::PaymentKind::Spontaneous { + hash: self_.get(1).cst_decode(), + preimage: self_.get(2).cst_decode(), + }, + 4 => crate::api::types::PaymentKind::Bolt12Offer { + hash: self_.get(1).cst_decode(), + preimage: self_.get(2).cst_decode(), + secret: self_.get(3).cst_decode(), + offer_id: self_.get(4).cst_decode(), + }, + 5 => crate::api::types::PaymentKind::Bolt12Refund { + hash: self_.get(1).cst_decode(), + preimage: self_.get(2).cst_decode(), + secret: self_.get(3).cst_decode(), + }, + _ => unreachable!(), + } + } +} +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::PaymentPreimage { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 1, + "Expected 1 elements, got {}", + self_.length() + ); + crate::api::types::PaymentPreimage { + data: 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::PaymentSecret { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 1, + "Expected 1 elements, got {}", + self_.length() + ); + crate::api::types::PaymentSecret { + data: 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::PeerDetails { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 3, + "Expected 3 elements, got {}", self_.length() ); crate::api::types::PeerDetails { @@ -494,6 +1096,34 @@ 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 { @@ -513,6 +1143,57 @@ impl CstDecode } } } +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 +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::RoutingFees { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 2, + "Expected 2 elements, got {}", + self_.length() + ); + crate::api::graph::RoutingFees { + base_msat: self_.get(0).cst_decode(), + proportional_millionths: self_.get(1).cst_decode(), + } + } +} impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { @@ -616,11 +1297,105 @@ 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) -> NodeBuilder { + flutter_rust_bridge::for_generated::rust_auto_opaque_decode_owned(CstDecode::< + RustOpaqueNom>, + >::cst_decode( + self + )) + } +} +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) -> RustOpaqueNom> { + #[cfg(target_pointer_width = "64")] + { + compile_error!("64-bit pointers are not supported."); + } + unsafe { decode_rust_opaque_nom((self.as_f64().unwrap() as usize) as _) } + } +} +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) -> RustOpaqueNom { + #[cfg(target_pointer_width = "64")] + { + compile_error!("64-bit pointers are not supported."); + } + unsafe { decode_rust_opaque_nom((self.as_f64().unwrap() as usize) as _) } + } +} +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, + ) -> RustOpaqueNom> { + #[cfg(target_pointer_width = "64")] + { + compile_error!("64-bit pointers are not supported."); + } + unsafe { decode_rust_opaque_nom((self.as_f64().unwrap() as usize) as _) } + } +} +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) -> RustOpaqueNom { + #[cfg(target_pointer_width = "64")] + { + compile_error!("64-bit pointers are not supported."); + } + unsafe { decode_rust_opaque_nom((self.as_f64().unwrap() as usize) as _) } + } +} +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) -> RustOpaqueNom { + #[cfg(target_pointer_width = "64")] + { + compile_error!("64-bit pointers are not supported."); + } + unsafe { decode_rust_opaque_nom((self.as_f64().unwrap() as usize) as _) } + } +} +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) -> RustOpaqueNom { + #[cfg(target_pointer_width = "64")] + { + compile_error!("64-bit pointers are not supported."); + } + unsafe { decode_rust_opaque_nom((self.as_f64().unwrap() as usize) as _) } + } +} +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) -> RustOpaqueNom { + #[cfg(target_pointer_width = "64")] + { + compile_error!("64-bit pointers are not supported."); + } + unsafe { decode_rust_opaque_nom((self.as_f64().unwrap() as usize) as _) } + } +} +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) -> RustOpaqueNom> { + fn cst_decode(self) -> RustOpaqueNom { #[cfg(target_pointer_width = "64")] { compile_error!("64-bit pointers are not supported."); @@ -640,18 +1415,28 @@ 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) -> i32 { + self.unchecked_into_f64() as _ + } +} +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::BuilderException { + fn cst_decode(self) -> crate::utils::error::LdkBuilderError { (self.unchecked_into_f64() as i32).cst_decode() } } -impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { +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) -> i32 { - self.unchecked_into_f64() as _ + fn cst_decode(self) -> Vec { + let buf = self + .dyn_into::() + .unwrap(); + let buf = flutter_rust_bridge::for_generated::js_sys::Uint8Array::new(&buf.buffer()); + flutter_rust_bridge::for_generated::slice_from_byte_buffer(buf.to_vec()).into() } } impl CstDecode> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { @@ -678,19 +1463,19 @@ 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::NodeException { + fn cst_decode(self) -> crate::api::types::PaymentDirection { (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::types::PaymentDirection { + fn cst_decode(self) -> crate::api::types::PaymentFailureReason { (self.unchecked_into_f64() as i32).cst_decode() } } @@ -714,119 +1499,320 @@ impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValu self.unchecked_into_f64() as _ } } -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) -> u64 { - ::std::convert::TryInto::try_into( - self.dyn_into::() - .unwrap(), - ) - .unwrap() - } +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) -> u64 { + ::std::convert::TryInto::::try_into(self).unwrap() as _ + } +} +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) -> u8 { + self.unchecked_into_f64() as _ + } +} +impl CstDecode<[u8; 12]> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> [u8; 12] { + let vec: Vec = self.cst_decode(); + flutter_rust_bridge::for_generated::from_vec_to_array(vec) + } +} +impl CstDecode<[u8; 16]> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> [u8; 16] { + let vec: Vec = self.cst_decode(); + flutter_rust_bridge::for_generated::from_vec_to_array(vec) + } +} +impl CstDecode<[u8; 32]> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> [u8; 32] { + let vec: Vec = self.cst_decode(); + flutter_rust_bridge::for_generated::from_vec_to_array(vec) + } +} +impl CstDecode<[u8; 4]> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> [u8; 4] { + let vec: Vec = self.cst_decode(); + flutter_rust_bridge::for_generated::from_vec_to_array(vec) + } +} +impl CstDecode<[u8; 64]> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> [u8; 64] { + let vec: Vec = self.cst_decode(); + flutter_rust_bridge::for_generated::from_vec_to_array(vec) + } +} +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) -> usize { + ::std::convert::TryInto::::try_into(self).unwrap() as _ + } +} + +#[wasm_bindgen] +pub fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + amount_msat: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + description: String, + expiry_secs: u32, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_impl( + port_, + that, + amount_msat, + description, + expiry_secs, + ) +} + +#[wasm_bindgen] +pub fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + description: String, + expiry_secs: u32, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_impl( + port_, + that, + description, + expiry_secs, + ) +} + +#[wasm_bindgen] +pub fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel( + 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__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel_impl( + port_, + that, + description, + expiry_secs, + max_proportional_lsp_fee_limit_ppm_msat, + ) +} + +#[wasm_bindgen] +pub fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + amount_msat: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + description: String, + expiry_secs: u32, + max_total_lsp_fee_limit_msat: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel_impl( + port_, + that, + amount_msat, + description, + expiry_secs, + max_total_lsp_fee_limit_msat, + ) +} + +#[wasm_bindgen] +pub fn wire__crate__api__bolt11__ldk_bolt_11_payment_send( + 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__crate__api__bolt11__ldk_bolt_11_payment_send_impl(port_, that, invoice) } -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) -> u8 { - self.unchecked_into_f64() as _ - } + +#[wasm_bindgen] +pub fn wire__crate__api__bolt11__ldk_bolt_11_payment_send_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__crate__api__bolt11__ldk_bolt_11_payment_send_probes_impl(port_, that, invoice) } -impl CstDecode<[u8; 12]> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> [u8; 12] { - let vec: Vec = self.cst_decode(); - flutter_rust_bridge::for_generated::from_vec_to_array(vec) - } + +#[wasm_bindgen] +pub fn wire__crate__api__bolt11__ldk_bolt_11_payment_send_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: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount_impl( + port_, + that, + invoice, + amount_msat, + ) } -impl CstDecode<[u8; 16]> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> [u8; 16] { - let vec: Vec = self.cst_decode(); - flutter_rust_bridge::for_generated::from_vec_to_array(vec) - } + +#[wasm_bindgen] +pub fn wire__crate__api__bolt11__ldk_bolt_11_payment_send_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: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount_impl( + port_, + that, + invoice, + amount_msat, + ) } -impl CstDecode<[u8; 32]> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> [u8; 32] { - let vec: Vec = self.cst_decode(); - flutter_rust_bridge::for_generated::from_vec_to_array(vec) - } + +#[wasm_bindgen] +pub fn wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder( + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder_impl(that) } -impl CstDecode<[u8; 4]> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> [u8; 4] { - let vec: Vec = self.cst_decode(); - flutter_rust_bridge::for_generated::from_vec_to_array(vec) - } + +#[wasm_bindgen] +pub fn wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder( + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + builder: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder_impl(that, builder) } -impl CstDecode<[u8; 64]> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> [u8; 64] { - let vec: Vec = self.cst_decode(); - flutter_rust_bridge::for_generated::from_vec_to_array(vec) - } + +#[wasm_bindgen] +pub fn wire__crate__api__builder__NodeBuilder_build( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire__crate__api__builder__NodeBuilder_build_impl(port_, that) } -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) -> usize { - self.unchecked_into_f64() as _ - } + +#[wasm_bindgen] +pub fn wire__crate__api__builder__NodeBuilder_build_with_fs_store( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire__crate__api__builder__NodeBuilder_build_with_fs_store_impl(port_, that) } #[wasm_bindgen] -pub fn wire_build_with_sqlite_store( +pub fn wire__crate__api__builder__NodeBuilder_create_builder( 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, ) { - wire_build_with_sqlite_store_impl( + wire__crate__api__builder__NodeBuilder_create_builder_impl( port_, config, chain_data_source_config, entropy_source_config, gossip_source_config, + liquidity_source_config, ) } #[wasm_bindgen] -pub fn wire_ldk_mnemonic_generate(port_: flutter_rust_bridge::for_generated::MessagePort) { - wire_ldk_mnemonic_generate_impl(port_) +pub fn wire__crate__api__builder__ldk_mnemonic_generate( + port_: flutter_rust_bridge::for_generated::MessagePort, +) { + wire__crate__api__builder__ldk_mnemonic_generate_impl(port_) +} + +#[wasm_bindgen] +pub fn wire__crate__api__graph__ldk_network_graph_channel( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + short_channel_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire__crate__api__graph__ldk_network_graph_channel_impl(port_, that, short_channel_id) +} + +#[wasm_bindgen] +pub fn wire__crate__api__graph__ldk_network_graph_list_channels( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire__crate__api__graph__ldk_network_graph_list_channels_impl(port_, that) +} + +#[wasm_bindgen] +pub fn wire__crate__api__graph__ldk_network_graph_list_nodes( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire__crate__api__graph__ldk_network_graph_list_nodes_impl(port_, that) +} + +#[wasm_bindgen] +pub fn wire__crate__api__node__ldk_node_bolt11_payment( + port_: flutter_rust_bridge::for_generated::MessagePort, + ptr: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire__crate__api__node__ldk_node_bolt11_payment_impl(port_, ptr) } #[wasm_bindgen] -pub fn wire_ldk_node_close_channel( +pub fn wire__crate__api__node__ldk_node_bolt12_payment( + port_: flutter_rust_bridge::for_generated::MessagePort, + ptr: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire__crate__api__node__ldk_node_bolt12_payment_impl(port_, ptr) +} + +#[wasm_bindgen] +pub fn wire__crate__api__node__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, + user_channel_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, counterparty_node_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_close_channel_impl(port_, that, channel_id, counterparty_node_id) + wire__crate__api__node__ldk_node_close_channel_impl( + port_, + that, + user_channel_id, + counterparty_node_id, + ) +} + +#[wasm_bindgen] +pub fn wire__crate__api__node__ldk_node_config( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire__crate__api__node__ldk_node_config_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_connect( +pub fn wire__crate__api__node__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_ldk_node_connect_impl(port_, that, node_id, address, persist) + wire__crate__api__node__ldk_node_connect_impl(port_, that, node_id, address, persist) } #[wasm_bindgen] -pub fn wire_ldk_node_connect_open_channel( +pub fn wire__crate__api__node__ldk_node_connect_open_channel( port_: flutter_rust_bridge::for_generated::MessagePort, that: 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, + channel_amount_sats: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, 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_ldk_node_connect_open_channel_impl( + wire__crate__api__node__ldk_node_connect_open_channel_impl( port_, that, socket_address, @@ -839,322 +1825,423 @@ pub fn wire_ldk_node_connect_open_channel( } #[wasm_bindgen] -pub fn wire_ldk_node_disconnect( +pub fn wire__crate__api__node__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_ldk_node_disconnect_impl(port_, that, counterparty_node_id) + wire__crate__api__node__ldk_node_disconnect_impl(port_, that, counterparty_node_id) } #[wasm_bindgen] -pub fn wire_ldk_node_event_handled( +pub fn wire__crate__api__node__ldk_node_event_handled( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_event_handled_impl(port_, that) + wire__crate__api__node__ldk_node_event_handled_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_is_running( +pub fn wire__crate__api__node__ldk_node_force_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_ldk_node_is_running_impl(port_, that) + wire__crate__api__node__ldk_node_force_close_channel_impl( + port_, + that, + user_channel_id, + counterparty_node_id, + ) } #[wasm_bindgen] -pub fn wire_ldk_node_list_channels( +pub fn wire__crate__api__node__ldk_node_list_balances( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_list_channels_impl(port_, that) + wire__crate__api__node__ldk_node_list_balances_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_list_payments( +pub fn wire__crate__api__node__ldk_node_list_channels( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_list_payments_impl(port_, that) + wire__crate__api__node__ldk_node_list_channels_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_list_payments_with_filter( +pub fn wire__crate__api__node__ldk_node_list_payments( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - payment_direction: i32, ) { - wire_ldk_node_list_payments_with_filter_impl(port_, that, payment_direction) + wire__crate__api__node__ldk_node_list_payments_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_list_peers( +pub fn wire__crate__api__node__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_ldk_node_list_peers_impl(port_, that) + wire__crate__api__node__ldk_node_list_payments_with_filter_impl(port_, that, payment_direction) } #[wasm_bindgen] -pub fn wire_ldk_node_listening_addresses( +pub fn wire__crate__api__node__ldk_node_list_peers( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_listening_addresses_impl(port_, that) + wire__crate__api__node__ldk_node_list_peers_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_new_onchain_address( +pub fn wire__crate__api__node__ldk_node_listening_addresses( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_new_onchain_address_impl(port_, that) + wire__crate__api__node__ldk_node_listening_addresses_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_next_event( +pub fn wire__crate__api__node__ldk_node_network_graph( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_next_event_impl(port_, that) + wire__crate__api__node__ldk_node_network_graph_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_node_id( +pub fn wire__crate__api__node__ldk_node_next_event( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_node_id_impl(port_, that) + wire__crate__api__node__ldk_node_next_event_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_payment( +pub fn wire__crate__api__node__ldk_node_next_event_async( 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_ldk_node_payment_impl(port_, that, payment_hash) + wire__crate__api__node__ldk_node_next_event_async_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_receive_payment( +pub fn wire__crate__api__node__ldk_node_node_id( 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_ldk_node_receive_payment_impl(port_, that, amount_msat, description, expiry_secs) + wire__crate__api__node__ldk_node_node_id_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_receive_variable_amount_payment( +pub fn wire__crate__api__node__ldk_node_on_chain_payment( port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - description: String, - expiry_secs: u32, + ptr: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_receive_variable_amount_payment_impl(port_, that, description, expiry_secs) + wire__crate__api__node__ldk_node_on_chain_payment_impl(port_, ptr) } #[wasm_bindgen] -pub fn wire_ldk_node_remove_payment( +pub fn wire__crate__api__node__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, + payment_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_remove_payment_impl(port_, that, payment_hash) + wire__crate__api__node__ldk_node_payment_impl(port_, that, payment_id) } #[wasm_bindgen] -pub fn wire_ldk_node_send_all_to_onchain_address( +pub fn wire__crate__api__node__ldk_node_remove_payment( 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, + payment_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_send_all_to_onchain_address_impl(port_, that, address) + wire__crate__api__node__ldk_node_remove_payment_impl(port_, that, payment_id) } #[wasm_bindgen] -pub fn wire_ldk_node_send_payment( +pub fn wire__crate__api__node__ldk_node_sign_message( 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, + msg: Box<[u8]>, ) { - wire_ldk_node_send_payment_impl(port_, that, invoice) + wire__crate__api__node__ldk_node_sign_message_impl(port_, that, msg) } #[wasm_bindgen] -pub fn wire_ldk_node_send_payment_probes( +pub fn wire__crate__api__node__ldk_node_spontaneous_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, + ptr: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_send_payment_probes_impl(port_, that, invoice) + wire__crate__api__node__ldk_node_spontaneous_payment_impl(port_, ptr) } #[wasm_bindgen] -pub fn wire_ldk_node_send_payment_probes_using_amount( +pub fn wire__crate__api__node__ldk_node_start( 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_ldk_node_send_payment_probes_using_amount_impl(port_, that, invoice, amount_msat) + wire__crate__api__node__ldk_node_start_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_send_payment_using_amount( +pub fn wire__crate__api__node__ldk_node_status( 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_ldk_node_send_payment_using_amount_impl(port_, that, invoice, amount_msat) + wire__crate__api__node__ldk_node_status_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_send_spontaneous_payment( +pub fn wire__crate__api__node__ldk_node_stop( 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_ldk_node_send_spontaneous_payment_impl(port_, that, amount_msat, node_id) + wire__crate__api__node__ldk_node_stop_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_send_spontaneous_payment_probes( +pub fn wire__crate__api__node__ldk_node_sync_wallets( 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_ldk_node_send_spontaneous_payment_probes_impl(port_, that, amount_msat, node_id) + wire__crate__api__node__ldk_node_sync_wallets_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_send_to_onchain_address( +pub fn wire__crate__api__node__ldk_node_update_channel_config( 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, + user_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_ldk_node_send_to_onchain_address_impl(port_, that, address, amount_sats) + wire__crate__api__node__ldk_node_update_channel_config_impl( + port_, + that, + user_channel_id, + counterparty_node_id, + channel_config, + ) } #[wasm_bindgen] -pub fn wire_ldk_node_sign_message( +pub fn wire__crate__api__node__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, + public_key: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_sign_message_impl(port_, that, msg) + wire__crate__api__node__ldk_node_verify_signature_impl(port_, that, msg, sig, public_key) } #[wasm_bindgen] -pub fn wire_ldk_node_spendable_onchain_balance_sats( +pub fn wire__crate__api__node__ldk_node_wait_next_event( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_spendable_onchain_balance_sats_impl(port_, that) + wire__crate__api__node__ldk_node_wait_next_event_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_start( +pub fn wire__crate__api__on_chain__ldk_on_chain_payment_new_address( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_start_impl(port_, that) + wire__crate__api__on_chain__ldk_on_chain_payment_new_address_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_stop( +pub fn wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_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_ldk_node_stop_impl(port_, that) + wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address_impl(port_, that, address) } #[wasm_bindgen] -pub fn wire_ldk_node_sync_wallets( +pub fn wire__crate__api__on_chain__ldk_on_chain_payment_send_to_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: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_sync_wallets_impl(port_, that) + wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address_impl( + port_, + that, + address, + amount_sats, + ) } #[wasm_bindgen] -pub fn wire_ldk_node_total_onchain_balance_sats( +pub fn wire__crate__api__spontaneous__ldk_spontaneous_payment_send( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + amount_msat: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + node_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_total_onchain_balance_sats_impl(port_, that) + wire__crate__api__spontaneous__ldk_spontaneous_payment_send_impl( + port_, + that, + amount_msat, + node_id, + ) } #[wasm_bindgen] -pub fn wire_ldk_node_update_channel_config( +pub fn wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes( 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, + amount_msat: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + node_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_update_channel_config_impl( + wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes_impl( port_, that, - channel_id, - counterparty_node_id, - channel_config, + amount_msat, + node_id, ) } #[wasm_bindgen] -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, +pub fn rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ptr: *const std::ffi::c_void, ) { - wire_ldk_node_verify_signature_impl(port_, that, msg, sig, pkey) + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } } #[wasm_bindgen] -pub fn wire_ldk_node_wait_next_event( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +pub fn rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ptr: *const std::ffi::c_void, ) { - wire_ldk_node_wait_next_event_impl(port_, that) + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } } #[wasm_bindgen] -pub fn wire_socket_address_as_string( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +pub fn rust_arc_increment_strong_count_RustOpaque_Node(ptr: *const std::ffi::c_void) { + unsafe { + StdArc::::increment_strong_count(ptr as _); + } +} + +#[wasm_bindgen] +pub fn rust_arc_decrement_strong_count_RustOpaque_Node(ptr: *const std::ffi::c_void) { + unsafe { + StdArc::::decrement_strong_count(ptr as _); + } +} + +#[wasm_bindgen] +pub fn rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + ptr: *const std::ffi::c_void, ) { - wire_socket_address_as_string_impl(port_, that) + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } } #[wasm_bindgen] -pub fn wire_socket_address_from_str( - port_: flutter_rust_bridge::for_generated::MessagePort, - address: String, +pub fn rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } +} + +#[wasm_bindgen] +pub fn rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilder(ptr: *const std::ffi::c_void) { + unsafe { + StdArc::::increment_strong_count(ptr as _); + } +} + +#[wasm_bindgen] +pub fn rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilder(ptr: *const std::ffi::c_void) { + unsafe { + StdArc::::decrement_strong_count(ptr as _); + } +} + +#[wasm_bindgen] +pub fn rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraph( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::::increment_strong_count(ptr as _); + } +} + +#[wasm_bindgen] +pub fn rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraph( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::::decrement_strong_count(ptr as _); + } +} + +#[wasm_bindgen] +pub fn rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::::increment_strong_count(ptr as _); + } +} + +#[wasm_bindgen] +pub fn rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( + ptr: *const std::ffi::c_void, ) { - wire_socket_address_from_str_impl(port_, address) + unsafe { + StdArc::::decrement_strong_count(ptr as _); + } +} + +#[wasm_bindgen] +pub fn rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::::increment_strong_count(ptr as _); + } } #[wasm_bindgen] -pub fn rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore(ptr: *const std::ffi::c_void) { +pub fn rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::::decrement_strong_count(ptr as _); + } +} + +#[wasm_bindgen] +pub fn rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( + ptr: *const std::ffi::c_void, +) { unsafe { - StdArc::>::increment_strong_count(ptr as _); + StdArc::::increment_strong_count(ptr as _); } } #[wasm_bindgen] -pub fn rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore(ptr: *const std::ffi::c_void) { +pub fn rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( + ptr: *const std::ffi::c_void, +) { unsafe { - StdArc::>::decrement_strong_count(ptr as _); + StdArc::::decrement_strong_count(ptr as _); } } diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 0458c57..bdb0d23 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -1,3 +1,4 @@ mod frb_generated; /* AUTO INJECTED BY flutter_rust_bridge. This line may not be accurate, and you can change it according to your needs. */ pub mod api; +pub mod utils; diff --git a/rust/src/utils/error.rs b/rust/src/utils/error.rs new file mode 100644 index 0000000..a988553 --- /dev/null +++ b/rust/src/utils/error.rs @@ -0,0 +1,289 @@ +use ldk_node::{BuildError, NodeError}; + +#[derive(Debug, PartialEq)] +pub enum LdkNodeError { + InvalidTxid, + /// Returned when trying to start [Node] while it is already running. + AlreadyRunning, + /// Returned when trying to stop [Node] while it is not running. + NotRunning, + /// An on-chain transaction could not be created. + OnchainTxCreationFailed, + /// A network connection has been closed. + ConnectionFailed, + /// Invoice creation failed. + InvoiceCreationFailed, + /// Sending a payment has failed. + PaymentSendingFailed, + /// Sending a payment probe has failed. + ProbeSendingFailed, + /// A channel could not be opened. + ChannelCreationFailed, + /// A channel could not be closed. + ChannelClosingFailed, + /// A channel config could not be updated. + ChannelConfigUpdateFailed, + /// Persistence failed. + PersistenceFailed, + /// A wallet operation failed. + WalletOperationFailed, + /// A signing operation for transaction failed. + OnchainTxSigningFailed, + /// A signing operation for message failed. + MessageSigningFailed, + /// A transaction sync operation failed. + TxSyncFailed, + /// A gossip updating operation failed. + GossipUpdateFailed, + /// The given address is invalid. + InvalidAddress, + /// The given network address is invalid. + InvalidSocketAddress, + /// The given public key is invalid. + InvalidPublicKey, + /// The given secret key is invalid. + InvalidSecretKey, + /// The given payment hash is invalid. + InvalidPaymentHash, + /// The given payment preimage is invalid. + InvalidPaymentPreimage, + /// The given payment secret is invalid. + InvalidPaymentSecret, + /// The given amount is invalid. + InvalidAmount, + /// The given invoice is invalid. + InvalidInvoice, + /// The given channel ID is invalid. + InvalidChannelId, + /// The given network is invalid. + InvalidNetwork, + /// A payment with the given hash has already been initiated. + DuplicatePayment, + /// There are insufficient funds to complete the given operation. + InsufficientFunds, + ///A fee rate estimation update failed. + FeerateEstimationUpdateFailed, + ///A liquidity request operation failed. + LiquidityRequestFailed, + ///The given operation failed due to the required liquidity source being unavailable. + LiquiditySourceUnavailable, + ///The given operation failed due to the LSP's required opening fee being too high. + LiquidityFeeTooHigh, + ///The given payment id is invalid. + InvalidPaymentId, + ///An error in decoding a message or struct. + Decode(DecodeError), + ///An error in decoding the Bolt12 offer. + Bolt12Parse(Bolt12ParseError), + ///Invoice request creation failed. + InvoiceRequestCreationFailed, + ///Offer creation failed. + OfferCreationFailed, + ///Refund creation failed. + RefundCreationFailed, + ///A fee rate estimation update timed out. + FeerateEstimationUpdateTimeout, + ///A wallet operation timed out. + WalletOperationTimeout, + ///A transaction sync operation timed out. + TxSyncTimeout, + ///A gossip updating operation timed out. + GossipUpdateTimeout, + ///The given offer id is invalid. + InvalidOfferId, + ///The given node id is invalid. + InvalidNodeId, + ///The given offer is invalid. + InvalidOffer, + ///The given refund is invalid. + InvalidRefund, + ///The provided offer was denominated in an unsupported currency. + UnsupportedCurrency, +} +#[allow(dead_code)] +#[derive(Debug)] +pub enum LdkBuilderError { + SocketAddressParseError, + /// The given seed bytes are invalid, e.g., have invalid length. + InvalidSeedBytes, + /// The given seed file is invalid, e.g., has invalid length, or could not be read. + InvalidSeedFile, + /// The current system time is invalid, clocks might have gone backwards. + InvalidSystemTime, + /// The a read channel monitor is invalid. + InvalidChannelMonitor, + /// The given listening addresses are invalid, e.g. too many were passed. + InvalidListeningAddress, + /// We failed to read data from the [`KVStore`]. + ReadFailed, + /// We failed to write data to the [`KVStore`]. + WriteFailed, + /// We failed to access the given `storage_dir_path`. + StoragePathAccessFailed, + /// We failed to setup our [`KVStore`]. + KVStoreSetupFailed, + /// We failed to setup the onchain wallet. + WalletSetupFailed, + /// We failed to setup the logger. + LoggerSetupFailed, + + InvalidPublicKey, +} + +impl From for LdkNodeError { + fn from(value: NodeError) -> Self { + match value { + NodeError::AlreadyRunning => LdkNodeError::AlreadyRunning, + NodeError::NotRunning => LdkNodeError::NotRunning, + NodeError::OnchainTxCreationFailed => LdkNodeError::OnchainTxCreationFailed, + NodeError::ConnectionFailed => LdkNodeError::ConnectionFailed, + NodeError::InvoiceCreationFailed => LdkNodeError::InvoiceCreationFailed, + NodeError::PaymentSendingFailed => LdkNodeError::PaymentSendingFailed, + NodeError::ProbeSendingFailed => LdkNodeError::ProbeSendingFailed, + NodeError::ChannelCreationFailed => LdkNodeError::ChannelCreationFailed, + NodeError::ChannelClosingFailed => LdkNodeError::ChannelClosingFailed, + NodeError::ChannelConfigUpdateFailed => LdkNodeError::ChannelConfigUpdateFailed, + NodeError::PersistenceFailed => LdkNodeError::PersistenceFailed, + NodeError::WalletOperationFailed => LdkNodeError::WalletOperationFailed, + NodeError::OnchainTxSigningFailed => LdkNodeError::OnchainTxSigningFailed, + NodeError::MessageSigningFailed => LdkNodeError::MessageSigningFailed, + NodeError::TxSyncFailed => LdkNodeError::TxSyncFailed, + NodeError::GossipUpdateFailed => LdkNodeError::GossipUpdateFailed, + NodeError::InvalidAddress => LdkNodeError::InvalidAddress, + NodeError::InvalidSocketAddress => LdkNodeError::InvalidSocketAddress, + NodeError::InvalidPublicKey => LdkNodeError::InvalidPublicKey, + NodeError::InvalidSecretKey => LdkNodeError::InvalidSecretKey, + NodeError::InvalidPaymentHash => LdkNodeError::InvalidPaymentHash, + NodeError::InvalidPaymentPreimage => LdkNodeError::InvalidPaymentPreimage, + NodeError::InvalidPaymentSecret => LdkNodeError::InvalidPaymentSecret, + NodeError::InvalidAmount => LdkNodeError::InvalidAmount, + NodeError::InvalidInvoice => LdkNodeError::InvalidInvoice, + NodeError::InvalidChannelId => LdkNodeError::InvalidChannelId, + NodeError::InvalidNetwork => LdkNodeError::InvalidNetwork, + NodeError::DuplicatePayment => LdkNodeError::DuplicatePayment, + NodeError::InsufficientFunds => LdkNodeError::InsufficientFunds, + NodeError::FeerateEstimationUpdateFailed => LdkNodeError::FeerateEstimationUpdateFailed, + NodeError::LiquidityRequestFailed => LdkNodeError::LiquidityRequestFailed, + NodeError::LiquiditySourceUnavailable => LdkNodeError::LiquiditySourceUnavailable, + NodeError::LiquidityFeeTooHigh => LdkNodeError::LiquidityFeeTooHigh, + NodeError::InvalidPaymentId => LdkNodeError::InvalidPaymentId, + NodeError::InvoiceRequestCreationFailed => LdkNodeError::InvoiceRequestCreationFailed, + NodeError::OfferCreationFailed => LdkNodeError::OfferCreationFailed, + NodeError::RefundCreationFailed => LdkNodeError::RefundCreationFailed, + NodeError::FeerateEstimationUpdateTimeout => { + LdkNodeError::FeerateEstimationUpdateTimeout + } + NodeError::WalletOperationTimeout => LdkNodeError::WalletOperationTimeout, + NodeError::TxSyncTimeout => LdkNodeError::TxSyncTimeout, + NodeError::GossipUpdateTimeout => LdkNodeError::GossipUpdateTimeout, + NodeError::InvalidOfferId => LdkNodeError::InvalidOfferId, + NodeError::InvalidNodeId => LdkNodeError::InvalidNodeId, + NodeError::InvalidOffer => LdkNodeError::InvalidOffer, + NodeError::InvalidRefund => LdkNodeError::InvalidRefund, + NodeError::UnsupportedCurrency => LdkNodeError::UnsupportedCurrency, + } + } +} +impl From for LdkBuilderError { + fn from(value: BuildError) -> Self { + match value { + BuildError::InvalidSeedBytes => LdkBuilderError::InvalidSeedBytes, + BuildError::InvalidSeedFile => LdkBuilderError::InvalidSeedFile, + BuildError::InvalidSystemTime => LdkBuilderError::InvalidSystemTime, + BuildError::ReadFailed => LdkBuilderError::ReadFailed, + BuildError::WriteFailed => LdkBuilderError::WriteFailed, + BuildError::StoragePathAccessFailed => LdkBuilderError::StoragePathAccessFailed, + BuildError::WalletSetupFailed => LdkBuilderError::WalletSetupFailed, + BuildError::LoggerSetupFailed => LdkBuilderError::LoggerSetupFailed, + BuildError::InvalidChannelMonitor => LdkBuilderError::InvalidChannelMonitor, + BuildError::KVStoreSetupFailed => LdkBuilderError::KVStoreSetupFailed, + BuildError::InvalidListeningAddresses => LdkBuilderError::InvalidListeningAddress, + } + } +} + +impl From for LdkBuilderError { + fn from(value: ldk_node::bip39::Error) -> Self { + match value { + ldk_node::bip39::Error::BadWordCount(_) => LdkBuilderError::InvalidSeedBytes, + ldk_node::bip39::Error::UnknownWord(_) => LdkBuilderError::InvalidSeedBytes, + ldk_node::bip39::Error::BadEntropyBitCount(_) => LdkBuilderError::InvalidSeedBytes, + ldk_node::bip39::Error::InvalidChecksum => LdkBuilderError::InvalidSeedBytes, + ldk_node::bip39::Error::AmbiguousLanguages(_) => LdkBuilderError::InvalidSeedBytes, + } + } +} +impl From for LdkNodeError { + fn from(value: ldk_node::lightning::ln::msgs::DecodeError) -> Self { + LdkNodeError::Decode(value.into()) + } +} +impl From for DecodeError { + fn from(e: ldk_node::lightning::ln::msgs::DecodeError) -> Self { + match e { + ldk_node::lightning::ln::msgs::DecodeError::UnknownVersion => { + DecodeError::UnknownVersion + } + ldk_node::lightning::ln::msgs::DecodeError::UnknownRequiredFeature => { + DecodeError::UnknownRequiredFeature + } + ldk_node::lightning::ln::msgs::DecodeError::InvalidValue => DecodeError::InvalidValue, + ldk_node::lightning::ln::msgs::DecodeError::ShortRead => DecodeError::ShortRead, + ldk_node::lightning::ln::msgs::DecodeError::BadLengthDescriptor => { + DecodeError::BadLengthDescriptor + } + ldk_node::lightning::ln::msgs::DecodeError::Io(e) => DecodeError::Io(e.to_string()), + ldk_node::lightning::ln::msgs::DecodeError::UnsupportedCompression => { + DecodeError::UnsupportedCompression + } + ldk_node::lightning::ln::msgs::DecodeError::DangerousValue => { + DecodeError::DangerousValue + } + } + } +} +#[derive(Debug, PartialEq)] +pub enum DecodeError { + UnknownVersion, + UnknownRequiredFeature, + InvalidValue, + ShortRead, + BadLengthDescriptor, + Io(String), + UnsupportedCompression, + DangerousValue, +} + +#[derive(Debug, PartialEq)] +pub enum Bolt12ParseError { + InvalidContinuation, + InvalidBech32Hrp, + Bech32(String), + Decode(DecodeError), + InvalidSemantics(String), + InvalidSignature(String), +} +impl From for LdkNodeError { + fn from(value: ldk_node::lightning::offers::parse::Bolt12ParseError) -> Self { + match value { + ldk_node::lightning::offers::parse::Bolt12ParseError::InvalidContinuation => { + LdkNodeError::Bolt12Parse(Bolt12ParseError::InvalidContinuation) + } + ldk_node::lightning::offers::parse::Bolt12ParseError::InvalidBech32Hrp => { + LdkNodeError::Bolt12Parse(Bolt12ParseError::InvalidBech32Hrp) + } + ldk_node::lightning::offers::parse::Bolt12ParseError::Bech32(e) => { + LdkNodeError::Bolt12Parse(Bolt12ParseError::Bech32(e.to_string())) + } + ldk_node::lightning::offers::parse::Bolt12ParseError::Decode(e) => { + LdkNodeError::Bolt12Parse(Bolt12ParseError::Decode(e.into())) + } + ldk_node::lightning::offers::parse::Bolt12ParseError::InvalidSemantics(e) => { + LdkNodeError::Bolt12Parse(Bolt12ParseError::InvalidSemantics(format!("{:?}", e))) + } + ldk_node::lightning::offers::parse::Bolt12ParseError::InvalidSignature(e) => { + LdkNodeError::Bolt12Parse(Bolt12ParseError::InvalidSignature(e.to_string())) + } + } + } +} diff --git a/rust/src/utils/mod.rs b/rust/src/utils/mod.rs new file mode 100644 index 0000000..a91e735 --- /dev/null +++ b/rust/src/utils/mod.rs @@ -0,0 +1 @@ +pub mod error; From d733d0f3066f9bbe31264301cba4608f21881a24 Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Mon, 1 Jul 2024 12:00:00 -0400 Subject: [PATCH 36/48] code cleanup --- .github/workflows/precompile_binaries.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/precompile_binaries.yml b/.github/workflows/precompile_binaries.yml index 4ecdbac..70f9010 100644 --- a/.github/workflows/precompile_binaries.yml +++ b/.github/workflows/precompile_binaries.yml @@ -1,6 +1,6 @@ on: push: - branches: [main, upgrade-v0.3.0, v0.3.0] + branches: [main, v0.3.0] name: Precompile Binaries From 8e22230f61074594403c5fec3822197722cf5c62 Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Mon, 1 Jul 2024 19:47:00 -0400 Subject: [PATCH 37/48] Merge branch 'main' into v0.3.0 --- ios/ldk_node.podspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/ldk_node.podspec b/ios/ldk_node.podspec index efbef9a..78bda57 100644 --- a/ios/ldk_node.podspec +++ b/ios/ldk_node.podspec @@ -2,9 +2,9 @@ Pod::Spec.new do |s| s.name = 'ldk_node' s.version = '0.3.0' s.summary = 'A ready-to-go Lightning node library built using LDK and BDK.' - s.homepage = 'http://example.com' + s.homepage = 'https://www.LtbL.io' s.license = { :file => '../LICENSE' } - s.author = { 'Your Company' => 'email@example.com' } + s.author = { 'Let there be Lightning, Inc' => 'hello@LtbL.io' } s.source = { :path => '.' } s.source_files = 'Classes/**/*' s.dependency 'Flutter' From f1aa61489663f577a41f459579846644ee34d0ed Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Tue, 2 Jul 2024 13:44:00 -0400 Subject: [PATCH 38/48] toolchain updated stable --- lib/src/generated/api/types.dart | 2 +- rust/cargokit.yaml | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/src/generated/api/types.dart b/lib/src/generated/api/types.dart index 46a07c6..1af2513 100644 --- a/lib/src/generated/api/types.dart +++ b/lib/src/generated/api/types.dart @@ -10,7 +10,7 @@ import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; import 'package:freezed_annotation/freezed_annotation.dart' hide protected; part 'types.freezed.dart'; -// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `default`, `default`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `hash`, `hash`, `hash`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from` +// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `default`, `default`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `hash`, `hash`, `hash`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from` /// A Bitcoin address. /// diff --git a/rust/cargokit.yaml b/rust/cargokit.yaml index fc12e2c..c57f2dd 100644 --- a/rust/cargokit.yaml +++ b/rust/cargokit.yaml @@ -1,9 +1,6 @@ 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_ From 33d61a4c6da4f418dc6019deb1b154c55210bc34 Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Tue, 2 Jul 2024 19:43:00 -0400 Subject: [PATCH 39/48] opt-level updated to 3 --- rust/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 36d8254..e81455f 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -17,7 +17,7 @@ ldk-node = { version = "= 0.3.0" } [profile.release] -opt-level = 'z' # Optimize for size. +opt-level = 3 # Optimize for size. lto = true # Enable Link Time Optimization codegen-units = 1 # Reduce number of codegen units to increase optimizations. panic = 'abort' From c860dd9faaed2d7be9381cf3ddde101ad23249ff Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Wed, 3 Jul 2024 08:21:00 -0400 Subject: [PATCH 40/48] feat(Node): exposed bolt12Payment handler --- lib/src/root.dart | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/src/root.dart b/lib/src/root.dart index 33d02df..9607cfe 100644 --- a/lib/src/root.dart +++ b/lib/src/root.dart @@ -399,7 +399,7 @@ class Node extends LdkNode { } } - ///Returns a payment handler allowing to create and pay BOLT 11 invoices. + ///Returns a payment handler allowing to create and pay BOLT 11 invoices. Future bolt11Payment() async { try { final res = await LdkNode.bolt11Payment(ptr: this); @@ -409,6 +409,16 @@ class Node extends LdkNode { } } + ///Returns a payment handler allowing to create and pay BOLT 12 invoices. + Future bolt12Payment() async { + try { + final res = await LdkNode.bolt12Payment(ptr: this); + return Bolt12Payment._(ptr: res.ptr); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + ///Returns a payment handler allowing to send and receive on-chain payments. Future onChainPayment() async { try { From f43c5866de94fea41556639edd91bcbd1ac970e0 Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Wed, 3 Jul 2024 17:45:00 -0400 Subject: [PATCH 41/48] integration_test added --- example/pubspec.lock | 55 ++++++++++++++++++++++++++++++++++++++++---- example/pubspec.yaml | 4 ++++ 2 files changed, 55 insertions(+), 4 deletions(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index d7b0271..da2e496 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -89,6 +89,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.2" + file: + dependency: transitive + description: + name: file + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" + source: hosted + version: "7.0.0" fixnum: dependency: transitive description: @@ -102,6 +110,11 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_driver: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" flutter_lints: dependency: "direct dev" description: @@ -127,10 +140,15 @@ packages: dependency: transitive description: name: freezed_annotation - sha256: c3fd9336eb55a38cc1bbd79ab17573113a8deccd0ecbbf926cca3c62803b5c2d + sha256: f54946fdb1fa7b01f780841937b1a80783a20b393485f3f6cdf336fd6f4705f2 url: "https://pub.dev" source: hosted - version: "2.4.1" + version: "2.4.2" + fuchsia_remote_debug_protocol: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" google_fonts: dependency: "direct main" description: @@ -155,6 +173,11 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.2" + integration_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" json_annotation: dependency: transitive description: @@ -286,10 +309,10 @@ packages: dependency: transitive description: name: platform - sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65" + sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec" url: "https://pub.dev" source: hosted - version: "3.1.5" + version: "3.1.4" plugin_platform_interface: dependency: transitive description: @@ -298,6 +321,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.8" + process: + dependency: transitive + description: + name: process + sha256: "21e54fd2faf1b5bdd5102afd25012184a6793927648ea81eea80552ac9405b32" + url: "https://pub.dev" + source: hosted + version: "5.0.2" sky_engine: dependency: transitive description: flutter @@ -343,6 +374,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.0" + sync_http: + dependency: transitive + description: + name: sync_http + sha256: "7f0cd72eca000d2e026bcd6f990b81d0ca06022ef4e32fb257b30d3d1014a961" + url: "https://pub.dev" + source: hosted + version: "0.3.1" term_glyph: dependency: transitive description: @@ -399,6 +438,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.5.1" + webdriver: + dependency: transitive + description: + name: webdriver + sha256: "003d7da9519e1e5f329422b36c4dcdf18d7d2978d1ba099ea4e45ba490ed845e" + url: "https://pub.dev" + source: hosted + version: "3.0.3" win32: dependency: transitive description: diff --git a/example/pubspec.yaml b/example/pubspec.yaml index b2b4e1c..db48300 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -16,6 +16,10 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + integration_test: + sdk: flutter + flutter_driver: + sdk: flutter flutter_lints: ^2.0.0 flutter: uses-material-design: true \ No newline at end of file From 611fd970859f3abf6f6b6aec36af98d11bf8ef9d Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Thu, 4 Jul 2024 00:44:00 -0400 Subject: [PATCH 42/48] Added bolt11 integration test --- .../integration_test/bolt11_and_12_test.dart | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 example/integration_test/bolt11_and_12_test.dart diff --git a/example/integration_test/bolt11_and_12_test.dart b/example/integration_test/bolt11_and_12_test.dart new file mode 100644 index 0000000..463bae8 --- /dev/null +++ b/example/integration_test/bolt11_and_12_test.dart @@ -0,0 +1,75 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:integration_test/integration_test.dart'; +import 'package:ldk_node/ldk_node.dart' as ldk; +import 'package:path_provider/path_provider.dart'; + +void main() { + BigInt satsToMsats(int sats) => BigInt.from(sats * 1000); + String mSatsToSats(BigInt mSats) => '${mSats.toInt() ~/ 1000}sats'; + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + + group('bolt11_&_bolt12', () { + setUp(() async {}); + testWidgets('bolt11_full_cycle', (WidgetTester tester) async { + final directory = await getApplicationDocumentsDirectory(); + final ldkCache = "${directory.path}/ldk_cache"; + final aliceStoragePath = "$ldkCache/integration/alice"; + debugPrint('Alice Storage Path: $aliceStoragePath'); + final alice_builder = ldk.Builder.mutinynet() + .setEntropyBip39Mnemonic( + mnemonic: ldk.Mnemonic( + seedPhrase: + "replace force spring cruise nothing select glass erupt medal raise consider pull")) + .setStorageDirPath(aliceStoragePath); + final aliceNode = await alice_builder.build(); + await aliceNode.start(); + final bobStoragePath = "$ldkCache/integration/bob"; + final bob_builder = ldk.Builder.mutinynet() + .setEntropyBip39Mnemonic( + mnemonic: ldk.Mnemonic( + seedPhrase: + "skin hospital fee risk health theory actor kiwi solution desert unhappy hello")) + .setStorageDirPath(bobStoragePath); + debugPrint('Bob Storage Path: $bobStoragePath'); + final bobNode = await bob_builder.build(); + await bobNode.start(); + debugPrint("Manually syncing Alice's node"); + await aliceNode.syncWallets(); + debugPrint("Manually syncing Bob's node"); + final aliceBalance = + (await aliceNode.listBalances()).spendableOnchainBalanceSats; + await bobNode.syncWallets(); + expect(aliceBalance, 0); + debugPrint("Alice's onChain balance ${aliceBalance.toString()}"); + final bobBalance = + (await bobNode.listBalances()).spendableOnchainBalanceSats; + debugPrint("Bob's onChain balance ${bobBalance.toString()}"); + + final bobBolt11PaymentHandler = await bobNode.bolt11Payment(); + final bobJitInvoice = await bobBolt11PaymentHandler.receiveViaJitChannel( + amountMsat: satsToMsats(10000), + description: 'test', + expirySecs: 9000, + ); + debugPrint("Bob's onChain balance ${bobBalance.toString()}"); + final aliceBolt11PaymentHandler = await aliceNode.bolt11Payment(); + final aliceJitInvoice = + await aliceBolt11PaymentHandler.receiveViaJitChannel( + amountMsat: satsToMsats(10000), + description: 'test', + expirySecs: 9000, + ); + final aliceLBalance = + (await aliceNode.listBalances()).totalLightningBalanceSats; + debugPrint("Alice's Lightning balance ${aliceLBalance.toString()}"); + final bobInvoice = await bobBolt11PaymentHandler.receive( + amountMsat: satsToMsats(10000), + description: 'test', + expirySecs: 9000); + final paymentId = + await aliceBolt11PaymentHandler.send(invoice: bobInvoice); + debugPrint("Alice's payment id ${paymentId.field0}"); + }); + }); +} From b23b90d7215c829921ec817b7b1240d544558384 Mon Sep 17 00:00:00 2001 From: kumulynja Date: Fri, 5 Jul 2024 02:05:46 +0200 Subject: [PATCH 43/48] restore example on mutinynet with jit channels --- example/lib/main.dart | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/example/lib/main.dart b/example/lib/main.dart index 8097cd2..ca531cc 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -1,5 +1,3 @@ -import 'dart:io'; - import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; @@ -28,14 +26,14 @@ class _MyAppState extends State { ldk.Bolt11Invoice? invoice; ldk.UserChannelId? userChannelId; - // Replace this with your local esplora url - String esploraUrl = - // "https://testnet-electrs.ltbl.io:3004"; - Platform.isAndroid - ? - //10.0.2.2 to access the AVD - 'http://10.0.2.2:30000' - : 'http://127.0.0.1:30000'; + String esploraUrl = "https://mutinynet.ltbl.io/api"; + /* + // For local esplora server + String esploraUrl = Platform.isAndroid + ? + //10.0.2.2 to access the AVD + 'http://10.0.2.2:30000' + : 'http://127.0.0.1:30000';*/ @override void initState() { @@ -67,7 +65,7 @@ class _MyAppState extends State { } Future initAliceNode() async { - final aliceConfig = await initLdkConfig('alice_regtest', + final aliceConfig = await initLdkConfig('alice_mutinynet', ldk.SocketAddress.hostname(addr: "0.0.0.0", port: 3003)); ldk.Builder aliceBuilder = ldk.Builder.fromConfig(config: aliceConfig); aliceNode = await aliceBuilder @@ -94,15 +92,13 @@ class _MyAppState extends State { } initBobNode() async { - final bobConfig = await initLdkConfig( - "bob_regtest", ldk.SocketAddress.hostname(addr: "0.0.0.0", port: 3001)); - ldk.Builder bobBuilder = ldk.Builder.fromConfig(config: bobConfig); + ldk.Builder bobBuilder = ldk.Builder + .mutinynet(); // For a node on the mutiny network with default config and services bobNode = await bobBuilder .setEntropyBip39Mnemonic( mnemonic: ldk.Mnemonic( seedPhrase: 'puppy interest whip tonight dad never sudden response push zone pig patch')) - .setEsploraServer(esploraUrl) .build(); await startNode(bobNode); final res = await bobNode.nodeId(); @@ -213,16 +209,25 @@ class _MyAppState extends State { userChannelId = await aliceNode.connectOpenChannel( channelAmountSats: BigInt.from(funding_amount_sat), announceChannel: true, - socketAddress: bobAddr!, + socketAddress: ldk.SocketAddress.hostname( + addr: '45.79.52.207', + port: 9735, + ), pushToCounterpartyMsat: BigInt.from(push_msat), - nodeId: bobNodeId!); + nodeId: ldk.PublicKey( + hex: + '02465ed5be53d04fde66c9418ff14a5f2267723810176c9212b722e542dc1afb1b', + )); } receiveAndSendPayments() async { final bobBolt11Handler = await bobNode.bolt11Payment(); final aliceBolt11Handler = await aliceNode.bolt11Payment(); - invoice = await bobBolt11Handler.receive( - amountMsat: BigInt.from(2500000), + // Bob doesn't have a channel yet, so he can't receive normal payments, + // but he can receive payments via JIT channels through an LSP configured + // in its node. + invoice = await bobBolt11Handler.receiveViaJitChannel( + amountMsat: BigInt.from(25000 * 1000), description: 'asdf', expirySecs: 9217); setState(() { From c2dae9fc7ebc83e351b3703eb95553de7314b7ba Mon Sep 17 00:00:00 2001 From: StaxoLotl Date: Fri, 5 Jul 2024 10:32:00 -0400 Subject: [PATCH 44/48] default config --- .github/workflows/precompile_binaries.yml | 26 +- CHANGELOG.md | 4 +- README.md | 4 +- .../integration_test/bolt11_and_12_test.dart | 75 + example/ios/Podfile.lock | 6 +- example/lib/main.dart | 139 +- example/pubspec.lock | 165 +- example/pubspec.yaml | 4 + flutter_rust_bridge.yaml | 7 +- ios/Classes/frb_generated.h | 1022 +- ios/ldk_node.podspec | 6 +- lib/ldk_node.dart | 9 +- lib/src/generated/api/bolt11.dart | 142 + lib/src/generated/api/bolt12.dart | 126 + lib/src/generated/api/builder.dart | 61 + lib/src/generated/api/error.dart | 137 - lib/src/generated/api/graph.dart | 243 + lib/src/generated/api/node.dart | 412 +- lib/src/generated/api/on_chain.dart | 44 + lib/src/generated/api/spontaneous.dart | 40 + lib/src/generated/api/types.dart | 1119 +- lib/src/generated/api/types.freezed.dart | 11181 ++++++- lib/src/generated/frb_generated.dart | 6545 +++- lib/src/generated/frb_generated.io.dart | 5849 +++- lib/src/generated/frb_generated.web.dart | 1846 -- lib/src/generated/lib.dart | 90 + lib/src/generated/utils/error.dart | 272 + lib/src/generated/utils/error.freezed.dart | 26142 ++++++++++++++++ lib/src/root.dart | 849 +- lib/src/utils/default_services.dart | 5 + lib/src/utils/exceptions.dart | 215 +- lib/src/utils/utils.dart | 4 +- makefile | 2 +- pubspec.yaml | 15 +- rust/Cargo.lock | 700 +- rust/Cargo.toml | 12 +- rust/cargokit.yaml | 2 +- rust/src/api/bolt11.rs | 175 + rust/src/api/bolt12.rs | 147 + rust/src/api/builder.rs | 126 + rust/src/api/error.rs | 162 - rust/src/api/graph.rs | 167 + rust/src/api/mod.rs | 9 +- rust/src/api/node.rs | 299 +- rust/src/api/on_chain.rs | 39 + rust/src/api/spontaneous.rs | 28 + rust/src/api/types.rs | 1444 +- rust/src/frb_generated.io.rs | 2919 +- rust/src/frb_generated.rs | 7645 +++-- rust/src/frb_generated.web.rs | 1779 +- rust/src/lib.rs | 1 + rust/src/utils/error.rs | 289 + rust/src/utils/mod.rs | 1 + 53 files changed, 62587 insertions(+), 10163 deletions(-) create mode 100644 example/integration_test/bolt11_and_12_test.dart create mode 100644 lib/src/generated/api/bolt11.dart create mode 100644 lib/src/generated/api/bolt12.dart create mode 100644 lib/src/generated/api/builder.dart delete mode 100644 lib/src/generated/api/error.dart create mode 100644 lib/src/generated/api/graph.dart create mode 100644 lib/src/generated/api/on_chain.dart create mode 100644 lib/src/generated/api/spontaneous.dart delete mode 100644 lib/src/generated/frb_generated.web.dart create mode 100644 lib/src/generated/lib.dart create mode 100644 lib/src/generated/utils/error.dart create mode 100644 lib/src/generated/utils/error.freezed.dart create mode 100644 rust/src/api/bolt11.rs create mode 100644 rust/src/api/bolt12.rs create mode 100644 rust/src/api/builder.rs delete mode 100644 rust/src/api/error.rs create mode 100644 rust/src/api/graph.rs create mode 100644 rust/src/api/on_chain.rs create mode 100644 rust/src/api/spontaneous.rs create mode 100644 rust/src/utils/error.rs create mode 100644 rust/src/utils/mod.rs diff --git a/.github/workflows/precompile_binaries.yml b/.github/workflows/precompile_binaries.yml index c2442a8..70f9010 100644 --- a/.github/workflows/precompile_binaries.yml +++ b/.github/workflows/precompile_binaries.yml @@ -1,19 +1,16 @@ on: push: - branches: [v0.2.2-dev, main] + branches: [main, v0.3.0] name: Precompile Binaries jobs: Precompile: - runs-on: ${{ matrix.os }} strategy: - fail-fast: false + fail-fast: true matrix: - os: - - ubuntu-20.04 - - macOS-latest - - windows-latest + os: [ubuntu-20.04, macOS-latest] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: actions-rs/toolchain@v1 @@ -25,7 +22,7 @@ jobs: run: | mkdir -p .cargo echo "[profile.release]" >> .cargo/config.toml - echo "opt-level = 'z'" >> .cargo/config.toml + echo "opt-level = 3" >> .cargo/config.toml echo "lto = true" >> .cargo/config.toml echo "codegen-units = 1" >> .cargo/config.toml echo "panic = 'abort'" >> .cargo/config.toml @@ -33,24 +30,15 @@ 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') || (matrix.os == 'windows-latest') + if: matrix.os == 'macOS-latest' run: dart run build_tool precompile-binaries -v --manifest-dir=../../rust --repository=LtbLightning/ldk-node-flutter working-directory: cargokit/build_tool env: GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} PRIVATE_KEY: ${{ secrets.CARGOKIT_PRIVATE_KEY }} - name: Precompile (with Android) - if: (matrix.os == 'ubuntu-20.04') + if: matrix.os == 'ubuntu-20.04' run: dart run build_tool precompile-binaries -v --manifest-dir=../../rust --repository=LtbLightning/ldk-node-flutter --android-sdk-location=/usr/local/lib/android/sdk --android-ndk-version=24.0.8215888 --android-min-sdk-version=23 working-directory: cargokit/build_tool env: diff --git a/CHANGELOG.md b/CHANGELOG.md index 16f6ba8..f0423dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +## [0.3.0] + ## [0.2.2-dev] Updated Rust and Flutter dependencies. #### APIs added @@ -117,4 +119,4 @@ This is the first release of `ldk_node`. It features support for sourcing chain `stop`- Disconnects all peers, stops all running background tasks, and shuts down Node. -`syncWallets`- Sync the `LDK & BDK` wallets with the current chain state. +`syncWallets`- Sync the `LDK & BDK` wallets with the current chain state. \ No newline at end of file diff --git a/README.md b/README.md index 8a41c4b..c7cda5e 100644 --- a/README.md +++ b/README.md @@ -40,12 +40,12 @@ To use the `ldk_node` package in your project, add it as a dependency in your pr ```dart dependencies: - ldk_node: ^0.2.2-dev + ldk_node: ^0.3.0 ``` or add from pub.dev using `pub add` command ``` - flutter pub add ldk_node@0.2.2-dev + flutter pub add ldk_node ``` ### Examples diff --git a/example/integration_test/bolt11_and_12_test.dart b/example/integration_test/bolt11_and_12_test.dart new file mode 100644 index 0000000..463bae8 --- /dev/null +++ b/example/integration_test/bolt11_and_12_test.dart @@ -0,0 +1,75 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:integration_test/integration_test.dart'; +import 'package:ldk_node/ldk_node.dart' as ldk; +import 'package:path_provider/path_provider.dart'; + +void main() { + BigInt satsToMsats(int sats) => BigInt.from(sats * 1000); + String mSatsToSats(BigInt mSats) => '${mSats.toInt() ~/ 1000}sats'; + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + + group('bolt11_&_bolt12', () { + setUp(() async {}); + testWidgets('bolt11_full_cycle', (WidgetTester tester) async { + final directory = await getApplicationDocumentsDirectory(); + final ldkCache = "${directory.path}/ldk_cache"; + final aliceStoragePath = "$ldkCache/integration/alice"; + debugPrint('Alice Storage Path: $aliceStoragePath'); + final alice_builder = ldk.Builder.mutinynet() + .setEntropyBip39Mnemonic( + mnemonic: ldk.Mnemonic( + seedPhrase: + "replace force spring cruise nothing select glass erupt medal raise consider pull")) + .setStorageDirPath(aliceStoragePath); + final aliceNode = await alice_builder.build(); + await aliceNode.start(); + final bobStoragePath = "$ldkCache/integration/bob"; + final bob_builder = ldk.Builder.mutinynet() + .setEntropyBip39Mnemonic( + mnemonic: ldk.Mnemonic( + seedPhrase: + "skin hospital fee risk health theory actor kiwi solution desert unhappy hello")) + .setStorageDirPath(bobStoragePath); + debugPrint('Bob Storage Path: $bobStoragePath'); + final bobNode = await bob_builder.build(); + await bobNode.start(); + debugPrint("Manually syncing Alice's node"); + await aliceNode.syncWallets(); + debugPrint("Manually syncing Bob's node"); + final aliceBalance = + (await aliceNode.listBalances()).spendableOnchainBalanceSats; + await bobNode.syncWallets(); + expect(aliceBalance, 0); + debugPrint("Alice's onChain balance ${aliceBalance.toString()}"); + final bobBalance = + (await bobNode.listBalances()).spendableOnchainBalanceSats; + debugPrint("Bob's onChain balance ${bobBalance.toString()}"); + + final bobBolt11PaymentHandler = await bobNode.bolt11Payment(); + final bobJitInvoice = await bobBolt11PaymentHandler.receiveViaJitChannel( + amountMsat: satsToMsats(10000), + description: 'test', + expirySecs: 9000, + ); + debugPrint("Bob's onChain balance ${bobBalance.toString()}"); + final aliceBolt11PaymentHandler = await aliceNode.bolt11Payment(); + final aliceJitInvoice = + await aliceBolt11PaymentHandler.receiveViaJitChannel( + amountMsat: satsToMsats(10000), + description: 'test', + expirySecs: 9000, + ); + final aliceLBalance = + (await aliceNode.listBalances()).totalLightningBalanceSats; + debugPrint("Alice's Lightning balance ${aliceLBalance.toString()}"); + final bobInvoice = await bobBolt11PaymentHandler.receive( + amountMsat: satsToMsats(10000), + description: 'test', + expirySecs: 9000); + final paymentId = + await aliceBolt11PaymentHandler.send(invoice: bobInvoice); + debugPrint("Alice's payment id ${paymentId.field0}"); + }); + }); +} diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 0bbacec..4c8d391 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1,6 +1,6 @@ PODS: - Flutter (1.0.0) - - ldk_node (0.2.2-dev): + - ldk_node (0.3.0): - Flutter - path_provider_foundation (0.0.1): - Flutter @@ -21,8 +21,8 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 - ldk_node: 5b3cacf9e7a5d5ae0d5c24e133af5c37c3da338b - path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c + ldk_node: 4a64d0c424f716c522130b900a00405f5b2df367 + path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 PODFILE CHECKSUM: 4e8f8b2be68aeea4c0d5beb6ff1e79fface1d048 diff --git a/example/lib/main.dart b/example/lib/main.dart index cee0032..ca531cc 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -1,5 +1,3 @@ -import 'dart:io'; - import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; @@ -26,16 +24,16 @@ class _MyAppState extends State { String displayText = ""; ldk.SocketAddress? bobAddr; ldk.Bolt11Invoice? invoice; - ldk.ChannelId? channelId; + ldk.UserChannelId? userChannelId; - // Replace this with your local esplora url - String esploraUrl = - // "https://testnet-electrs.ltbl.io:3004"; - Platform.isAndroid - ? - //10.0.2.2 to access the AVD - 'http://10.0.2.2:30000' - : 'http://127.0.0.1:30000'; + String esploraUrl = "https://mutinynet.ltbl.io/api"; + /* + // For local esplora server + String esploraUrl = Platform.isAndroid + ? + //10.0.2.2 to access the AVD + 'http://10.0.2.2:30000' + : 'http://127.0.0.1:30000';*/ @override void initState() { @@ -48,14 +46,14 @@ class _MyAppState extends State { final directory = await getApplicationDocumentsDirectory(); final nodePath = "${directory.path}/ldk_cache/$path"; final config = ldk.Config( - probingLiquidityLimitMultiplier: 3, + probingLiquidityLimitMultiplier: BigInt.from(3), trustedPeers0Conf: [], storageDirPath: nodePath, network: ldk.Network.regtest, listeningAddresses: [address], - onchainWalletSyncIntervalSecs: 60, - walletSyncIntervalSecs: 20, - feeRateCacheUpdateIntervalSecs: 600, + onchainWalletSyncIntervalSecs: BigInt.from(60), + walletSyncIntervalSecs: BigInt.from(20), + feeRateCacheUpdateIntervalSecs: BigInt.from(600), logLevel: ldk.LogLevel.debug, defaultCltvExpiryDelta: 144); return config; @@ -63,11 +61,11 @@ class _MyAppState extends State { closeChannel() async { await aliceNode.closeChannel( - channelId: channelId!, counterpartyNodeId: bobNodeId!); + userChannelId: userChannelId!, counterpartyNodeId: bobNodeId!); } Future initAliceNode() async { - final aliceConfig = await initLdkConfig('alice_regtest', + final aliceConfig = await initLdkConfig('alice_mutinynet', ldk.SocketAddress.hostname(addr: "0.0.0.0", port: 3003)); ldk.Builder aliceBuilder = ldk.Builder.fromConfig(config: aliceConfig); aliceNode = await aliceBuilder @@ -94,37 +92,33 @@ class _MyAppState extends State { } initBobNode() async { - final bobConfig = await initLdkConfig( - "bob_regtest", ldk.SocketAddress.hostname(addr: "0.0.0.0", port: 3001)); - ldk.Builder bobBuilder = ldk.Builder.fromConfig(config: bobConfig); + ldk.Builder bobBuilder = ldk.Builder + .mutinynet(); // For a node on the mutiny network with default config and services bobNode = await bobBuilder .setEntropyBip39Mnemonic( mnemonic: ldk.Mnemonic( seedPhrase: 'puppy interest whip tonight dad never sudden response push zone pig patch')) - .setEsploraServer(esploraUrl) .build(); await startNode(bobNode); final res = await bobNode.nodeId(); setState(() { bobNodeId = res; - displayText = "$bobNodeId started successfully"; + displayText = "${bobNodeId!.hex} started successfully"; }); } totalOnchainBalanceSats() async { - final alice = await aliceNode.totalOnchainBalanceSats(); - final bob = await bobNode.totalOnchainBalanceSats(); + final alice = await aliceNode.listBalances(); + final bob = await bobNode.listBalances(); if (kDebugMode) { - 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()}"); + 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}"); } setState(() { - aliceBalance = alice; + aliceBalance = alice.spendableOnchainBalanceSats.toInt(); }); } @@ -143,6 +137,7 @@ class _MyAppState extends State { print("======Channels========"); for (var e in res) { print("nodeId: ${aliceNodeId!.hex}"); + print("userChannelId: ${e.userChannelId.data}"); print("channelId: ${e.channelId.data}"); print("isChannelReady: ${e.isChannelReady}"); print("isUsable: ${e.isUsable}"); @@ -161,9 +156,8 @@ class _MyAppState extends State { print("======Payments========"); for (var e in res) { print("amountMsat: ${e.amountMsat}"); - print("hash: ${e.hash.data}"); - print("preimage: ${e.preimage?.data}"); - print("secret: ${e.secret!.data}"); + print("paymentId: ${e.id.field0}"); + print("status: ${e.status.name}"); } } } @@ -176,7 +170,7 @@ class _MyAppState extends State { removeLastPayment() async { final lastPayment = await listPaymentsWithFilter(false); if (lastPayment != null) { - final _ = await aliceNode.removePayment(paymentHash: lastPayment.hash); + final _ = await aliceNode.removePayment(paymentId: lastPayment.id); setState(() { displayText = "${lastPayment.hash.internal} removed"; }); @@ -184,8 +178,8 @@ class _MyAppState extends State { } Future> newOnchainAddress() async { - final alice = await aliceNode.newOnchainAddress(); - final bob = await bobNode.newOnchainAddress(); + final alice = await (await aliceNode.onChainPayment()).newAddress(); + final bob = await (await bobNode.onChainPayment()).newAddress(); if (kDebugMode) { print("alice's address: ${alice.s}"); print("bob's address: ${bob.s}"); @@ -212,45 +206,41 @@ class _MyAppState extends State { connectOpenChannel() async { final funding_amount_sat = 80000; final push_msat = (funding_amount_sat / 2) * 1000; - await aliceNode.connectOpenChannel( - channelAmountSats: funding_amount_sat, + userChannelId = await aliceNode.connectOpenChannel( + channelAmountSats: BigInt.from(funding_amount_sat), announceChannel: true, - socketAddress: bobAddr!, - pushToCounterpartyMsat: push_msat.toInt(), - nodeId: bobNodeId!); + socketAddress: ldk.SocketAddress.hostname( + addr: '45.79.52.207', + port: 9735, + ), + pushToCounterpartyMsat: BigInt.from(push_msat), + nodeId: ldk.PublicKey( + hex: + '02465ed5be53d04fde66c9418ff14a5f2267723810176c9212b722e542dc1afb1b', + )); } receiveAndSendPayments() async { - invoice = await bobNode.receivePayment( - amountMsat: 2500000, description: 'asdf', expirySecs: 9217); + final bobBolt11Handler = await bobNode.bolt11Payment(); + final aliceBolt11Handler = await aliceNode.bolt11Payment(); + // Bob doesn't have a channel yet, so he can't receive normal payments, + // but he can receive payments via JIT channels through an LSP configured + // in its node. + invoice = await bobBolt11Handler.receiveViaJitChannel( + amountMsat: BigInt.from(25000 * 1000), + description: 'asdf', + expirySecs: 9217); setState(() { displayText = invoice.toString(); }); - final paymentHash = await aliceNode.sendPayment(invoice: invoice!); - final res = await aliceNode.payment(paymentHash: paymentHash); + final paymentId = await aliceBolt11Handler.send(invoice: invoice!); + final res = await aliceNode.payment(paymentId: paymentId); setState(() { - displayText = "send payment success ${res?.hash.data}"; + displayText = + "Payment status: ${res?.status.name}\n PaymentId: ${res?.id.field0}"; }); } - 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(); @@ -285,6 +275,11 @@ class _MyAppState extends State { print( "channelClosed: ${e.channelId.data}, userChannelId: ${e.userChannelId.data}"); } + }, paymentClaimable: (e) { + if (kDebugMode) { + print( + "paymentId: ${e.paymentId.field0.toString()}, claimableAmountMsat: ${e.claimableAmountMsat}, userChannelId: ${e.claimDeadline}"); + } }); await node.eventHandled(); } @@ -462,20 +457,6 @@ 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(); diff --git a/example/pubspec.lock b/example/pubspec.lock index f297b01..da2e496 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: transitive description: name: args - sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" url: "https://pub.dev" source: hosted - version: "2.4.2" + version: "2.5.0" async: dependency: transitive description: @@ -69,10 +69,10 @@ packages: dependency: "direct main" description: name: cupertino_icons - sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 url: "https://pub.dev" source: hosted - version: "1.0.6" + version: "1.0.8" fake_async: dependency: transitive description: @@ -85,10 +85,18 @@ packages: dependency: transitive description: name: ffi - sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" + sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.2" + file: + dependency: transitive + description: + name: file + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" + source: hosted + version: "7.0.0" fixnum: dependency: transitive description: @@ -102,6 +110,11 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_driver: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" flutter_lints: dependency: "direct dev" description: @@ -114,10 +127,10 @@ packages: dependency: transitive description: name: flutter_rust_bridge - sha256: e9a8716b1ad2fc81c434f3e4bf84b86c578578678c57e568b44aea7acf210102 + sha256: f703c4b50e253e53efc604d50281bbaefe82d615856f8ae1e7625518ae252e98 url: "https://pub.dev" source: hosted - version: "2.0.0-dev.31" + version: "2.0.0" flutter_test: dependency: "direct dev" description: flutter @@ -127,10 +140,15 @@ packages: dependency: transitive description: name: freezed_annotation - sha256: c3fd9336eb55a38cc1bbd79ab17573113a8deccd0ecbbf926cca3c62803b5c2d + sha256: f54946fdb1fa7b01f780841937b1a80783a20b393485f3f6cdf336fd6f4705f2 url: "https://pub.dev" source: hosted - version: "2.4.1" + version: "2.4.2" + fuchsia_remote_debug_protocol: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" google_fonts: dependency: "direct main" description: @@ -143,10 +161,10 @@ packages: dependency: transitive description: name: http - sha256: a2bbf9d017fcced29139daa8ed2bba4ece450ab222871df93ca9eec6f80c34ba + sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.1" http_parser: dependency: transitive description: @@ -155,29 +173,50 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.2" - js: - dependency: transitive - description: - name: js - sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf - url: "https://pub.dev" - source: hosted - version: "0.7.1" + integration_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" json_annotation: dependency: transitive description: name: json_annotation - sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" url: "https://pub.dev" source: hosted - version: "4.8.1" + version: "4.9.0" ldk_node: dependency: "direct main" description: path: ".." relative: true source: path - version: "0.2.2-dev" + version: "0.3.0" + 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,58 +229,58 @@ 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: name: path_provider - sha256: b27217933eeeba8ff24845c34003b003b2b22151de3c908d0e679e8fe1aa078b + sha256: c9e7d3a4cd1410877472158bee69963a4579f78b68c65a2b7d40d1a7a88bb161 url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.3" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: "477184d672607c0a3bf68fbbf601805f92ef79c82b64b4d6eb318cbca4c48668" + sha256: bca87b0165ffd7cdb9cad8edd22d18d2201e886d9a9f19b4fb3452ea7df3a72a url: "https://pub.dev" source: hosted - version: "2.2.2" + version: "2.2.6" path_provider_foundation: dependency: transitive description: name: path_provider_foundation - sha256: "5a7999be66e000916500be4f15a3633ebceb8302719b47b9cc49ce924125350f" + sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16 url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.4.0" path_provider_linux: dependency: transitive description: @@ -282,6 +321,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.8" + process: + dependency: transitive + description: + name: process + sha256: "21e54fd2faf1b5bdd5102afd25012184a6793927648ea81eea80552ac9405b32" + url: "https://pub.dev" + source: hosted + version: "5.0.2" sky_engine: dependency: transitive description: flutter @@ -327,6 +374,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.0" + sync_http: + dependency: transitive + description: + name: sync_http + sha256: "7f0cd72eca000d2e026bcd6f990b81d0ca06022ef4e32fb257b30d3d1014a961" + url: "https://pub.dev" + source: hosted + version: "0.3.1" term_glyph: dependency: transitive description: @@ -339,10 +394,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: @@ -355,10 +410,10 @@ packages: dependency: transitive description: name: uuid - sha256: cd210a09f7c18cbe5a02511718e0334de6559871052c90a90c0cca46a4aa81c8 + sha256: "814e9e88f21a176ae1359149021870e87f7cddaf633ab678a5d2b0bff7fd1ba8" url: "https://pub.dev" source: hosted - version: "4.3.3" + version: "4.4.0" vector_math: dependency: transitive description: @@ -367,22 +422,38 @@ 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: name: web - sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" url: "https://pub.dev" source: hosted - version: "0.3.0" + version: "0.5.1" + webdriver: + dependency: transitive + description: + name: webdriver + sha256: "003d7da9519e1e5f329422b36c4dcdf18d7d2978d1ba099ea4e45ba490ed845e" + url: "https://pub.dev" + source: hosted + version: "3.0.3" win32: dependency: transitive description: name: win32 - sha256: "464f5674532865248444b4c3daca12bd9bf2d7c47f759ce2617986e7229494a8" + sha256: a79dbe579cb51ecd6d30b17e0cae4e0ea15e2c0e66f69ad4198f22a6789e94f4 url: "https://pub.dev" source: hosted - version: "5.2.0" + version: "5.5.1" xdg_directories: dependency: transitive description: @@ -392,5 +463,5 @@ packages: source: hosted version: "1.0.4" sdks: - dart: ">=3.2.0 <4.0.0" - flutter: ">=3.10.0" + dart: ">=3.4.0 <4.0.0" + flutter: ">=3.22.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index b2b4e1c..db48300 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -16,6 +16,10 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + integration_test: + sdk: flutter + flutter_driver: + sdk: flutter flutter_lints: ^2.0.0 flutter: uses-material-design: true \ No newline at end of file diff --git a/flutter_rust_bridge.yaml b/flutter_rust_bridge.yaml index 8524d59..53f8e62 100644 --- a/flutter_rust_bridge.yaml +++ b/flutter_rust_bridge.yaml @@ -1,5 +1,8 @@ -rust_input: rust/src/api/*.rs +rust_input: crate::api +rust_root: rust/ dart_output: lib/src/generated/ full_dep: true +web: false +dart3: true c_output: ios/Classes/frb_generated.h -dart_entrypoint_class_name: LdkCore \ No newline at end of file +dart_entrypoint_class_name: core \ No newline at end of file diff --git a/ios/Classes/frb_generated.h b/ios/Classes/frb_generated.h index a72914e..620c796 100644 --- a/ios/Classes/frb_generated.h +++ b/ios/Classes/frb_generated.h @@ -14,11 +14,39 @@ void store_dart_post_cobject(DartPostCObjectFnType ptr); // EXTRA END typedef struct _Dart_Handle* Dart_Handle; +typedef struct wire_cst_ldk_bolt_11_payment { + uintptr_t ptr; +} wire_cst_ldk_bolt_11_payment; + 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_payment_hash { + struct wire_cst_list_prim_u_8_strict *data; +} wire_cst_payment_hash; + +typedef struct wire_cst_payment_preimage { + struct wire_cst_list_prim_u_8_strict *data; +} wire_cst_payment_preimage; + +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_ldk_bolt_12_payment { + uintptr_t ptr; +} wire_cst_ldk_bolt_12_payment; + +typedef struct wire_cst_refund { + struct wire_cst_list_prim_u_8_strict *s; +} wire_cst_refund; + +typedef struct wire_cst_offer { + struct wire_cst_list_prim_u_8_strict *s; +} wire_cst_offer; + typedef struct wire_cst_SocketAddress_TcpIpV4 { struct wire_cst_list_prim_u_8_strict *addr; uint16_t port; @@ -72,6 +100,11 @@ typedef struct wire_cst_list_public_key { int32_t len; } wire_cst_list_public_key; +typedef struct wire_cst_anchor_channels_config { + struct wire_cst_list_public_key *trusted_peers_no_reserve; + uint64_t per_channel_reserve_sats; +} wire_cst_anchor_channels_config; + typedef struct wire_cst_config { struct wire_cst_list_prim_u_8_strict *storage_dir_path; struct wire_cst_list_prim_u_8_strict *log_dir_path; @@ -84,6 +117,7 @@ typedef struct wire_cst_config { struct wire_cst_list_public_key *trusted_peers_0conf; uint64_t probing_liquidity_limit_multiplier; int32_t log_level; + struct wire_cst_anchor_channels_config *anchor_channels_config; } wire_cst_config; typedef struct wire_cst_ChainDataSourceConfig_Esplora { @@ -140,13 +174,31 @@ 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_network_graph { + uintptr_t ptr; +} wire_cst_ldk_network_graph; + +typedef struct wire_cst_node_id { + struct wire_cst_list_prim_u_8_strict *compressed; +} wire_cst_node_id; + typedef struct wire_cst_ldk_node { uintptr_t ptr; } wire_cst_ldk_node; -typedef struct wire_cst_channel_id { +typedef struct wire_cst_user_channel_id { struct wire_cst_list_prim_u_8_strict *data; -} wire_cst_channel_id; +} wire_cst_user_channel_id; typedef struct wire_cst_MaxDustHTLCExposure_FixedLimitMsat { uint64_t field0; @@ -170,57 +222,142 @@ 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; + 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_payment_id { + struct wire_cst_list_prim_u_8_strict *field0; +} wire_cst_payment_id; + +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_ldk_on_chain_payment { + uintptr_t ptr; +} wire_cst_ldk_on_chain_payment; 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_ldk_spontaneous_payment { + uintptr_t ptr; +} wire_cst_ldk_spontaneous_payment; -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_Bolt12ParseError_Bech32 { + struct wire_cst_list_prim_u_8_strict *field0; +} wire_cst_Bolt12ParseError_Bech32; + +typedef struct wire_cst_DecodeError_Io { + struct wire_cst_list_prim_u_8_strict *field0; +} wire_cst_DecodeError_Io; + +typedef union DecodeErrorKind { + struct wire_cst_DecodeError_Io Io; +} DecodeErrorKind; + +typedef struct wire_cst_decode_error { + int32_t tag; + union DecodeErrorKind kind; +} wire_cst_decode_error; + +typedef struct wire_cst_Bolt12ParseError_Decode { + struct wire_cst_decode_error *field0; +} wire_cst_Bolt12ParseError_Decode; + +typedef struct wire_cst_Bolt12ParseError_InvalidSemantics { + struct wire_cst_list_prim_u_8_strict *field0; +} wire_cst_Bolt12ParseError_InvalidSemantics; + +typedef struct wire_cst_Bolt12ParseError_InvalidSignature { + struct wire_cst_list_prim_u_8_strict *field0; +} wire_cst_Bolt12ParseError_InvalidSignature; + +typedef union Bolt12ParseErrorKind { + struct wire_cst_Bolt12ParseError_Bech32 Bech32; + struct wire_cst_Bolt12ParseError_Decode Decode; + struct wire_cst_Bolt12ParseError_InvalidSemantics InvalidSemantics; + struct wire_cst_Bolt12ParseError_InvalidSignature InvalidSignature; +} Bolt12ParseErrorKind; + +typedef struct wire_cst_bolt_12_parse_error { + int32_t tag; + union Bolt12ParseErrorKind kind; +} wire_cst_bolt_12_parse_error; + +typedef struct wire_cst_channel_id { + struct wire_cst_list_prim_u_8_strict *data; +} wire_cst_channel_id; + +typedef struct wire_cst_routing_fees { + uint32_t base_msat; + uint32_t proportional_millionths; +} wire_cst_routing_fees; + +typedef struct wire_cst_channel_update_info { + uint32_t last_update; + bool enabled; + uint16_t cltv_expiry_delta; + uint64_t htlc_minimum_msat; + uint64_t htlc_maximum_msat; + struct wire_cst_routing_fees fees; +} wire_cst_channel_update_info; + +typedef struct wire_cst_channel_info { + struct wire_cst_node_id node_one; + struct wire_cst_channel_update_info *one_to_two; + struct wire_cst_node_id node_two; + struct wire_cst_channel_update_info *two_to_one; + uint64_t *capacity_sats; +} wire_cst_channel_info; + +typedef struct wire_cst_ClosureReason_CounterpartyForceClosed { + struct wire_cst_list_prim_u_8_strict *peer_msg; +} wire_cst_ClosureReason_CounterpartyForceClosed; + +typedef struct wire_cst_ClosureReason_ProcessingError { + struct wire_cst_list_prim_u_8_strict *err; +} wire_cst_ClosureReason_ProcessingError; + +typedef union ClosureReasonKind { + struct wire_cst_ClosureReason_CounterpartyForceClosed CounterpartyForceClosed; + struct wire_cst_ClosureReason_ProcessingError ProcessingError; +} ClosureReasonKind; + +typedef struct wire_cst_closure_reason { + int32_t tag; + union ClosureReasonKind kind; +} wire_cst_closure_reason; + +typedef struct wire_cst_Event_PaymentClaimable { + struct wire_cst_payment_id *payment_id; + struct wire_cst_payment_hash *payment_hash; + uint64_t claimable_amount_msat; + uint32_t *claim_deadline; +} wire_cst_Event_PaymentClaimable; typedef struct wire_cst_Event_PaymentSuccessful { + struct wire_cst_payment_id *payment_id; 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_id *payment_id; struct wire_cst_payment_hash *payment_hash; + int32_t *reason; } wire_cst_Event_PaymentFailed; typedef struct wire_cst_Event_PaymentReceived { + struct wire_cst_payment_id *payment_id; struct wire_cst_payment_hash *payment_hash; 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; @@ -238,13 +375,27 @@ 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_PaymentClaimable PaymentClaimable; 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 { @@ -252,18 +403,82 @@ typedef struct wire_cst_event { union EventKind kind; } wire_cst_event; -typedef struct wire_cst_payment_preimage { - struct wire_cst_list_prim_u_8_strict *data; -} wire_cst_payment_preimage; +typedef struct wire_cst_lsp_fee_limits { + uint64_t *max_total_opening_fee_msat; + uint64_t *max_proportional_opening_fee_ppm_msat; +} wire_cst_lsp_fee_limits; + +typedef struct wire_cst_node_announcement_info { + uint32_t last_update; + struct wire_cst_list_prim_u_8_strict *alias; + struct wire_cst_list_socket_address *addresses; +} wire_cst_node_announcement_info; + +typedef struct wire_cst_list_prim_u_64_strict { + uint64_t *ptr; + int32_t len; +} wire_cst_list_prim_u_64_strict; + +typedef struct wire_cst_node_info { + struct wire_cst_list_prim_u_64_strict *channels; + struct wire_cst_node_announcement_info *announcement_info; +} wire_cst_node_info; + +typedef struct wire_cst_offer_id { + struct wire_cst_list_prim_u_8_strict *field0; +} wire_cst_offer_id; typedef struct wire_cst_payment_secret { struct wire_cst_list_prim_u_8_strict *data; } wire_cst_payment_secret; -typedef struct wire_cst_payment_details { - struct wire_cst_payment_hash hash; +typedef struct wire_cst_PaymentKind_Bolt11 { + struct wire_cst_payment_hash *hash; + struct wire_cst_payment_preimage *preimage; + struct wire_cst_payment_secret *secret; +} wire_cst_PaymentKind_Bolt11; + +typedef struct wire_cst_PaymentKind_Bolt11Jit { + struct wire_cst_payment_hash *hash; + struct wire_cst_payment_preimage *preimage; + struct wire_cst_payment_secret *secret; + struct wire_cst_lsp_fee_limits *lsp_fee_limits; +} wire_cst_PaymentKind_Bolt11Jit; + +typedef struct wire_cst_PaymentKind_Spontaneous { + struct wire_cst_payment_hash *hash; + struct wire_cst_payment_preimage *preimage; +} wire_cst_PaymentKind_Spontaneous; + +typedef struct wire_cst_PaymentKind_Bolt12Offer { + struct wire_cst_payment_hash *hash; struct wire_cst_payment_preimage *preimage; struct wire_cst_payment_secret *secret; + struct wire_cst_offer_id *offer_id; +} wire_cst_PaymentKind_Bolt12Offer; + +typedef struct wire_cst_PaymentKind_Bolt12Refund { + struct wire_cst_payment_hash *hash; + struct wire_cst_payment_preimage *preimage; + struct wire_cst_payment_secret *secret; +} wire_cst_PaymentKind_Bolt12Refund; + +typedef union PaymentKindKind { + struct wire_cst_PaymentKind_Bolt11 Bolt11; + struct wire_cst_PaymentKind_Bolt11Jit Bolt11Jit; + struct wire_cst_PaymentKind_Spontaneous Spontaneous; + struct wire_cst_PaymentKind_Bolt12Offer Bolt12Offer; + struct wire_cst_PaymentKind_Bolt12Refund Bolt12Refund; +} PaymentKindKind; + +typedef struct wire_cst_payment_kind { + int32_t tag; + union PaymentKindKind kind; +} wire_cst_payment_kind; + +typedef struct wire_cst_payment_details { + struct wire_cst_payment_id id; + struct wire_cst_payment_kind kind; uint64_t *amount_msat; int32_t direction; int32_t status; @@ -272,12 +487,11 @@ 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_list_prim_u_8_strict *funding_txo; + struct wire_cst_out_point *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; @@ -286,6 +500,19 @@ 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 { @@ -293,6 +520,74 @@ 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_node_id { + struct wire_cst_node_id *ptr; + int32_t len; +} wire_cst_list_node_id; + typedef struct wire_cst_list_payment_details { struct wire_cst_payment_details *ptr; int32_t len; @@ -309,194 +604,470 @@ typedef struct wire_cst_list_peer_details { int32_t len; } wire_cst_list_peer_details; -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_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; + +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_bolt_12_invoice { + struct wire_cst_list_prim_u_8_strict *data; +} wire_cst_bolt_12_invoice; -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); +typedef struct wire_cst_LdkNodeError_Decode { + struct wire_cst_decode_error *field0; +} wire_cst_LdkNodeError_Decode; -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); +typedef struct wire_cst_LdkNodeError_Bolt12Parse { + struct wire_cst_bolt_12_parse_error *field0; +} wire_cst_LdkNodeError_Bolt12Parse; -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); +typedef union LdkNodeErrorKind { + struct wire_cst_LdkNodeError_Decode Decode; + struct wire_cst_LdkNodeError_Bolt12Parse Bolt12Parse; +} LdkNodeErrorKind; -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); +typedef struct wire_cst_ldk_node_error { + int32_t tag; + union LdkNodeErrorKind kind; +} wire_cst_ldk_node_error; + +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__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hash(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + struct wire_cst_payment_hash *payment_hash, + uint64_t claimable_amount_msat, + struct wire_cst_payment_preimage *preimage); + +void frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hash(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + struct wire_cst_payment_hash *payment_hash); + +void frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + uint64_t amount_msat, + struct wire_cst_list_prim_u_8_strict *description, + uint32_t expiry_secs); + +void frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hash(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + struct wire_cst_payment_hash *payment_hash, + uint64_t amount_msat, + struct wire_cst_list_prim_u_8_strict *description, + uint32_t expiry_secs); + +void frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + struct wire_cst_list_prim_u_8_strict *description, + uint32_t expiry_secs); + +void frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hash(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + struct wire_cst_list_prim_u_8_strict *description, + uint32_t expiry_secs, + struct wire_cst_payment_hash *payment_hash); + +void frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *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__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *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__crate__api__bolt11__ldk_bolt_11_payment_send(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + struct wire_cst_bolt_11_invoice *invoice); + +void frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + struct wire_cst_bolt_11_invoice *invoice); + +void frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + struct wire_cst_bolt_11_invoice *invoice, + uint64_t amount_msat); + +void frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount(int64_t port_, + struct wire_cst_ldk_bolt_11_payment *that, + struct wire_cst_bolt_11_invoice *invoice, + uint64_t amount_msat); + +void frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refund(int64_t port_, + struct wire_cst_ldk_bolt_12_payment *that, + uint64_t amount_msat, + uint32_t expiry_secs); + +void frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_receive(int64_t port_, + struct wire_cst_ldk_bolt_12_payment *that, + uint64_t amount_msat, + struct wire_cst_list_prim_u_8_strict *description); + +void frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amount(int64_t port_, + struct wire_cst_ldk_bolt_12_payment *that, + struct wire_cst_list_prim_u_8_strict *description); + +void frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_payment(int64_t port_, + struct wire_cst_ldk_bolt_12_payment *that, + struct wire_cst_refund *refund); + +void frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_send(int64_t port_, + struct wire_cst_ldk_bolt_12_payment *that, + struct wire_cst_offer *offer, + struct wire_cst_list_prim_u_8_strict *payer_note); + +void frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amount(int64_t port_, + struct wire_cst_ldk_bolt_12_payment *that, + struct wire_cst_offer *offer, + struct wire_cst_list_prim_u_8_strict *payer_note, + uint64_t amount_msat); + +WireSyncRust2DartDco frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder(uintptr_t that); + +WireSyncRust2DartDco frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder(uintptr_t that, + uintptr_t builder); + +void frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_build(int64_t port_, uintptr_t that); + +void frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_build_with_fs_store(int64_t port_, + uintptr_t that); + +void frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_create_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__crate__api__builder__ldk_mnemonic_generate(int64_t port_); + +void frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_channel(int64_t port_, + struct wire_cst_ldk_network_graph *that, + uint64_t short_channel_id); + +void frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_list_channels(int64_t port_, + struct wire_cst_ldk_network_graph *that); + +void frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_list_nodes(int64_t port_, + struct wire_cst_ldk_network_graph *that); + +void frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_node(int64_t port_, + struct wire_cst_ldk_network_graph *that, + struct wire_cst_node_id *node_id); + +void frbgen_ldk_node_wire__crate__api__node__ldk_node_bolt11_payment(int64_t port_, + struct wire_cst_ldk_node *ptr); + +void frbgen_ldk_node_wire__crate__api__node__ldk_node_bolt12_payment(int64_t port_, + struct wire_cst_ldk_node *ptr); -void frbgen_ldk_node_wire_ldk_node_event_handled(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_close_channel(int64_t port_, + struct wire_cst_ldk_node *that, + struct wire_cst_user_channel_id *user_channel_id, + struct wire_cst_public_key *counterparty_node_id); -void frbgen_ldk_node_wire_ldk_node_is_running(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_config(int64_t port_, + struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_ldk_node_list_channels(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__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_ldk_node_list_payments(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__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_ldk_node_list_payments_with_filter(int64_t port_, - struct wire_cst_ldk_node *that, - int32_t payment_direction); +void frbgen_ldk_node_wire__crate__api__node__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_ldk_node_list_peers(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_event_handled(int64_t port_, + struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_ldk_node_listening_addresses(int64_t port_, - struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_force_close_channel(int64_t port_, + struct wire_cst_ldk_node *that, + struct wire_cst_user_channel_id *user_channel_id, + struct wire_cst_public_key *counterparty_node_id); -void frbgen_ldk_node_wire_ldk_node_new_onchain_address(int64_t port_, - struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_list_balances(int64_t port_, + struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_ldk_node_next_event(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_list_channels(int64_t port_, + struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_ldk_node_node_id(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_list_payments(int64_t port_, + struct wire_cst_ldk_node *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__crate__api__node__ldk_node_list_payments_with_filter(int64_t port_, + struct wire_cst_ldk_node *that, + int32_t payment_direction); -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__crate__api__node__ldk_node_list_peers(int64_t port_, + struct wire_cst_ldk_node *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__crate__api__node__ldk_node_listening_addresses(int64_t port_, + struct wire_cst_ldk_node *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__crate__api__node__ldk_node_network_graph(int64_t port_, + struct wire_cst_ldk_node *ptr); -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__crate__api__node__ldk_node_next_event(int64_t port_, + struct wire_cst_ldk_node *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__crate__api__node__ldk_node_next_event_async(int64_t port_, + struct wire_cst_ldk_node *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__crate__api__node__ldk_node_node_id(int64_t port_, + struct wire_cst_ldk_node *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__crate__api__node__ldk_node_on_chain_payment(int64_t port_, + struct wire_cst_ldk_node *ptr); -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__crate__api__node__ldk_node_payment(int64_t port_, + struct wire_cst_ldk_node *that, + struct wire_cst_payment_id *payment_id); -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__crate__api__node__ldk_node_remove_payment(int64_t port_, + struct wire_cst_ldk_node *that, + struct wire_cst_payment_id *payment_id); -void frbgen_ldk_node_wire_ldk_node_send_spontaneous_payment_probes(int64_t port_, +void frbgen_ldk_node_wire__crate__api__node__ldk_node_sign_message(int64_t port_, struct wire_cst_ldk_node *that, - uint64_t amount_msat, - struct wire_cst_public_key *node_id); + struct wire_cst_list_prim_u_8_loose *msg); -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__crate__api__node__ldk_node_spontaneous_payment(int64_t port_, + struct wire_cst_ldk_node *ptr); -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__crate__api__node__ldk_node_start(int64_t port_, + struct wire_cst_ldk_node *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__crate__api__node__ldk_node_status(int64_t port_, + struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_ldk_node_start(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_stop(int64_t port_, + struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_ldk_node_stop(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_sync_wallets(int64_t port_, + struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_ldk_node_sync_wallets(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_wire__crate__api__node__ldk_node_update_channel_config(int64_t port_, + struct wire_cst_ldk_node *that, + struct wire_cst_user_channel_id *user_channel_id, + struct wire_cst_public_key *counterparty_node_id, + struct wire_cst_channel_config *channel_config); -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__crate__api__node__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 *public_key); + +void frbgen_ldk_node_wire__crate__api__node__ldk_node_wait_next_event(int64_t port_, + struct wire_cst_ldk_node *that); + +void frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_new_address(int64_t port_, + struct wire_cst_ldk_on_chain_payment *that); + +void frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address(int64_t port_, + struct wire_cst_ldk_on_chain_payment *that, + struct wire_cst_address *address); + +void frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address(int64_t port_, + struct wire_cst_ldk_on_chain_payment *that, + struct wire_cst_address *address, + uint64_t amount_sats); -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__crate__api__spontaneous__ldk_spontaneous_payment_send(int64_t port_, + struct wire_cst_ldk_spontaneous_payment *that, + uint64_t amount_msat, + struct wire_cst_public_key *node_id); -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__crate__api__spontaneous__ldk_spontaneous_payment_send_probes(int64_t port_, + struct wire_cst_ldk_spontaneous_payment *that, + uint64_t amount_msat, + struct wire_cst_public_key *node_id); -void frbgen_ldk_node_wire_ldk_node_wait_next_event(int64_t port_, struct wire_cst_ldk_node *that); +void frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment(const void *ptr); -void frbgen_ldk_node_wire_socket_address_as_string(int64_t port_, - struct wire_cst_socket_address *that); +void frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment(const void *ptr); -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_Node(const void *ptr); -void frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore(const void *ptr); +void frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_Node(const void *ptr); -void frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore(const void *ptr); +void frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder(const void *ptr); + +void frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder(const void *ptr); + +void frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilder(const void *ptr); + +void frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilder(const void *ptr); + +void frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraph(const void *ptr); + +void frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraph(const void *ptr); + +void frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment(const void *ptr); + +void frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment(const void *ptr); + +void frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment(const void *ptr); + +void frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment(const void *ptr); + +void frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment(const void *ptr); + +void frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment(const void *ptr); struct wire_cst_address *frbgen_ldk_node_cst_new_box_autoadd_address(void); +struct wire_cst_anchor_channels_config *frbgen_ldk_node_cst_new_box_autoadd_anchor_channels_config(void); + struct wire_cst_bolt_11_invoice *frbgen_ldk_node_cst_new_box_autoadd_bolt_11_invoice(void); +struct wire_cst_bolt_12_parse_error *frbgen_ldk_node_cst_new_box_autoadd_bolt_12_parse_error(void); + struct wire_cst_chain_data_source_config *frbgen_ldk_node_cst_new_box_autoadd_chain_data_source_config(void); struct wire_cst_channel_config *frbgen_ldk_node_cst_new_box_autoadd_channel_config(void); struct wire_cst_channel_id *frbgen_ldk_node_cst_new_box_autoadd_channel_id(void); +struct wire_cst_channel_info *frbgen_ldk_node_cst_new_box_autoadd_channel_info(void); + +struct wire_cst_channel_update_info *frbgen_ldk_node_cst_new_box_autoadd_channel_update_info(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_decode_error *frbgen_ldk_node_cst_new_box_autoadd_decode_error(void); + struct wire_cst_entropy_source_config *frbgen_ldk_node_cst_new_box_autoadd_entropy_source_config(void); 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_ldk_bolt_11_payment *frbgen_ldk_node_cst_new_box_autoadd_ldk_bolt_11_payment(void); + +struct wire_cst_ldk_bolt_12_payment *frbgen_ldk_node_cst_new_box_autoadd_ldk_bolt_12_payment(void); + struct wire_cst_ldk_mnemonic *frbgen_ldk_node_cst_new_box_autoadd_ldk_mnemonic(void); +struct wire_cst_ldk_network_graph *frbgen_ldk_node_cst_new_box_autoadd_ldk_network_graph(void); + struct wire_cst_ldk_node *frbgen_ldk_node_cst_new_box_autoadd_ldk_node(void); +struct wire_cst_ldk_on_chain_payment *frbgen_ldk_node_cst_new_box_autoadd_ldk_on_chain_payment(void); + +struct wire_cst_ldk_spontaneous_payment *frbgen_ldk_node_cst_new_box_autoadd_ldk_spontaneous_payment(void); + +struct wire_cst_liquidity_source_config *frbgen_ldk_node_cst_new_box_autoadd_liquidity_source_config(void); + +struct wire_cst_lsp_fee_limits *frbgen_ldk_node_cst_new_box_autoadd_lsp_fee_limits(void); + +struct wire_cst_max_dust_htlc_exposure *frbgen_ldk_node_cst_new_box_autoadd_max_dust_htlc_exposure(void); + +struct wire_cst_node_announcement_info *frbgen_ldk_node_cst_new_box_autoadd_node_announcement_info(void); + +struct wire_cst_node_id *frbgen_ldk_node_cst_new_box_autoadd_node_id(void); + +struct wire_cst_node_info *frbgen_ldk_node_cst_new_box_autoadd_node_info(void); + +struct wire_cst_offer *frbgen_ldk_node_cst_new_box_autoadd_offer(void); + +struct wire_cst_offer_id *frbgen_ldk_node_cst_new_box_autoadd_offer_id(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_id *frbgen_ldk_node_cst_new_box_autoadd_payment_id(void); + struct wire_cst_payment_preimage *frbgen_ldk_node_cst_new_box_autoadd_payment_preimage(void); struct wire_cst_payment_secret *frbgen_ldk_node_cst_new_box_autoadd_payment_secret(void); struct wire_cst_public_key *frbgen_ldk_node_cst_new_box_autoadd_public_key(void); +struct wire_cst_refund *frbgen_ldk_node_cst_new_box_autoadd_refund(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); @@ -505,10 +1076,18 @@ 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_node_id *frbgen_ldk_node_cst_new_list_node_id(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_64_strict *frbgen_ldk_node_cst_new_list_prim_u_64_strict(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); @@ -519,74 +1098,141 @@ struct wire_cst_list_socket_address *frbgen_ldk_node_cst_new_list_socket_address static int64_t dummy_method_to_enforce_bundling(void) { int64_t dummy_var = 0; dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_address); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_anchor_channels_config); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_bolt_11_invoice); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_bolt_12_parse_error); 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_channel_info); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_channel_update_info); + 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_decode_error); 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_ldk_bolt_11_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_ldk_bolt_12_payment); 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_network_graph); 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_ldk_on_chain_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_ldk_spontaneous_payment); + 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_lsp_fee_limits); + 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_node_announcement_info); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_node_id); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_node_info); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_offer); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_offer_id); 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_id); 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_refund); 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_node_id); 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_64_strict); 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_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*) frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_Node); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilder); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraph); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_Node); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilder); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraph); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hash); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hash); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hash); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hash); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refund); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_receive); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amount); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_send); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amount); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_build); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_build_with_fs_store); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_create_builder); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__builder__ldk_mnemonic_generate); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_channel); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_list_channels); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_list_nodes); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_node); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_bolt11_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_bolt12_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_close_channel); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_config); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_connect); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_connect_open_channel); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_disconnect); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_event_handled); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_force_close_channel); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_list_balances); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_list_channels); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_list_payments); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_list_payments_with_filter); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_list_peers); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_listening_addresses); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_network_graph); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_next_event); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_next_event_async); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_node_id); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_on_chain_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_remove_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_sign_message); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_spontaneous_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_start); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_status); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_stop); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_sync_wallets); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_update_channel_config); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_verify_signature); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__node__ldk_node_wait_next_event); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_new_address); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__spontaneous__ldk_spontaneous_payment_send); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes); dummy_var ^= ((int64_t) (void*) store_dart_post_cobject); return dummy_var; } diff --git a/ios/ldk_node.podspec b/ios/ldk_node.podspec index 696a1b2..78bda57 100644 --- a/ios/ldk_node.podspec +++ b/ios/ldk_node.podspec @@ -1,10 +1,10 @@ Pod::Spec.new do |s| s.name = 'ldk_node' - s.version = '0.2.2-dev' + s.version = '0.3.0' s.summary = 'A ready-to-go Lightning node library built using LDK and BDK.' - s.homepage = 'http://example.com' + s.homepage = 'https://www.LtbL.io' s.license = { :file => '../LICENSE' } - s.author = { 'Your Company' => 'email@example.com' } + s.author = { 'Let there be Lightning, Inc' => 'hello@LtbL.io' } s.source = { :path => '.' } s.source_files = 'Classes/**/*' s.dependency 'Flutter' diff --git a/lib/ldk_node.dart b/lib/ldk_node.dart index d5934f7..10af5cc 100644 --- a/lib/ldk_node.dart +++ b/lib/ldk_node.dart @@ -1,3 +1,7 @@ +export './src/generated/api/bolt11.dart'; +export './src/generated/api/bolt12.dart'; +export './src/generated/api/on_chain.dart'; +export './src/generated/api/spontaneous.dart'; export './src/generated/api/types.dart' hide Event_ChannelClosed, @@ -11,6 +15,7 @@ export './src/generated/api/types.dart' SocketAddress_OnionV2, EntropySourceConfig, SocketAddress_OnionV3, + $ChainDataSourceConfigCopyWith, SocketAddress_TcpIpV4, SocketAddress_TcpIpV6, MaxDustHTLCExposure_FeeRateMultiplier, @@ -24,7 +29,5 @@ export './src/generated/api/types.dart' GossipSourceConfig, EntropySourceConfig_SeedFile; export 'src/root.dart'; -export 'src/generated/api/node.dart' - show U8Array4, U8Array12, U8Array64, U8Array32; export 'src/utils/utils.dart' - hide LdkException, mapBuilderException, mapNodeException, Frb; + hide ExceptionBase, mapLdkBuilderError, mapLdkNodeError, Frb; diff --git a/lib/src/generated/api/bolt11.dart b/lib/src/generated/api/bolt11.dart new file mode 100644 index 0000000..a81e48c --- /dev/null +++ b/lib/src/generated/api/bolt11.dart @@ -0,0 +1,142 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0. + +// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import + +import '../frb_generated.dart'; +import '../lib.dart'; +import '../utils/error.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; +import 'types.dart'; + +// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `assert_receiver_is_total_eq`, `clone`, `eq`, `fmt`, `from`, `from`, `try_from` + +///Represents a syntactically and semantically correct lightning BOLT11 invoice. +/// +class Bolt11Invoice { + final String signedRawInvoice; + + const Bolt11Invoice({ + required this.signedRawInvoice, + }); + + @override + int get hashCode => signedRawInvoice.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Bolt11Invoice && + runtimeType == other.runtimeType && + signedRawInvoice == other.signedRawInvoice; +} + +class LdkBolt11Payment { + final Bolt11Payment ptr; + + const LdkBolt11Payment({ + required this.ptr, + }); + + Future claimForHash( + {required PaymentHash paymentHash, + required BigInt claimableAmountMsat, + required PaymentPreimage preimage}) => + core.instance.api.crateApiBolt11LdkBolt11PaymentClaimForHash( + that: this, + paymentHash: paymentHash, + claimableAmountMsat: claimableAmountMsat, + preimage: preimage); + + Future failForHash({required PaymentHash paymentHash}) => + core.instance.api.crateApiBolt11LdkBolt11PaymentFailForHash( + that: this, paymentHash: paymentHash); + + Future receive( + {required BigInt amountMsat, + required String description, + required int expirySecs}) => + core.instance.api.crateApiBolt11LdkBolt11PaymentReceive( + that: this, + amountMsat: amountMsat, + description: description, + expirySecs: expirySecs); + + Future receiveForHash( + {required PaymentHash paymentHash, + required BigInt amountMsat, + required String description, + required int expirySecs}) => + core.instance.api.crateApiBolt11LdkBolt11PaymentReceiveForHash( + that: this, + paymentHash: paymentHash, + amountMsat: amountMsat, + description: description, + expirySecs: expirySecs); + + Future receiveVariableAmount( + {required String description, required int expirySecs}) => + core.instance.api.crateApiBolt11LdkBolt11PaymentReceiveVariableAmount( + that: this, description: description, expirySecs: expirySecs); + + Future receiveVariableAmountForHash( + {required String description, + required int expirySecs, + required PaymentHash paymentHash}) => + core.instance.api + .crateApiBolt11LdkBolt11PaymentReceiveVariableAmountForHash( + that: this, + description: description, + expirySecs: expirySecs, + paymentHash: paymentHash); + + Future receiveVariableAmountViaJitChannel( + {required String description, + required int expirySecs, + BigInt? maxProportionalLspFeeLimitPpmMsat}) => + core.instance.api + .crateApiBolt11LdkBolt11PaymentReceiveVariableAmountViaJitChannel( + that: this, + description: description, + expirySecs: expirySecs, + maxProportionalLspFeeLimitPpmMsat: + maxProportionalLspFeeLimitPpmMsat); + + Future receiveViaJitChannel( + {required BigInt amountMsat, + required String description, + required int expirySecs, + BigInt? maxTotalLspFeeLimitMsat}) => + core.instance.api.crateApiBolt11LdkBolt11PaymentReceiveViaJitChannel( + that: this, + amountMsat: amountMsat, + description: description, + expirySecs: expirySecs, + maxTotalLspFeeLimitMsat: maxTotalLspFeeLimitMsat); + + Future send({required Bolt11Invoice invoice}) => core.instance.api + .crateApiBolt11LdkBolt11PaymentSend(that: this, invoice: invoice); + + Future sendProbes({required Bolt11Invoice invoice}) => core.instance.api + .crateApiBolt11LdkBolt11PaymentSendProbes(that: this, invoice: invoice); + + Future sendProbesUsingAmount( + {required Bolt11Invoice invoice, required BigInt amountMsat}) => + core.instance.api.crateApiBolt11LdkBolt11PaymentSendProbesUsingAmount( + that: this, invoice: invoice, amountMsat: amountMsat); + + Future sendUsingAmount( + {required Bolt11Invoice invoice, required BigInt amountMsat}) => + core.instance.api.crateApiBolt11LdkBolt11PaymentSendUsingAmount( + that: this, invoice: invoice, amountMsat: amountMsat); + + @override + int get hashCode => ptr.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LdkBolt11Payment && + runtimeType == other.runtimeType && + ptr == other.ptr; +} diff --git a/lib/src/generated/api/bolt12.dart b/lib/src/generated/api/bolt12.dart new file mode 100644 index 0000000..08f6999 --- /dev/null +++ b/lib/src/generated/api/bolt12.dart @@ -0,0 +1,126 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0. + +// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import + +import '../frb_generated.dart'; +import '../lib.dart'; +import '../utils/error.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; +import 'types.dart'; + +// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `assert_receiver_is_total_eq`, `clone`, `eq`, `fmt`, `from`, `from`, `from`, `try_from`, `try_from`, `try_from` + +// Rust type: RustOpaqueNom> +abstract class ArcBolt12Payment implements RustOpaqueInterface {} + +///A Bolt12Invoice is a payment request, typically corresponding to an Offer or a Refund. +class Bolt12Invoice { + final Uint8List data; + + const Bolt12Invoice({ + required this.data, + }); + + @override + int get hashCode => data.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Bolt12Invoice && + runtimeType == other.runtimeType && + data == other.data; +} + +class LdkBolt12Payment { + final ArcBolt12Payment ptr; + + const LdkBolt12Payment({ + required this.ptr, + }); + + Future initiateRefund( + {required BigInt amountMsat, required int expirySecs}) => + core.instance.api.crateApiBolt12LdkBolt12PaymentInitiateRefund( + that: this, amountMsat: amountMsat, expirySecs: expirySecs); + + Future receive( + {required BigInt amountMsat, required String description}) => + core.instance.api.crateApiBolt12LdkBolt12PaymentReceive( + that: this, amountMsat: amountMsat, description: description); + + Future receiveVariableAmount({required String description}) => + core.instance.api.crateApiBolt12LdkBolt12PaymentReceiveVariableAmount( + that: this, description: description); + + Future requestRefundPayment({required Refund refund}) => + core.instance.api.crateApiBolt12LdkBolt12PaymentRequestRefundPayment( + that: this, refund: refund); + + Future send({required Offer offer, String? payerNote}) => + core.instance.api.crateApiBolt12LdkBolt12PaymentSend( + that: this, offer: offer, payerNote: payerNote); + + Future sendUsingAmount( + {required Offer offer, + String? payerNote, + required BigInt amountMsat}) => + core.instance.api.crateApiBolt12LdkBolt12PaymentSendUsingAmount( + that: this, + offer: offer, + payerNote: payerNote, + amountMsat: amountMsat); + + @override + int get hashCode => ptr.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LdkBolt12Payment && + runtimeType == other.runtimeType && + ptr == other.ptr; +} + +/// An `Offer` is a potentially long-lived proposal for payment of a good or service. +/// +/// An offer is a precursor to an [InvoiceRequest]. A merchant publishes an offer from which a +/// customer may request an [Bolt12Invoice] for a specific quantity and using an amount sufficient +/// to cover that quantity (i.e., at least `quantity * amount`). +/// +/// Offers may be denominated in currency other than bitcoin but are ultimately paid using the +/// latter. +/// +class Offer { + final String s; + + const Offer({ + required this.s, + }); + + @override + int get hashCode => s.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Offer && runtimeType == other.runtimeType && s == other.s; +} + +///A Refund is a request to send an `Bolt12Invoice` without a preceding `Offer`. +class Refund { + final String s; + + const Refund({ + required this.s, + }); + + @override + int get hashCode => s.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Refund && runtimeType == other.runtimeType && s == other.s; +} diff --git a/lib/src/generated/api/builder.dart b/lib/src/generated/api/builder.dart new file mode 100644 index 0000000..a6fd072 --- /dev/null +++ b/lib/src/generated/api/builder.dart @@ -0,0 +1,61 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0. + +// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import + +import '../frb_generated.dart'; +import '../lib.dart'; +import '../utils/error.dart'; +import 'node.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; +import 'types.dart'; + +// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `clone`, `fmt`, `from`, `try_from` + +// Rust type: RustOpaqueNom> +abstract class NodeBuilder implements RustOpaqueInterface { + Builder get builder; + + void set builder(Builder builder); + + Future build(); + + Future buildWithFsStore(); + + static Future createBuilder( + {required Config config, + ChainDataSourceConfig? chainDataSourceConfig, + EntropySourceConfig? entropySourceConfig, + GossipSourceConfig? gossipSourceConfig, + LiquiditySourceConfig? liquiditySourceConfig}) => + core.instance.api.crateApiBuilderNodeBuilderCreateBuilder( + config: config, + chainDataSourceConfig: chainDataSourceConfig, + entropySourceConfig: entropySourceConfig, + gossipSourceConfig: gossipSourceConfig, + liquiditySourceConfig: liquiditySourceConfig); +} + +// Rust type: RustOpaqueNom +abstract class Builder implements RustOpaqueInterface {} + +class LdkMnemonic { + final String seedPhrase; + + const LdkMnemonic({ + required this.seedPhrase, + }); + + static Future generate() => + core.instance.api.crateApiBuilderLdkMnemonicGenerate(); + + @override + int get hashCode => seedPhrase.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LdkMnemonic && + runtimeType == other.runtimeType && + seedPhrase == other.seedPhrase; +} diff --git a/lib/src/generated/api/error.dart b/lib/src/generated/api/error.dart deleted file mode 100644 index f9b1e46..0000000 --- a/lib/src/generated/api/error.dart +++ /dev/null @@ -1,137 +0,0 @@ -// This file is automatically generated, so please do not edit it. -// 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 BuilderException { - socketAddressParseError, - - /// The given seed bytes are invalid, e.g., have invalid length. - invalidSeedBytes, - - /// The given seed file is invalid, e.g., has invalid length, or could not be read. - invalidSeedFile, - - /// The current system time is invalid, clocks might have gone backwards. - invalidSystemTime, - - /// The a read channel monitor is invalid. - invalidChannelMonitor, - - /// The given listening addresses are invalid, e.g. too many were passed. - invalidListeningAddress, - - /// We failed to read data from the [`KVStore`]. - readFailed, - - /// We failed to write data to the [`KVStore`]. - writeFailed, - - /// We failed to access the given `storage_dir_path`. - storagePathAccessFailed, - - /// We failed to setup our [`KVStore`]. - kvStoreSetupFailed, - - /// We failed to setup the onchain wallet. - walletSetupFailed, - - /// We failed to setup the logger. - loggerSetupFailed, - invalidTrustedPeer, -} - -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. - notRunning, - - /// An on-chain transaction could not be created. - onchainTxCreationFailed, - - /// A network connection has been closed. - connectionFailed, - - /// Invoice creation failed. - invoiceCreationFailed, - - /// Sending a payment has failed. - paymentSendingFailed, - - /// Sending a payment probe has failed. - probeSendingFailed, - - /// A channel could not be opened. - channelCreationFailed, - - /// A channel could not be closed. - channelClosingFailed, - - /// A channel config could not be updated. - channelConfigUpdateFailed, - - /// Persistence failed. - persistenceFailed, - - /// A wallet operation failed. - walletOperationFailed, - - /// A signing operation for transaction failed. - onchainTxSigningFailed, - - /// A signing operation for message failed. - messageSigningFailed, - - /// A transaction sync operation failed. - txSyncFailed, - - /// A gossip updating operation failed. - gossipUpdateFailed, - - /// The given address is invalid. - invalidAddress, - - /// The given network address is invalid. - invalidSocketAddress, - - /// The given public key is invalid. - invalidPublicKey, - - /// The given secret key is invalid. - invalidSecretKey, - - /// The given payment hash is invalid. - invalidPaymentHash, - - /// The given payment preimage is invalid. - invalidPaymentPreimage, - - /// The given payment secret is invalid. - invalidPaymentSecret, - - /// The given amount is invalid. - invalidAmount, - - /// The given invoice is invalid. - invalidInvoice, - - /// The given channel ID is invalid. - invalidChannelId, - - /// The given network is invalid. - invalidNetwork, - - /// A payment with the given hash has already been initiated. - duplicatePayment, - - /// There are insufficient funds to complete the given operation. - insufficientFunds, - feerateEstimationUpdateFailed, -} diff --git a/lib/src/generated/api/graph.dart b/lib/src/generated/api/graph.dart new file mode 100644 index 0000000..6859cec --- /dev/null +++ b/lib/src/generated/api/graph.dart @@ -0,0 +1,243 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0. + +// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import + +import '../frb_generated.dart'; +import '../lib.dart'; +import '../utils/error.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; +import 'types.dart'; + +// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `from`, `from`, `from`, `from`, `from`, `from`, `from`, `try_from` + +///Details about a channel (both directions). Received within a channel announcement. +class ChannelInfo { + ///Source node of the first direction of a channel + final NodeId nodeOne; + + ///Details about the first direction of a channel + final ChannelUpdateInfo? oneToTwo; + + ///Source node of the second direction of a channel + final NodeId nodeTwo; + + ///Details about the second direction of a channel + final ChannelUpdateInfo? twoToOne; + + ///The channel capacity as seen on-chain, if chain lookup is available. + final BigInt? capacitySats; + + const ChannelInfo({ + required this.nodeOne, + this.oneToTwo, + required this.nodeTwo, + this.twoToOne, + this.capacitySats, + }); + + @override + int get hashCode => + nodeOne.hashCode ^ + oneToTwo.hashCode ^ + nodeTwo.hashCode ^ + twoToOne.hashCode ^ + capacitySats.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ChannelInfo && + runtimeType == other.runtimeType && + nodeOne == other.nodeOne && + oneToTwo == other.oneToTwo && + nodeTwo == other.nodeTwo && + twoToOne == other.twoToOne && + capacitySats == other.capacitySats; +} + +class ChannelUpdateInfo { + ///When the last update to the channel direction was issued. Value is opaque, as set in the announcement. + final int lastUpdate; + + ///Whether the channel can be currently used for payments (in this one direction). + final bool enabled; + + ///The difference in CLTV values that you must have when routing through this channel. + final int cltvExpiryDelta; + + ///The minimum value, which must be relayed to the next hop via the channel + final BigInt htlcMinimumMsat; + + ///The maximum value which may be relayed to the next hop via the channel. + final BigInt htlcMaximumMsat; + final RoutingFees fees; + + const ChannelUpdateInfo({ + required this.lastUpdate, + required this.enabled, + required this.cltvExpiryDelta, + required this.htlcMinimumMsat, + required this.htlcMaximumMsat, + required this.fees, + }); + + @override + int get hashCode => + lastUpdate.hashCode ^ + enabled.hashCode ^ + cltvExpiryDelta.hashCode ^ + htlcMinimumMsat.hashCode ^ + htlcMaximumMsat.hashCode ^ + fees.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ChannelUpdateInfo && + runtimeType == other.runtimeType && + lastUpdate == other.lastUpdate && + enabled == other.enabled && + cltvExpiryDelta == other.cltvExpiryDelta && + htlcMinimumMsat == other.htlcMinimumMsat && + htlcMaximumMsat == other.htlcMaximumMsat && + fees == other.fees; +} + +class LdkNetworkGraph { + final NetworkGraph ptr; + + const LdkNetworkGraph({ + required this.ptr, + }); + + /// Returns information on a channel with the given id. + Future channel({required BigInt shortChannelId}) => + core.instance.api.crateApiGraphLdkNetworkGraphChannel( + that: this, shortChannelId: shortChannelId); + + /// Returns the list of channels in the graph + Future listChannels() => + core.instance.api.crateApiGraphLdkNetworkGraphListChannels( + that: this, + ); + + /// Returns the list of nodes in the graph + Future> listNodes() => + core.instance.api.crateApiGraphLdkNetworkGraphListNodes( + that: this, + ); + + Future node({required NodeId nodeId}) => core.instance.api + .crateApiGraphLdkNetworkGraphNode(that: this, nodeId: nodeId); + + @override + int get hashCode => ptr.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LdkNetworkGraph && + runtimeType == other.runtimeType && + ptr == other.ptr; +} + +class NodeAnnouncementInfo { + /// When the last known update to the node state was issued. + /// Value is opaque, as set in the announcement. + final int lastUpdate; + + /// Moniker assigned to the node. + /// May be invalid or malicious (eg control chars), + /// should not be exposed to the user. + final String alias; + + /// List of addresses on which this node is reachable + final List addresses; + + const NodeAnnouncementInfo({ + required this.lastUpdate, + required this.alias, + required this.addresses, + }); + + @override + int get hashCode => lastUpdate.hashCode ^ alias.hashCode ^ addresses.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is NodeAnnouncementInfo && + runtimeType == other.runtimeType && + lastUpdate == other.lastUpdate && + alias == other.alias && + addresses == other.addresses; +} + +///Represents the compressed public key of a node +class NodeId { + final Uint8List compressed; + + const NodeId({ + required this.compressed, + }); + + @override + int get hashCode => compressed.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is NodeId && + runtimeType == other.runtimeType && + compressed == other.compressed; +} + +///Details about a node in the network, known from the network announcement. +class NodeInfo { + final Uint64List channels; + + ///More information about a node from node_announcement. Optional because we store a Node entry after learning about it from a channel announcement, but before receiving a node announcement. + final NodeAnnouncementInfo? announcementInfo; + + const NodeInfo({ + required this.channels, + this.announcementInfo, + }); + + @override + int get hashCode => channels.hashCode ^ announcementInfo.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is NodeInfo && + runtimeType == other.runtimeType && + channels == other.channels && + announcementInfo == other.announcementInfo; +} + +///Fees for routing via a given channel or a node +class RoutingFees { + ///Flat routing fee in millisatoshis. + final int baseMsat; + + ///Liquidity-based routing fee in millionths of a routed amount. In other words, 10000 is 1%. + final int proportionalMillionths; + + const RoutingFees({ + required this.baseMsat, + required this.proportionalMillionths, + }); + + @override + int get hashCode => baseMsat.hashCode ^ proportionalMillionths.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is RoutingFees && + runtimeType == other.runtimeType && + baseMsat == other.baseMsat && + proportionalMillionths == other.proportionalMillionths; +} diff --git a/lib/src/generated/api/node.dart b/lib/src/generated/api/node.dart index 20d548f..b409039 100644 --- a/lib/src/generated/api/node.dart +++ b/lib/src/generated/api/node.dart @@ -1,269 +1,189 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. +// Generated by `flutter_rust_bridge`@ 2.0.0. // ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import import '../frb_generated.dart'; -import 'error.dart'; -import 'package:collection/collection.dart'; +import '../lib.dart'; +import '../utils/error.dart'; +import 'bolt11.dart'; +import 'bolt12.dart'; +import 'graph.dart'; +import 'on_chain.dart'; import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; +import 'spontaneous.dart'; import 'types.dart'; -Future buildWithSqliteStore( - {required Config config, - ChainDataSourceConfig? chainDataSourceConfig, - EntropySourceConfig? entropySourceConfig, - GossipSourceConfig? gossipSourceConfig, - dynamic hint}) => - LdkCore.instance.api.buildWithSqliteStore( - config: config, - chainDataSourceConfig: chainDataSourceConfig, - entropySourceConfig: entropySourceConfig, - gossipSourceConfig: gossipSourceConfig, - hint: hint); - -// Rust type: RustOpaqueNom> -@sealed -class NodeSqliteStore extends RustOpaque { - NodeSqliteStore.dcoDecode(List wire) - : super.dcoDecode(wire, _kStaticData); - - NodeSqliteStore.sseDecode(int ptr, int externalSizeOnNative) - : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); - - static final _kStaticData = RustArcStaticData( - rustArcIncrementStrongCount: - LdkCore.instance.api.rust_arc_increment_strong_count_NodeSqliteStore, - rustArcDecrementStrongCount: - LdkCore.instance.api.rust_arc_decrement_strong_count_NodeSqliteStore, - rustArcDecrementStrongCountPtr: - LdkCore.instance.api.rust_arc_decrement_strong_count_NodeSqliteStorePtr, - ); -} - -class LdkMnemonic { - final String seedPhrase; - - const LdkMnemonic({ - required this.seedPhrase, - }); - - static Future generate({dynamic hint}) => - LdkCore.instance.api.ldkMnemonicGenerate(hint: hint); - - @override - int get hashCode => seedPhrase.hashCode; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is LdkMnemonic && - runtimeType == other.runtimeType && - seedPhrase == other.seedPhrase; -} +// Rust type: RustOpaqueNom +abstract class Node implements RustOpaqueInterface {} class LdkNode { - final NodeSqliteStore ptr; + final Node ptr; const LdkNode({ required this.ptr, }); + static Future bolt11Payment({required LdkNode ptr}) => + core.instance.api.crateApiNodeLdkNodeBolt11Payment(ptr: ptr); + + static Future bolt12Payment({required LdkNode ptr}) => + core.instance.api.crateApiNodeLdkNodeBolt12Payment(ptr: ptr); + Future closeChannel( - {required ChannelId channelId, - required PublicKey counterpartyNodeId, - dynamic hint}) => - LdkCore.instance.api.ldkNodeCloseChannel( + {required UserChannelId userChannelId, + required PublicKey counterpartyNodeId}) => + core.instance.api.crateApiNodeLdkNodeCloseChannel( that: this, - channelId: channelId, - counterpartyNodeId: counterpartyNodeId, - hint: hint); + userChannelId: userChannelId, + counterpartyNodeId: counterpartyNodeId); + + Future config() => core.instance.api.crateApiNodeLdkNodeConfig( + that: this, + ); Future connect( {required PublicKey nodeId, required SocketAddress address, - required bool persist, - dynamic hint}) => - LdkCore.instance.api.ldkNodeConnect( - that: this, - nodeId: nodeId, - address: address, - persist: persist, - hint: hint); + required bool persist}) => + core.instance.api.crateApiNodeLdkNodeConnect( + that: this, nodeId: nodeId, address: address, persist: persist); - Future connectOpenChannel( + Future connectOpenChannel( {required SocketAddress socketAddress, required PublicKey nodeId, - required int channelAmountSats, - int? pushToCounterpartyMsat, + required BigInt channelAmountSats, + BigInt? pushToCounterpartyMsat, required bool announceChannel, - ChannelConfig? channelConfig, - dynamic hint}) => - LdkCore.instance.api.ldkNodeConnectOpenChannel( + ChannelConfig? channelConfig}) => + core.instance.api.crateApiNodeLdkNodeConnectOpenChannel( that: this, socketAddress: socketAddress, nodeId: nodeId, channelAmountSats: channelAmountSats, pushToCounterpartyMsat: pushToCounterpartyMsat, announceChannel: announceChannel, - channelConfig: channelConfig, - hint: hint); + channelConfig: channelConfig); + + Future disconnect({required PublicKey counterpartyNodeId}) => + core.instance.api.crateApiNodeLdkNodeDisconnect( + that: this, counterpartyNodeId: counterpartyNodeId); - Future disconnect( - {required PublicKey counterpartyNodeId, dynamic hint}) => - LdkCore.instance.api.ldkNodeDisconnect( - that: this, counterpartyNodeId: counterpartyNodeId, hint: hint); + Future eventHandled() => + core.instance.api.crateApiNodeLdkNodeEventHandled( + that: this, + ); - Future eventHandled({dynamic hint}) => - LdkCore.instance.api.ldkNodeEventHandled(that: this, hint: hint); + Future forceCloseChannel( + {required UserChannelId userChannelId, + required PublicKey counterpartyNodeId}) => + core.instance.api.crateApiNodeLdkNodeForceCloseChannel( + that: this, + userChannelId: userChannelId, + counterpartyNodeId: counterpartyNodeId); - Future isRunning({dynamic hint}) => - LdkCore.instance.api.ldkNodeIsRunning(that: this, hint: hint); + Future listBalances() => + core.instance.api.crateApiNodeLdkNodeListBalances( + that: this, + ); - Future> listChannels({dynamic hint}) => - LdkCore.instance.api.ldkNodeListChannels(that: this, hint: hint); + Future> listChannels() => + core.instance.api.crateApiNodeLdkNodeListChannels( + that: this, + ); - Future> listPayments({dynamic hint}) => - LdkCore.instance.api.ldkNodeListPayments(that: this, hint: hint); + Future> listPayments() => + core.instance.api.crateApiNodeLdkNodeListPayments( + that: this, + ); Future> listPaymentsWithFilter( - {required PaymentDirection paymentDirection, dynamic hint}) => - LdkCore.instance.api.ldkNodeListPaymentsWithFilter( - that: this, paymentDirection: paymentDirection, hint: hint); + {required PaymentDirection paymentDirection}) => + core.instance.api.crateApiNodeLdkNodeListPaymentsWithFilter( + that: this, paymentDirection: paymentDirection); - Future> listPeers({dynamic hint}) => - LdkCore.instance.api.ldkNodeListPeers(that: this, hint: hint); + Future> listPeers() => + core.instance.api.crateApiNodeLdkNodeListPeers( + that: this, + ); - Future?> listeningAddresses({dynamic hint}) => - LdkCore.instance.api.ldkNodeListeningAddresses(that: this, hint: hint); + Future?> listeningAddresses() => + core.instance.api.crateApiNodeLdkNodeListeningAddresses( + that: this, + ); - Future
newOnchainAddress({dynamic hint}) => - LdkCore.instance.api.ldkNodeNewOnchainAddress(that: this, hint: hint); + static Future networkGraph({required LdkNode ptr}) => + core.instance.api.crateApiNodeLdkNodeNetworkGraph(ptr: ptr); - Future nextEvent({dynamic hint}) => - LdkCore.instance.api.ldkNodeNextEvent(that: this, hint: hint); + Future nextEvent() => core.instance.api.crateApiNodeLdkNodeNextEvent( + that: this, + ); - Future nodeId({dynamic hint}) => - LdkCore.instance.api.ldkNodeNodeId(that: this, hint: hint); + Future nextEventAsync() => + core.instance.api.crateApiNodeLdkNodeNextEventAsync( + that: this, + ); - Future payment( - {required PaymentHash paymentHash, dynamic hint}) => - LdkCore.instance.api - .ldkNodePayment(that: this, paymentHash: paymentHash, hint: hint); + Future nodeId() => core.instance.api.crateApiNodeLdkNodeNodeId( + that: this, + ); - Future receivePayment( - {required int amountMsat, - required String description, - required int expirySecs, - dynamic hint}) => - 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.ldkNodeReceiveVariableAmountPayment( - that: this, - description: description, - expirySecs: expirySecs, - hint: hint); - - Future removePayment( - {required PaymentHash paymentHash, dynamic hint}) => - LdkCore.instance.api.ldkNodeRemovePayment( - that: this, paymentHash: paymentHash, hint: hint); - - Future sendAllToOnchainAddress( - {required Address address, dynamic hint}) => - LdkCore.instance.api.ldkNodeSendAllToOnchainAddress( - that: this, address: address, hint: hint); - - Future sendPayment( - {required Bolt11Invoice invoice, dynamic hint}) => - LdkCore.instance.api - .ldkNodeSendPayment(that: this, invoice: invoice, hint: hint); - - Future sendPaymentProbes( - {required Bolt11Invoice invoice, dynamic hint}) => - LdkCore.instance.api - .ldkNodeSendPaymentProbes(that: this, invoice: invoice, hint: hint); - - Future sendPaymentProbesUsingAmount( - {required Bolt11Invoice invoice, - required int amountMsat, - dynamic hint}) => - 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.ldkNodeSendPaymentUsingAmount( - that: this, invoice: invoice, amountMsat: amountMsat, hint: hint); - - Future sendSpontaneousPayment( - {required int amountMsat, required PublicKey nodeId, dynamic hint}) => - 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.ldkNodeSendSpontaneousPaymentProbes( - that: this, amountMsat: amountMsat, nodeId: nodeId, hint: hint); - - Future sendToOnchainAddress( - {required Address address, required int amountSats, dynamic hint}) => - LdkCore.instance.api.ldkNodeSendToOnchainAddress( - that: this, address: address, amountSats: amountSats, hint: hint); - - Future signMessage({required List msg, dynamic hint}) => - LdkCore.instance.api.ldkNodeSignMessage(that: this, msg: msg, hint: hint); - - Future spendableOnchainBalanceSats({dynamic hint}) => - LdkCore.instance.api - .ldkNodeSpendableOnchainBalanceSats(that: this, hint: hint); - - Future start({dynamic hint}) => - LdkCore.instance.api.ldkNodeStart(that: this, hint: hint); - - Future stop({dynamic hint}) => - LdkCore.instance.api.ldkNodeStop(that: this, hint: hint); - - Future syncWallets({dynamic hint}) => - LdkCore.instance.api.ldkNodeSyncWallets(that: this, hint: hint); - - Future totalOnchainBalanceSats({dynamic hint}) => LdkCore.instance.api - .ldkNodeTotalOnchainBalanceSats(that: this, hint: hint); + static Future onChainPayment({required LdkNode ptr}) => + core.instance.api.crateApiNodeLdkNodeOnChainPayment(ptr: ptr); + + Future payment({required PaymentId paymentId}) => + core.instance.api + .crateApiNodeLdkNodePayment(that: this, paymentId: paymentId); + + Future removePayment({required PaymentId paymentId}) => + core.instance.api + .crateApiNodeLdkNodeRemovePayment(that: this, paymentId: paymentId); + + Future signMessage({required List msg}) => + core.instance.api.crateApiNodeLdkNodeSignMessage(that: this, msg: msg); + + static Future spontaneousPayment( + {required LdkNode ptr}) => + core.instance.api.crateApiNodeLdkNodeSpontaneousPayment(ptr: ptr); + + Future start() => core.instance.api.crateApiNodeLdkNodeStart( + that: this, + ); + + Future status() => core.instance.api.crateApiNodeLdkNodeStatus( + that: this, + ); + + Future stop() => core.instance.api.crateApiNodeLdkNodeStop( + that: this, + ); + + Future syncWallets() => + core.instance.api.crateApiNodeLdkNodeSyncWallets( + that: this, + ); Future updateChannelConfig( - {required ChannelId channelId, + {required UserChannelId userChannelId, required PublicKey counterpartyNodeId, - required ChannelConfig channelConfig, - dynamic hint}) => - LdkCore.instance.api.ldkNodeUpdateChannelConfig( + required ChannelConfig channelConfig}) => + core.instance.api.crateApiNodeLdkNodeUpdateChannelConfig( that: this, - channelId: channelId, + userChannelId: userChannelId, counterpartyNodeId: counterpartyNodeId, - channelConfig: channelConfig, - hint: hint); + channelConfig: channelConfig); Future verifySignature( {required List msg, required String sig, - required PublicKey pkey, - dynamic hint}) => - LdkCore.instance.api.ldkNodeVerifySignature( - that: this, msg: msg, sig: sig, pkey: pkey, hint: hint); + required PublicKey publicKey}) => + core.instance.api.crateApiNodeLdkNodeVerifySignature( + that: this, msg: msg, sig: sig, publicKey: publicKey); - Future waitNextEvent({dynamic hint}) => - LdkCore.instance.api.ldkNodeWaitNextEvent(that: this, hint: hint); + Future waitNextEvent() => + core.instance.api.crateApiNodeLdkNodeWaitNextEvent( + that: this, + ); @override int get hashCode => ptr.hashCode; @@ -273,73 +193,3 @@ class LdkNode { identical(this, other) || other is LdkNode && runtimeType == other.runtimeType && ptr == other.ptr; } - -class U8Array12 extends NonGrowableListView { - static const arraySize = 12; - - @internal - Uint8List get inner => _inner; - final Uint8List _inner; - - U8Array12(this._inner) - : assert(_inner.length == arraySize), - super(_inner); - - U8Array12.init() : this(Uint8List(arraySize)); -} - -class U8Array16 extends NonGrowableListView { - static const arraySize = 16; - - @internal - Uint8List get inner => _inner; - final Uint8List _inner; - - U8Array16(this._inner) - : assert(_inner.length == arraySize), - super(_inner); - - U8Array16.init() : this(Uint8List(arraySize)); -} - -class U8Array32 extends NonGrowableListView { - static const arraySize = 32; - - @internal - Uint8List get inner => _inner; - final Uint8List _inner; - - U8Array32(this._inner) - : assert(_inner.length == arraySize), - super(_inner); - - U8Array32.init() : this(Uint8List(arraySize)); -} - -class U8Array4 extends NonGrowableListView { - static const arraySize = 4; - - @internal - Uint8List get inner => _inner; - final Uint8List _inner; - - U8Array4(this._inner) - : assert(_inner.length == arraySize), - super(_inner); - - U8Array4.init() : this(Uint8List(arraySize)); -} - -class U8Array64 extends NonGrowableListView { - static const arraySize = 64; - - @internal - Uint8List get inner => _inner; - final Uint8List _inner; - - U8Array64(this._inner) - : assert(_inner.length == arraySize), - super(_inner); - - U8Array64.init() : this(Uint8List(arraySize)); -} diff --git a/lib/src/generated/api/on_chain.dart b/lib/src/generated/api/on_chain.dart new file mode 100644 index 0000000..2679842 --- /dev/null +++ b/lib/src/generated/api/on_chain.dart @@ -0,0 +1,44 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0. + +// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import + +import '../frb_generated.dart'; +import '../lib.dart'; +import '../utils/error.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; +import 'types.dart'; + +// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `from` + +class LdkOnChainPayment { + final OnchainPayment ptr; + + const LdkOnChainPayment({ + required this.ptr, + }); + + Future
newAddress() => + core.instance.api.crateApiOnChainLdkOnChainPaymentNewAddress( + that: this, + ); + + Future sendAllToAddress({required Address address}) => + core.instance.api.crateApiOnChainLdkOnChainPaymentSendAllToAddress( + that: this, address: address); + + Future sendToAddress( + {required Address address, required BigInt amountSats}) => + core.instance.api.crateApiOnChainLdkOnChainPaymentSendToAddress( + that: this, address: address, amountSats: amountSats); + + @override + int get hashCode => ptr.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LdkOnChainPayment && + runtimeType == other.runtimeType && + ptr == other.ptr; +} diff --git a/lib/src/generated/api/spontaneous.dart b/lib/src/generated/api/spontaneous.dart new file mode 100644 index 0000000..adad377 --- /dev/null +++ b/lib/src/generated/api/spontaneous.dart @@ -0,0 +1,40 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0. + +// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import + +import '../frb_generated.dart'; +import '../lib.dart'; +import '../utils/error.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; +import 'types.dart'; + +// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `from` + +class LdkSpontaneousPayment { + final SpontaneousPayment ptr; + + const LdkSpontaneousPayment({ + required this.ptr, + }); + + Future send( + {required BigInt amountMsat, required PublicKey nodeId}) => + core.instance.api.crateApiSpontaneousLdkSpontaneousPaymentSend( + that: this, amountMsat: amountMsat, nodeId: nodeId); + + Future sendProbes( + {required BigInt amountMsat, required PublicKey nodeId}) => + core.instance.api.crateApiSpontaneousLdkSpontaneousPaymentSendProbes( + that: this, amountMsat: amountMsat, nodeId: nodeId); + + @override + int get hashCode => ptr.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LdkSpontaneousPayment && + runtimeType == other.runtimeType && + ptr == other.ptr; +} diff --git a/lib/src/generated/api/types.dart b/lib/src/generated/api/types.dart index 412aae8..1af2513 100644 --- a/lib/src/generated/api/types.dart +++ b/lib/src/generated/api/types.dart @@ -1,15 +1,17 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. +// Generated by `flutter_rust_bridge`@ 2.0.0. // ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import import '../frb_generated.dart'; -import 'error.dart'; -import 'node.dart'; +import '../lib.dart'; +import 'builder.dart'; import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; import 'package:freezed_annotation/freezed_annotation.dart' hide protected; part 'types.freezed.dart'; +// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `assert_receiver_is_total_eq`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `default`, `default`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `hash`, `hash`, `hash`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from`, `try_from` + /// A Bitcoin address. /// class Address { @@ -28,24 +30,167 @@ class Address { other is Address && runtimeType == other.runtimeType && s == other.s; } -///Represents a syntactically and semantically correct lightning BOLT11 invoice. +/// Configuration options pertaining to 'Anchor' channels, i.e., channels for which the +/// `optionAnchorsZeroFeeHtlcTx` channel type is negotiated. +/// +/// Prior to the introduction of Anchor channels, the on-chain fees paying for the transactions +/// issued on channel closure were pre-determined and locked-in at the time of the channel +/// opening. This required to estimate what fee rate would be sufficient to still have the +/// closing transactions be spendable on-chain (i.e., not be considered dust). This legacy +/// design of pre-anchor channels proved inadequate in the unpredictable, often turbulent, fee +/// markets we experience today. +/// +/// In contrast, Anchor channels allow to determine an adequate fee rate *at the time of channel +/// closure*, making them much more robust in the face of fee spikes. In turn, they require to +/// maintain a reserve of on-chain funds to have the channel closure transactions confirmed +/// on-chain, at least if the channel counterparty can't be trusted to do this for us. +/// +/// See [BOLT 3] for more technical details on Anchor channels. +/// +/// +/// ### Defaults +/// +/// | Parameter | Value | +/// |----------------------------|--------| +/// | `trustedPeersNoReserve` | [] | +/// | `perChannelReserveSats` | 25000 | +/// +/// +/// [BOLT 3]: https://github.com/lightning/bolts/blob/master/03-transactions.md#htlc-timeout-and-htlc-success-transactions +class AnchorChannelsConfig { + /// A list of peers that we trust to get the required channel closing transactions confirmed + /// on-chain. + /// + /// Channels with these peers won't count towards the retained on-chain reserve and we won't + /// take any action to get the required transactions confirmed ourselves. + /// + /// **Note:** Trusting the channel counterparty to take the necessary actions to get the + /// required Anchor spending and HTLC transactions confirmed on-chain is potentially insecure + /// as the channel may not be closed if they refuse to do so, potentially leaving the user + /// funds stuck *or* even allow the counterparty to steal any in-flight funds after the + /// corresponding HTLCs time out. + final List trustedPeersNoReserve; + + /// The amount of satoshis per anchors-negotiated channel with an untrusted peer that we keep + /// as an emergency reserve in our on-chain wallet. + /// + /// This allows for having the required Anchor output spending and HTLC transactions confirmed + /// when the channel is closed. + /// + /// If the channel peer is not marked as trusted via trustedPeersNoReserve, + /// we will always try to spend the Anchor + /// outputs with *any* on-chain funds available, i.e., the total reserve value as well as any + /// spendable funds available in the on-chain wallet. Therefore, this per-channel multiplier is + /// really an emergency reserve that we maintain at all time to reduce reduce the risk of + /// insufficient funds at time of a channel closure. To this end, we will refuse to open + /// outbound or accept inbound channels if we don't have sufficient on-chain funds available to + /// cover the additional reserve requirement. + /// + /// **Note:** Depending on the fee market at the time of closure, this reserve amount might or + /// might not suffice to successfully spend the Anchor output and have the HTLC transactions + /// confirmed on-chain, i.e., you may want to adjust this value accordingly. + final BigInt perChannelReserveSats; + + const AnchorChannelsConfig({ + required this.trustedPeersNoReserve, + required this.perChannelReserveSats, + }); + + @override + int get hashCode => + trustedPeersNoReserve.hashCode ^ perChannelReserveSats.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AnchorChannelsConfig && + runtimeType == other.runtimeType && + trustedPeersNoReserve == other.trustedPeersNoReserve && + perChannelReserveSats == other.perChannelReserveSats; +} + +/// Details of the known available balances returned by `node.listBalances`. /// -class Bolt11Invoice { - final String signedRawInvoice; +class BalanceDetails { + /// The total balance of our on-chain wallet. + final BigInt totalOnchainBalanceSats; + + /// The currently spendable balance of our on-chain wallet. + final BigInt spendableOnchainBalanceSats; - const Bolt11Invoice({ - required this.signedRawInvoice, + /// 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 BigInt 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 => signedRawInvoice.hashCode; + int get hashCode => + totalOnchainBalanceSats.hashCode ^ + spendableOnchainBalanceSats.hashCode ^ + totalLightningBalanceSats.hashCode ^ + lightningBalances.hashCode ^ + pendingBalancesFromChannelClosures.hashCode; @override bool operator ==(Object other) => identical(this, other) || - other is Bolt11Invoice && + other is BalanceDetails && runtimeType == other.runtimeType && - signedRawInvoice == other.signedRawInvoice; + 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; } @freezed @@ -79,7 +224,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. /// @@ -90,18 +235,16 @@ class ChannelConfig { /// When we are not the funder, we require the closing transaction fee pay at least our Background fee estimate, but allow our counterparty to pay as much fee as they like. Thus, this value is ignored when we are not the funder. /// /// Default value: 1000 satoshis. - final int forceCloseAvoidanceMaxFeeSatoshis; + final BigInt 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, - required this.maxDustHtlcExposure, + this.maxDustHtlcExposure, required this.forceCloseAvoidanceMaxFeeSatoshis, required this.acceptUnderpayingHtlcs, }); @@ -130,118 +273,146 @@ class ChannelConfig { acceptUnderpayingHtlcs == other.acceptUnderpayingHtlcs; } -/// Details of a channel, as returned by node.listChannels() -/// class ChannelDetails { - /// 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). + /// 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). + /// /// 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 String? fundingTxo; + final OutPoint? fundingTxo; - ///The value, in satoshis, of this channel as it appears in the funding output. - final int channelValueSats; + /// The value, in satoshis, of this channel as it appears in the funding output. + final BigInt channelValueSats; - /// 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. + /// 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. /// - /// This value is not included in `outbound_capacity_msat` as it can never be spent. + /// This value is not included in `outboundCapacityMsat` as it can never be spent. /// - /// This value will be null for outbound channels until the counterparty accepts the channel. + /// This value will be `None` for outbound channels until the counterparty accepts the channel. /// - final int? unspendablePunishmentReserve; + final BigInt? unspendablePunishmentReserve; - /// 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. - /// + /// The local `user_channel_id` of this channel. 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; - /// 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 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 + /// The amount does not include any pending HTLCs which are not yet 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; + final BigInt outboundCapacityMsat; - /// 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. + /// The available outbound capacity for sending HTLCs to the remote peer. /// - /// 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 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. - /// - final int inboundCapacityMsat; - - /// 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 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 BigInt 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 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; - /// True if the channel was initiated (and thus funded) by us. - /// + /// Returns `true` if the channel was initiated (and therefore funded) by us. final bool isOutbound; - /// 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 - /// + /// 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; - /// 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 is a strict superset of `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. /// + /// This is a strict superset of `is_channel_ready`. final bool isUsable; - /// True if this channel is (or will be) publicly-announced. - /// + /// 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; + + /// 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. + /// + /// This value is not included in [`inbound_capacity_msat`] as it can never be spent. + /// + /// [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat + final BigInt counterpartyUnspendablePunishmentReserve; + + /// The smallest value HTLC (in msat) the remote peer will accept, for this channel. + /// + /// This field is only `None` before we have received either the `OpenChannel` or + /// `AcceptChannel` message from the remote peer. + final BigInt? counterpartyOutboundHtlcMinimumMsat; + + /// The largest value HTLC (in msat) the remote peer currently will accept, for this channel. + final BigInt? 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 BigInt 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 BigInt 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 BigInt inboundHtlcMinimumMsat; + + /// The largest value HTLC (in msat) we currently will accept, for this channel. + final BigInt? inboundHtlcMaximumMsat; + + /// Set of configurable parameters that affect channel operation. + final ChannelConfig config; + const ChannelDetails({ required this.channelId, required this.counterpartyNodeId, @@ -250,7 +421,6 @@ class ChannelDetails { this.unspendablePunishmentReserve, required this.userChannelId, required this.feerateSatPer1000Weight, - required this.balanceMsat, required this.outboundCapacityMsat, required this.inboundCapacityMsat, this.confirmationsRequired, @@ -259,6 +429,19 @@ 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 @@ -270,7 +453,6 @@ class ChannelDetails { unspendablePunishmentReserve.hashCode ^ userChannelId.hashCode ^ feerateSatPer1000Weight.hashCode ^ - balanceMsat.hashCode ^ outboundCapacityMsat.hashCode ^ inboundCapacityMsat.hashCode ^ confirmationsRequired.hashCode ^ @@ -278,7 +460,20 @@ class ChannelDetails { isOutbound.hashCode ^ isChannelReady.hashCode ^ isUsable.hashCode ^ - isPublic.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; @override bool operator ==(Object other) => @@ -292,7 +487,6 @@ class ChannelDetails { unspendablePunishmentReserve == other.unspendablePunishmentReserve && userChannelId == other.userChannelId && feerateSatPer1000Weight == other.feerateSatPer1000Weight && - balanceMsat == other.balanceMsat && outboundCapacityMsat == other.outboundCapacityMsat && inboundCapacityMsat == other.inboundCapacityMsat && confirmationsRequired == other.confirmationsRequired && @@ -300,7 +494,26 @@ class ChannelDetails { isOutbound == other.isOutbound && isChannelReady == other.isChannelReady && isUsable == other.isUsable && - isPublic == other.isPublic; + 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; } /// The global identifier of a channel. @@ -327,6 +540,102 @@ class ChannelId { data == other.data; } +@freezed +sealed class ClosureReason with _$ClosureReason { + const 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. + /// + /// [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel. + 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. + /// + /// This was only set in versions of LDK prior to 0.0.122. + const factory ClosureReason.legacyCooperativeClosure() = + ClosureReason_LegacyCooperativeClosure; + + /// The channel was closed after negotiating a cooperative close and we've now broadcasted + /// the cooperative close transaction. This indicates that the shutdown was initiated by our + /// counterparty. + /// + /// In rare cases where we initiated closure immediately prior to shutting down without + /// persisting, this value may be provided for channels we initiated closure for. + const factory ClosureReason.counterpartyInitiatedCooperativeClosure() = + ClosureReason_CounterpartyInitiatedCooperativeClosure; + + /// The channel was closed after negotiating a cooperative close and we've now broadcasted + /// the cooperative close transaction. This indicates that the shutdown was initiated by us. + const factory ClosureReason.locallyInitiatedCooperativeClosure() = + ClosureReason_LocallyInitiatedCooperativeClosure; + + /// 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. + /// + /// [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor + const factory ClosureReason.disconnectedPeer() = + ClosureReason_DisconnectedPeer; + + /// Closure generated from `ChannelManager::read` if the [`ChannelMonitor`] is newer than + /// the [`ChannelManager`] deserialized. + /// + /// [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor + /// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager + 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; + + /// One of our HTLCs timed out in a channel, causing us to force close the channel. + const factory ClosureReason.htlCsTimedOut() = ClosureReason_HTLCsTimedOut; +} + /// Represents the configuration of an [Node] instance. /// class Config { @@ -347,28 +656,29 @@ class Config { ///The time in-between background sync attempts of the onchain wallet, in seconds. /// Note: A minimum of 10 seconds is always enforced. - int onchainWalletSyncIntervalSecs; + BigInt onchainWalletSyncIntervalSecs; /// The time in-between background sync attempts of the LDK wallet, in seconds. /// Note: A minimum of 10 seconds is always enforced. /// - int walletSyncIntervalSecs; + BigInt walletSyncIntervalSecs; ///The time in-between background update attempts to our fee rate cache, in seconds. /// Note: A minimum of 10 seconds is always enforced. /// - int feeRateCacheUpdateIntervalSecs; + BigInt feeRateCacheUpdateIntervalSecs; ///A list of peers that we allow to establish zero confirmation channels to us. /// ///Note: Allowing payments via zero-confirmation channels is potentially insecure if the funding transaction ends up never being confirmed on-chain. Zero-confirmation channels should therefore only be accepted from trusted peers. final List trustedPeers0Conf; - final int probingLiquidityLimitMultiplier; + final BigInt probingLiquidityLimitMultiplier; ///The level at which we log messages. /// Any messages below this level will be excluded from the logs. /// LogLevel logLevel; + AnchorChannelsConfig? anchorChannelsConfig; Config({ required this.storageDirPath, @@ -382,6 +692,7 @@ class Config { required this.trustedPeers0Conf, required this.probingLiquidityLimitMultiplier, required this.logLevel, + this.anchorChannelsConfig, }); @override @@ -396,7 +707,8 @@ class Config { feeRateCacheUpdateIntervalSecs.hashCode ^ trustedPeers0Conf.hashCode ^ probingLiquidityLimitMultiplier.hashCode ^ - logLevel.hashCode; + logLevel.hashCode ^ + anchorChannelsConfig.hashCode; @override bool operator ==(Object other) => @@ -416,7 +728,8 @@ class Config { trustedPeers0Conf == other.trustedPeers0Conf && probingLiquidityLimitMultiplier == other.probingLiquidityLimitMultiplier && - logLevel == other.logLevel; + logLevel == other.logLevel && + anchorChannelsConfig == other.anchorChannelsConfig; } @freezed @@ -439,64 +752,119 @@ sealed class EntropySourceConfig with _$EntropySourceConfig { sealed class Event with _$Event { const Event._(); + /// A payment for a previously-registered payment hash has been received. + /// + /// This needs to be manually claimed by supplying the correct preimage to `claimForHash`. + /// + /// If the the provided parameters don't match the expectations or the preimage can't be + /// retrieved in time, should be failed-back via [`failForHash`]. + const factory Event.paymentClaimable({ + /// A local identifier used to track the payment. + required PaymentId paymentId, + + /// The hash of the payment. + required PaymentHash paymentHash, + + /// The value, in thousandths of a satoshi, that is claimable. + required BigInt claimableAmountMsat, + + /// The block height at which this payment will be failed back and will no longer be + /// eligible for claiming. + int? claimDeadline, + }) = Event_PaymentClaimable; + /// A sent payment was successful. const factory Event.paymentSuccessful({ + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + PaymentId? paymentId, + /// The hash of the payment. required PaymentHash paymentHash, + + /// The total fee which was spent at intermediate hops in this payment. + BigInt? feePaidMsat, }) = Event_PaymentSuccessful; /// A sent payment has failed. const factory Event.paymentFailed({ + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + PaymentId? paymentId, + /// 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. const factory Event.paymentReceived({ + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + PaymentId? paymentId, + /// The hash of the payment. required PaymentHash paymentHash, /// The value, in thousandths of a satoshi, that has been received. - required int amountMsat, + required BigInt amountMsat, }) = Event_PaymentReceived; + /// A channel has been created and is pending confirmation on-chain. + const factory Event.channelPending({ + /// The `channelId` of the channel. + required ChannelId channelId, + + /// The `userChannelId` of the channel. + required UserChannelId userChannelId, + + /// The `temporaryChannelId` this channel used to be known by during channel establishment. + required ChannelId formerTemporaryChannelId, + + /// The `nodeId` 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 `channelId` of the channel. required ChannelId channelId, - /// The user_channel_id of the channel. + /// The `userChannelId` of the channel. required UserChannelId userChannelId, + + /// The `nodeId` 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 `channelId` of the channel. required ChannelId channelId, - /// The user_channel_id of the channel. + /// The `userChannelId` of the channel. required UserChannelId userChannelId, - PublicKey? counterpartyNodeId, - }) = Event_ChannelClosed; - /// 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 `nodeId` of the channel counterparty. + /// + /// This will be `None` for events serialized by LDK Node v0.1.0 and prior. + PublicKey? counterpartyNodeId, - /// The outpoint of the channel's funding transaction. - required OutPoint fundingTxo, - }) = Event_ChannelPending; + /// This will be `None` for events serialized by LDK Node v0.2.1 and prior. + ClosureReason? reason, + }) = Event_ChannelClosed; } @freezed @@ -509,6 +877,153 @@ sealed class GossipSourceConfig with _$GossipSourceConfig { ) = GossipSourceConfig_RapidGossipSync; } +@freezed +sealed class LightningBalance with _$LightningBalance { + const 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 BigInt 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 BigInt 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 BigInt 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 BigInt 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. + 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 BigInt 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 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 identifier of our channel counterparty. + required PublicKey counterpartyNodeId, + + /// The amount, in satoshis, of the output which we can claim. + required BigInt amountSatoshis, + }) = LightningBalance_CounterpartyRevokedOutputClaimable; +} + +class LiquiditySourceConfig { + final (SocketAddress, PublicKey, String?) lsps2Service; + + const LiquiditySourceConfig({ + required this.lsps2Service, + }); + + @override + int get hashCode => lsps2Service.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LiquiditySourceConfig && + runtimeType == other.runtimeType && + lsps2Service == other.lsps2Service; +} + /// An enum representing the available verbosity levels of the logger. /// enum LogLevel { @@ -535,6 +1050,37 @@ enum LogLevel { /// Designates very serious errors /// error, + ; +} + +/// Limits applying to how much fee we allow an LSP to deduct from the payment amount. +class LSPFeeLimits { + /// The maximal total amount we allow any configured LSP withhold from us when forwarding the + /// payment. + final BigInt? maxTotalOpeningFeeMsat; + + /// The maximal proportional fee, in parts-per-million millisatoshi, we allow any configured + /// LSP withhold from us when forwarding the payment. + final BigInt? maxProportionalOpeningFeePpmMsat; + + const LSPFeeLimits({ + this.maxTotalOpeningFeeMsat, + this.maxProportionalOpeningFeePpmMsat, + }); + + @override + int get hashCode => + maxTotalOpeningFeeMsat.hashCode ^ + maxProportionalOpeningFeePpmMsat.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LSPFeeLimits && + runtimeType == other.runtimeType && + maxTotalOpeningFeeMsat == other.maxTotalOpeningFeeMsat && + maxProportionalOpeningFeePpmMsat == + other.maxProportionalOpeningFeePpmMsat; } @freezed @@ -543,12 +1089,12 @@ sealed class MaxDustHTLCExposure with _$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, + BigInt field0, ) = MaxDustHTLCExposure_FixedLimitMsat; ///This sets a multiplier on the estimated high priority feerate (sats/KW, as obtained from FeeEstimator) to determine the maximum allowed dust exposure. If this variant is used then the maximum dust exposure in millisatoshis is calculated as: high_priority_feerate_per_kw * value. For example, with our default value FeeRateMultiplier(5000): const factory MaxDustHTLCExposure.feeRateMultiplier( - int field0, + BigInt field0, ) = MaxDustHTLCExposure_FeeRateMultiplier; } @@ -570,6 +1116,107 @@ enum Network { ///Bitcoin’s regtest /// 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 BigInt? 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 BigInt? 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 BigInt? 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 BigInt? 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 BigInt? 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; +} + +class OfferId { + final U8Array32 field0; + + const OfferId({ + required this.field0, + }); + + @override + int get hashCode => field0.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is OfferId && + runtimeType == other.runtimeType && + field0 == other.field0; } ///A reference to a transaction output. @@ -596,19 +1243,15 @@ class OutPoint { } /// Represents a payment. -/// class PaymentDetails { - /// The payment hash, i.e., the hash of the `preimage`. - final PaymentHash hash; - - /// The pre-image used by the payment. - final PaymentPreimage? preimage; + /// The identifier of this payment. + final PaymentId id; - /// The secret used by the payment. - final PaymentSecret? secret; + /// The kind of the payment. + final PaymentKind kind; /// The amount transferred. - final int? amountMsat; + final BigInt? amountMsat; /// The direction of the payment. final PaymentDirection direction; @@ -617,9 +1260,8 @@ class PaymentDetails { final PaymentStatus status; const PaymentDetails({ - required this.hash, - this.preimage, - this.secret, + required this.id, + required this.kind, this.amountMsat, required this.direction, required this.status, @@ -627,9 +1269,8 @@ class PaymentDetails { @override int get hashCode => - hash.hashCode ^ - preimage.hashCode ^ - secret.hashCode ^ + id.hashCode ^ + kind.hashCode ^ amountMsat.hashCode ^ direction.hashCode ^ status.hashCode; @@ -639,9 +1280,8 @@ class PaymentDetails { identical(this, other) || other is PaymentDetails && runtimeType == other.runtimeType && - hash == other.hash && - preimage == other.preimage && - secret == other.secret && + id == other.id && + kind == other.kind && amountMsat == other.amountMsat && direction == other.direction && status == other.status; @@ -655,6 +1295,35 @@ enum PaymentDirection { /// The payment is outbound. 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 @@ -677,6 +1346,109 @@ class PaymentHash { data == other.data; } +///A user-provided identifier in channelManager.sendPayment used to uniquely identify a payment and ensure idempotency in LDK. +class PaymentId { + final U8Array32 field0; + + const PaymentId({ + required this.field0, + }); + + @override + int get hashCode => field0.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is PaymentId && + runtimeType == other.runtimeType && + field0 == other.field0; +} + +@freezed +sealed class PaymentKind with _$PaymentKind { + const PaymentKind._(); + + /// An on-chain payment. + const factory PaymentKind.onchain() = PaymentKind_Onchain; + + /// A [BOLT 11] payment. + /// + /// [BOLT 11]: https://github.com/lightning/bolts/blob/master/11-payment-encoding.md + const factory PaymentKind.bolt11({ + /// The payment hash, i.e., the hash of the `preimage`. + required PaymentHash hash, + + /// The pre-image used by the payment. + PaymentPreimage? preimage, + + /// The secret used by the payment. + PaymentSecret? secret, + }) = PaymentKind_Bolt11; + + /// A [BOLT 11] payment intended to open an [LSPS 2] just-in-time channel. + /// + /// [BOLT 11]: https://github.com/lightning/bolts/blob/master/11-payment-encoding.md + /// [LSPS 2]: https://github.com/BitcoinAndLightningLayerSpecs/lsp/blob/main/LSPS2/README.md + const factory PaymentKind.bolt11Jit({ + /// The payment hash, i.e., the hash of the `preimage`. + required PaymentHash hash, + + /// The pre-image used by the payment. + PaymentPreimage? preimage, + + /// The secret used by the payment. + PaymentSecret? secret, + + /// Limits applying to how much fee we allow an LSP to deduct from the payment amount. + /// + /// Allowing them to deduct this fee from the first inbound payment will pay for the LSP's + /// channel opening fees. + /// + required LSPFeeLimits lspFeeLimits, + }) = PaymentKind_Bolt11Jit; + + /// A spontaneous ("keysend") payment. + const factory PaymentKind.spontaneous({ + /// The payment hash, i.e., the hash of the `preimage`. + required PaymentHash hash, + + /// The pre-image used by the payment. + PaymentPreimage? preimage, + }) = PaymentKind_Spontaneous; + + /// A [BOLT 12] offer payment, i.e., a payment for an `Offer`. + /// + /// [BOLT 12]: https://github.com/lightning/bolts/blob/master/12-offer-encoding.md + const factory PaymentKind.bolt12Offer({ + /// The payment hash, i.e., the hash of the `preimage`. + PaymentHash? hash, + + /// The pre-image used by the payment. + PaymentPreimage? preimage, + + /// The secret used by the payment. + PaymentSecret? secret, + + /// The ID of the offer this payment is for. + required OfferId offerId, + }) = PaymentKind_Bolt12Offer; + + /// A [BOLT 12] 'refund' payment, i.e., a payment for a `Refund`. + /// + /// [BOLT 12]: https://github.com/lightning/bolts/blob/master/12-offer-encoding.md + const factory PaymentKind.bolt12Refund({ + /// The payment hash, i.e., the hash of the `preimage`. + PaymentHash? hash, + + /// The pre-image used by the payment. + PaymentPreimage? preimage, + + /// The secret used by the payment. + PaymentSecret? secret, + }) = PaymentKind_Bolt12Refund; +} + /// paymentPreimage type, use to route payment between hop /// class PaymentPreimage { @@ -728,6 +1500,7 @@ enum PaymentStatus { /// The payment failed. failed, + ; } /// Details of a known Lightning peer as returned by `node.listPeers`. @@ -764,6 +1537,59 @@ class PeerDetails { isConnected == other.isConnected; } +@freezed +sealed class PendingSweepBalance with _$PendingSweepBalance { + const 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 BigInt 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 BigInt 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 BigInt amountSatoshis, + }) = PendingSweepBalance_AwaitingThresholdConfirmations; +} + ///A Secp256k1 public key, used for verification of signatures. /// class PublicKey { @@ -809,13 +1635,6 @@ 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. @@ -841,7 +1660,7 @@ class Txid { /// By default, this will be randomly generated for the user to ensure local uniqueness. /// class UserChannelId { - final int data; + final Uint8List 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 1a466c2..ac2bfd5 100644 --- a/lib/src/generated/api/types.freezed.dart +++ b/lib/src/generated/api/types.freezed.dart @@ -230,66 +230,158 @@ abstract class ChainDataSourceConfig_Esplora extends ChainDataSourceConfig { } /// @nodoc -mixin _$EntropySourceConfig { +mixin _$ClosureReason { @optionalTypeArgs TResult when({ - required TResult Function(String field0) seedFile, - required TResult Function(U8Array64 field0) seedBytes, - required TResult Function(LdkMnemonic mnemonic, String? passphrase) - bip39Mnemonic, + required TResult Function(String peerMsg) counterpartyForceClosed, + required TResult Function() holderForceClosed, + required TResult Function() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(String field0)? seedFile, - TResult? Function(U8Array64 field0)? seedBytes, - TResult? Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult maybeWhen({ - TResult Function(String field0)? seedFile, - TResult Function(U8Array64 field0)? seedBytes, - TResult Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, 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, + required TResult Function(ClosureReason_CounterpartyForceClosed value) + counterpartyForceClosed, + required TResult Function(ClosureReason_HolderForceClosed value) + holderForceClosed, + required TResult Function(ClosureReason_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(EntropySourceConfig_SeedFile value)? seedFile, - TResult? Function(EntropySourceConfig_SeedBytes value)? seedBytes, - TResult? Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult maybeMap({ - TResult Function(EntropySourceConfig_SeedFile value)? seedFile, - TResult Function(EntropySourceConfig_SeedBytes value)? seedBytes, - TResult Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, required TResult orElse(), }) => throw _privateConstructorUsedError; } /// @nodoc -abstract class $EntropySourceConfigCopyWith<$Res> { - factory $EntropySourceConfigCopyWith( - EntropySourceConfig value, $Res Function(EntropySourceConfig) then) = - _$EntropySourceConfigCopyWithImpl<$Res, EntropySourceConfig>; +abstract class $ClosureReasonCopyWith<$Res> { + factory $ClosureReasonCopyWith( + ClosureReason value, $Res Function(ClosureReason) then) = + _$ClosureReasonCopyWithImpl<$Res, ClosureReason>; } /// @nodoc -class _$EntropySourceConfigCopyWithImpl<$Res, $Val extends EntropySourceConfig> - implements $EntropySourceConfigCopyWith<$Res> { - _$EntropySourceConfigCopyWithImpl(this._value, this._then); +class _$ClosureReasonCopyWithImpl<$Res, $Val extends ClosureReason> + implements $ClosureReasonCopyWith<$Res> { + _$ClosureReasonCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; @@ -298,34 +390,34 @@ class _$EntropySourceConfigCopyWithImpl<$Res, $Val extends EntropySourceConfig> } /// @nodoc -abstract class _$$EntropySourceConfig_SeedFileImplCopyWith<$Res> { - factory _$$EntropySourceConfig_SeedFileImplCopyWith( - _$EntropySourceConfig_SeedFileImpl value, - $Res Function(_$EntropySourceConfig_SeedFileImpl) then) = - __$$EntropySourceConfig_SeedFileImplCopyWithImpl<$Res>; +abstract class _$$ClosureReason_CounterpartyForceClosedImplCopyWith<$Res> { + factory _$$ClosureReason_CounterpartyForceClosedImplCopyWith( + _$ClosureReason_CounterpartyForceClosedImpl value, + $Res Function(_$ClosureReason_CounterpartyForceClosedImpl) then) = + __$$ClosureReason_CounterpartyForceClosedImplCopyWithImpl<$Res>; @useResult - $Res call({String field0}); + $Res call({String peerMsg}); } /// @nodoc -class __$$EntropySourceConfig_SeedFileImplCopyWithImpl<$Res> - extends _$EntropySourceConfigCopyWithImpl<$Res, - _$EntropySourceConfig_SeedFileImpl> - implements _$$EntropySourceConfig_SeedFileImplCopyWith<$Res> { - __$$EntropySourceConfig_SeedFileImplCopyWithImpl( - _$EntropySourceConfig_SeedFileImpl _value, - $Res Function(_$EntropySourceConfig_SeedFileImpl) _then) +class __$$ClosureReason_CounterpartyForceClosedImplCopyWithImpl<$Res> + extends _$ClosureReasonCopyWithImpl<$Res, + _$ClosureReason_CounterpartyForceClosedImpl> + implements _$$ClosureReason_CounterpartyForceClosedImplCopyWith<$Res> { + __$$ClosureReason_CounterpartyForceClosedImplCopyWithImpl( + _$ClosureReason_CounterpartyForceClosedImpl _value, + $Res Function(_$ClosureReason_CounterpartyForceClosedImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override $Res call({ - Object? field0 = null, + Object? peerMsg = null, }) { - return _then(_$EntropySourceConfig_SeedFileImpl( - null == field0 - ? _value.field0 - : field0 // ignore: cast_nullable_to_non_nullable + return _then(_$ClosureReason_CounterpartyForceClosedImpl( + peerMsg: null == peerMsg + ? _value.peerMsg + : peerMsg // ignore: cast_nullable_to_non_nullable as String, )); } @@ -333,67 +425,105 @@ class __$$EntropySourceConfig_SeedFileImplCopyWithImpl<$Res> /// @nodoc -class _$EntropySourceConfig_SeedFileImpl extends EntropySourceConfig_SeedFile { - const _$EntropySourceConfig_SeedFileImpl(this.field0) : super._(); +class _$ClosureReason_CounterpartyForceClosedImpl + extends ClosureReason_CounterpartyForceClosed { + const _$ClosureReason_CounterpartyForceClosedImpl({required this.peerMsg}) + : 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 field0; + final String peerMsg; @override String toString() { - return 'EntropySourceConfig.seedFile(field0: $field0)'; + return 'ClosureReason.counterpartyForceClosed(peerMsg: $peerMsg)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$EntropySourceConfig_SeedFileImpl && - (identical(other.field0, field0) || other.field0 == field0)); + other is _$ClosureReason_CounterpartyForceClosedImpl && + (identical(other.peerMsg, peerMsg) || other.peerMsg == peerMsg)); } @override - int get hashCode => Object.hash(runtimeType, field0); + int get hashCode => Object.hash(runtimeType, peerMsg); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$EntropySourceConfig_SeedFileImplCopyWith< - _$EntropySourceConfig_SeedFileImpl> - get copyWith => __$$EntropySourceConfig_SeedFileImplCopyWithImpl< - _$EntropySourceConfig_SeedFileImpl>(this, _$identity); + _$$ClosureReason_CounterpartyForceClosedImplCopyWith< + _$ClosureReason_CounterpartyForceClosedImpl> + get copyWith => __$$ClosureReason_CounterpartyForceClosedImplCopyWithImpl< + _$ClosureReason_CounterpartyForceClosedImpl>(this, _$identity); @override @optionalTypeArgs TResult when({ - required TResult Function(String field0) seedFile, - required TResult Function(U8Array64 field0) seedBytes, - required TResult Function(LdkMnemonic mnemonic, String? passphrase) - bip39Mnemonic, + required TResult Function(String peerMsg) counterpartyForceClosed, + required TResult Function() holderForceClosed, + required TResult Function() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, }) { - return seedFile(field0); + return counterpartyForceClosed(peerMsg); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(String field0)? seedFile, - TResult? Function(U8Array64 field0)? seedBytes, - TResult? Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, }) { - return seedFile?.call(field0); + return counterpartyForceClosed?.call(peerMsg); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(String field0)? seedFile, - TResult Function(U8Array64 field0)? seedBytes, - TResult Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, required TResult orElse(), }) { - if (seedFile != null) { - return seedFile(field0); + if (counterpartyForceClosed != null) { + return counterpartyForceClosed(peerMsg); } return orElse(); } @@ -401,150 +531,222 @@ class _$EntropySourceConfig_SeedFileImpl extends EntropySourceConfig_SeedFile { @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, + required TResult Function(ClosureReason_CounterpartyForceClosed value) + counterpartyForceClosed, + required TResult Function(ClosureReason_HolderForceClosed value) + holderForceClosed, + required TResult Function(ClosureReason_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, }) { - return seedFile(this); + return counterpartyForceClosed(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(EntropySourceConfig_SeedFile value)? seedFile, - TResult? Function(EntropySourceConfig_SeedBytes value)? seedBytes, - TResult? Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, }) { - return seedFile?.call(this); + return counterpartyForceClosed?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(EntropySourceConfig_SeedFile value)? seedFile, - TResult Function(EntropySourceConfig_SeedBytes value)? seedBytes, - TResult Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, required TResult orElse(), }) { - if (seedFile != null) { - return seedFile(this); + if (counterpartyForceClosed != null) { + return counterpartyForceClosed(this); } return orElse(); } } -abstract class EntropySourceConfig_SeedFile extends EntropySourceConfig { - const factory EntropySourceConfig_SeedFile(final String field0) = - _$EntropySourceConfig_SeedFileImpl; - const EntropySourceConfig_SeedFile._() : super._(); - - String get field0; +abstract class ClosureReason_CounterpartyForceClosed extends ClosureReason { + const factory ClosureReason_CounterpartyForceClosed( + {required final String peerMsg}) = + _$ClosureReason_CounterpartyForceClosedImpl; + const ClosureReason_CounterpartyForceClosed._() : 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 + String get peerMsg; @JsonKey(ignore: true) - _$$EntropySourceConfig_SeedFileImplCopyWith< - _$EntropySourceConfig_SeedFileImpl> + _$$ClosureReason_CounterpartyForceClosedImplCopyWith< + _$ClosureReason_CounterpartyForceClosedImpl> 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}); +abstract class _$$ClosureReason_HolderForceClosedImplCopyWith<$Res> { + factory _$$ClosureReason_HolderForceClosedImplCopyWith( + _$ClosureReason_HolderForceClosedImpl value, + $Res Function(_$ClosureReason_HolderForceClosedImpl) then) = + __$$ClosureReason_HolderForceClosedImplCopyWithImpl<$Res>; } /// @nodoc -class __$$EntropySourceConfig_SeedBytesImplCopyWithImpl<$Res> - extends _$EntropySourceConfigCopyWithImpl<$Res, - _$EntropySourceConfig_SeedBytesImpl> - implements _$$EntropySourceConfig_SeedBytesImplCopyWith<$Res> { - __$$EntropySourceConfig_SeedBytesImplCopyWithImpl( - _$EntropySourceConfig_SeedBytesImpl _value, - $Res Function(_$EntropySourceConfig_SeedBytesImpl) _then) +class __$$ClosureReason_HolderForceClosedImplCopyWithImpl<$Res> + extends _$ClosureReasonCopyWithImpl<$Res, + _$ClosureReason_HolderForceClosedImpl> + implements _$$ClosureReason_HolderForceClosedImplCopyWith<$Res> { + __$$ClosureReason_HolderForceClosedImplCopyWithImpl( + _$ClosureReason_HolderForceClosedImpl _value, + $Res Function(_$ClosureReason_HolderForceClosedImpl) _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 - extends EntropySourceConfig_SeedBytes { - const _$EntropySourceConfig_SeedBytesImpl(this.field0) : super._(); - - @override - final U8Array64 field0; +class _$ClosureReason_HolderForceClosedImpl + extends ClosureReason_HolderForceClosed { + const _$ClosureReason_HolderForceClosedImpl() : super._(); @override String toString() { - return 'EntropySourceConfig.seedBytes(field0: $field0)'; + return 'ClosureReason.holderForceClosed()'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$EntropySourceConfig_SeedBytesImpl && - const DeepCollectionEquality().equals(other.field0, field0)); + other is _$ClosureReason_HolderForceClosedImpl); } @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); + int get hashCode => runtimeType.hashCode; @override @optionalTypeArgs TResult when({ - required TResult Function(String field0) seedFile, - required TResult Function(U8Array64 field0) seedBytes, - required TResult Function(LdkMnemonic mnemonic, String? passphrase) - bip39Mnemonic, + required TResult Function(String peerMsg) counterpartyForceClosed, + required TResult Function() holderForceClosed, + required TResult Function() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, }) { - return seedBytes(field0); + return holderForceClosed(); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(String field0)? seedFile, - TResult? Function(U8Array64 field0)? seedBytes, - TResult? Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, }) { - return seedBytes?.call(field0); + return holderForceClosed?.call(); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(String field0)? seedFile, - TResult Function(U8Array64 field0)? seedBytes, - TResult Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, required TResult orElse(), }) { - if (seedBytes != null) { - return seedBytes(field0); + if (holderForceClosed != null) { + return holderForceClosed(); } return orElse(); } @@ -552,161 +754,7753 @@ class _$EntropySourceConfig_SeedBytesImpl @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, + required TResult Function(ClosureReason_CounterpartyForceClosed value) + counterpartyForceClosed, + required TResult Function(ClosureReason_HolderForceClosed value) + holderForceClosed, + required TResult Function(ClosureReason_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, }) { - return seedBytes(this); + return holderForceClosed(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(EntropySourceConfig_SeedFile value)? seedFile, - TResult? Function(EntropySourceConfig_SeedBytes value)? seedBytes, - TResult? Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, }) { - return seedBytes?.call(this); + return holderForceClosed?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(EntropySourceConfig_SeedFile value)? seedFile, - TResult Function(EntropySourceConfig_SeedBytes value)? seedBytes, - TResult Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, required TResult orElse(), }) { - if (seedBytes != null) { - return seedBytes(this); + if (holderForceClosed != null) { + return holderForceClosed(this); } return orElse(); } } -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; +abstract class ClosureReason_HolderForceClosed extends ClosureReason { + const factory ClosureReason_HolderForceClosed() = + _$ClosureReason_HolderForceClosedImpl; + const ClosureReason_HolderForceClosed._() : super._(); } /// @nodoc -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}); +abstract class _$$ClosureReason_LegacyCooperativeClosureImplCopyWith<$Res> { + factory _$$ClosureReason_LegacyCooperativeClosureImplCopyWith( + _$ClosureReason_LegacyCooperativeClosureImpl value, + $Res Function(_$ClosureReason_LegacyCooperativeClosureImpl) then) = + __$$ClosureReason_LegacyCooperativeClosureImplCopyWithImpl<$Res>; } /// @nodoc -class __$$EntropySourceConfig_Bip39MnemonicImplCopyWithImpl<$Res> - extends _$EntropySourceConfigCopyWithImpl<$Res, - _$EntropySourceConfig_Bip39MnemonicImpl> - implements _$$EntropySourceConfig_Bip39MnemonicImplCopyWith<$Res> { - __$$EntropySourceConfig_Bip39MnemonicImplCopyWithImpl( - _$EntropySourceConfig_Bip39MnemonicImpl _value, - $Res Function(_$EntropySourceConfig_Bip39MnemonicImpl) _then) +class __$$ClosureReason_LegacyCooperativeClosureImplCopyWithImpl<$Res> + extends _$ClosureReasonCopyWithImpl<$Res, + _$ClosureReason_LegacyCooperativeClosureImpl> + implements _$$ClosureReason_LegacyCooperativeClosureImplCopyWith<$Res> { + __$$ClosureReason_LegacyCooperativeClosureImplCopyWithImpl( + _$ClosureReason_LegacyCooperativeClosureImpl _value, + $Res Function(_$ClosureReason_LegacyCooperativeClosureImpl) _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 _$EntropySourceConfig_Bip39MnemonicImpl - extends EntropySourceConfig_Bip39Mnemonic { - const _$EntropySourceConfig_Bip39MnemonicImpl( - {required this.mnemonic, this.passphrase}) - : super._(); - - @override - final LdkMnemonic mnemonic; - @override - final String? passphrase; +class _$ClosureReason_LegacyCooperativeClosureImpl + extends ClosureReason_LegacyCooperativeClosure { + const _$ClosureReason_LegacyCooperativeClosureImpl() : super._(); @override String toString() { - return 'EntropySourceConfig.bip39Mnemonic(mnemonic: $mnemonic, passphrase: $passphrase)'; + return 'ClosureReason.legacyCooperativeClosure()'; } @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)); + other is _$ClosureReason_LegacyCooperativeClosureImpl); } @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); + int get hashCode => runtimeType.hashCode; @override @optionalTypeArgs TResult when({ - required TResult Function(String field0) seedFile, + required TResult Function(String peerMsg) counterpartyForceClosed, + required TResult Function() holderForceClosed, + required TResult Function() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, + }) { + return legacyCooperativeClosure(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + }) { + return legacyCooperativeClosure?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + required TResult orElse(), + }) { + if (legacyCooperativeClosure != null) { + return legacyCooperativeClosure(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(ClosureReason_CounterpartyForceClosed value) + counterpartyForceClosed, + required TResult Function(ClosureReason_HolderForceClosed value) + holderForceClosed, + required TResult Function(ClosureReason_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, + }) { + return legacyCooperativeClosure(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + }) { + return legacyCooperativeClosure?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + required TResult orElse(), + }) { + if (legacyCooperativeClosure != null) { + return legacyCooperativeClosure(this); + } + return orElse(); + } +} + +abstract class ClosureReason_LegacyCooperativeClosure extends ClosureReason { + const factory ClosureReason_LegacyCooperativeClosure() = + _$ClosureReason_LegacyCooperativeClosureImpl; + const ClosureReason_LegacyCooperativeClosure._() : super._(); +} + +/// @nodoc +abstract class _$$ClosureReason_CounterpartyInitiatedCooperativeClosureImplCopyWith< + $Res> { + factory _$$ClosureReason_CounterpartyInitiatedCooperativeClosureImplCopyWith( + _$ClosureReason_CounterpartyInitiatedCooperativeClosureImpl value, + $Res Function( + _$ClosureReason_CounterpartyInitiatedCooperativeClosureImpl) + then) = + __$$ClosureReason_CounterpartyInitiatedCooperativeClosureImplCopyWithImpl< + $Res>; +} + +/// @nodoc +class __$$ClosureReason_CounterpartyInitiatedCooperativeClosureImplCopyWithImpl< + $Res> + extends _$ClosureReasonCopyWithImpl<$Res, + _$ClosureReason_CounterpartyInitiatedCooperativeClosureImpl> + implements + _$$ClosureReason_CounterpartyInitiatedCooperativeClosureImplCopyWith< + $Res> { + __$$ClosureReason_CounterpartyInitiatedCooperativeClosureImplCopyWithImpl( + _$ClosureReason_CounterpartyInitiatedCooperativeClosureImpl _value, + $Res Function(_$ClosureReason_CounterpartyInitiatedCooperativeClosureImpl) + _then) + : super(_value, _then); +} + +/// @nodoc + +class _$ClosureReason_CounterpartyInitiatedCooperativeClosureImpl + extends ClosureReason_CounterpartyInitiatedCooperativeClosure { + const _$ClosureReason_CounterpartyInitiatedCooperativeClosureImpl() + : super._(); + + @override + String toString() { + return 'ClosureReason.counterpartyInitiatedCooperativeClosure()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other + is _$ClosureReason_CounterpartyInitiatedCooperativeClosureImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(String peerMsg) counterpartyForceClosed, + required TResult Function() holderForceClosed, + required TResult Function() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, + }) { + return counterpartyInitiatedCooperativeClosure(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + }) { + return counterpartyInitiatedCooperativeClosure?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + required TResult orElse(), + }) { + if (counterpartyInitiatedCooperativeClosure != null) { + return counterpartyInitiatedCooperativeClosure(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(ClosureReason_CounterpartyForceClosed value) + counterpartyForceClosed, + required TResult Function(ClosureReason_HolderForceClosed value) + holderForceClosed, + required TResult Function(ClosureReason_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, + }) { + return counterpartyInitiatedCooperativeClosure(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + }) { + return counterpartyInitiatedCooperativeClosure?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + required TResult orElse(), + }) { + if (counterpartyInitiatedCooperativeClosure != null) { + return counterpartyInitiatedCooperativeClosure(this); + } + return orElse(); + } +} + +abstract class ClosureReason_CounterpartyInitiatedCooperativeClosure + extends ClosureReason { + const factory ClosureReason_CounterpartyInitiatedCooperativeClosure() = + _$ClosureReason_CounterpartyInitiatedCooperativeClosureImpl; + const ClosureReason_CounterpartyInitiatedCooperativeClosure._() : super._(); +} + +/// @nodoc +abstract class _$$ClosureReason_LocallyInitiatedCooperativeClosureImplCopyWith< + $Res> { + factory _$$ClosureReason_LocallyInitiatedCooperativeClosureImplCopyWith( + _$ClosureReason_LocallyInitiatedCooperativeClosureImpl value, + $Res Function(_$ClosureReason_LocallyInitiatedCooperativeClosureImpl) + then) = + __$$ClosureReason_LocallyInitiatedCooperativeClosureImplCopyWithImpl< + $Res>; +} + +/// @nodoc +class __$$ClosureReason_LocallyInitiatedCooperativeClosureImplCopyWithImpl<$Res> + extends _$ClosureReasonCopyWithImpl<$Res, + _$ClosureReason_LocallyInitiatedCooperativeClosureImpl> + implements + _$$ClosureReason_LocallyInitiatedCooperativeClosureImplCopyWith<$Res> { + __$$ClosureReason_LocallyInitiatedCooperativeClosureImplCopyWithImpl( + _$ClosureReason_LocallyInitiatedCooperativeClosureImpl _value, + $Res Function(_$ClosureReason_LocallyInitiatedCooperativeClosureImpl) + _then) + : super(_value, _then); +} + +/// @nodoc + +class _$ClosureReason_LocallyInitiatedCooperativeClosureImpl + extends ClosureReason_LocallyInitiatedCooperativeClosure { + const _$ClosureReason_LocallyInitiatedCooperativeClosureImpl() : super._(); + + @override + String toString() { + return 'ClosureReason.locallyInitiatedCooperativeClosure()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ClosureReason_LocallyInitiatedCooperativeClosureImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(String peerMsg) counterpartyForceClosed, + required TResult Function() holderForceClosed, + required TResult Function() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, + }) { + return locallyInitiatedCooperativeClosure(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + }) { + return locallyInitiatedCooperativeClosure?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + required TResult orElse(), + }) { + if (locallyInitiatedCooperativeClosure != null) { + return locallyInitiatedCooperativeClosure(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(ClosureReason_CounterpartyForceClosed value) + counterpartyForceClosed, + required TResult Function(ClosureReason_HolderForceClosed value) + holderForceClosed, + required TResult Function(ClosureReason_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, + }) { + return locallyInitiatedCooperativeClosure(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + }) { + return locallyInitiatedCooperativeClosure?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + required TResult orElse(), + }) { + if (locallyInitiatedCooperativeClosure != null) { + return locallyInitiatedCooperativeClosure(this); + } + return orElse(); + } +} + +abstract class ClosureReason_LocallyInitiatedCooperativeClosure + extends ClosureReason { + const factory ClosureReason_LocallyInitiatedCooperativeClosure() = + _$ClosureReason_LocallyInitiatedCooperativeClosureImpl; + const ClosureReason_LocallyInitiatedCooperativeClosure._() : super._(); +} + +/// @nodoc +abstract class _$$ClosureReason_CommitmentTxConfirmedImplCopyWith<$Res> { + factory _$$ClosureReason_CommitmentTxConfirmedImplCopyWith( + _$ClosureReason_CommitmentTxConfirmedImpl value, + $Res Function(_$ClosureReason_CommitmentTxConfirmedImpl) then) = + __$$ClosureReason_CommitmentTxConfirmedImplCopyWithImpl<$Res>; +} + +/// @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 + extends ClosureReason_CommitmentTxConfirmed { + const _$ClosureReason_CommitmentTxConfirmedImpl() : super._(); + + @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() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, + }) { + return commitmentTxConfirmed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + }) { + return commitmentTxConfirmed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + 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_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, + }) { + return commitmentTxConfirmed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + }) { + return commitmentTxConfirmed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + required TResult orElse(), + }) { + if (commitmentTxConfirmed != null) { + return commitmentTxConfirmed(this); + } + return orElse(); + } +} + +abstract class ClosureReason_CommitmentTxConfirmed extends ClosureReason { + const factory ClosureReason_CommitmentTxConfirmed() = + _$ClosureReason_CommitmentTxConfirmedImpl; + const ClosureReason_CommitmentTxConfirmed._() : super._(); +} + +/// @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 + extends ClosureReason_FundingTimedOut { + const _$ClosureReason_FundingTimedOutImpl() : super._(); + + @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() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, + }) { + return fundingTimedOut(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + }) { + return fundingTimedOut?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + 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_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, + }) { + return fundingTimedOut(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + }) { + return fundingTimedOut?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + required TResult orElse(), + }) { + if (fundingTimedOut != null) { + return fundingTimedOut(this); + } + return orElse(); + } +} + +abstract class ClosureReason_FundingTimedOut extends ClosureReason { + const factory ClosureReason_FundingTimedOut() = + _$ClosureReason_FundingTimedOutImpl; + const ClosureReason_FundingTimedOut._() : super._(); +} + +/// @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 + extends ClosureReason_ProcessingError { + const _$ClosureReason_ProcessingErrorImpl({required this.err}) : super._(); + + /// 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() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, + }) { + return processingError(err); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + }) { + return processingError?.call(err); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + 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_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, + }) { + return processingError(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + }) { + return processingError?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + required TResult orElse(), + }) { + if (processingError != null) { + return processingError(this); + } + return orElse(); + } +} + +abstract class ClosureReason_ProcessingError extends ClosureReason { + const factory ClosureReason_ProcessingError({required final String err}) = + _$ClosureReason_ProcessingErrorImpl; + const ClosureReason_ProcessingError._() : super._(); + + /// 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 + extends ClosureReason_DisconnectedPeer { + const _$ClosureReason_DisconnectedPeerImpl() : super._(); + + @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() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, + }) { + return disconnectedPeer(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + }) { + return disconnectedPeer?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + 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_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, + }) { + return disconnectedPeer(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + }) { + return disconnectedPeer?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + required TResult orElse(), + }) { + if (disconnectedPeer != null) { + return disconnectedPeer(this); + } + return orElse(); + } +} + +abstract class ClosureReason_DisconnectedPeer extends ClosureReason { + const factory ClosureReason_DisconnectedPeer() = + _$ClosureReason_DisconnectedPeerImpl; + const ClosureReason_DisconnectedPeer._() : super._(); +} + +/// @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 + extends ClosureReason_OutdatedChannelManager { + const _$ClosureReason_OutdatedChannelManagerImpl() : super._(); + + @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() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, + }) { + return outdatedChannelManager(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + }) { + return outdatedChannelManager?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + 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_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, + }) { + return outdatedChannelManager(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + }) { + return outdatedChannelManager?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + required TResult orElse(), + }) { + if (outdatedChannelManager != null) { + return outdatedChannelManager(this); + } + return orElse(); + } +} + +abstract class ClosureReason_OutdatedChannelManager extends ClosureReason { + const factory ClosureReason_OutdatedChannelManager() = + _$ClosureReason_OutdatedChannelManagerImpl; + const ClosureReason_OutdatedChannelManager._() : super._(); +} + +/// @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 + extends ClosureReason_CounterpartyCoopClosedUnfundedChannel { + const _$ClosureReason_CounterpartyCoopClosedUnfundedChannelImpl() : super._(); + + @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() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, + }) { + return counterpartyCoopClosedUnfundedChannel(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + }) { + return counterpartyCoopClosedUnfundedChannel?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + 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_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, + }) { + return counterpartyCoopClosedUnfundedChannel(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + }) { + return counterpartyCoopClosedUnfundedChannel?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + required TResult orElse(), + }) { + if (counterpartyCoopClosedUnfundedChannel != null) { + return counterpartyCoopClosedUnfundedChannel(this); + } + return orElse(); + } +} + +abstract class ClosureReason_CounterpartyCoopClosedUnfundedChannel + extends ClosureReason { + const factory ClosureReason_CounterpartyCoopClosedUnfundedChannel() = + _$ClosureReason_CounterpartyCoopClosedUnfundedChannelImpl; + const ClosureReason_CounterpartyCoopClosedUnfundedChannel._() : super._(); +} + +/// @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 + extends ClosureReason_FundingBatchClosure { + const _$ClosureReason_FundingBatchClosureImpl() : super._(); + + @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() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, + }) { + return fundingBatchClosure(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + }) { + return fundingBatchClosure?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + 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_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, + }) { + return fundingBatchClosure(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + }) { + return fundingBatchClosure?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + required TResult orElse(), + }) { + if (fundingBatchClosure != null) { + return fundingBatchClosure(this); + } + return orElse(); + } +} + +abstract class ClosureReason_FundingBatchClosure extends ClosureReason { + const factory ClosureReason_FundingBatchClosure() = + _$ClosureReason_FundingBatchClosureImpl; + const ClosureReason_FundingBatchClosure._() : super._(); +} + +/// @nodoc +abstract class _$$ClosureReason_HTLCsTimedOutImplCopyWith<$Res> { + factory _$$ClosureReason_HTLCsTimedOutImplCopyWith( + _$ClosureReason_HTLCsTimedOutImpl value, + $Res Function(_$ClosureReason_HTLCsTimedOutImpl) then) = + __$$ClosureReason_HTLCsTimedOutImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$ClosureReason_HTLCsTimedOutImplCopyWithImpl<$Res> + extends _$ClosureReasonCopyWithImpl<$Res, _$ClosureReason_HTLCsTimedOutImpl> + implements _$$ClosureReason_HTLCsTimedOutImplCopyWith<$Res> { + __$$ClosureReason_HTLCsTimedOutImplCopyWithImpl( + _$ClosureReason_HTLCsTimedOutImpl _value, + $Res Function(_$ClosureReason_HTLCsTimedOutImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$ClosureReason_HTLCsTimedOutImpl extends ClosureReason_HTLCsTimedOut { + const _$ClosureReason_HTLCsTimedOutImpl() : super._(); + + @override + String toString() { + return 'ClosureReason.htlCsTimedOut()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ClosureReason_HTLCsTimedOutImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(String peerMsg) counterpartyForceClosed, + required TResult Function() holderForceClosed, + required TResult Function() legacyCooperativeClosure, + required TResult Function() counterpartyInitiatedCooperativeClosure, + required TResult Function() locallyInitiatedCooperativeClosure, + 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() htlCsTimedOut, + }) { + return htlCsTimedOut(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String peerMsg)? counterpartyForceClosed, + TResult? Function()? holderForceClosed, + TResult? Function()? legacyCooperativeClosure, + TResult? Function()? counterpartyInitiatedCooperativeClosure, + TResult? Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + }) { + return htlCsTimedOut?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String peerMsg)? counterpartyForceClosed, + TResult Function()? holderForceClosed, + TResult Function()? legacyCooperativeClosure, + TResult Function()? counterpartyInitiatedCooperativeClosure, + TResult Function()? locallyInitiatedCooperativeClosure, + 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()? htlCsTimedOut, + required TResult orElse(), + }) { + if (htlCsTimedOut != null) { + return htlCsTimedOut(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(ClosureReason_CounterpartyForceClosed value) + counterpartyForceClosed, + required TResult Function(ClosureReason_HolderForceClosed value) + holderForceClosed, + required TResult Function(ClosureReason_LegacyCooperativeClosure value) + legacyCooperativeClosure, + required TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value) + counterpartyInitiatedCooperativeClosure, + required TResult Function( + ClosureReason_LocallyInitiatedCooperativeClosure value) + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value) htlCsTimedOut, + }) { + return htlCsTimedOut(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult? Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult? Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult? Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + }) { + return htlCsTimedOut?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(ClosureReason_CounterpartyForceClosed value)? + counterpartyForceClosed, + TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, + TResult Function(ClosureReason_LegacyCooperativeClosure value)? + legacyCooperativeClosure, + TResult Function( + ClosureReason_CounterpartyInitiatedCooperativeClosure value)? + counterpartyInitiatedCooperativeClosure, + TResult Function(ClosureReason_LocallyInitiatedCooperativeClosure value)? + locallyInitiatedCooperativeClosure, + 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(ClosureReason_HTLCsTimedOut value)? htlCsTimedOut, + required TResult orElse(), + }) { + if (htlCsTimedOut != null) { + return htlCsTimedOut(this); + } + return orElse(); + } +} + +abstract class ClosureReason_HTLCsTimedOut extends ClosureReason { + const factory ClosureReason_HTLCsTimedOut() = + _$ClosureReason_HTLCsTimedOutImpl; + const ClosureReason_HTLCsTimedOut._() : super._(); +} + +/// @nodoc +mixin _$EntropySourceConfig { + @optionalTypeArgs + TResult when({ + 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 field0)? seedFile, + TResult? Function(U8Array64 field0)? seedBytes, + TResult? Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + 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(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 extends EntropySourceConfig_SeedFile { + const _$EntropySourceConfig_SeedFileImpl(this.field0) : super._(); + + @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(LdkMnemonic mnemonic, String? passphrase) + bip39Mnemonic, + }) { + return seedFile(field0); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String field0)? seedFile, + TResult? Function(U8Array64 field0)? seedBytes, + TResult? Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + }) { + return seedFile?.call(field0); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String field0)? seedFile, + TResult Function(U8Array64 field0)? seedBytes, + TResult Function(LdkMnemonic 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 extends EntropySourceConfig { + const factory EntropySourceConfig_SeedFile(final String field0) = + _$EntropySourceConfig_SeedFileImpl; + const EntropySourceConfig_SeedFile._() : super._(); + + 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 + extends EntropySourceConfig_SeedBytes { + const _$EntropySourceConfig_SeedBytesImpl(this.field0) : super._(); + + @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(LdkMnemonic mnemonic, String? passphrase) + bip39Mnemonic, + }) { + return seedBytes(field0); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String field0)? seedFile, + TResult? Function(U8Array64 field0)? seedBytes, + TResult? Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + }) { + return seedBytes?.call(field0); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(String field0)? seedFile, + TResult Function(U8Array64 field0)? seedBytes, + TResult Function(LdkMnemonic 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 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 _$$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 __$$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 _$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 '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(LdkMnemonic mnemonic, String? passphrase) bip39Mnemonic, }) { - return bip39Mnemonic(mnemonic, passphrase); + return bip39Mnemonic(mnemonic, passphrase); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(String field0)? seedFile, + TResult? Function(U8Array64 field0)? seedBytes, + TResult? Function(LdkMnemonic 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(LdkMnemonic 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 extends EntropySourceConfig { + const factory EntropySourceConfig_Bip39Mnemonic( + {required final LdkMnemonic mnemonic, + final String? passphrase}) = _$EntropySourceConfig_Bip39MnemonicImpl; + const EntropySourceConfig_Bip39Mnemonic._() : super._(); + + LdkMnemonic 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(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline) + paymentClaimable, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat) + paymentSuccessful, + required TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason) + paymentFailed, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult? Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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_PaymentClaimable value) paymentClaimable, + 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_PaymentClaimable value)? paymentClaimable, + 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_PaymentClaimable value)? paymentClaimable, + 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_PaymentClaimableImplCopyWith<$Res> { + factory _$$Event_PaymentClaimableImplCopyWith( + _$Event_PaymentClaimableImpl value, + $Res Function(_$Event_PaymentClaimableImpl) then) = + __$$Event_PaymentClaimableImplCopyWithImpl<$Res>; + @useResult + $Res call( + {PaymentId paymentId, + PaymentHash paymentHash, + BigInt claimableAmountMsat, + int? claimDeadline}); +} + +/// @nodoc +class __$$Event_PaymentClaimableImplCopyWithImpl<$Res> + extends _$EventCopyWithImpl<$Res, _$Event_PaymentClaimableImpl> + implements _$$Event_PaymentClaimableImplCopyWith<$Res> { + __$$Event_PaymentClaimableImplCopyWithImpl( + _$Event_PaymentClaimableImpl _value, + $Res Function(_$Event_PaymentClaimableImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? paymentId = null, + Object? paymentHash = null, + Object? claimableAmountMsat = null, + Object? claimDeadline = freezed, + }) { + return _then(_$Event_PaymentClaimableImpl( + paymentId: null == paymentId + ? _value.paymentId + : paymentId // ignore: cast_nullable_to_non_nullable + as PaymentId, + paymentHash: null == paymentHash + ? _value.paymentHash + : paymentHash // ignore: cast_nullable_to_non_nullable + as PaymentHash, + claimableAmountMsat: null == claimableAmountMsat + ? _value.claimableAmountMsat + : claimableAmountMsat // ignore: cast_nullable_to_non_nullable + as BigInt, + claimDeadline: freezed == claimDeadline + ? _value.claimDeadline + : claimDeadline // ignore: cast_nullable_to_non_nullable + as int?, + )); + } +} + +/// @nodoc + +class _$Event_PaymentClaimableImpl extends Event_PaymentClaimable { + const _$Event_PaymentClaimableImpl( + {required this.paymentId, + required this.paymentHash, + required this.claimableAmountMsat, + this.claimDeadline}) + : super._(); + + /// A local identifier used to track the payment. + @override + final PaymentId paymentId; + + /// The hash of the payment. + @override + final PaymentHash paymentHash; + + /// The value, in thousandths of a satoshi, that is claimable. + @override + final BigInt claimableAmountMsat; + + /// The block height at which this payment will be failed back and will no longer be + /// eligible for claiming. + @override + final int? claimDeadline; + + @override + String toString() { + return 'Event.paymentClaimable(paymentId: $paymentId, paymentHash: $paymentHash, claimableAmountMsat: $claimableAmountMsat, claimDeadline: $claimDeadline)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Event_PaymentClaimableImpl && + (identical(other.paymentId, paymentId) || + other.paymentId == paymentId) && + (identical(other.paymentHash, paymentHash) || + other.paymentHash == paymentHash) && + (identical(other.claimableAmountMsat, claimableAmountMsat) || + other.claimableAmountMsat == claimableAmountMsat) && + (identical(other.claimDeadline, claimDeadline) || + other.claimDeadline == claimDeadline)); + } + + @override + int get hashCode => Object.hash( + runtimeType, paymentId, paymentHash, claimableAmountMsat, claimDeadline); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$Event_PaymentClaimableImplCopyWith<_$Event_PaymentClaimableImpl> + get copyWith => __$$Event_PaymentClaimableImplCopyWithImpl< + _$Event_PaymentClaimableImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline) + paymentClaimable, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat) + paymentSuccessful, + required TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason) + paymentFailed, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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 paymentClaimable( + paymentId, paymentHash, claimableAmountMsat, claimDeadline); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult? Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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 paymentClaimable?.call( + paymentId, paymentHash, claimableAmountMsat, claimDeadline); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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 (paymentClaimable != null) { + return paymentClaimable( + paymentId, paymentHash, claimableAmountMsat, claimDeadline); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Event_PaymentClaimable value) paymentClaimable, + 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 paymentClaimable(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Event_PaymentClaimable value)? paymentClaimable, + 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 paymentClaimable?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Event_PaymentClaimable value)? paymentClaimable, + 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 (paymentClaimable != null) { + return paymentClaimable(this); + } + return orElse(); + } +} + +abstract class Event_PaymentClaimable extends Event { + const factory Event_PaymentClaimable( + {required final PaymentId paymentId, + required final PaymentHash paymentHash, + required final BigInt claimableAmountMsat, + final int? claimDeadline}) = _$Event_PaymentClaimableImpl; + const Event_PaymentClaimable._() : super._(); + + /// A local identifier used to track the payment. + PaymentId get paymentId; + + /// The hash of the payment. + PaymentHash get paymentHash; + + /// The value, in thousandths of a satoshi, that is claimable. + BigInt get claimableAmountMsat; + + /// The block height at which this payment will be failed back and will no longer be + /// eligible for claiming. + int? get claimDeadline; + @JsonKey(ignore: true) + _$$Event_PaymentClaimableImplCopyWith<_$Event_PaymentClaimableImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$Event_PaymentSuccessfulImplCopyWith<$Res> { + factory _$$Event_PaymentSuccessfulImplCopyWith( + _$Event_PaymentSuccessfulImpl value, + $Res Function(_$Event_PaymentSuccessfulImpl) then) = + __$$Event_PaymentSuccessfulImplCopyWithImpl<$Res>; + @useResult + $Res call( + {PaymentId? paymentId, PaymentHash paymentHash, BigInt? 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? paymentId = freezed, + Object? paymentHash = null, + Object? feePaidMsat = freezed, + }) { + return _then(_$Event_PaymentSuccessfulImpl( + paymentId: freezed == paymentId + ? _value.paymentId + : paymentId // ignore: cast_nullable_to_non_nullable + as PaymentId?, + 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 BigInt?, + )); + } +} + +/// @nodoc + +class _$Event_PaymentSuccessfulImpl extends Event_PaymentSuccessful { + const _$Event_PaymentSuccessfulImpl( + {this.paymentId, required this.paymentHash, this.feePaidMsat}) + : super._(); + + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + @override + final PaymentId? paymentId; + + /// The hash of the payment. + @override + final PaymentHash paymentHash; + + /// The total fee which was spent at intermediate hops in this payment. + @override + final BigInt? feePaidMsat; + + @override + String toString() { + return 'Event.paymentSuccessful(paymentId: $paymentId, paymentHash: $paymentHash, feePaidMsat: $feePaidMsat)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Event_PaymentSuccessfulImpl && + (identical(other.paymentId, paymentId) || + other.paymentId == paymentId) && + (identical(other.paymentHash, paymentHash) || + other.paymentHash == paymentHash) && + (identical(other.feePaidMsat, feePaidMsat) || + other.feePaidMsat == feePaidMsat)); + } + + @override + int get hashCode => + Object.hash(runtimeType, paymentId, 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(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline) + paymentClaimable, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat) + paymentSuccessful, + required TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason) + paymentFailed, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(paymentId, paymentHash, feePaidMsat); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult? Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(paymentId, paymentHash, feePaidMsat); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(paymentId, paymentHash, feePaidMsat); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Event_PaymentClaimable value) paymentClaimable, + 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_PaymentClaimable value)? paymentClaimable, + 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_PaymentClaimable value)? paymentClaimable, + 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 extends Event { + const factory Event_PaymentSuccessful( + {final PaymentId? paymentId, + required final PaymentHash paymentHash, + final BigInt? feePaidMsat}) = _$Event_PaymentSuccessfulImpl; + const Event_PaymentSuccessful._() : super._(); + + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + PaymentId? get paymentId; + + /// The hash of the payment. + PaymentHash get paymentHash; + + /// The total fee which was spent at intermediate hops in this payment. + BigInt? 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( + {PaymentId? paymentId, + 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? paymentId = freezed, + Object? paymentHash = null, + Object? reason = freezed, + }) { + return _then(_$Event_PaymentFailedImpl( + paymentId: freezed == paymentId + ? _value.paymentId + : paymentId // ignore: cast_nullable_to_non_nullable + as PaymentId?, + 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 extends Event_PaymentFailed { + const _$Event_PaymentFailedImpl( + {this.paymentId, required this.paymentHash, this.reason}) + : super._(); + + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + @override + final PaymentId? paymentId; + + /// 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(paymentId: $paymentId, paymentHash: $paymentHash, reason: $reason)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Event_PaymentFailedImpl && + (identical(other.paymentId, paymentId) || + other.paymentId == paymentId) && + (identical(other.paymentHash, paymentHash) || + other.paymentHash == paymentHash) && + (identical(other.reason, reason) || other.reason == reason)); + } + + @override + int get hashCode => Object.hash(runtimeType, paymentId, 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(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline) + paymentClaimable, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat) + paymentSuccessful, + required TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason) + paymentFailed, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(paymentId, paymentHash, reason); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult? Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(paymentId, paymentHash, reason); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(paymentId, paymentHash, reason); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Event_PaymentClaimable value) paymentClaimable, + 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_PaymentClaimable value)? paymentClaimable, + 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_PaymentClaimable value)? paymentClaimable, + 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 extends Event { + const factory Event_PaymentFailed( + {final PaymentId? paymentId, + required final PaymentHash paymentHash, + final PaymentFailureReason? reason}) = _$Event_PaymentFailedImpl; + const Event_PaymentFailed._() : super._(); + + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + PaymentId? get paymentId; + + /// 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({PaymentId? paymentId, PaymentHash paymentHash, BigInt 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? paymentId = freezed, + Object? paymentHash = null, + Object? amountMsat = null, + }) { + return _then(_$Event_PaymentReceivedImpl( + paymentId: freezed == paymentId + ? _value.paymentId + : paymentId // ignore: cast_nullable_to_non_nullable + as PaymentId?, + 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 BigInt, + )); + } +} + +/// @nodoc + +class _$Event_PaymentReceivedImpl extends Event_PaymentReceived { + const _$Event_PaymentReceivedImpl( + {this.paymentId, required this.paymentHash, required this.amountMsat}) + : super._(); + + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + @override + final PaymentId? paymentId; + + /// The hash of the payment. + @override + final PaymentHash paymentHash; + + /// The value, in thousandths of a satoshi, that has been received. + @override + final BigInt amountMsat; + + @override + String toString() { + return 'Event.paymentReceived(paymentId: $paymentId, paymentHash: $paymentHash, amountMsat: $amountMsat)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Event_PaymentReceivedImpl && + (identical(other.paymentId, paymentId) || + other.paymentId == paymentId) && + (identical(other.paymentHash, paymentHash) || + other.paymentHash == paymentHash) && + (identical(other.amountMsat, amountMsat) || + other.amountMsat == amountMsat)); + } + + @override + int get hashCode => + Object.hash(runtimeType, paymentId, 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(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline) + paymentClaimable, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat) + paymentSuccessful, + required TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason) + paymentFailed, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(paymentId, paymentHash, amountMsat); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult? Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(paymentId, paymentHash, amountMsat); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(paymentId, paymentHash, amountMsat); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Event_PaymentClaimable value) paymentClaimable, + 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_PaymentClaimable value)? paymentClaimable, + 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_PaymentClaimable value)? paymentClaimable, + 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 extends Event { + const factory Event_PaymentReceived( + {final PaymentId? paymentId, + required final PaymentHash paymentHash, + required final BigInt amountMsat}) = _$Event_PaymentReceivedImpl; + const Event_PaymentReceived._() : super._(); + + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + PaymentId? get paymentId; + + /// The hash of the payment. + PaymentHash get paymentHash; + + /// The value, in thousandths of a satoshi, that has been received. + BigInt 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 extends Event_ChannelPending { + const _$Event_ChannelPendingImpl( + {required this.channelId, + required this.userChannelId, + required this.formerTemporaryChannelId, + required this.counterpartyNodeId, + required this.fundingTxo}) + : super._(); + + /// The `channelId` of the channel. + @override + final ChannelId channelId; + + /// The `userChannelId` of the channel. + @override + final UserChannelId userChannelId; + + /// The `temporaryChannelId` this channel used to be known by during channel establishment. + @override + final ChannelId formerTemporaryChannelId; + + /// The `nodeId` 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(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline) + paymentClaimable, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat) + paymentSuccessful, + required TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason) + paymentFailed, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult? Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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_PaymentClaimable value) paymentClaimable, + 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_PaymentClaimable value)? paymentClaimable, + 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_PaymentClaimable value)? paymentClaimable, + 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 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 `channelId` of the channel. + ChannelId get channelId; + + /// The `userChannelId` of the channel. + UserChannelId get userChannelId; + + /// The `temporaryChannelId` this channel used to be known by during channel establishment. + ChannelId get formerTemporaryChannelId; + + /// The `nodeId` 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 extends Event_ChannelReady { + const _$Event_ChannelReadyImpl( + {required this.channelId, + required this.userChannelId, + this.counterpartyNodeId}) + : super._(); + + /// The `channelId` of the channel. + @override + final ChannelId channelId; + + /// The `userChannelId` of the channel. + @override + final UserChannelId userChannelId; + + /// The `nodeId` 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(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline) + paymentClaimable, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat) + paymentSuccessful, + required TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason) + paymentFailed, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult? Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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_PaymentClaimable value) paymentClaimable, + 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_PaymentClaimable value)? paymentClaimable, + 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_PaymentClaimable value)? paymentClaimable, + 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 extends Event { + const factory Event_ChannelReady( + {required final ChannelId channelId, + required final UserChannelId userChannelId, + final PublicKey? counterpartyNodeId}) = _$Event_ChannelReadyImpl; + const Event_ChannelReady._() : super._(); + + /// The `channelId` of the channel. + ChannelId get channelId; + + /// The `userChannelId` of the channel. + UserChannelId get userChannelId; + + /// The `nodeId` 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 extends Event_ChannelClosed { + const _$Event_ChannelClosedImpl( + {required this.channelId, + required this.userChannelId, + this.counterpartyNodeId, + this.reason}) + : super._(); + + /// The `channelId` of the channel. + @override + final ChannelId channelId; + + /// The `userChannelId` of the channel. + @override + final UserChannelId userChannelId; + + /// The `nodeId` 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(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline) + paymentClaimable, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat) + paymentSuccessful, + required TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason) + paymentFailed, + required TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult? Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult? Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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(PaymentId paymentId, PaymentHash paymentHash, + BigInt claimableAmountMsat, int? claimDeadline)? + paymentClaimable, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt? feePaidMsat)? + paymentSuccessful, + TResult Function(PaymentId? paymentId, PaymentHash paymentHash, + PaymentFailureReason? reason)? + paymentFailed, + TResult Function( + PaymentId? paymentId, PaymentHash paymentHash, BigInt 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_PaymentClaimable value) paymentClaimable, + 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_PaymentClaimable value)? paymentClaimable, + 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_PaymentClaimable value)? paymentClaimable, + 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 extends Event { + const factory Event_ChannelClosed( + {required final ChannelId channelId, + required final UserChannelId userChannelId, + final PublicKey? counterpartyNodeId, + final ClosureReason? reason}) = _$Event_ChannelClosedImpl; + const Event_ChannelClosed._() : super._(); + + /// The `channelId` of the channel. + ChannelId get channelId; + + /// The `userChannelId` of the channel. + UserChannelId get userChannelId; + + /// The `nodeId` 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 + extends GossipSourceConfig_P2PNetwork { + const _$GossipSourceConfig_P2PNetworkImpl() : super._(); + + @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 extends GossipSourceConfig { + const factory GossipSourceConfig_P2PNetwork() = + _$GossipSourceConfig_P2PNetworkImpl; + const GossipSourceConfig_P2PNetwork._() : super._(); +} + +/// @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 + extends GossipSourceConfig_RapidGossipSync { + const _$GossipSourceConfig_RapidGossipSyncImpl(this.field0) : super._(); + + @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 extends GossipSourceConfig { + const factory GossipSourceConfig_RapidGossipSync(final String field0) = + _$GossipSourceConfig_RapidGossipSyncImpl; + const GossipSourceConfig_RapidGossipSync._() : super._(); + + 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. + BigInt get amountSatoshis => throw _privateConstructorUsedError; + @optionalTypeArgs + TResult when({ + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis) + claimableOnChannelClose, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight) + claimableAwaitingConfirmations, + required TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage) + contentiousClaimable, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int claimableHeight, PaymentHash paymentHash) + maybeTimeoutClaimableHtlc, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash) + maybePreimageClaimableHtlc, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis) + counterpartyRevokedOutputClaimable, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + claimableOnChannelClose, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight)? + claimableAwaitingConfirmations, + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage)? + contentiousClaimable, + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? + maybeTimeoutClaimableHtlc, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + maybePreimageClaimableHtlc, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + counterpartyRevokedOutputClaimable, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + claimableOnChannelClose, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight)? + claimableAwaitingConfirmations, + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage)? + contentiousClaimable, + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? + maybeTimeoutClaimableHtlc, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + maybePreimageClaimableHtlc, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + counterpartyRevokedOutputClaimable, + 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, + }) => + 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, + }) => + 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, + 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, + BigInt amountSatoshis}); +} + +/// @nodoc +class _$LightningBalanceCopyWithImpl<$Res, $Val extends LightningBalance> + implements $LightningBalanceCopyWith<$Res> { + _$LightningBalanceCopyWithImpl(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 BigInt, + ) 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 + @useResult + $Res call( + {ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis}); +} + +/// @nodoc +class __$$LightningBalance_ClaimableOnChannelCloseImplCopyWithImpl<$Res> + extends _$LightningBalanceCopyWithImpl<$Res, + _$LightningBalance_ClaimableOnChannelCloseImpl> + implements _$$LightningBalance_ClaimableOnChannelCloseImplCopyWith<$Res> { + __$$LightningBalance_ClaimableOnChannelCloseImplCopyWithImpl( + _$LightningBalance_ClaimableOnChannelCloseImpl _value, + $Res Function(_$LightningBalance_ClaimableOnChannelCloseImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? channelId = null, + Object? counterpartyNodeId = null, + Object? amountSatoshis = 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 BigInt, + )); + } +} + +/// @nodoc + +class _$LightningBalance_ClaimableOnChannelCloseImpl + extends LightningBalance_ClaimableOnChannelClose { + const _$LightningBalance_ClaimableOnChannelCloseImpl( + {required this.channelId, + required this.counterpartyNodeId, + required this.amountSatoshis}) + : super._(); + + /// 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 BigInt amountSatoshis; + + @override + String toString() { + return 'LightningBalance.claimableOnChannelClose(channelId: $channelId, counterpartyNodeId: $counterpartyNodeId, amountSatoshis: $amountSatoshis)'; + } + + @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)); + } + + @override + int get hashCode => + Object.hash(runtimeType, channelId, counterpartyNodeId, amountSatoshis); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$LightningBalance_ClaimableOnChannelCloseImplCopyWith< + _$LightningBalance_ClaimableOnChannelCloseImpl> + get copyWith => + __$$LightningBalance_ClaimableOnChannelCloseImplCopyWithImpl< + _$LightningBalance_ClaimableOnChannelCloseImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis) + claimableOnChannelClose, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight) + claimableAwaitingConfirmations, + required TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage) + contentiousClaimable, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int claimableHeight, PaymentHash paymentHash) + maybeTimeoutClaimableHtlc, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash) + maybePreimageClaimableHtlc, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis) + counterpartyRevokedOutputClaimable, + }) { + return claimableOnChannelClose( + channelId, counterpartyNodeId, amountSatoshis); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + claimableOnChannelClose, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight)? + claimableAwaitingConfirmations, + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage)? + contentiousClaimable, + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? + maybeTimeoutClaimableHtlc, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + maybePreimageClaimableHtlc, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + counterpartyRevokedOutputClaimable, + }) { + return claimableOnChannelClose?.call( + channelId, counterpartyNodeId, amountSatoshis); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + claimableOnChannelClose, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight)? + claimableAwaitingConfirmations, + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage)? + contentiousClaimable, + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? + maybeTimeoutClaimableHtlc, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + maybePreimageClaimableHtlc, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + counterpartyRevokedOutputClaimable, + required TResult orElse(), + }) { + if (claimableOnChannelClose != null) { + return claimableOnChannelClose( + channelId, counterpartyNodeId, amountSatoshis); + } + return orElse(); + } + + @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, + }) { + return claimableOnChannelClose(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, + }) { + return claimableOnChannelClose?.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, + required TResult orElse(), + }) { + if (claimableOnChannelClose != null) { + return claimableOnChannelClose(this); + } + return orElse(); + } +} + +abstract class LightningBalance_ClaimableOnChannelClose + extends LightningBalance { + const factory LightningBalance_ClaimableOnChannelClose( + {required final ChannelId channelId, + required final PublicKey counterpartyNodeId, + required final BigInt amountSatoshis}) = + _$LightningBalance_ClaimableOnChannelCloseImpl; + const LightningBalance_ClaimableOnChannelClose._() : super._(); + + @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. + BigInt get amountSatoshis; + @override + @JsonKey(ignore: true) + _$$LightningBalance_ClaimableOnChannelCloseImplCopyWith< + _$LightningBalance_ClaimableOnChannelCloseImpl> + 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 + @useResult + $Res call( + {ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int confirmationHeight}); +} + +/// @nodoc +class __$$LightningBalance_ClaimableAwaitingConfirmationsImplCopyWithImpl<$Res> + extends _$LightningBalanceCopyWithImpl<$Res, + _$LightningBalance_ClaimableAwaitingConfirmationsImpl> + implements + _$$LightningBalance_ClaimableAwaitingConfirmationsImplCopyWith<$Res> { + __$$LightningBalance_ClaimableAwaitingConfirmationsImplCopyWithImpl( + _$LightningBalance_ClaimableAwaitingConfirmationsImpl _value, + $Res Function(_$LightningBalance_ClaimableAwaitingConfirmationsImpl) + _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? channelId = null, + Object? counterpartyNodeId = null, + Object? amountSatoshis = null, + Object? confirmationHeight = 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 BigInt, + confirmationHeight: null == confirmationHeight + ? _value.confirmationHeight + : confirmationHeight // ignore: cast_nullable_to_non_nullable + as int, + )); + } +} + +/// @nodoc + +class _$LightningBalance_ClaimableAwaitingConfirmationsImpl + extends LightningBalance_ClaimableAwaitingConfirmations { + const _$LightningBalance_ClaimableAwaitingConfirmationsImpl( + {required this.channelId, + required this.counterpartyNodeId, + required this.amountSatoshis, + required this.confirmationHeight}) + : super._(); + + /// 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 BigInt amountSatoshis; + + /// The height at which an [`Event::SpendableOutputs`] event will be generated for this + /// amount. + /// + /// [`Event::SpendableOutputs`]: lightning::events::Event::SpendableOutputs + @override + final int confirmationHeight; + + @override + String toString() { + return 'LightningBalance.claimableAwaitingConfirmations(channelId: $channelId, counterpartyNodeId: $counterpartyNodeId, amountSatoshis: $amountSatoshis, confirmationHeight: $confirmationHeight)'; + } + + @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)); + } + + @override + int get hashCode => Object.hash(runtimeType, channelId, counterpartyNodeId, + amountSatoshis, confirmationHeight); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$LightningBalance_ClaimableAwaitingConfirmationsImplCopyWith< + _$LightningBalance_ClaimableAwaitingConfirmationsImpl> + get copyWith => + __$$LightningBalance_ClaimableAwaitingConfirmationsImplCopyWithImpl< + _$LightningBalance_ClaimableAwaitingConfirmationsImpl>( + this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis) + claimableOnChannelClose, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight) + claimableAwaitingConfirmations, + required TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage) + contentiousClaimable, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int claimableHeight, PaymentHash paymentHash) + maybeTimeoutClaimableHtlc, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash) + maybePreimageClaimableHtlc, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis) + counterpartyRevokedOutputClaimable, + }) { + return claimableAwaitingConfirmations( + channelId, counterpartyNodeId, amountSatoshis, confirmationHeight); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + claimableOnChannelClose, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight)? + claimableAwaitingConfirmations, + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage)? + contentiousClaimable, + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? + maybeTimeoutClaimableHtlc, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + maybePreimageClaimableHtlc, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + counterpartyRevokedOutputClaimable, + }) { + return claimableAwaitingConfirmations?.call( + channelId, counterpartyNodeId, amountSatoshis, confirmationHeight); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + claimableOnChannelClose, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight)? + claimableAwaitingConfirmations, + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage)? + contentiousClaimable, + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? + maybeTimeoutClaimableHtlc, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + maybePreimageClaimableHtlc, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + counterpartyRevokedOutputClaimable, + required TResult orElse(), + }) { + if (claimableAwaitingConfirmations != null) { + return claimableAwaitingConfirmations( + channelId, counterpartyNodeId, amountSatoshis, confirmationHeight); + } + return orElse(); + } + + @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, + }) { + return claimableAwaitingConfirmations(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, + }) { + return claimableAwaitingConfirmations?.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, + required TResult orElse(), + }) { + if (claimableAwaitingConfirmations != null) { + return claimableAwaitingConfirmations(this); + } + return orElse(); + } +} + +abstract class LightningBalance_ClaimableAwaitingConfirmations + extends LightningBalance { + const factory LightningBalance_ClaimableAwaitingConfirmations( + {required final ChannelId channelId, + required final PublicKey counterpartyNodeId, + required final BigInt amountSatoshis, + required final int confirmationHeight}) = + _$LightningBalance_ClaimableAwaitingConfirmationsImpl; + const LightningBalance_ClaimableAwaitingConfirmations._() : super._(); + + @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, possibly excluding the on-chain fees which + /// were spent in broadcasting the transaction. + BigInt 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 + @JsonKey(ignore: true) + _$$LightningBalance_ClaimableAwaitingConfirmationsImplCopyWith< + _$LightningBalance_ClaimableAwaitingConfirmationsImpl> + 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 + @useResult + $Res call( + {ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage}); +} + +/// @nodoc +class __$$LightningBalance_ContentiousClaimableImplCopyWithImpl<$Res> + extends _$LightningBalanceCopyWithImpl<$Res, + _$LightningBalance_ContentiousClaimableImpl> + implements _$$LightningBalance_ContentiousClaimableImplCopyWith<$Res> { + __$$LightningBalance_ContentiousClaimableImplCopyWithImpl( + _$LightningBalance_ContentiousClaimableImpl _value, + $Res Function(_$LightningBalance_ContentiousClaimableImpl) _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, + }) { + 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 BigInt, + timeoutHeight: null == timeoutHeight + ? _value.timeoutHeight + : timeoutHeight // ignore: cast_nullable_to_non_nullable + as int, + 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, + )); + } +} + +/// @nodoc + +class _$LightningBalance_ContentiousClaimableImpl + extends LightningBalance_ContentiousClaimable { + const _$LightningBalance_ContentiousClaimableImpl( + {required this.channelId, + required this.counterpartyNodeId, + required this.amountSatoshis, + required this.timeoutHeight, + required this.paymentHash, + required this.paymentPreimage}) + : super._(); + + /// 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 BigInt amountSatoshis; + + /// The height at which the counterparty may be able to claim the balance if we have not + /// done so. + @override + final int timeoutHeight; + + /// The payment hash that locks this HTLC. + @override + final PaymentHash paymentHash; + + /// The preimage that can be used to claim this HTLC. + @override + final PaymentPreimage paymentPreimage; + + @override + String toString() { + return 'LightningBalance.contentiousClaimable(channelId: $channelId, counterpartyNodeId: $counterpartyNodeId, amountSatoshis: $amountSatoshis, timeoutHeight: $timeoutHeight, paymentHash: $paymentHash, paymentPreimage: $paymentPreimage)'; + } + + @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) && + (identical(other.paymentHash, paymentHash) || + other.paymentHash == paymentHash) && + (identical(other.paymentPreimage, paymentPreimage) || + other.paymentPreimage == paymentPreimage)); + } + + @override + int get hashCode => Object.hash(runtimeType, channelId, counterpartyNodeId, + amountSatoshis, timeoutHeight, paymentHash, paymentPreimage); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$LightningBalance_ContentiousClaimableImplCopyWith< + _$LightningBalance_ContentiousClaimableImpl> + get copyWith => __$$LightningBalance_ContentiousClaimableImplCopyWithImpl< + _$LightningBalance_ContentiousClaimableImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis) + claimableOnChannelClose, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight) + claimableAwaitingConfirmations, + required TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage) + contentiousClaimable, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int claimableHeight, PaymentHash paymentHash) + maybeTimeoutClaimableHtlc, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash) + maybePreimageClaimableHtlc, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis) + counterpartyRevokedOutputClaimable, + }) { + return contentiousClaimable(channelId, counterpartyNodeId, amountSatoshis, + timeoutHeight, paymentHash, paymentPreimage); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + claimableOnChannelClose, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight)? + claimableAwaitingConfirmations, + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage)? + contentiousClaimable, + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? + maybeTimeoutClaimableHtlc, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + maybePreimageClaimableHtlc, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + counterpartyRevokedOutputClaimable, + }) { + return contentiousClaimable?.call(channelId, counterpartyNodeId, + amountSatoshis, timeoutHeight, paymentHash, paymentPreimage); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + claimableOnChannelClose, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight)? + claimableAwaitingConfirmations, + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage)? + contentiousClaimable, + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? + maybeTimeoutClaimableHtlc, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + maybePreimageClaimableHtlc, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + counterpartyRevokedOutputClaimable, + required TResult orElse(), + }) { + if (contentiousClaimable != null) { + return contentiousClaimable(channelId, counterpartyNodeId, amountSatoshis, + timeoutHeight, paymentHash, paymentPreimage); + } + return orElse(); + } + + @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, + }) { + return contentiousClaimable(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, + }) { + return contentiousClaimable?.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, + required TResult orElse(), + }) { + if (contentiousClaimable != null) { + return contentiousClaimable(this); + } + return orElse(); + } +} + +abstract class LightningBalance_ContentiousClaimable extends LightningBalance { + const factory LightningBalance_ContentiousClaimable( + {required final ChannelId channelId, + required final PublicKey counterpartyNodeId, + required final BigInt amountSatoshis, + required final int timeoutHeight, + required final PaymentHash paymentHash, + required final PaymentPreimage paymentPreimage}) = + _$LightningBalance_ContentiousClaimableImpl; + const LightningBalance_ContentiousClaimable._() : super._(); + + @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. + BigInt get amountSatoshis; + + /// The height at which the counterparty may be able to claim the balance if we have not + /// done so. + int get timeoutHeight; + + /// The payment hash that locks this HTLC. + PaymentHash get paymentHash; + + /// The preimage that can be used to claim this HTLC. + PaymentPreimage get paymentPreimage; + @override + @JsonKey(ignore: true) + _$$LightningBalance_ContentiousClaimableImplCopyWith< + _$LightningBalance_ContentiousClaimableImpl> + 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 + @useResult + $Res call( + {ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash}); +} + +/// @nodoc +class __$$LightningBalance_MaybeTimeoutClaimableHTLCImplCopyWithImpl<$Res> + extends _$LightningBalanceCopyWithImpl<$Res, + _$LightningBalance_MaybeTimeoutClaimableHTLCImpl> + implements _$$LightningBalance_MaybeTimeoutClaimableHTLCImplCopyWith<$Res> { + __$$LightningBalance_MaybeTimeoutClaimableHTLCImplCopyWithImpl( + _$LightningBalance_MaybeTimeoutClaimableHTLCImpl _value, + $Res Function(_$LightningBalance_MaybeTimeoutClaimableHTLCImpl) _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, + }) { + return _then(_$LightningBalance_MaybeTimeoutClaimableHTLCImpl( + 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 BigInt, + 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, + )); + } +} + +/// @nodoc + +class _$LightningBalance_MaybeTimeoutClaimableHTLCImpl + extends LightningBalance_MaybeTimeoutClaimableHTLC { + const _$LightningBalance_MaybeTimeoutClaimableHTLCImpl( + {required this.channelId, + required this.counterpartyNodeId, + required this.amountSatoshis, + required this.claimableHeight, + required this.paymentHash}) + : super._(); + + /// 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 potentially available to claim, in satoshis, excluding the on-chain fees + /// which will be required to do so. + @override + final BigInt amountSatoshis; + + /// The height at which we will be able to claim the balance if our counterparty has not + /// done so. + @override + final int claimableHeight; + + /// The payment hash whose preimage our counterparty needs to claim this HTLC. + @override + final PaymentHash paymentHash; + + @override + String toString() { + return 'LightningBalance.maybeTimeoutClaimableHtlc(channelId: $channelId, counterpartyNodeId: $counterpartyNodeId, amountSatoshis: $amountSatoshis, claimableHeight: $claimableHeight, paymentHash: $paymentHash)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LightningBalance_MaybeTimeoutClaimableHTLCImpl && + (identical(other.channelId, channelId) || + other.channelId == channelId) && + (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)); + } + + @override + int get hashCode => Object.hash(runtimeType, channelId, counterpartyNodeId, + amountSatoshis, claimableHeight, paymentHash); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$LightningBalance_MaybeTimeoutClaimableHTLCImplCopyWith< + _$LightningBalance_MaybeTimeoutClaimableHTLCImpl> + get copyWith => + __$$LightningBalance_MaybeTimeoutClaimableHTLCImplCopyWithImpl< + _$LightningBalance_MaybeTimeoutClaimableHTLCImpl>( + this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis) + claimableOnChannelClose, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight) + claimableAwaitingConfirmations, + required TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage) + contentiousClaimable, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int claimableHeight, PaymentHash paymentHash) + maybeTimeoutClaimableHtlc, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash) + maybePreimageClaimableHtlc, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis) + counterpartyRevokedOutputClaimable, + }) { + return maybeTimeoutClaimableHtlc(channelId, counterpartyNodeId, + amountSatoshis, claimableHeight, paymentHash); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + claimableOnChannelClose, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight)? + claimableAwaitingConfirmations, + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage)? + contentiousClaimable, + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? + maybeTimeoutClaimableHtlc, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + maybePreimageClaimableHtlc, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + counterpartyRevokedOutputClaimable, + }) { + return maybeTimeoutClaimableHtlc?.call(channelId, counterpartyNodeId, + amountSatoshis, claimableHeight, paymentHash); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + claimableOnChannelClose, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight)? + claimableAwaitingConfirmations, + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage)? + contentiousClaimable, + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? + maybeTimeoutClaimableHtlc, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + maybePreimageClaimableHtlc, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + counterpartyRevokedOutputClaimable, + required TResult orElse(), + }) { + if (maybeTimeoutClaimableHtlc != null) { + return maybeTimeoutClaimableHtlc(channelId, counterpartyNodeId, + amountSatoshis, claimableHeight, paymentHash); + } + return orElse(); + } + + @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, + }) { + return maybeTimeoutClaimableHtlc(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, + }) { + return maybeTimeoutClaimableHtlc?.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, + required TResult orElse(), + }) { + if (maybeTimeoutClaimableHtlc != null) { + return maybeTimeoutClaimableHtlc(this); + } + return orElse(); + } +} + +abstract class LightningBalance_MaybeTimeoutClaimableHTLC + extends LightningBalance { + const factory LightningBalance_MaybeTimeoutClaimableHTLC( + {required final ChannelId channelId, + required final PublicKey counterpartyNodeId, + required final BigInt amountSatoshis, + required final int claimableHeight, + required final PaymentHash paymentHash}) = + _$LightningBalance_MaybeTimeoutClaimableHTLCImpl; + const LightningBalance_MaybeTimeoutClaimableHTLC._() : super._(); + + @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 potentially available to claim, in satoshis, excluding the on-chain fees + /// which will be required to do so. + BigInt 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 + @JsonKey(ignore: true) + _$$LightningBalance_MaybeTimeoutClaimableHTLCImplCopyWith< + _$LightningBalance_MaybeTimeoutClaimableHTLCImpl> + 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 + @useResult + $Res call( + {ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int expiryHeight, + PaymentHash paymentHash}); +} + +/// @nodoc +class __$$LightningBalance_MaybePreimageClaimableHTLCImplCopyWithImpl<$Res> + extends _$LightningBalanceCopyWithImpl<$Res, + _$LightningBalance_MaybePreimageClaimableHTLCImpl> + implements + _$$LightningBalance_MaybePreimageClaimableHTLCImplCopyWith<$Res> { + __$$LightningBalance_MaybePreimageClaimableHTLCImplCopyWithImpl( + _$LightningBalance_MaybePreimageClaimableHTLCImpl _value, + $Res Function(_$LightningBalance_MaybePreimageClaimableHTLCImpl) _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, + }) { + return _then(_$LightningBalance_MaybePreimageClaimableHTLCImpl( + 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 BigInt, + 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, + )); + } +} + +/// @nodoc + +class _$LightningBalance_MaybePreimageClaimableHTLCImpl + extends LightningBalance_MaybePreimageClaimableHTLC { + const _$LightningBalance_MaybePreimageClaimableHTLCImpl( + {required this.channelId, + required this.counterpartyNodeId, + required this.amountSatoshis, + required this.expiryHeight, + required this.paymentHash}) + : super._(); + + /// 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 potentially available to claim, in satoshis, excluding the on-chain fees + /// which will be required to do so. + @override + final BigInt 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. + @override + final int expiryHeight; + + /// The payment hash whose preimage we need to claim this HTLC. + @override + final PaymentHash paymentHash; + + @override + String toString() { + return 'LightningBalance.maybePreimageClaimableHtlc(channelId: $channelId, counterpartyNodeId: $counterpartyNodeId, amountSatoshis: $amountSatoshis, expiryHeight: $expiryHeight, paymentHash: $paymentHash)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LightningBalance_MaybePreimageClaimableHTLCImpl && + (identical(other.channelId, channelId) || + other.channelId == channelId) && + (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)); + } + + @override + int get hashCode => Object.hash(runtimeType, channelId, counterpartyNodeId, + amountSatoshis, expiryHeight, paymentHash); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$LightningBalance_MaybePreimageClaimableHTLCImplCopyWith< + _$LightningBalance_MaybePreimageClaimableHTLCImpl> + get copyWith => + __$$LightningBalance_MaybePreimageClaimableHTLCImplCopyWithImpl< + _$LightningBalance_MaybePreimageClaimableHTLCImpl>( + this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis) + claimableOnChannelClose, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight) + claimableAwaitingConfirmations, + required TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage) + contentiousClaimable, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int claimableHeight, PaymentHash paymentHash) + maybeTimeoutClaimableHtlc, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash) + maybePreimageClaimableHtlc, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis) + counterpartyRevokedOutputClaimable, + }) { + return maybePreimageClaimableHtlc(channelId, counterpartyNodeId, + amountSatoshis, expiryHeight, paymentHash); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + claimableOnChannelClose, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight)? + claimableAwaitingConfirmations, + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage)? + contentiousClaimable, + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? + maybeTimeoutClaimableHtlc, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + maybePreimageClaimableHtlc, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + counterpartyRevokedOutputClaimable, + }) { + return maybePreimageClaimableHtlc?.call(channelId, counterpartyNodeId, + amountSatoshis, expiryHeight, paymentHash); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + claimableOnChannelClose, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight)? + claimableAwaitingConfirmations, + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage)? + contentiousClaimable, + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? + maybeTimeoutClaimableHtlc, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + maybePreimageClaimableHtlc, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + counterpartyRevokedOutputClaimable, + required TResult orElse(), + }) { + if (maybePreimageClaimableHtlc != null) { + return maybePreimageClaimableHtlc(channelId, counterpartyNodeId, + amountSatoshis, expiryHeight, paymentHash); + } + return orElse(); + } + + @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, + }) { + return maybePreimageClaimableHtlc(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, + }) { + return maybePreimageClaimableHtlc?.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, + required TResult orElse(), + }) { + if (maybePreimageClaimableHtlc != null) { + return maybePreimageClaimableHtlc(this); + } + return orElse(); + } +} + +abstract class LightningBalance_MaybePreimageClaimableHTLC + extends LightningBalance { + const factory LightningBalance_MaybePreimageClaimableHTLC( + {required final ChannelId channelId, + required final PublicKey counterpartyNodeId, + required final BigInt amountSatoshis, + required final int expiryHeight, + required final PaymentHash paymentHash}) = + _$LightningBalance_MaybePreimageClaimableHTLCImpl; + const LightningBalance_MaybePreimageClaimableHTLC._() : super._(); + + @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 potentially available to claim, in satoshis, excluding the on-chain fees + /// which will be required to do so. + BigInt 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 + @JsonKey(ignore: true) + _$$LightningBalance_MaybePreimageClaimableHTLCImplCopyWith< + _$LightningBalance_MaybePreimageClaimableHTLCImpl> + 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 + @useResult + $Res call( + {ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis}); +} + +/// @nodoc +class __$$LightningBalance_CounterpartyRevokedOutputClaimableImplCopyWithImpl< + $Res> + extends _$LightningBalanceCopyWithImpl<$Res, + _$LightningBalance_CounterpartyRevokedOutputClaimableImpl> + implements + _$$LightningBalance_CounterpartyRevokedOutputClaimableImplCopyWith< + $Res> { + __$$LightningBalance_CounterpartyRevokedOutputClaimableImplCopyWithImpl( + _$LightningBalance_CounterpartyRevokedOutputClaimableImpl _value, + $Res Function(_$LightningBalance_CounterpartyRevokedOutputClaimableImpl) + _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? channelId = null, + Object? counterpartyNodeId = null, + Object? amountSatoshis = null, + }) { + return _then(_$LightningBalance_CounterpartyRevokedOutputClaimableImpl( + 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 BigInt, + )); + } +} + +/// @nodoc + +class _$LightningBalance_CounterpartyRevokedOutputClaimableImpl + extends LightningBalance_CounterpartyRevokedOutputClaimable { + const _$LightningBalance_CounterpartyRevokedOutputClaimableImpl( + {required this.channelId, + required this.counterpartyNodeId, + required this.amountSatoshis}) + : super._(); + + /// 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, in satoshis, of the output which we can claim. + @override + final BigInt amountSatoshis; + + @override + String toString() { + return 'LightningBalance.counterpartyRevokedOutputClaimable(channelId: $channelId, counterpartyNodeId: $counterpartyNodeId, amountSatoshis: $amountSatoshis)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other + is _$LightningBalance_CounterpartyRevokedOutputClaimableImpl && + (identical(other.channelId, channelId) || + other.channelId == channelId) && + (identical(other.counterpartyNodeId, counterpartyNodeId) || + other.counterpartyNodeId == counterpartyNodeId) && + (identical(other.amountSatoshis, amountSatoshis) || + other.amountSatoshis == amountSatoshis)); + } + + @override + int get hashCode => + Object.hash(runtimeType, channelId, counterpartyNodeId, amountSatoshis); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$LightningBalance_CounterpartyRevokedOutputClaimableImplCopyWith< + _$LightningBalance_CounterpartyRevokedOutputClaimableImpl> + get copyWith => + __$$LightningBalance_CounterpartyRevokedOutputClaimableImplCopyWithImpl< + _$LightningBalance_CounterpartyRevokedOutputClaimableImpl>( + this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis) + claimableOnChannelClose, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight) + claimableAwaitingConfirmations, + required TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage) + contentiousClaimable, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int claimableHeight, PaymentHash paymentHash) + maybeTimeoutClaimableHtlc, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash) + maybePreimageClaimableHtlc, + required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis) + counterpartyRevokedOutputClaimable, + }) { + return counterpartyRevokedOutputClaimable( + channelId, counterpartyNodeId, amountSatoshis); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + claimableOnChannelClose, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight)? + claimableAwaitingConfirmations, + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage)? + contentiousClaimable, + TResult? Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? + maybeTimeoutClaimableHtlc, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + maybePreimageClaimableHtlc, + TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + counterpartyRevokedOutputClaimable, + }) { + return counterpartyRevokedOutputClaimable?.call( + channelId, counterpartyNodeId, amountSatoshis); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + claimableOnChannelClose, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int confirmationHeight)? + claimableAwaitingConfirmations, + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int timeoutHeight, + PaymentHash paymentHash, + PaymentPreimage paymentPreimage)? + contentiousClaimable, + TResult Function( + ChannelId channelId, + PublicKey counterpartyNodeId, + BigInt amountSatoshis, + int claimableHeight, + PaymentHash paymentHash)? + maybeTimeoutClaimableHtlc, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis, int expiryHeight, PaymentHash paymentHash)? + maybePreimageClaimableHtlc, + TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, + BigInt amountSatoshis)? + counterpartyRevokedOutputClaimable, + required TResult orElse(), + }) { + if (counterpartyRevokedOutputClaimable != null) { + return counterpartyRevokedOutputClaimable( + channelId, counterpartyNodeId, amountSatoshis); + } + return orElse(); + } + + @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, + }) { + return counterpartyRevokedOutputClaimable(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, + }) { + return counterpartyRevokedOutputClaimable?.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, + required TResult orElse(), + }) { + if (counterpartyRevokedOutputClaimable != null) { + return counterpartyRevokedOutputClaimable(this); + } + return orElse(); + } +} + +abstract class LightningBalance_CounterpartyRevokedOutputClaimable + extends LightningBalance { + const factory LightningBalance_CounterpartyRevokedOutputClaimable( + {required final ChannelId channelId, + required final PublicKey counterpartyNodeId, + required final BigInt amountSatoshis}) = + _$LightningBalance_CounterpartyRevokedOutputClaimableImpl; + const LightningBalance_CounterpartyRevokedOutputClaimable._() : super._(); + + @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, in satoshis, of the output which we can claim. + BigInt get amountSatoshis; + @override + @JsonKey(ignore: true) + _$$LightningBalance_CounterpartyRevokedOutputClaimableImplCopyWith< + _$LightningBalance_CounterpartyRevokedOutputClaimableImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +mixin _$MaxDustHTLCExposure { + BigInt get field0 => throw _privateConstructorUsedError; + @optionalTypeArgs + TResult when({ + required TResult Function(BigInt field0) fixedLimitMsat, + required TResult Function(BigInt field0) feeRateMultiplier, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(BigInt field0)? fixedLimitMsat, + TResult? Function(BigInt field0)? feeRateMultiplier, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(BigInt field0)? fixedLimitMsat, + TResult Function(BigInt field0)? feeRateMultiplier, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map({ + required TResult Function(MaxDustHTLCExposure_FixedLimitMsat value) + fixedLimitMsat, + required TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value) + feeRateMultiplier, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, + TResult? Function(MaxDustHTLCExposure_FeeRateMultiplier value)? + feeRateMultiplier, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap({ + TResult Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, + TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value)? + feeRateMultiplier, + 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({BigInt field0}); +} + +/// @nodoc +class _$MaxDustHTLCExposureCopyWithImpl<$Res, $Val extends MaxDustHTLCExposure> + implements $MaxDustHTLCExposureCopyWith<$Res> { + _$MaxDustHTLCExposureCopyWithImpl(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 BigInt, + ) 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({BigInt field0}); +} + +/// @nodoc +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? field0 = null, + }) { + return _then(_$MaxDustHTLCExposure_FixedLimitMsatImpl( + null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as BigInt, + )); + } +} + +/// @nodoc + +class _$MaxDustHTLCExposure_FixedLimitMsatImpl + extends MaxDustHTLCExposure_FixedLimitMsat { + const _$MaxDustHTLCExposure_FixedLimitMsatImpl(this.field0) : super._(); + + @override + final BigInt field0; + + @override + String toString() { + return 'MaxDustHTLCExposure.fixedLimitMsat(field0: $field0)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$MaxDustHTLCExposure_FixedLimitMsatImpl && + (identical(other.field0, field0) || other.field0 == field0)); + } + + @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); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(BigInt field0) fixedLimitMsat, + required TResult Function(BigInt field0) feeRateMultiplier, + }) { + return fixedLimitMsat(field0); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(String field0)? seedFile, - TResult? Function(U8Array64 field0)? seedBytes, - TResult? Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + TResult? Function(BigInt field0)? fixedLimitMsat, + TResult? Function(BigInt field0)? feeRateMultiplier, }) { - return bip39Mnemonic?.call(mnemonic, passphrase); + return fixedLimitMsat?.call(field0); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(String field0)? seedFile, - TResult Function(U8Array64 field0)? seedBytes, - TResult Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, + TResult Function(BigInt field0)? fixedLimitMsat, + TResult Function(BigInt field0)? feeRateMultiplier, required TResult orElse(), }) { - if (bip39Mnemonic != null) { - return bip39Mnemonic(mnemonic, passphrase); + if (fixedLimitMsat != null) { + return fixedLimitMsat(field0); } return orElse(); } @@ -714,160 +8508,306 @@ class _$EntropySourceConfig_Bip39MnemonicImpl @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, + required TResult Function(MaxDustHTLCExposure_FixedLimitMsat value) + fixedLimitMsat, + required TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value) + feeRateMultiplier, }) { - return bip39Mnemonic(this); + return fixedLimitMsat(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(EntropySourceConfig_SeedFile value)? seedFile, - TResult? Function(EntropySourceConfig_SeedBytes value)? seedBytes, - TResult? Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, + TResult? Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, + TResult? Function(MaxDustHTLCExposure_FeeRateMultiplier value)? + feeRateMultiplier, }) { - return bip39Mnemonic?.call(this); + return fixedLimitMsat?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(EntropySourceConfig_SeedFile value)? seedFile, - TResult Function(EntropySourceConfig_SeedBytes value)? seedBytes, - TResult Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, + TResult Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, + TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value)? + feeRateMultiplier, required TResult orElse(), }) { - if (bip39Mnemonic != null) { - return bip39Mnemonic(this); + if (fixedLimitMsat != null) { + return fixedLimitMsat(this); + } + return orElse(); + } +} + +abstract class MaxDustHTLCExposure_FixedLimitMsat extends MaxDustHTLCExposure { + const factory MaxDustHTLCExposure_FixedLimitMsat(final BigInt field0) = + _$MaxDustHTLCExposure_FixedLimitMsatImpl; + const MaxDustHTLCExposure_FixedLimitMsat._() : super._(); + + @override + BigInt get field0; + @override + @JsonKey(ignore: true) + _$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWith< + _$MaxDustHTLCExposure_FixedLimitMsatImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +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({BigInt 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) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? field0 = null, + }) { + return _then(_$MaxDustHTLCExposure_FeeRateMultiplierImpl( + null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as BigInt, + )); + } +} + +/// @nodoc + +class _$MaxDustHTLCExposure_FeeRateMultiplierImpl + extends MaxDustHTLCExposure_FeeRateMultiplier { + const _$MaxDustHTLCExposure_FeeRateMultiplierImpl(this.field0) : super._(); + + @override + final BigInt field0; + + @override + String toString() { + return 'MaxDustHTLCExposure.feeRateMultiplier(field0: $field0)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$MaxDustHTLCExposure_FeeRateMultiplierImpl && + (identical(other.field0, field0) || other.field0 == field0)); + } + + @override + int get hashCode => Object.hash(runtimeType, field0); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWith< + _$MaxDustHTLCExposure_FeeRateMultiplierImpl> + get copyWith => __$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWithImpl< + _$MaxDustHTLCExposure_FeeRateMultiplierImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(BigInt field0) fixedLimitMsat, + required TResult Function(BigInt field0) feeRateMultiplier, + }) { + return feeRateMultiplier(field0); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(BigInt field0)? fixedLimitMsat, + TResult? Function(BigInt field0)? feeRateMultiplier, + }) { + return feeRateMultiplier?.call(field0); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(BigInt field0)? fixedLimitMsat, + TResult Function(BigInt field0)? feeRateMultiplier, + required TResult orElse(), + }) { + if (feeRateMultiplier != null) { + return feeRateMultiplier(field0); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(MaxDustHTLCExposure_FixedLimitMsat value) + fixedLimitMsat, + required TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value) + feeRateMultiplier, + }) { + return feeRateMultiplier(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, + TResult? Function(MaxDustHTLCExposure_FeeRateMultiplier value)? + feeRateMultiplier, + }) { + return feeRateMultiplier?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, + TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value)? + feeRateMultiplier, + required TResult orElse(), + }) { + if (feeRateMultiplier != null) { + return feeRateMultiplier(this); } return orElse(); } } -abstract class EntropySourceConfig_Bip39Mnemonic extends EntropySourceConfig { - const factory EntropySourceConfig_Bip39Mnemonic( - {required final LdkMnemonic mnemonic, - final String? passphrase}) = _$EntropySourceConfig_Bip39MnemonicImpl; - const EntropySourceConfig_Bip39Mnemonic._() : super._(); +abstract class MaxDustHTLCExposure_FeeRateMultiplier + extends MaxDustHTLCExposure { + const factory MaxDustHTLCExposure_FeeRateMultiplier(final BigInt field0) = + _$MaxDustHTLCExposure_FeeRateMultiplierImpl; + const MaxDustHTLCExposure_FeeRateMultiplier._() : super._(); - LdkMnemonic get mnemonic; - String? get passphrase; + @override + BigInt get field0; + @override @JsonKey(ignore: true) - _$$EntropySourceConfig_Bip39MnemonicImplCopyWith< - _$EntropySourceConfig_Bip39MnemonicImpl> + _$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWith< + _$MaxDustHTLCExposure_FeeRateMultiplierImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -mixin _$Event { +mixin _$PaymentKind { @optionalTypeArgs TResult when({ - 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() onchain, required TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo) - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt11, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits) + bolt11Jit, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage) + spontaneous, + required TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId) + bolt12Offer, + required TResult Function( + PaymentHash? hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt12Refund, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult? whenOrNull({ - 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()? onchain, TResult? Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult maybeWhen({ - 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()? onchain, TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, 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_ChannelReady value) channelReady, - required TResult Function(Event_ChannelClosed value) channelClosed, - required TResult Function(Event_ChannelPending value) channelPending, + required TResult Function(PaymentKind_Onchain value) onchain, + required TResult Function(PaymentKind_Bolt11 value) bolt11, + required TResult Function(PaymentKind_Bolt11Jit value) bolt11Jit, + required TResult Function(PaymentKind_Spontaneous value) spontaneous, + required TResult Function(PaymentKind_Bolt12Offer value) bolt12Offer, + required TResult Function(PaymentKind_Bolt12Refund value) bolt12Refund, }) => 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_ChannelReady value)? channelReady, - TResult? Function(Event_ChannelClosed value)? channelClosed, - TResult? Function(Event_ChannelPending value)? channelPending, + TResult? Function(PaymentKind_Onchain value)? onchain, + TResult? Function(PaymentKind_Bolt11 value)? bolt11, + TResult? Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult? Function(PaymentKind_Spontaneous value)? spontaneous, + TResult? Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult? Function(PaymentKind_Bolt12Refund value)? bolt12Refund, }) => 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_ChannelReady value)? channelReady, - TResult Function(Event_ChannelClosed value)? channelClosed, - TResult Function(Event_ChannelPending value)? channelPending, + TResult Function(PaymentKind_Onchain value)? onchain, + TResult Function(PaymentKind_Bolt11 value)? bolt11, + TResult Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult Function(PaymentKind_Spontaneous value)? spontaneous, + TResult Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult Function(PaymentKind_Bolt12Refund value)? bolt12Refund, required TResult orElse(), }) => throw _privateConstructorUsedError; } /// @nodoc -abstract class $EventCopyWith<$Res> { - factory $EventCopyWith(Event value, $Res Function(Event) then) = - _$EventCopyWithImpl<$Res, Event>; +abstract class $PaymentKindCopyWith<$Res> { + factory $PaymentKindCopyWith( + PaymentKind value, $Res Function(PaymentKind) then) = + _$PaymentKindCopyWithImpl<$Res, PaymentKind>; } /// @nodoc -class _$EventCopyWithImpl<$Res, $Val extends Event> - implements $EventCopyWith<$Res> { - _$EventCopyWithImpl(this._value, this._then); +class _$PaymentKindCopyWithImpl<$Res, $Val extends PaymentKind> + implements $PaymentKindCopyWith<$Res> { + _$PaymentKindCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; @@ -876,141 +8816,105 @@ class _$EventCopyWithImpl<$Res, $Val extends Event> } /// @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}); +abstract class _$$PaymentKind_OnchainImplCopyWith<$Res> { + factory _$$PaymentKind_OnchainImplCopyWith(_$PaymentKind_OnchainImpl value, + $Res Function(_$PaymentKind_OnchainImpl) then) = + __$$PaymentKind_OnchainImplCopyWithImpl<$Res>; } /// @nodoc -class __$$Event_PaymentSuccessfulImplCopyWithImpl<$Res> - extends _$EventCopyWithImpl<$Res, _$Event_PaymentSuccessfulImpl> - implements _$$Event_PaymentSuccessfulImplCopyWith<$Res> { - __$$Event_PaymentSuccessfulImplCopyWithImpl( - _$Event_PaymentSuccessfulImpl _value, - $Res Function(_$Event_PaymentSuccessfulImpl) _then) +class __$$PaymentKind_OnchainImplCopyWithImpl<$Res> + extends _$PaymentKindCopyWithImpl<$Res, _$PaymentKind_OnchainImpl> + implements _$$PaymentKind_OnchainImplCopyWith<$Res> { + __$$PaymentKind_OnchainImplCopyWithImpl(_$PaymentKind_OnchainImpl _value, + $Res Function(_$PaymentKind_OnchainImpl) _then) : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentHash = null, - }) { - return _then(_$Event_PaymentSuccessfulImpl( - paymentHash: null == paymentHash - ? _value.paymentHash - : paymentHash // ignore: cast_nullable_to_non_nullable - as PaymentHash, - )); - } } /// @nodoc -class _$Event_PaymentSuccessfulImpl extends Event_PaymentSuccessful { - const _$Event_PaymentSuccessfulImpl({required this.paymentHash}) : super._(); - - /// The hash of the payment. - @override - final PaymentHash paymentHash; +class _$PaymentKind_OnchainImpl extends PaymentKind_Onchain { + const _$PaymentKind_OnchainImpl() : super._(); @override String toString() { - return 'Event.paymentSuccessful(paymentHash: $paymentHash)'; + return 'PaymentKind.onchain()'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$Event_PaymentSuccessfulImpl && - (identical(other.paymentHash, paymentHash) || - other.paymentHash == paymentHash)); + other is _$PaymentKind_OnchainImpl); } @override - int get hashCode => Object.hash(runtimeType, paymentHash); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$Event_PaymentSuccessfulImplCopyWith<_$Event_PaymentSuccessfulImpl> - get copyWith => __$$Event_PaymentSuccessfulImplCopyWithImpl< - _$Event_PaymentSuccessfulImpl>(this, _$identity); + int get hashCode => runtimeType.hashCode; @override @optionalTypeArgs TResult when({ - 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() onchain, required TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo) - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt11, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits) + bolt11Jit, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage) + spontaneous, + required TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId) + bolt12Offer, + required TResult Function( + PaymentHash? hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt12Refund, }) { - return paymentSuccessful(paymentHash); + return onchain(); } @override @optionalTypeArgs TResult? whenOrNull({ - 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()? onchain, TResult? Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, }) { - return paymentSuccessful?.call(paymentHash); + return onchain?.call(); } @override @optionalTypeArgs TResult maybeWhen({ - 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()? onchain, TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, required TResult orElse(), }) { - if (paymentSuccessful != null) { - return paymentSuccessful(paymentHash); + if (onchain != null) { + return onchain(); } return orElse(); } @@ -1018,193 +8922,203 @@ class _$Event_PaymentSuccessfulImpl extends Event_PaymentSuccessful { @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_ChannelReady value) channelReady, - required TResult Function(Event_ChannelClosed value) channelClosed, - required TResult Function(Event_ChannelPending value) channelPending, + required TResult Function(PaymentKind_Onchain value) onchain, + required TResult Function(PaymentKind_Bolt11 value) bolt11, + required TResult Function(PaymentKind_Bolt11Jit value) bolt11Jit, + required TResult Function(PaymentKind_Spontaneous value) spontaneous, + required TResult Function(PaymentKind_Bolt12Offer value) bolt12Offer, + required TResult Function(PaymentKind_Bolt12Refund value) bolt12Refund, }) { - return paymentSuccessful(this); + return onchain(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_ChannelReady value)? channelReady, - TResult? Function(Event_ChannelClosed value)? channelClosed, - TResult? Function(Event_ChannelPending value)? channelPending, + TResult? Function(PaymentKind_Onchain value)? onchain, + TResult? Function(PaymentKind_Bolt11 value)? bolt11, + TResult? Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult? Function(PaymentKind_Spontaneous value)? spontaneous, + TResult? Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult? Function(PaymentKind_Bolt12Refund value)? bolt12Refund, }) { - return paymentSuccessful?.call(this); + return onchain?.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_ChannelReady value)? channelReady, - TResult Function(Event_ChannelClosed value)? channelClosed, - TResult Function(Event_ChannelPending value)? channelPending, + TResult Function(PaymentKind_Onchain value)? onchain, + TResult Function(PaymentKind_Bolt11 value)? bolt11, + TResult Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult Function(PaymentKind_Spontaneous value)? spontaneous, + TResult Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult Function(PaymentKind_Bolt12Refund value)? bolt12Refund, required TResult orElse(), }) { - if (paymentSuccessful != null) { - return paymentSuccessful(this); + if (onchain != null) { + return onchain(this); } return orElse(); } } -abstract class Event_PaymentSuccessful extends Event { - const factory Event_PaymentSuccessful( - {required final PaymentHash paymentHash}) = _$Event_PaymentSuccessfulImpl; - const Event_PaymentSuccessful._() : super._(); - - /// The hash of the payment. - PaymentHash get paymentHash; - @JsonKey(ignore: true) - _$$Event_PaymentSuccessfulImplCopyWith<_$Event_PaymentSuccessfulImpl> - get copyWith => throw _privateConstructorUsedError; +abstract class PaymentKind_Onchain extends PaymentKind { + const factory PaymentKind_Onchain() = _$PaymentKind_OnchainImpl; + const PaymentKind_Onchain._() : super._(); } /// @nodoc -abstract class _$$Event_PaymentFailedImplCopyWith<$Res> { - factory _$$Event_PaymentFailedImplCopyWith(_$Event_PaymentFailedImpl value, - $Res Function(_$Event_PaymentFailedImpl) then) = - __$$Event_PaymentFailedImplCopyWithImpl<$Res>; +abstract class _$$PaymentKind_Bolt11ImplCopyWith<$Res> { + factory _$$PaymentKind_Bolt11ImplCopyWith(_$PaymentKind_Bolt11Impl value, + $Res Function(_$PaymentKind_Bolt11Impl) then) = + __$$PaymentKind_Bolt11ImplCopyWithImpl<$Res>; @useResult - $Res call({PaymentHash paymentHash}); + $Res call( + {PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret}); } /// @nodoc -class __$$Event_PaymentFailedImplCopyWithImpl<$Res> - extends _$EventCopyWithImpl<$Res, _$Event_PaymentFailedImpl> - implements _$$Event_PaymentFailedImplCopyWith<$Res> { - __$$Event_PaymentFailedImplCopyWithImpl(_$Event_PaymentFailedImpl _value, - $Res Function(_$Event_PaymentFailedImpl) _then) +class __$$PaymentKind_Bolt11ImplCopyWithImpl<$Res> + extends _$PaymentKindCopyWithImpl<$Res, _$PaymentKind_Bolt11Impl> + implements _$$PaymentKind_Bolt11ImplCopyWith<$Res> { + __$$PaymentKind_Bolt11ImplCopyWithImpl(_$PaymentKind_Bolt11Impl _value, + $Res Function(_$PaymentKind_Bolt11Impl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override $Res call({ - Object? paymentHash = null, - }) { - return _then(_$Event_PaymentFailedImpl( - paymentHash: null == paymentHash - ? _value.paymentHash - : paymentHash // ignore: cast_nullable_to_non_nullable + Object? hash = null, + Object? preimage = freezed, + Object? secret = freezed, + }) { + return _then(_$PaymentKind_Bolt11Impl( + hash: null == hash + ? _value.hash + : hash // ignore: cast_nullable_to_non_nullable as PaymentHash, + preimage: freezed == preimage + ? _value.preimage + : preimage // ignore: cast_nullable_to_non_nullable + as PaymentPreimage?, + secret: freezed == secret + ? _value.secret + : secret // ignore: cast_nullable_to_non_nullable + as PaymentSecret?, )); } } /// @nodoc -class _$Event_PaymentFailedImpl extends Event_PaymentFailed { - const _$Event_PaymentFailedImpl({required this.paymentHash}) : super._(); +class _$PaymentKind_Bolt11Impl extends PaymentKind_Bolt11 { + const _$PaymentKind_Bolt11Impl( + {required this.hash, this.preimage, this.secret}) + : super._(); - /// The hash of the payment. + /// The payment hash, i.e., the hash of the `preimage`. @override - final PaymentHash paymentHash; + final PaymentHash hash; + + /// The pre-image used by the payment. + @override + final PaymentPreimage? preimage; + + /// The secret used by the payment. + @override + final PaymentSecret? secret; @override String toString() { - return 'Event.paymentFailed(paymentHash: $paymentHash)'; + return 'PaymentKind.bolt11(hash: $hash, preimage: $preimage, secret: $secret)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$Event_PaymentFailedImpl && - (identical(other.paymentHash, paymentHash) || - other.paymentHash == paymentHash)); + other is _$PaymentKind_Bolt11Impl && + (identical(other.hash, hash) || other.hash == hash) && + (identical(other.preimage, preimage) || + other.preimage == preimage) && + (identical(other.secret, secret) || other.secret == secret)); } @override - int get hashCode => Object.hash(runtimeType, paymentHash); + int get hashCode => Object.hash(runtimeType, hash, preimage, secret); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$Event_PaymentFailedImplCopyWith<_$Event_PaymentFailedImpl> get copyWith => - __$$Event_PaymentFailedImplCopyWithImpl<_$Event_PaymentFailedImpl>( + _$$PaymentKind_Bolt11ImplCopyWith<_$PaymentKind_Bolt11Impl> get copyWith => + __$$PaymentKind_Bolt11ImplCopyWithImpl<_$PaymentKind_Bolt11Impl>( this, _$identity); @override @optionalTypeArgs TResult when({ - 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() onchain, required TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo) - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt11, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits) + bolt11Jit, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage) + spontaneous, + required TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId) + bolt12Offer, + required TResult Function( + PaymentHash? hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt12Refund, }) { - return paymentFailed(paymentHash); + return bolt11(hash, preimage, secret); } @override @optionalTypeArgs TResult? whenOrNull({ - 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()? onchain, TResult? Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, }) { - return paymentFailed?.call(paymentHash); + return bolt11?.call(hash, preimage, secret); } @override - @optionalTypeArgs - TResult maybeWhen({ - 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, + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? onchain, TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, required TResult orElse(), }) { - if (paymentFailed != null) { - return paymentFailed(paymentHash); + if (bolt11 != null) { + return bolt11(hash, preimage, secret); } return orElse(); } @@ -1212,207 +9126,241 @@ class _$Event_PaymentFailedImpl extends Event_PaymentFailed { @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_ChannelReady value) channelReady, - required TResult Function(Event_ChannelClosed value) channelClosed, - required TResult Function(Event_ChannelPending value) channelPending, + required TResult Function(PaymentKind_Onchain value) onchain, + required TResult Function(PaymentKind_Bolt11 value) bolt11, + required TResult Function(PaymentKind_Bolt11Jit value) bolt11Jit, + required TResult Function(PaymentKind_Spontaneous value) spontaneous, + required TResult Function(PaymentKind_Bolt12Offer value) bolt12Offer, + required TResult Function(PaymentKind_Bolt12Refund value) bolt12Refund, }) { - return paymentFailed(this); + return bolt11(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_ChannelReady value)? channelReady, - TResult? Function(Event_ChannelClosed value)? channelClosed, - TResult? Function(Event_ChannelPending value)? channelPending, + TResult? Function(PaymentKind_Onchain value)? onchain, + TResult? Function(PaymentKind_Bolt11 value)? bolt11, + TResult? Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult? Function(PaymentKind_Spontaneous value)? spontaneous, + TResult? Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult? Function(PaymentKind_Bolt12Refund value)? bolt12Refund, }) { - return paymentFailed?.call(this); + return bolt11?.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_ChannelReady value)? channelReady, - TResult Function(Event_ChannelClosed value)? channelClosed, - TResult Function(Event_ChannelPending value)? channelPending, + TResult Function(PaymentKind_Onchain value)? onchain, + TResult Function(PaymentKind_Bolt11 value)? bolt11, + TResult Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult Function(PaymentKind_Spontaneous value)? spontaneous, + TResult Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult Function(PaymentKind_Bolt12Refund value)? bolt12Refund, required TResult orElse(), }) { - if (paymentFailed != null) { - return paymentFailed(this); + if (bolt11 != null) { + return bolt11(this); } return orElse(); } } -abstract class Event_PaymentFailed extends Event { - const factory Event_PaymentFailed({required final PaymentHash paymentHash}) = - _$Event_PaymentFailedImpl; - const Event_PaymentFailed._() : super._(); +abstract class PaymentKind_Bolt11 extends PaymentKind { + const factory PaymentKind_Bolt11( + {required final PaymentHash hash, + final PaymentPreimage? preimage, + final PaymentSecret? secret}) = _$PaymentKind_Bolt11Impl; + const PaymentKind_Bolt11._() : super._(); - /// The hash of the payment. - PaymentHash get paymentHash; + /// The payment hash, i.e., the hash of the `preimage`. + PaymentHash get hash; + + /// The pre-image used by the payment. + PaymentPreimage? get preimage; + + /// The secret used by the payment. + PaymentSecret? get secret; @JsonKey(ignore: true) - _$$Event_PaymentFailedImplCopyWith<_$Event_PaymentFailedImpl> get copyWith => + _$$PaymentKind_Bolt11ImplCopyWith<_$PaymentKind_Bolt11Impl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$Event_PaymentReceivedImplCopyWith<$Res> { - factory _$$Event_PaymentReceivedImplCopyWith( - _$Event_PaymentReceivedImpl value, - $Res Function(_$Event_PaymentReceivedImpl) then) = - __$$Event_PaymentReceivedImplCopyWithImpl<$Res>; +abstract class _$$PaymentKind_Bolt11JitImplCopyWith<$Res> { + factory _$$PaymentKind_Bolt11JitImplCopyWith( + _$PaymentKind_Bolt11JitImpl value, + $Res Function(_$PaymentKind_Bolt11JitImpl) then) = + __$$PaymentKind_Bolt11JitImplCopyWithImpl<$Res>; @useResult - $Res call({PaymentHash paymentHash, int amountMsat}); + $Res call( + {PaymentHash hash, + PaymentPreimage? preimage, + PaymentSecret? secret, + LSPFeeLimits lspFeeLimits}); } /// @nodoc -class __$$Event_PaymentReceivedImplCopyWithImpl<$Res> - extends _$EventCopyWithImpl<$Res, _$Event_PaymentReceivedImpl> - implements _$$Event_PaymentReceivedImplCopyWith<$Res> { - __$$Event_PaymentReceivedImplCopyWithImpl(_$Event_PaymentReceivedImpl _value, - $Res Function(_$Event_PaymentReceivedImpl) _then) +class __$$PaymentKind_Bolt11JitImplCopyWithImpl<$Res> + extends _$PaymentKindCopyWithImpl<$Res, _$PaymentKind_Bolt11JitImpl> + implements _$$PaymentKind_Bolt11JitImplCopyWith<$Res> { + __$$PaymentKind_Bolt11JitImplCopyWithImpl(_$PaymentKind_Bolt11JitImpl _value, + $Res Function(_$PaymentKind_Bolt11JitImpl) _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 + Object? hash = null, + Object? preimage = freezed, + Object? secret = freezed, + Object? lspFeeLimits = null, + }) { + return _then(_$PaymentKind_Bolt11JitImpl( + hash: null == hash + ? _value.hash + : hash // ignore: cast_nullable_to_non_nullable as PaymentHash, - amountMsat: null == amountMsat - ? _value.amountMsat - : amountMsat // ignore: cast_nullable_to_non_nullable - as int, + preimage: freezed == preimage + ? _value.preimage + : preimage // ignore: cast_nullable_to_non_nullable + as PaymentPreimage?, + secret: freezed == secret + ? _value.secret + : secret // ignore: cast_nullable_to_non_nullable + as PaymentSecret?, + lspFeeLimits: null == lspFeeLimits + ? _value.lspFeeLimits + : lspFeeLimits // ignore: cast_nullable_to_non_nullable + as LSPFeeLimits, )); } } /// @nodoc -class _$Event_PaymentReceivedImpl extends Event_PaymentReceived { - const _$Event_PaymentReceivedImpl( - {required this.paymentHash, required this.amountMsat}) +class _$PaymentKind_Bolt11JitImpl extends PaymentKind_Bolt11Jit { + const _$PaymentKind_Bolt11JitImpl( + {required this.hash, + this.preimage, + this.secret, + required this.lspFeeLimits}) : super._(); - /// The hash of the payment. + /// The payment hash, i.e., the hash of the `preimage`. @override - final PaymentHash paymentHash; + final PaymentHash hash; - /// The value, in thousandths of a satoshi, that has been received. + /// The pre-image used by the payment. + @override + final PaymentPreimage? preimage; + + /// The secret used by the payment. + @override + final PaymentSecret? secret; + + /// Limits applying to how much fee we allow an LSP to deduct from the payment amount. + /// + /// Allowing them to deduct this fee from the first inbound payment will pay for the LSP's + /// channel opening fees. + /// @override - final int amountMsat; + final LSPFeeLimits lspFeeLimits; @override String toString() { - return 'Event.paymentReceived(paymentHash: $paymentHash, amountMsat: $amountMsat)'; + return 'PaymentKind.bolt11Jit(hash: $hash, preimage: $preimage, secret: $secret, lspFeeLimits: $lspFeeLimits)'; } @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)); + other is _$PaymentKind_Bolt11JitImpl && + (identical(other.hash, hash) || other.hash == hash) && + (identical(other.preimage, preimage) || + other.preimage == preimage) && + (identical(other.secret, secret) || other.secret == secret) && + (identical(other.lspFeeLimits, lspFeeLimits) || + other.lspFeeLimits == lspFeeLimits)); } @override - int get hashCode => Object.hash(runtimeType, paymentHash, amountMsat); + int get hashCode => + Object.hash(runtimeType, hash, preimage, secret, lspFeeLimits); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$Event_PaymentReceivedImplCopyWith<_$Event_PaymentReceivedImpl> - get copyWith => __$$Event_PaymentReceivedImplCopyWithImpl< - _$Event_PaymentReceivedImpl>(this, _$identity); + _$$PaymentKind_Bolt11JitImplCopyWith<_$PaymentKind_Bolt11JitImpl> + get copyWith => __$$PaymentKind_Bolt11JitImplCopyWithImpl< + _$PaymentKind_Bolt11JitImpl>(this, _$identity); @override @optionalTypeArgs TResult when({ - 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() onchain, required TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo) - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt11, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits) + bolt11Jit, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage) + spontaneous, + required TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId) + bolt12Offer, + required TResult Function( + PaymentHash? hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt12Refund, }) { - return paymentReceived(paymentHash, amountMsat); + return bolt11Jit(hash, preimage, secret, lspFeeLimits); } @override @optionalTypeArgs TResult? whenOrNull({ - 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()? onchain, TResult? Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, }) { - return paymentReceived?.call(paymentHash, amountMsat); + return bolt11Jit?.call(hash, preimage, secret, lspFeeLimits); } @override @optionalTypeArgs TResult maybeWhen({ - 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()? onchain, TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, required TResult orElse(), }) { - if (paymentReceived != null) { - return paymentReceived(paymentHash, amountMsat); + if (bolt11Jit != null) { + return bolt11Jit(hash, preimage, secret, lspFeeLimits); } return orElse(); } @@ -1420,225 +9368,216 @@ class _$Event_PaymentReceivedImpl extends Event_PaymentReceived { @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_ChannelReady value) channelReady, - required TResult Function(Event_ChannelClosed value) channelClosed, - required TResult Function(Event_ChannelPending value) channelPending, + required TResult Function(PaymentKind_Onchain value) onchain, + required TResult Function(PaymentKind_Bolt11 value) bolt11, + required TResult Function(PaymentKind_Bolt11Jit value) bolt11Jit, + required TResult Function(PaymentKind_Spontaneous value) spontaneous, + required TResult Function(PaymentKind_Bolt12Offer value) bolt12Offer, + required TResult Function(PaymentKind_Bolt12Refund value) bolt12Refund, }) { - return paymentReceived(this); + return bolt11Jit(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_ChannelReady value)? channelReady, - TResult? Function(Event_ChannelClosed value)? channelClosed, - TResult? Function(Event_ChannelPending value)? channelPending, + TResult? Function(PaymentKind_Onchain value)? onchain, + TResult? Function(PaymentKind_Bolt11 value)? bolt11, + TResult? Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult? Function(PaymentKind_Spontaneous value)? spontaneous, + TResult? Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult? Function(PaymentKind_Bolt12Refund value)? bolt12Refund, }) { - return paymentReceived?.call(this); + return bolt11Jit?.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_ChannelReady value)? channelReady, - TResult Function(Event_ChannelClosed value)? channelClosed, - TResult Function(Event_ChannelPending value)? channelPending, + TResult Function(PaymentKind_Onchain value)? onchain, + TResult Function(PaymentKind_Bolt11 value)? bolt11, + TResult Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult Function(PaymentKind_Spontaneous value)? spontaneous, + TResult Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult Function(PaymentKind_Bolt12Refund value)? bolt12Refund, required TResult orElse(), }) { - if (paymentReceived != null) { - return paymentReceived(this); + if (bolt11Jit != null) { + return bolt11Jit(this); } return orElse(); } } -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 hash of the payment. - PaymentHash get paymentHash; - - /// The value, in thousandths of a satoshi, that has been received. - int get amountMsat; +abstract class PaymentKind_Bolt11Jit extends PaymentKind { + const factory PaymentKind_Bolt11Jit( + {required final PaymentHash hash, + final PaymentPreimage? preimage, + final PaymentSecret? secret, + required final LSPFeeLimits lspFeeLimits}) = _$PaymentKind_Bolt11JitImpl; + const PaymentKind_Bolt11Jit._() : super._(); + + /// The payment hash, i.e., the hash of the `preimage`. + PaymentHash get hash; + + /// The pre-image used by the payment. + PaymentPreimage? get preimage; + + /// The secret used by the payment. + PaymentSecret? get secret; + + /// Limits applying to how much fee we allow an LSP to deduct from the payment amount. + /// + /// Allowing them to deduct this fee from the first inbound payment will pay for the LSP's + /// channel opening fees. + /// + LSPFeeLimits get lspFeeLimits; @JsonKey(ignore: true) - _$$Event_PaymentReceivedImplCopyWith<_$Event_PaymentReceivedImpl> + _$$PaymentKind_Bolt11JitImplCopyWith<_$PaymentKind_Bolt11JitImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$Event_ChannelReadyImplCopyWith<$Res> { - factory _$$Event_ChannelReadyImplCopyWith(_$Event_ChannelReadyImpl value, - $Res Function(_$Event_ChannelReadyImpl) then) = - __$$Event_ChannelReadyImplCopyWithImpl<$Res>; +abstract class _$$PaymentKind_SpontaneousImplCopyWith<$Res> { + factory _$$PaymentKind_SpontaneousImplCopyWith( + _$PaymentKind_SpontaneousImpl value, + $Res Function(_$PaymentKind_SpontaneousImpl) then) = + __$$PaymentKind_SpontaneousImplCopyWithImpl<$Res>; @useResult - $Res call( - {ChannelId channelId, - UserChannelId userChannelId, - PublicKey? counterpartyNodeId}); + $Res call({PaymentHash hash, PaymentPreimage? preimage}); } /// @nodoc -class __$$Event_ChannelReadyImplCopyWithImpl<$Res> - extends _$EventCopyWithImpl<$Res, _$Event_ChannelReadyImpl> - implements _$$Event_ChannelReadyImplCopyWith<$Res> { - __$$Event_ChannelReadyImplCopyWithImpl(_$Event_ChannelReadyImpl _value, - $Res Function(_$Event_ChannelReadyImpl) _then) +class __$$PaymentKind_SpontaneousImplCopyWithImpl<$Res> + extends _$PaymentKindCopyWithImpl<$Res, _$PaymentKind_SpontaneousImpl> + implements _$$PaymentKind_SpontaneousImplCopyWith<$Res> { + __$$PaymentKind_SpontaneousImplCopyWithImpl( + _$PaymentKind_SpontaneousImpl _value, + $Res Function(_$PaymentKind_SpontaneousImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override $Res call({ - Object? channelId = null, - Object? userChannelId = null, - Object? counterpartyNodeId = freezed, + Object? hash = null, + Object? preimage = 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?, + return _then(_$PaymentKind_SpontaneousImpl( + hash: null == hash + ? _value.hash + : hash // ignore: cast_nullable_to_non_nullable + as PaymentHash, + preimage: freezed == preimage + ? _value.preimage + : preimage // ignore: cast_nullable_to_non_nullable + as PaymentPreimage?, )); } } /// @nodoc -class _$Event_ChannelReadyImpl extends Event_ChannelReady { - const _$Event_ChannelReadyImpl( - {required this.channelId, - required this.userChannelId, - this.counterpartyNodeId}) +class _$PaymentKind_SpontaneousImpl extends PaymentKind_Spontaneous { + const _$PaymentKind_SpontaneousImpl({required this.hash, this.preimage}) : super._(); - /// The channel_id of the channel. + /// The payment hash, i.e., the hash of the `preimage`. @override - final ChannelId channelId; + final PaymentHash hash; - /// The user_channel_id of the channel. + /// The pre-image used by the payment. @override - final UserChannelId userChannelId; - @override - final PublicKey? counterpartyNodeId; + final PaymentPreimage? preimage; @override String toString() { - return 'Event.channelReady(channelId: $channelId, userChannelId: $userChannelId, counterpartyNodeId: $counterpartyNodeId)'; + return 'PaymentKind.spontaneous(hash: $hash, preimage: $preimage)'; } @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)); + other is _$PaymentKind_SpontaneousImpl && + (identical(other.hash, hash) || other.hash == hash) && + (identical(other.preimage, preimage) || + other.preimage == preimage)); } @override - int get hashCode => - Object.hash(runtimeType, channelId, userChannelId, counterpartyNodeId); + int get hashCode => Object.hash(runtimeType, hash, preimage); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$Event_ChannelReadyImplCopyWith<_$Event_ChannelReadyImpl> get copyWith => - __$$Event_ChannelReadyImplCopyWithImpl<_$Event_ChannelReadyImpl>( - this, _$identity); + _$$PaymentKind_SpontaneousImplCopyWith<_$PaymentKind_SpontaneousImpl> + get copyWith => __$$PaymentKind_SpontaneousImplCopyWithImpl< + _$PaymentKind_SpontaneousImpl>(this, _$identity); @override @optionalTypeArgs TResult when({ - 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() onchain, required TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo) - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt11, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits) + bolt11Jit, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage) + spontaneous, + required TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId) + bolt12Offer, + required TResult Function( + PaymentHash? hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt12Refund, }) { - return channelReady(channelId, userChannelId, counterpartyNodeId); + return spontaneous(hash, preimage); } @override @optionalTypeArgs TResult? whenOrNull({ - 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()? onchain, TResult? Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, }) { - return channelReady?.call(channelId, userChannelId, counterpartyNodeId); + return spontaneous?.call(hash, preimage); } @override @optionalTypeArgs TResult maybeWhen({ - 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()? onchain, TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, required TResult orElse(), }) { - if (channelReady != null) { - return channelReady(channelId, userChannelId, counterpartyNodeId); + if (spontaneous != null) { + return spontaneous(hash, preimage); } return orElse(); } @@ -1646,227 +9585,229 @@ class _$Event_ChannelReadyImpl extends Event_ChannelReady { @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_ChannelReady value) channelReady, - required TResult Function(Event_ChannelClosed value) channelClosed, - required TResult Function(Event_ChannelPending value) channelPending, + required TResult Function(PaymentKind_Onchain value) onchain, + required TResult Function(PaymentKind_Bolt11 value) bolt11, + required TResult Function(PaymentKind_Bolt11Jit value) bolt11Jit, + required TResult Function(PaymentKind_Spontaneous value) spontaneous, + required TResult Function(PaymentKind_Bolt12Offer value) bolt12Offer, + required TResult Function(PaymentKind_Bolt12Refund value) bolt12Refund, }) { - return channelReady(this); + return spontaneous(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_ChannelReady value)? channelReady, - TResult? Function(Event_ChannelClosed value)? channelClosed, - TResult? Function(Event_ChannelPending value)? channelPending, + TResult? mapOrNull({ + TResult? Function(PaymentKind_Onchain value)? onchain, + TResult? Function(PaymentKind_Bolt11 value)? bolt11, + TResult? Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult? Function(PaymentKind_Spontaneous value)? spontaneous, + TResult? Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult? Function(PaymentKind_Bolt12Refund value)? bolt12Refund, }) { - return channelReady?.call(this); + return spontaneous?.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_ChannelReady value)? channelReady, - TResult Function(Event_ChannelClosed value)? channelClosed, - TResult Function(Event_ChannelPending value)? channelPending, + TResult Function(PaymentKind_Onchain value)? onchain, + TResult Function(PaymentKind_Bolt11 value)? bolt11, + TResult Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult Function(PaymentKind_Spontaneous value)? spontaneous, + TResult Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult Function(PaymentKind_Bolt12Refund value)? bolt12Refund, required TResult orElse(), }) { - if (channelReady != null) { - return channelReady(this); + if (spontaneous != null) { + return spontaneous(this); } return orElse(); } } -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._(); +abstract class PaymentKind_Spontaneous extends PaymentKind { + const factory PaymentKind_Spontaneous( + {required final PaymentHash hash, + final PaymentPreimage? preimage}) = _$PaymentKind_SpontaneousImpl; + const PaymentKind_Spontaneous._() : super._(); - /// The channel_id of the channel. - ChannelId get channelId; + /// The payment hash, i.e., the hash of the `preimage`. + PaymentHash get hash; - /// The user_channel_id of the channel. - UserChannelId get userChannelId; - PublicKey? get counterpartyNodeId; + /// The pre-image used by the payment. + PaymentPreimage? get preimage; @JsonKey(ignore: true) - _$$Event_ChannelReadyImplCopyWith<_$Event_ChannelReadyImpl> get copyWith => - throw _privateConstructorUsedError; + _$$PaymentKind_SpontaneousImplCopyWith<_$PaymentKind_SpontaneousImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$Event_ChannelClosedImplCopyWith<$Res> { - factory _$$Event_ChannelClosedImplCopyWith(_$Event_ChannelClosedImpl value, - $Res Function(_$Event_ChannelClosedImpl) then) = - __$$Event_ChannelClosedImplCopyWithImpl<$Res>; +abstract class _$$PaymentKind_Bolt12OfferImplCopyWith<$Res> { + factory _$$PaymentKind_Bolt12OfferImplCopyWith( + _$PaymentKind_Bolt12OfferImpl value, + $Res Function(_$PaymentKind_Bolt12OfferImpl) then) = + __$$PaymentKind_Bolt12OfferImplCopyWithImpl<$Res>; @useResult $Res call( - {ChannelId channelId, - UserChannelId userChannelId, - PublicKey? counterpartyNodeId}); + {PaymentHash? hash, + PaymentPreimage? preimage, + PaymentSecret? secret, + OfferId offerId}); } /// @nodoc -class __$$Event_ChannelClosedImplCopyWithImpl<$Res> - extends _$EventCopyWithImpl<$Res, _$Event_ChannelClosedImpl> - implements _$$Event_ChannelClosedImplCopyWith<$Res> { - __$$Event_ChannelClosedImplCopyWithImpl(_$Event_ChannelClosedImpl _value, - $Res Function(_$Event_ChannelClosedImpl) _then) +class __$$PaymentKind_Bolt12OfferImplCopyWithImpl<$Res> + extends _$PaymentKindCopyWithImpl<$Res, _$PaymentKind_Bolt12OfferImpl> + implements _$$PaymentKind_Bolt12OfferImplCopyWith<$Res> { + __$$PaymentKind_Bolt12OfferImplCopyWithImpl( + _$PaymentKind_Bolt12OfferImpl _value, + $Res Function(_$PaymentKind_Bolt12OfferImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override $Res call({ - Object? channelId = null, - Object? userChannelId = null, - Object? counterpartyNodeId = 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?, + Object? hash = freezed, + Object? preimage = freezed, + Object? secret = freezed, + Object? offerId = null, + }) { + return _then(_$PaymentKind_Bolt12OfferImpl( + hash: freezed == hash + ? _value.hash + : hash // ignore: cast_nullable_to_non_nullable + as PaymentHash?, + preimage: freezed == preimage + ? _value.preimage + : preimage // ignore: cast_nullable_to_non_nullable + as PaymentPreimage?, + secret: freezed == secret + ? _value.secret + : secret // ignore: cast_nullable_to_non_nullable + as PaymentSecret?, + offerId: null == offerId + ? _value.offerId + : offerId // ignore: cast_nullable_to_non_nullable + as OfferId, )); } } /// @nodoc -class _$Event_ChannelClosedImpl extends Event_ChannelClosed { - const _$Event_ChannelClosedImpl( - {required this.channelId, - required this.userChannelId, - this.counterpartyNodeId}) +class _$PaymentKind_Bolt12OfferImpl extends PaymentKind_Bolt12Offer { + const _$PaymentKind_Bolt12OfferImpl( + {this.hash, this.preimage, this.secret, required this.offerId}) : super._(); - /// The channel_id of the channel. + /// The payment hash, i.e., the hash of the `preimage`. @override - final ChannelId channelId; + final PaymentHash? hash; - /// The user_channel_id of the channel. + /// The pre-image used by the payment. @override - final UserChannelId userChannelId; + final PaymentPreimage? preimage; + + /// The secret used by the payment. @override - final PublicKey? counterpartyNodeId; + final PaymentSecret? secret; + + /// The ID of the offer this payment is for. + @override + final OfferId offerId; @override String toString() { - return 'Event.channelClosed(channelId: $channelId, userChannelId: $userChannelId, counterpartyNodeId: $counterpartyNodeId)'; + return 'PaymentKind.bolt12Offer(hash: $hash, preimage: $preimage, secret: $secret, offerId: $offerId)'; } @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)); + other is _$PaymentKind_Bolt12OfferImpl && + (identical(other.hash, hash) || other.hash == hash) && + (identical(other.preimage, preimage) || + other.preimage == preimage) && + (identical(other.secret, secret) || other.secret == secret) && + (identical(other.offerId, offerId) || other.offerId == offerId)); } @override - int get hashCode => - Object.hash(runtimeType, channelId, userChannelId, counterpartyNodeId); + int get hashCode => Object.hash(runtimeType, hash, preimage, secret, offerId); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$Event_ChannelClosedImplCopyWith<_$Event_ChannelClosedImpl> get copyWith => - __$$Event_ChannelClosedImplCopyWithImpl<_$Event_ChannelClosedImpl>( - this, _$identity); + _$$PaymentKind_Bolt12OfferImplCopyWith<_$PaymentKind_Bolt12OfferImpl> + get copyWith => __$$PaymentKind_Bolt12OfferImplCopyWithImpl< + _$PaymentKind_Bolt12OfferImpl>(this, _$identity); @override @optionalTypeArgs TResult when({ - 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() onchain, required TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo) - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt11, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits) + bolt11Jit, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage) + spontaneous, + required TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId) + bolt12Offer, + required TResult Function( + PaymentHash? hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt12Refund, }) { - return channelClosed(channelId, userChannelId, counterpartyNodeId); + return bolt12Offer(hash, preimage, secret, offerId); } @override @optionalTypeArgs TResult? whenOrNull({ - 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()? onchain, TResult? Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, }) { - return channelClosed?.call(channelId, userChannelId, counterpartyNodeId); + return bolt12Offer?.call(hash, preimage, secret, offerId); } @override @optionalTypeArgs TResult maybeWhen({ - 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()? onchain, TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, required TResult orElse(), }) { - if (channelClosed != null) { - return channelClosed(channelId, userChannelId, counterpartyNodeId); + if (bolt12Offer != null) { + return bolt12Offer(hash, preimage, secret, offerId); } return orElse(); } @@ -1874,260 +9815,223 @@ class _$Event_ChannelClosedImpl extends Event_ChannelClosed { @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_ChannelReady value) channelReady, - required TResult Function(Event_ChannelClosed value) channelClosed, - required TResult Function(Event_ChannelPending value) channelPending, + required TResult Function(PaymentKind_Onchain value) onchain, + required TResult Function(PaymentKind_Bolt11 value) bolt11, + required TResult Function(PaymentKind_Bolt11Jit value) bolt11Jit, + required TResult Function(PaymentKind_Spontaneous value) spontaneous, + required TResult Function(PaymentKind_Bolt12Offer value) bolt12Offer, + required TResult Function(PaymentKind_Bolt12Refund value) bolt12Refund, }) { - return channelClosed(this); + return bolt12Offer(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_ChannelReady value)? channelReady, - TResult? Function(Event_ChannelClosed value)? channelClosed, - TResult? Function(Event_ChannelPending value)? channelPending, + TResult? Function(PaymentKind_Onchain value)? onchain, + TResult? Function(PaymentKind_Bolt11 value)? bolt11, + TResult? Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult? Function(PaymentKind_Spontaneous value)? spontaneous, + TResult? Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult? Function(PaymentKind_Bolt12Refund value)? bolt12Refund, }) { - return channelClosed?.call(this); + return bolt12Offer?.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_ChannelReady value)? channelReady, - TResult Function(Event_ChannelClosed value)? channelClosed, - TResult Function(Event_ChannelPending value)? channelPending, + TResult Function(PaymentKind_Onchain value)? onchain, + TResult Function(PaymentKind_Bolt11 value)? bolt11, + TResult Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult Function(PaymentKind_Spontaneous value)? spontaneous, + TResult Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult Function(PaymentKind_Bolt12Refund value)? bolt12Refund, required TResult orElse(), }) { - if (channelClosed != null) { - return channelClosed(this); + if (bolt12Offer != null) { + return bolt12Offer(this); } return orElse(); } } -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._(); +abstract class PaymentKind_Bolt12Offer extends PaymentKind { + const factory PaymentKind_Bolt12Offer( + {final PaymentHash? hash, + final PaymentPreimage? preimage, + final PaymentSecret? secret, + required final OfferId offerId}) = _$PaymentKind_Bolt12OfferImpl; + const PaymentKind_Bolt12Offer._() : super._(); - /// The channel_id of the channel. - ChannelId get channelId; + /// The payment hash, i.e., the hash of the `preimage`. + PaymentHash? get hash; - /// The user_channel_id of the channel. - UserChannelId get userChannelId; - PublicKey? get counterpartyNodeId; + /// The pre-image used by the payment. + PaymentPreimage? get preimage; + + /// The secret used by the payment. + PaymentSecret? get secret; + + /// The ID of the offer this payment is for. + OfferId get offerId; @JsonKey(ignore: true) - _$$Event_ChannelClosedImplCopyWith<_$Event_ChannelClosedImpl> get copyWith => - throw _privateConstructorUsedError; + _$$PaymentKind_Bolt12OfferImplCopyWith<_$PaymentKind_Bolt12OfferImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$Event_ChannelPendingImplCopyWith<$Res> { - factory _$$Event_ChannelPendingImplCopyWith(_$Event_ChannelPendingImpl value, - $Res Function(_$Event_ChannelPendingImpl) then) = - __$$Event_ChannelPendingImplCopyWithImpl<$Res>; +abstract class _$$PaymentKind_Bolt12RefundImplCopyWith<$Res> { + factory _$$PaymentKind_Bolt12RefundImplCopyWith( + _$PaymentKind_Bolt12RefundImpl value, + $Res Function(_$PaymentKind_Bolt12RefundImpl) then) = + __$$PaymentKind_Bolt12RefundImplCopyWithImpl<$Res>; @useResult $Res call( - {ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo}); + {PaymentHash? hash, PaymentPreimage? preimage, PaymentSecret? secret}); } /// @nodoc -class __$$Event_ChannelPendingImplCopyWithImpl<$Res> - extends _$EventCopyWithImpl<$Res, _$Event_ChannelPendingImpl> - implements _$$Event_ChannelPendingImplCopyWith<$Res> { - __$$Event_ChannelPendingImplCopyWithImpl(_$Event_ChannelPendingImpl _value, - $Res Function(_$Event_ChannelPendingImpl) _then) +class __$$PaymentKind_Bolt12RefundImplCopyWithImpl<$Res> + extends _$PaymentKindCopyWithImpl<$Res, _$PaymentKind_Bolt12RefundImpl> + implements _$$PaymentKind_Bolt12RefundImplCopyWith<$Res> { + __$$PaymentKind_Bolt12RefundImplCopyWithImpl( + _$PaymentKind_Bolt12RefundImpl _value, + $Res Function(_$PaymentKind_Bolt12RefundImpl) _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, + Object? hash = freezed, + Object? preimage = freezed, + Object? secret = freezed, + }) { + return _then(_$PaymentKind_Bolt12RefundImpl( + hash: freezed == hash + ? _value.hash + : hash // ignore: cast_nullable_to_non_nullable + as PaymentHash?, + preimage: freezed == preimage + ? _value.preimage + : preimage // ignore: cast_nullable_to_non_nullable + as PaymentPreimage?, + secret: freezed == secret + ? _value.secret + : secret // ignore: cast_nullable_to_non_nullable + as PaymentSecret?, )); } } /// @nodoc -class _$Event_ChannelPendingImpl extends Event_ChannelPending { - const _$Event_ChannelPendingImpl( - {required this.channelId, - required this.userChannelId, - required this.formerTemporaryChannelId, - required this.counterpartyNodeId, - required this.fundingTxo}) +class _$PaymentKind_Bolt12RefundImpl extends PaymentKind_Bolt12Refund { + const _$PaymentKind_Bolt12RefundImpl({this.hash, this.preimage, this.secret}) : super._(); - /// 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. + /// The payment hash, i.e., the hash of the `preimage`. @override - final ChannelId formerTemporaryChannelId; + final PaymentHash? hash; - /// The node_id of the channel counterparty. + /// The pre-image used by the payment. @override - final PublicKey counterpartyNodeId; + final PaymentPreimage? preimage; - /// The outpoint of the channel's funding transaction. + /// The secret used by the payment. @override - final OutPoint fundingTxo; + final PaymentSecret? secret; @override String toString() { - return 'Event.channelPending(channelId: $channelId, userChannelId: $userChannelId, formerTemporaryChannelId: $formerTemporaryChannelId, counterpartyNodeId: $counterpartyNodeId, fundingTxo: $fundingTxo)'; + return 'PaymentKind.bolt12Refund(hash: $hash, preimage: $preimage, secret: $secret)'; } @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)); + other is _$PaymentKind_Bolt12RefundImpl && + (identical(other.hash, hash) || other.hash == hash) && + (identical(other.preimage, preimage) || + other.preimage == preimage) && + (identical(other.secret, secret) || other.secret == secret)); } @override - int get hashCode => Object.hash(runtimeType, channelId, userChannelId, - formerTemporaryChannelId, counterpartyNodeId, fundingTxo); + int get hashCode => Object.hash(runtimeType, hash, preimage, secret); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$Event_ChannelPendingImplCopyWith<_$Event_ChannelPendingImpl> - get copyWith => - __$$Event_ChannelPendingImplCopyWithImpl<_$Event_ChannelPendingImpl>( - this, _$identity); + _$$PaymentKind_Bolt12RefundImplCopyWith<_$PaymentKind_Bolt12RefundImpl> + get copyWith => __$$PaymentKind_Bolt12RefundImplCopyWithImpl< + _$PaymentKind_Bolt12RefundImpl>(this, _$identity); @override @optionalTypeArgs TResult when({ - 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() onchain, required TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo) - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt11, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits) + bolt11Jit, + required TResult Function(PaymentHash hash, PaymentPreimage? preimage) + spontaneous, + required TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId) + bolt12Offer, + required TResult Function( + PaymentHash? hash, PaymentPreimage? preimage, PaymentSecret? secret) + bolt12Refund, }) { - return channelPending(channelId, userChannelId, formerTemporaryChannelId, - counterpartyNodeId, fundingTxo); + return bolt12Refund(hash, preimage, secret); } @override - @optionalTypeArgs - TResult? whenOrNull({ - 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, - OutPoint fundingTxo)? - channelPending, + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? onchain, + TResult? Function( + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult? Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult? Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, }) { - return channelPending?.call(channelId, userChannelId, - formerTemporaryChannelId, counterpartyNodeId, fundingTxo); + return bolt12Refund?.call(hash, preimage, secret); } @override @optionalTypeArgs TResult maybeWhen({ - 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()? onchain, TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, + PaymentHash hash, PaymentPreimage? preimage, PaymentSecret? secret)? + bolt11, + TResult Function(PaymentHash hash, PaymentPreimage? preimage, + PaymentSecret? secret, LSPFeeLimits lspFeeLimits)? + bolt11Jit, + TResult Function(PaymentHash hash, PaymentPreimage? preimage)? spontaneous, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret, OfferId offerId)? + bolt12Offer, + TResult Function(PaymentHash? hash, PaymentPreimage? preimage, + PaymentSecret? secret)? + bolt12Refund, required TResult orElse(), }) { - if (channelPending != null) { - return channelPending(channelId, userChannelId, formerTemporaryChannelId, - counterpartyNodeId, fundingTxo); + if (bolt12Refund != null) { + return bolt12Refund(hash, preimage, secret); } return orElse(); } @@ -2135,342 +10039,341 @@ class _$Event_ChannelPendingImpl extends Event_ChannelPending { @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_ChannelReady value) channelReady, - required TResult Function(Event_ChannelClosed value) channelClosed, - required TResult Function(Event_ChannelPending value) channelPending, + required TResult Function(PaymentKind_Onchain value) onchain, + required TResult Function(PaymentKind_Bolt11 value) bolt11, + required TResult Function(PaymentKind_Bolt11Jit value) bolt11Jit, + required TResult Function(PaymentKind_Spontaneous value) spontaneous, + required TResult Function(PaymentKind_Bolt12Offer value) bolt12Offer, + required TResult Function(PaymentKind_Bolt12Refund value) bolt12Refund, }) { - return channelPending(this); + return bolt12Refund(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_ChannelReady value)? channelReady, - TResult? Function(Event_ChannelClosed value)? channelClosed, - TResult? Function(Event_ChannelPending value)? channelPending, + TResult? Function(PaymentKind_Onchain value)? onchain, + TResult? Function(PaymentKind_Bolt11 value)? bolt11, + TResult? Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult? Function(PaymentKind_Spontaneous value)? spontaneous, + TResult? Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult? Function(PaymentKind_Bolt12Refund value)? bolt12Refund, }) { - return channelPending?.call(this); + return bolt12Refund?.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_ChannelReady value)? channelReady, - TResult Function(Event_ChannelClosed value)? channelClosed, - TResult Function(Event_ChannelPending value)? channelPending, + TResult Function(PaymentKind_Onchain value)? onchain, + TResult Function(PaymentKind_Bolt11 value)? bolt11, + TResult Function(PaymentKind_Bolt11Jit value)? bolt11Jit, + TResult Function(PaymentKind_Spontaneous value)? spontaneous, + TResult Function(PaymentKind_Bolt12Offer value)? bolt12Offer, + TResult Function(PaymentKind_Bolt12Refund value)? bolt12Refund, required TResult orElse(), }) { - if (channelPending != null) { - return channelPending(this); + if (bolt12Refund != null) { + return bolt12Refund(this); } return orElse(); } } -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 channel_id of the channel. - ChannelId get channelId; - - /// The user_channel_id of the channel. - UserChannelId get userChannelId; +abstract class PaymentKind_Bolt12Refund extends PaymentKind { + const factory PaymentKind_Bolt12Refund( + {final PaymentHash? hash, + final PaymentPreimage? preimage, + final PaymentSecret? secret}) = _$PaymentKind_Bolt12RefundImpl; + const PaymentKind_Bolt12Refund._() : super._(); - /// The temporary_channel_id this channel used to be known by during channel establishment. - ChannelId get formerTemporaryChannelId; + /// The payment hash, i.e., the hash of the `preimage`. + PaymentHash? get hash; - /// The node_id of the channel counterparty. - PublicKey get counterpartyNodeId; + /// The pre-image used by the payment. + PaymentPreimage? get preimage; - /// The outpoint of the channel's funding transaction. - OutPoint get fundingTxo; + /// The secret used by the payment. + PaymentSecret? get secret; @JsonKey(ignore: true) - _$$Event_ChannelPendingImplCopyWith<_$Event_ChannelPendingImpl> + _$$PaymentKind_Bolt12RefundImplCopyWith<_$PaymentKind_Bolt12RefundImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -mixin _$GossipSourceConfig { +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. + BigInt get amountSatoshis => throw _privateConstructorUsedError; @optionalTypeArgs TResult when({ - required TResult Function() p2PNetwork, - required TResult Function(String field0) rapidGossipSync, + required TResult Function(ChannelId? channelId, BigInt amountSatoshis) + pendingBroadcast, + required TResult Function(ChannelId? channelId, int latestBroadcastHeight, + Txid latestSpendingTxid, BigInt amountSatoshis) + broadcastAwaitingConfirmation, + required TResult Function( + ChannelId? channelId, + Txid latestSpendingTxid, + String confirmationHash, + int confirmationHeight, + BigInt amountSatoshis) + awaitingThresholdConfirmations, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult? whenOrNull({ - TResult? Function()? p2PNetwork, - TResult? Function(String field0)? rapidGossipSync, + TResult? Function(ChannelId? channelId, BigInt amountSatoshis)? + pendingBroadcast, + TResult? Function(ChannelId? channelId, int latestBroadcastHeight, + Txid latestSpendingTxid, BigInt amountSatoshis)? + broadcastAwaitingConfirmation, + TResult? Function( + ChannelId? channelId, + Txid latestSpendingTxid, + String confirmationHash, + int confirmationHeight, + BigInt amountSatoshis)? + awaitingThresholdConfirmations, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult maybeWhen({ - TResult Function()? p2PNetwork, - TResult Function(String field0)? rapidGossipSync, + TResult Function(ChannelId? channelId, BigInt amountSatoshis)? + pendingBroadcast, + TResult Function(ChannelId? channelId, int latestBroadcastHeight, + Txid latestSpendingTxid, BigInt amountSatoshis)? + broadcastAwaitingConfirmation, + TResult Function( + ChannelId? channelId, + Txid latestSpendingTxid, + String confirmationHash, + int confirmationHeight, + BigInt amountSatoshis)? + awaitingThresholdConfirmations, required TResult orElse(), }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult map({ - required TResult Function(GossipSourceConfig_P2PNetwork value) p2PNetwork, - required TResult Function(GossipSourceConfig_RapidGossipSync value) - rapidGossipSync, + 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(GossipSourceConfig_P2PNetwork value)? p2PNetwork, - TResult? Function(GossipSourceConfig_RapidGossipSync value)? - rapidGossipSync, + 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(GossipSourceConfig_P2PNetwork value)? p2PNetwork, - TResult Function(GossipSourceConfig_RapidGossipSync value)? rapidGossipSync, + 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 $GossipSourceConfigCopyWith<$Res> { - factory $GossipSourceConfigCopyWith( - GossipSourceConfig value, $Res Function(GossipSourceConfig) then) = - _$GossipSourceConfigCopyWithImpl<$Res, GossipSourceConfig>; +abstract class $PendingSweepBalanceCopyWith<$Res> { + factory $PendingSweepBalanceCopyWith( + PendingSweepBalance value, $Res Function(PendingSweepBalance) then) = + _$PendingSweepBalanceCopyWithImpl<$Res, PendingSweepBalance>; + @useResult + $Res call({ChannelId? channelId, BigInt amountSatoshis}); } /// @nodoc -class _$GossipSourceConfigCopyWithImpl<$Res, $Val extends GossipSourceConfig> - implements $GossipSourceConfigCopyWith<$Res> { - _$GossipSourceConfigCopyWithImpl(this._value, this._then); +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; -} - -/// @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 - extends GossipSourceConfig_P2PNetwork { - const _$GossipSourceConfig_P2PNetworkImpl() : super._(); - - @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); - } + @pragma('vm:prefer-inline') @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(GossipSourceConfig_P2PNetwork value)? p2PNetwork, - TResult Function(GossipSourceConfig_RapidGossipSync value)? rapidGossipSync, - required TResult orElse(), + $Res call({ + Object? channelId = freezed, + Object? amountSatoshis = null, }) { - if (p2PNetwork != null) { - return p2PNetwork(this); - } - return orElse(); + 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 BigInt, + ) as $Val); } } -abstract class GossipSourceConfig_P2PNetwork extends GossipSourceConfig { - const factory GossipSourceConfig_P2PNetwork() = - _$GossipSourceConfig_P2PNetworkImpl; - const GossipSourceConfig_P2PNetwork._() : super._(); -} - /// @nodoc -abstract class _$$GossipSourceConfig_RapidGossipSyncImplCopyWith<$Res> { - factory _$$GossipSourceConfig_RapidGossipSyncImplCopyWith( - _$GossipSourceConfig_RapidGossipSyncImpl value, - $Res Function(_$GossipSourceConfig_RapidGossipSyncImpl) then) = - __$$GossipSourceConfig_RapidGossipSyncImplCopyWithImpl<$Res>; +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({String field0}); + $Res call({ChannelId? channelId, BigInt amountSatoshis}); } /// @nodoc -class __$$GossipSourceConfig_RapidGossipSyncImplCopyWithImpl<$Res> - extends _$GossipSourceConfigCopyWithImpl<$Res, - _$GossipSourceConfig_RapidGossipSyncImpl> - implements _$$GossipSourceConfig_RapidGossipSyncImplCopyWith<$Res> { - __$$GossipSourceConfig_RapidGossipSyncImplCopyWithImpl( - _$GossipSourceConfig_RapidGossipSyncImpl _value, - $Res Function(_$GossipSourceConfig_RapidGossipSyncImpl) _then) +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? field0 = null, + Object? channelId = freezed, + Object? amountSatoshis = null, }) { - return _then(_$GossipSourceConfig_RapidGossipSyncImpl( - null == field0 - ? _value.field0 - : field0 // ignore: cast_nullable_to_non_nullable - as String, + 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 BigInt, )); } } /// @nodoc -class _$GossipSourceConfig_RapidGossipSyncImpl - extends GossipSourceConfig_RapidGossipSync { - const _$GossipSourceConfig_RapidGossipSyncImpl(this.field0) : super._(); +class _$PendingSweepBalance_PendingBroadcastImpl + extends PendingSweepBalance_PendingBroadcast { + const _$PendingSweepBalance_PendingBroadcastImpl( + {this.channelId, required this.amountSatoshis}) + : super._(); + /// The identifier of the channel this balance belongs to. @override - final String field0; + final ChannelId? channelId; + + /// The amount, in satoshis, of the output being swept. + @override + final BigInt amountSatoshis; @override String toString() { - return 'GossipSourceConfig.rapidGossipSync(field0: $field0)'; + return 'PendingSweepBalance.pendingBroadcast(channelId: $channelId, amountSatoshis: $amountSatoshis)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$GossipSourceConfig_RapidGossipSyncImpl && - (identical(other.field0, field0) || other.field0 == field0)); + 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, field0); + int get hashCode => Object.hash(runtimeType, channelId, amountSatoshis); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$GossipSourceConfig_RapidGossipSyncImplCopyWith< - _$GossipSourceConfig_RapidGossipSyncImpl> - get copyWith => __$$GossipSourceConfig_RapidGossipSyncImplCopyWithImpl< - _$GossipSourceConfig_RapidGossipSyncImpl>(this, _$identity); + _$$PendingSweepBalance_PendingBroadcastImplCopyWith< + _$PendingSweepBalance_PendingBroadcastImpl> + get copyWith => __$$PendingSweepBalance_PendingBroadcastImplCopyWithImpl< + _$PendingSweepBalance_PendingBroadcastImpl>(this, _$identity); @override @optionalTypeArgs TResult when({ - required TResult Function() p2PNetwork, - required TResult Function(String field0) rapidGossipSync, + required TResult Function(ChannelId? channelId, BigInt amountSatoshis) + pendingBroadcast, + required TResult Function(ChannelId? channelId, int latestBroadcastHeight, + Txid latestSpendingTxid, BigInt amountSatoshis) + broadcastAwaitingConfirmation, + required TResult Function( + ChannelId? channelId, + Txid latestSpendingTxid, + String confirmationHash, + int confirmationHeight, + BigInt amountSatoshis) + awaitingThresholdConfirmations, }) { - return rapidGossipSync(field0); + return pendingBroadcast(channelId, amountSatoshis); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function()? p2PNetwork, - TResult? Function(String field0)? rapidGossipSync, + TResult? Function(ChannelId? channelId, BigInt amountSatoshis)? + pendingBroadcast, + TResult? Function(ChannelId? channelId, int latestBroadcastHeight, + Txid latestSpendingTxid, BigInt amountSatoshis)? + broadcastAwaitingConfirmation, + TResult? Function( + ChannelId? channelId, + Txid latestSpendingTxid, + String confirmationHash, + int confirmationHeight, + BigInt amountSatoshis)? + awaitingThresholdConfirmations, }) { - return rapidGossipSync?.call(field0); + return pendingBroadcast?.call(channelId, amountSatoshis); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function()? p2PNetwork, - TResult Function(String field0)? rapidGossipSync, + TResult Function(ChannelId? channelId, BigInt amountSatoshis)? + pendingBroadcast, + TResult Function(ChannelId? channelId, int latestBroadcastHeight, + Txid latestSpendingTxid, BigInt amountSatoshis)? + broadcastAwaitingConfirmation, + TResult Function( + ChannelId? channelId, + Txid latestSpendingTxid, + String confirmationHash, + int confirmationHeight, + BigInt amountSatoshis)? + awaitingThresholdConfirmations, required TResult orElse(), }) { - if (rapidGossipSync != null) { - return rapidGossipSync(field0); + if (pendingBroadcast != null) { + return pendingBroadcast(channelId, amountSatoshis); } return orElse(); } @@ -2478,229 +10381,252 @@ class _$GossipSourceConfig_RapidGossipSyncImpl @override @optionalTypeArgs TResult map({ - required TResult Function(GossipSourceConfig_P2PNetwork value) p2PNetwork, - required TResult Function(GossipSourceConfig_RapidGossipSync value) - rapidGossipSync, + required TResult Function(PendingSweepBalance_PendingBroadcast value) + pendingBroadcast, + required TResult Function( + PendingSweepBalance_BroadcastAwaitingConfirmation value) + broadcastAwaitingConfirmation, + required TResult Function( + PendingSweepBalance_AwaitingThresholdConfirmations value) + awaitingThresholdConfirmations, }) { - return rapidGossipSync(this); + return pendingBroadcast(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(GossipSourceConfig_P2PNetwork value)? p2PNetwork, - TResult? Function(GossipSourceConfig_RapidGossipSync value)? - rapidGossipSync, + TResult? Function(PendingSweepBalance_PendingBroadcast value)? + pendingBroadcast, + TResult? Function(PendingSweepBalance_BroadcastAwaitingConfirmation value)? + broadcastAwaitingConfirmation, + TResult? Function(PendingSweepBalance_AwaitingThresholdConfirmations value)? + awaitingThresholdConfirmations, }) { - return rapidGossipSync?.call(this); + return pendingBroadcast?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(GossipSourceConfig_P2PNetwork value)? p2PNetwork, - TResult Function(GossipSourceConfig_RapidGossipSync value)? rapidGossipSync, + TResult Function(PendingSweepBalance_PendingBroadcast value)? + pendingBroadcast, + TResult Function(PendingSweepBalance_BroadcastAwaitingConfirmation value)? + broadcastAwaitingConfirmation, + TResult Function(PendingSweepBalance_AwaitingThresholdConfirmations value)? + awaitingThresholdConfirmations, required TResult orElse(), }) { - if (rapidGossipSync != null) { - return rapidGossipSync(this); + if (pendingBroadcast != null) { + return pendingBroadcast(this); } return orElse(); } } -abstract class GossipSourceConfig_RapidGossipSync extends GossipSourceConfig { - const factory GossipSourceConfig_RapidGossipSync(final String field0) = - _$GossipSourceConfig_RapidGossipSyncImpl; - const GossipSourceConfig_RapidGossipSync._() : super._(); +abstract class PendingSweepBalance_PendingBroadcast + extends PendingSweepBalance { + const factory PendingSweepBalance_PendingBroadcast( + {final ChannelId? channelId, required final BigInt amountSatoshis}) = + _$PendingSweepBalance_PendingBroadcastImpl; + const PendingSweepBalance_PendingBroadcast._() : super._(); - String get field0; - @JsonKey(ignore: true) - _$$GossipSourceConfig_RapidGossipSyncImplCopyWith< - _$GossipSourceConfig_RapidGossipSyncImpl> - get copyWith => throw _privateConstructorUsedError; -} + @override -/// @nodoc -mixin _$MaxDustHTLCExposure { - int get field0 => throw _privateConstructorUsedError; - @optionalTypeArgs - TResult when({ - required TResult Function(int field0) fixedLimitMsat, - required TResult Function(int field0) feeRateMultiplier, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(int field0)? fixedLimitMsat, - TResult? Function(int field0)? feeRateMultiplier, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(int field0)? fixedLimitMsat, - TResult Function(int field0)? feeRateMultiplier, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(MaxDustHTLCExposure_FixedLimitMsat value) - fixedLimitMsat, - required TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value) - feeRateMultiplier, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, - TResult? Function(MaxDustHTLCExposure_FeeRateMultiplier value)? - feeRateMultiplier, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - TResult Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, - TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value)? - feeRateMultiplier, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; + /// The identifier of the channel this balance belongs to. + ChannelId? get channelId; + @override + /// The amount, in satoshis, of the output being swept. + BigInt get amountSatoshis; + @override @JsonKey(ignore: true) - $MaxDustHTLCExposureCopyWith get copyWith => - throw _privateConstructorUsedError; + _$$PendingSweepBalance_PendingBroadcastImplCopyWith< + _$PendingSweepBalance_PendingBroadcastImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $MaxDustHTLCExposureCopyWith<$Res> { - factory $MaxDustHTLCExposureCopyWith( - MaxDustHTLCExposure value, $Res Function(MaxDustHTLCExposure) then) = - _$MaxDustHTLCExposureCopyWithImpl<$Res, MaxDustHTLCExposure>; +abstract class _$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWith< + $Res> implements $PendingSweepBalanceCopyWith<$Res> { + factory _$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWith( + _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl value, + $Res Function(_$PendingSweepBalance_BroadcastAwaitingConfirmationImpl) + then) = + __$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWithImpl< + $Res>; + @override @useResult - $Res call({int field0}); + $Res call( + {ChannelId? channelId, + int latestBroadcastHeight, + Txid latestSpendingTxid, + BigInt amountSatoshis}); } /// @nodoc -class _$MaxDustHTLCExposureCopyWithImpl<$Res, $Val extends MaxDustHTLCExposure> - implements $MaxDustHTLCExposureCopyWith<$Res> { - _$MaxDustHTLCExposureCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; +class __$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWithImpl< + $Res> + extends _$PendingSweepBalanceCopyWithImpl<$Res, + _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl> + implements + _$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWith<$Res> { + __$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWithImpl( + _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl _value, + $Res Function(_$PendingSweepBalance_BroadcastAwaitingConfirmationImpl) + _then) + : super(_value, _then); @pragma('vm:prefer-inline') @override $Res call({ - Object? field0 = null, + Object? channelId = freezed, + Object? latestBroadcastHeight = null, + Object? latestSpendingTxid = null, + Object? amountSatoshis = null, }) { - return _then(_value.copyWith( - field0: null == field0 - ? _value.field0 - : field0 // ignore: cast_nullable_to_non_nullable + 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, - ) as $Val); + 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 + as BigInt, + )); } } /// @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}); -} -/// @nodoc -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); +class _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl + extends PendingSweepBalance_BroadcastAwaitingConfirmation { + const _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl( + {this.channelId, + required this.latestBroadcastHeight, + required this.latestSpendingTxid, + required this.amountSatoshis}) + : super._(); - @pragma('vm:prefer-inline') + /// The identifier of the channel this balance belongs to. @override - $Res call({ - Object? field0 = null, - }) { - return _then(_$MaxDustHTLCExposure_FixedLimitMsatImpl( - null == field0 - ? _value.field0 - : field0 // ignore: cast_nullable_to_non_nullable - as int, - )); - } -} + final ChannelId? channelId; -/// @nodoc + /// The best height when we last broadcast a transaction spending the output being swept. + @override + final int latestBroadcastHeight; -class _$MaxDustHTLCExposure_FixedLimitMsatImpl - extends MaxDustHTLCExposure_FixedLimitMsat { - const _$MaxDustHTLCExposure_FixedLimitMsatImpl(this.field0) : super._(); + /// The identifier of the transaction spending the swept output we last broadcast. + @override + final Txid latestSpendingTxid; + /// The amount, in satoshis, of the output being swept. @override - final int field0; + final BigInt amountSatoshis; @override String toString() { - return 'MaxDustHTLCExposure.fixedLimitMsat(field0: $field0)'; + return 'PendingSweepBalance.broadcastAwaitingConfirmation(channelId: $channelId, latestBroadcastHeight: $latestBroadcastHeight, latestSpendingTxid: $latestSpendingTxid, amountSatoshis: $amountSatoshis)'; } @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 _$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)); } @override - int get hashCode => Object.hash(runtimeType, field0); + int get hashCode => Object.hash(runtimeType, channelId, latestBroadcastHeight, + latestSpendingTxid, amountSatoshis); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWith< - _$MaxDustHTLCExposure_FixedLimitMsatImpl> - get copyWith => __$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWithImpl< - _$MaxDustHTLCExposure_FixedLimitMsatImpl>(this, _$identity); + _$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWith< + _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl> + get copyWith => + __$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWithImpl< + _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl>( + this, _$identity); @override @optionalTypeArgs TResult when({ - required TResult Function(int field0) fixedLimitMsat, - required TResult Function(int field0) feeRateMultiplier, + required TResult Function(ChannelId? channelId, BigInt amountSatoshis) + pendingBroadcast, + required TResult Function(ChannelId? channelId, int latestBroadcastHeight, + Txid latestSpendingTxid, BigInt amountSatoshis) + broadcastAwaitingConfirmation, + required TResult Function( + ChannelId? channelId, + Txid latestSpendingTxid, + String confirmationHash, + int confirmationHeight, + BigInt amountSatoshis) + awaitingThresholdConfirmations, }) { - return fixedLimitMsat(field0); + return broadcastAwaitingConfirmation( + channelId, latestBroadcastHeight, latestSpendingTxid, amountSatoshis); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(int field0)? fixedLimitMsat, - TResult? Function(int field0)? feeRateMultiplier, + TResult? Function(ChannelId? channelId, BigInt amountSatoshis)? + pendingBroadcast, + TResult? Function(ChannelId? channelId, int latestBroadcastHeight, + Txid latestSpendingTxid, BigInt amountSatoshis)? + broadcastAwaitingConfirmation, + TResult? Function( + ChannelId? channelId, + Txid latestSpendingTxid, + String confirmationHash, + int confirmationHeight, + BigInt amountSatoshis)? + awaitingThresholdConfirmations, }) { - return fixedLimitMsat?.call(field0); + return broadcastAwaitingConfirmation?.call( + channelId, latestBroadcastHeight, latestSpendingTxid, amountSatoshis); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(int field0)? fixedLimitMsat, - TResult Function(int field0)? feeRateMultiplier, + TResult Function(ChannelId? channelId, BigInt amountSatoshis)? + pendingBroadcast, + TResult Function(ChannelId? channelId, int latestBroadcastHeight, + Txid latestSpendingTxid, BigInt amountSatoshis)? + broadcastAwaitingConfirmation, + TResult Function( + ChannelId? channelId, + Txid latestSpendingTxid, + String confirmationHash, + int confirmationHeight, + BigInt amountSatoshis)? + awaitingThresholdConfirmations, required TResult orElse(), }) { - if (fixedLimitMsat != null) { - return fixedLimitMsat(field0); + if (broadcastAwaitingConfirmation != null) { + return broadcastAwaitingConfirmation( + channelId, latestBroadcastHeight, latestSpendingTxid, amountSatoshis); } return orElse(); } @@ -2708,149 +10634,276 @@ class _$MaxDustHTLCExposure_FixedLimitMsatImpl @override @optionalTypeArgs TResult map({ - required TResult Function(MaxDustHTLCExposure_FixedLimitMsat value) - fixedLimitMsat, - required TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value) - feeRateMultiplier, + required TResult Function(PendingSweepBalance_PendingBroadcast value) + pendingBroadcast, + required TResult Function( + PendingSweepBalance_BroadcastAwaitingConfirmation value) + broadcastAwaitingConfirmation, + required TResult Function( + PendingSweepBalance_AwaitingThresholdConfirmations value) + awaitingThresholdConfirmations, }) { - return fixedLimitMsat(this); + return broadcastAwaitingConfirmation(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, - TResult? Function(MaxDustHTLCExposure_FeeRateMultiplier value)? - feeRateMultiplier, + TResult? Function(PendingSweepBalance_PendingBroadcast value)? + pendingBroadcast, + TResult? Function(PendingSweepBalance_BroadcastAwaitingConfirmation value)? + broadcastAwaitingConfirmation, + TResult? Function(PendingSweepBalance_AwaitingThresholdConfirmations value)? + awaitingThresholdConfirmations, }) { - return fixedLimitMsat?.call(this); + return broadcastAwaitingConfirmation?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, - TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value)? - feeRateMultiplier, + TResult Function(PendingSweepBalance_PendingBroadcast value)? + pendingBroadcast, + TResult Function(PendingSweepBalance_BroadcastAwaitingConfirmation value)? + broadcastAwaitingConfirmation, + TResult Function(PendingSweepBalance_AwaitingThresholdConfirmations value)? + awaitingThresholdConfirmations, required TResult orElse(), }) { - if (fixedLimitMsat != null) { - return fixedLimitMsat(this); + if (broadcastAwaitingConfirmation != null) { + return broadcastAwaitingConfirmation(this); } return orElse(); } } -abstract class MaxDustHTLCExposure_FixedLimitMsat extends MaxDustHTLCExposure { - const factory MaxDustHTLCExposure_FixedLimitMsat(final int field0) = - _$MaxDustHTLCExposure_FixedLimitMsatImpl; - const MaxDustHTLCExposure_FixedLimitMsat._() : super._(); +abstract class PendingSweepBalance_BroadcastAwaitingConfirmation + extends PendingSweepBalance { + const factory PendingSweepBalance_BroadcastAwaitingConfirmation( + {final ChannelId? channelId, + required final int latestBroadcastHeight, + required final Txid latestSpendingTxid, + required final BigInt amountSatoshis}) = + _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl; + const PendingSweepBalance_BroadcastAwaitingConfirmation._() : super._(); + + @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; + + /// The identifier of the transaction spending the swept output we last broadcast. + Txid get latestSpendingTxid; @override - int get field0; + + /// The amount, in satoshis, of the output being swept. + BigInt get amountSatoshis; @override @JsonKey(ignore: true) - _$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWith< - _$MaxDustHTLCExposure_FixedLimitMsatImpl> + _$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWith< + _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWith<$Res> - implements $MaxDustHTLCExposureCopyWith<$Res> { - factory _$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWith( - _$MaxDustHTLCExposure_FeeRateMultiplierImpl value, - $Res Function(_$MaxDustHTLCExposure_FeeRateMultiplierImpl) then) = - __$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWithImpl<$Res>; +abstract class _$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWith< + $Res> implements $PendingSweepBalanceCopyWith<$Res> { + factory _$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWith( + _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl value, + $Res Function( + _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl) + then) = + __$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWithImpl< + $Res>; @override @useResult - $Res call({int field0}); + $Res call( + {ChannelId? channelId, + Txid latestSpendingTxid, + String confirmationHash, + int confirmationHeight, + BigInt amountSatoshis}); } /// @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 __$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWithImpl< + $Res> + extends _$PendingSweepBalanceCopyWithImpl<$Res, + _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl> + implements + _$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWith< + $Res> { + __$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWithImpl( + _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl _value, + $Res Function(_$PendingSweepBalance_AwaitingThresholdConfirmationsImpl) + _then) : super(_value, _then); @pragma('vm:prefer-inline') @override $Res call({ - Object? field0 = null, - }) { - return _then(_$MaxDustHTLCExposure_FeeRateMultiplierImpl( - null == field0 - ? _value.field0 - : field0 // ignore: cast_nullable_to_non_nullable + 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 + as BigInt, )); } } /// @nodoc -class _$MaxDustHTLCExposure_FeeRateMultiplierImpl - extends MaxDustHTLCExposure_FeeRateMultiplier { - const _$MaxDustHTLCExposure_FeeRateMultiplierImpl(this.field0) : super._(); +class _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl + extends PendingSweepBalance_AwaitingThresholdConfirmations { + const _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl( + {this.channelId, + required this.latestSpendingTxid, + required this.confirmationHash, + required this.confirmationHeight, + required this.amountSatoshis}) + : super._(); + + /// 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; + /// The amount, in satoshis, of the output being swept. @override - final int field0; + final BigInt amountSatoshis; @override String toString() { - return 'MaxDustHTLCExposure.feeRateMultiplier(field0: $field0)'; + return 'PendingSweepBalance.awaitingThresholdConfirmations(channelId: $channelId, latestSpendingTxid: $latestSpendingTxid, confirmationHash: $confirmationHash, confirmationHeight: $confirmationHeight, amountSatoshis: $amountSatoshis)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$MaxDustHTLCExposure_FeeRateMultiplierImpl && - (identical(other.field0, field0) || other.field0 == field0)); + 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)); } @override - int get hashCode => Object.hash(runtimeType, field0); + int get hashCode => Object.hash(runtimeType, channelId, latestSpendingTxid, + confirmationHash, confirmationHeight, amountSatoshis); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWith< - _$MaxDustHTLCExposure_FeeRateMultiplierImpl> - get copyWith => __$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWithImpl< - _$MaxDustHTLCExposure_FeeRateMultiplierImpl>(this, _$identity); + _$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWith< + _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl> + get copyWith => + __$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWithImpl< + _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl>( + this, _$identity); @override @optionalTypeArgs TResult when({ - required TResult Function(int field0) fixedLimitMsat, - required TResult Function(int field0) feeRateMultiplier, + required TResult Function(ChannelId? channelId, BigInt amountSatoshis) + pendingBroadcast, + required TResult Function(ChannelId? channelId, int latestBroadcastHeight, + Txid latestSpendingTxid, BigInt amountSatoshis) + broadcastAwaitingConfirmation, + required TResult Function( + ChannelId? channelId, + Txid latestSpendingTxid, + String confirmationHash, + int confirmationHeight, + BigInt amountSatoshis) + awaitingThresholdConfirmations, }) { - return feeRateMultiplier(field0); + return awaitingThresholdConfirmations(channelId, latestSpendingTxid, + confirmationHash, confirmationHeight, amountSatoshis); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(int field0)? fixedLimitMsat, - TResult? Function(int field0)? feeRateMultiplier, + TResult? Function(ChannelId? channelId, BigInt amountSatoshis)? + pendingBroadcast, + TResult? Function(ChannelId? channelId, int latestBroadcastHeight, + Txid latestSpendingTxid, BigInt amountSatoshis)? + broadcastAwaitingConfirmation, + TResult? Function( + ChannelId? channelId, + Txid latestSpendingTxid, + String confirmationHash, + int confirmationHeight, + BigInt amountSatoshis)? + awaitingThresholdConfirmations, }) { - return feeRateMultiplier?.call(field0); + return awaitingThresholdConfirmations?.call(channelId, latestSpendingTxid, + confirmationHash, confirmationHeight, amountSatoshis); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(int field0)? fixedLimitMsat, - TResult Function(int field0)? feeRateMultiplier, + TResult Function(ChannelId? channelId, BigInt amountSatoshis)? + pendingBroadcast, + TResult Function(ChannelId? channelId, int latestBroadcastHeight, + Txid latestSpendingTxid, BigInt amountSatoshis)? + broadcastAwaitingConfirmation, + TResult Function( + ChannelId? channelId, + Txid latestSpendingTxid, + String confirmationHash, + int confirmationHeight, + BigInt amountSatoshis)? + awaitingThresholdConfirmations, required TResult orElse(), }) { - if (feeRateMultiplier != null) { - return feeRateMultiplier(field0); + if (awaitingThresholdConfirmations != null) { + return awaitingThresholdConfirmations(channelId, latestSpendingTxid, + confirmationHash, confirmationHeight, amountSatoshis); } return orElse(); } @@ -2858,51 +10911,81 @@ class _$MaxDustHTLCExposure_FeeRateMultiplierImpl @override @optionalTypeArgs TResult map({ - required TResult Function(MaxDustHTLCExposure_FixedLimitMsat value) - fixedLimitMsat, - required TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value) - feeRateMultiplier, + required TResult Function(PendingSweepBalance_PendingBroadcast value) + pendingBroadcast, + required TResult Function( + PendingSweepBalance_BroadcastAwaitingConfirmation value) + broadcastAwaitingConfirmation, + required TResult Function( + PendingSweepBalance_AwaitingThresholdConfirmations value) + awaitingThresholdConfirmations, }) { - return feeRateMultiplier(this); + return awaitingThresholdConfirmations(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, - TResult? Function(MaxDustHTLCExposure_FeeRateMultiplier value)? - feeRateMultiplier, + TResult? Function(PendingSweepBalance_PendingBroadcast value)? + pendingBroadcast, + TResult? Function(PendingSweepBalance_BroadcastAwaitingConfirmation value)? + broadcastAwaitingConfirmation, + TResult? Function(PendingSweepBalance_AwaitingThresholdConfirmations value)? + awaitingThresholdConfirmations, }) { - return feeRateMultiplier?.call(this); + return awaitingThresholdConfirmations?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, - TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value)? - feeRateMultiplier, + TResult Function(PendingSweepBalance_PendingBroadcast value)? + pendingBroadcast, + TResult Function(PendingSweepBalance_BroadcastAwaitingConfirmation value)? + broadcastAwaitingConfirmation, + TResult Function(PendingSweepBalance_AwaitingThresholdConfirmations value)? + awaitingThresholdConfirmations, required TResult orElse(), }) { - if (feeRateMultiplier != null) { - return feeRateMultiplier(this); + if (awaitingThresholdConfirmations != null) { + return awaitingThresholdConfirmations(this); } return orElse(); } } -abstract class MaxDustHTLCExposure_FeeRateMultiplier - extends MaxDustHTLCExposure { - const factory MaxDustHTLCExposure_FeeRateMultiplier(final int field0) = - _$MaxDustHTLCExposure_FeeRateMultiplierImpl; - const MaxDustHTLCExposure_FeeRateMultiplier._() : super._(); +abstract class PendingSweepBalance_AwaitingThresholdConfirmations + extends PendingSweepBalance { + const factory PendingSweepBalance_AwaitingThresholdConfirmations( + {final ChannelId? channelId, + required final Txid latestSpendingTxid, + required final String confirmationHash, + required final int confirmationHeight, + required final BigInt amountSatoshis}) = + _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl; + const PendingSweepBalance_AwaitingThresholdConfirmations._() : super._(); @override - int get field0; + + /// 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; + + /// The height at which the spending transaction was confirmed. + int get confirmationHeight; + @override + + /// The amount, in satoshis, of the output being swept. + BigInt get amountSatoshis; @override @JsonKey(ignore: true) - _$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWith< - _$MaxDustHTLCExposure_FeeRateMultiplierImpl> + _$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWith< + _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/generated/frb_generated.dart b/lib/src/generated/frb_generated.dart index 4e2953e..e65c14f 100644 --- a/lib/src/generated/frb_generated.dart +++ b/lib/src/generated/frb_generated.dart @@ -1,26 +1,35 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. +// Generated by `flutter_rust_bridge`@ 2.0.0. // 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 -import 'api/error.dart'; +import 'api/bolt11.dart'; +import 'api/bolt12.dart'; +import 'api/builder.dart'; +import 'api/graph.dart'; import 'api/node.dart'; +import 'api/on_chain.dart'; +import 'api/spontaneous.dart'; import 'api/types.dart'; import 'dart:async'; import 'dart:convert'; -import 'frb_generated.io.dart' if (dart.library.html) 'frb_generated.web.dart'; +import 'frb_generated.dart'; +import 'frb_generated.io.dart' + if (dart.library.js_interop) 'frb_generated.web.dart'; +import 'lib.dart'; import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; +import 'utils/error.dart'; /// Main entrypoint of the Rust API -class LdkCore extends BaseEntrypoint { +class core extends BaseEntrypoint { @internal - static final instance = LdkCore._(); + static final instance = core._(); - LdkCore._(); + core._(); /// Initialize flutter_rust_bridge static Future init({ - LdkCoreApi? api, + coreApi? api, BaseHandler? handler, ExternalLibrary? externalLibrary, }) async { @@ -38,12 +47,11 @@ class LdkCore extends BaseEntrypoint { static void dispose() => instance.disposeImpl(); @override - ApiImplConstructor get apiImplConstructor => - LdkCoreApiImpl.new; + ApiImplConstructor get apiImplConstructor => + coreApiImpl.new; @override - WireConstructor get wireConstructor => - LdkCoreWire.fromExternalLibrary; + WireConstructor get wireConstructor => coreWire.fromExternalLibrary; @override Future executeRustInitializers() async {} @@ -53,7 +61,10 @@ class LdkCore extends BaseEntrypoint { kDefaultExternalLibraryLoaderConfig; @override - String get codegenVersion => '2.0.0-dev.31'; + String get codegenVersion => '2.0.0'; + + @override + int get rustContentHash => 1761952349; static const kDefaultExternalLibraryLoaderConfig = ExternalLibraryLoaderConfig( @@ -63,179 +74,320 @@ class LdkCore extends BaseEntrypoint { ); } -abstract class LdkCoreApi extends BaseApi { - Future buildWithSqliteStore( +abstract class coreApi extends BaseApi { + Future crateApiBolt11LdkBolt11PaymentClaimForHash( + {required LdkBolt11Payment that, + required PaymentHash paymentHash, + required BigInt claimableAmountMsat, + required PaymentPreimage preimage}); + + Future crateApiBolt11LdkBolt11PaymentFailForHash( + {required LdkBolt11Payment that, required PaymentHash paymentHash}); + + Future crateApiBolt11LdkBolt11PaymentReceive( + {required LdkBolt11Payment that, + required BigInt amountMsat, + required String description, + required int expirySecs}); + + Future crateApiBolt11LdkBolt11PaymentReceiveForHash( + {required LdkBolt11Payment that, + required PaymentHash paymentHash, + required BigInt amountMsat, + required String description, + required int expirySecs}); + + Future crateApiBolt11LdkBolt11PaymentReceiveVariableAmount( + {required LdkBolt11Payment that, + required String description, + required int expirySecs}); + + Future + crateApiBolt11LdkBolt11PaymentReceiveVariableAmountForHash( + {required LdkBolt11Payment that, + required String description, + required int expirySecs, + required PaymentHash paymentHash}); + + Future + crateApiBolt11LdkBolt11PaymentReceiveVariableAmountViaJitChannel( + {required LdkBolt11Payment that, + required String description, + required int expirySecs, + BigInt? maxProportionalLspFeeLimitPpmMsat}); + + Future crateApiBolt11LdkBolt11PaymentReceiveViaJitChannel( + {required LdkBolt11Payment that, + required BigInt amountMsat, + required String description, + required int expirySecs, + BigInt? maxTotalLspFeeLimitMsat}); + + Future crateApiBolt11LdkBolt11PaymentSend( + {required LdkBolt11Payment that, required Bolt11Invoice invoice}); + + Future crateApiBolt11LdkBolt11PaymentSendProbes( + {required LdkBolt11Payment that, required Bolt11Invoice invoice}); + + Future crateApiBolt11LdkBolt11PaymentSendProbesUsingAmount( + {required LdkBolt11Payment that, + required Bolt11Invoice invoice, + required BigInt amountMsat}); + + Future crateApiBolt11LdkBolt11PaymentSendUsingAmount( + {required LdkBolt11Payment that, + required Bolt11Invoice invoice, + required BigInt amountMsat}); + + Future crateApiBolt12LdkBolt12PaymentInitiateRefund( + {required LdkBolt12Payment that, + required BigInt amountMsat, + required int expirySecs}); + + Future crateApiBolt12LdkBolt12PaymentReceive( + {required LdkBolt12Payment that, + required BigInt amountMsat, + required String description}); + + Future crateApiBolt12LdkBolt12PaymentReceiveVariableAmount( + {required LdkBolt12Payment that, required String description}); + + Future crateApiBolt12LdkBolt12PaymentRequestRefundPayment( + {required LdkBolt12Payment that, required Refund refund}); + + Future crateApiBolt12LdkBolt12PaymentSend( + {required LdkBolt12Payment that, + required Offer offer, + String? payerNote}); + + Future crateApiBolt12LdkBolt12PaymentSendUsingAmount( + {required LdkBolt12Payment that, + required Offer offer, + String? payerNote, + required BigInt amountMsat}); + + Builder crateApiBuilderNodeBuilderAutoAccessorGetBuilder( + {required NodeBuilder that}); + + void crateApiBuilderNodeBuilderAutoAccessorSetBuilder( + {required NodeBuilder that, required Builder builder}); + + Future crateApiBuilderNodeBuilderBuild({required NodeBuilder that}); + + Future crateApiBuilderNodeBuilderBuildWithFsStore( + {required NodeBuilder that}); + + Future crateApiBuilderNodeBuilderCreateBuilder( {required Config config, ChainDataSourceConfig? chainDataSourceConfig, EntropySourceConfig? entropySourceConfig, GossipSourceConfig? gossipSourceConfig, - dynamic hint}); + LiquiditySourceConfig? liquiditySourceConfig}); + + Future crateApiBuilderLdkMnemonicGenerate(); + + Future crateApiGraphLdkNetworkGraphChannel( + {required LdkNetworkGraph that, required BigInt shortChannelId}); + + Future crateApiGraphLdkNetworkGraphListChannels( + {required LdkNetworkGraph that}); + + Future> crateApiGraphLdkNetworkGraphListNodes( + {required LdkNetworkGraph that}); - Future ldkMnemonicGenerate({dynamic hint}); + Future crateApiGraphLdkNetworkGraphNode( + {required LdkNetworkGraph that, required NodeId nodeId}); - Future ldkNodeCloseChannel( + Future crateApiNodeLdkNodeBolt11Payment( + {required LdkNode ptr}); + + Future crateApiNodeLdkNodeBolt12Payment( + {required LdkNode ptr}); + + Future crateApiNodeLdkNodeCloseChannel( {required LdkNode that, - required ChannelId channelId, - required PublicKey counterpartyNodeId, - dynamic hint}); + required UserChannelId userChannelId, + required PublicKey counterpartyNodeId}); + + Future crateApiNodeLdkNodeConfig({required LdkNode that}); - Future ldkNodeConnect( + Future crateApiNodeLdkNodeConnect( {required LdkNode that, required PublicKey nodeId, required SocketAddress address, - required bool persist, - dynamic hint}); + required bool persist}); - Future ldkNodeConnectOpenChannel( + Future crateApiNodeLdkNodeConnectOpenChannel( {required LdkNode that, required SocketAddress socketAddress, required PublicKey nodeId, - required int channelAmountSats, - int? pushToCounterpartyMsat, + required BigInt channelAmountSats, + BigInt? pushToCounterpartyMsat, required bool announceChannel, - ChannelConfig? channelConfig, - dynamic hint}); + ChannelConfig? channelConfig}); - Future ldkNodeDisconnect( + Future crateApiNodeLdkNodeDisconnect( + {required LdkNode that, required PublicKey counterpartyNodeId}); + + Future crateApiNodeLdkNodeEventHandled({required LdkNode that}); + + Future crateApiNodeLdkNodeForceCloseChannel( {required LdkNode that, - required PublicKey counterpartyNodeId, - dynamic hint}); + required UserChannelId userChannelId, + required PublicKey counterpartyNodeId}); - Future ldkNodeEventHandled({required LdkNode that, dynamic hint}); + Future crateApiNodeLdkNodeListBalances( + {required LdkNode that}); - Future ldkNodeIsRunning({required LdkNode that, dynamic hint}); + Future> crateApiNodeLdkNodeListChannels( + {required LdkNode that}); - Future> ldkNodeListChannels( - {required LdkNode that, dynamic hint}); + Future> crateApiNodeLdkNodeListPayments( + {required LdkNode that}); - Future> ldkNodeListPayments( - {required LdkNode that, dynamic hint}); + Future> crateApiNodeLdkNodeListPaymentsWithFilter( + {required LdkNode that, required PaymentDirection paymentDirection}); - Future> ldkNodeListPaymentsWithFilter( - {required LdkNode that, - required PaymentDirection paymentDirection, - dynamic hint}); + Future> crateApiNodeLdkNodeListPeers( + {required LdkNode that}); - Future> ldkNodeListPeers( - {required LdkNode that, dynamic hint}); + Future?> crateApiNodeLdkNodeListeningAddresses( + {required LdkNode that}); - Future?> ldkNodeListeningAddresses( - {required LdkNode that, dynamic hint}); + Future crateApiNodeLdkNodeNetworkGraph( + {required LdkNode ptr}); - Future
ldkNodeNewOnchainAddress( - {required LdkNode that, dynamic hint}); + Future crateApiNodeLdkNodeNextEvent({required LdkNode that}); - Future ldkNodeNextEvent({required LdkNode that, dynamic hint}); + Future crateApiNodeLdkNodeNextEventAsync({required LdkNode that}); - Future ldkNodeNodeId({required LdkNode that, dynamic hint}); + Future crateApiNodeLdkNodeNodeId({required LdkNode that}); - Future ldkNodePayment( - {required LdkNode that, required PaymentHash paymentHash, dynamic hint}); + Future crateApiNodeLdkNodeOnChainPayment( + {required LdkNode ptr}); - Future ldkNodeReceivePayment( - {required LdkNode that, - required int amountMsat, - required String description, - required int expirySecs, - dynamic hint}); + Future crateApiNodeLdkNodePayment( + {required LdkNode that, required PaymentId paymentId}); - Future ldkNodeReceiveVariableAmountPayment( - {required LdkNode that, - required String description, - required int expirySecs, - dynamic hint}); + Future crateApiNodeLdkNodeRemovePayment( + {required LdkNode that, required PaymentId paymentId}); - Future ldkNodeRemovePayment( - {required LdkNode that, required PaymentHash paymentHash, dynamic hint}); + Future crateApiNodeLdkNodeSignMessage( + {required LdkNode that, required List msg}); - Future ldkNodeSendAllToOnchainAddress( - {required LdkNode that, required Address address, dynamic hint}); + Future crateApiNodeLdkNodeSpontaneousPayment( + {required LdkNode ptr}); - Future ldkNodeSendPayment( - {required LdkNode that, required Bolt11Invoice invoice, dynamic hint}); + Future crateApiNodeLdkNodeStart({required LdkNode that}); - Future ldkNodeSendPaymentProbes( - {required LdkNode that, required Bolt11Invoice invoice, dynamic hint}); + Future crateApiNodeLdkNodeStatus({required LdkNode that}); - Future ldkNodeSendPaymentProbesUsingAmount( - {required LdkNode that, - required Bolt11Invoice invoice, - required int amountMsat, - dynamic hint}); + Future crateApiNodeLdkNodeStop({required LdkNode that}); - Future ldkNodeSendPaymentUsingAmount( - {required LdkNode that, - required Bolt11Invoice invoice, - required int amountMsat, - dynamic hint}); + Future crateApiNodeLdkNodeSyncWallets({required LdkNode that}); - Future ldkNodeSendSpontaneousPayment( + Future crateApiNodeLdkNodeUpdateChannelConfig( {required LdkNode that, - required int amountMsat, - required PublicKey nodeId, - dynamic hint}); + required UserChannelId userChannelId, + required PublicKey counterpartyNodeId, + required ChannelConfig channelConfig}); - Future ldkNodeSendSpontaneousPaymentProbes( + Future crateApiNodeLdkNodeVerifySignature( {required LdkNode that, - required int amountMsat, - required PublicKey nodeId, - dynamic hint}); + required List msg, + required String sig, + required PublicKey publicKey}); - Future ldkNodeSendToOnchainAddress( - {required LdkNode that, + Future crateApiNodeLdkNodeWaitNextEvent({required LdkNode that}); + + Future
crateApiOnChainLdkOnChainPaymentNewAddress( + {required LdkOnChainPayment that}); + + Future crateApiOnChainLdkOnChainPaymentSendAllToAddress( + {required LdkOnChainPayment that, required Address address}); + + Future crateApiOnChainLdkOnChainPaymentSendToAddress( + {required LdkOnChainPayment that, required Address address, - required int amountSats, - dynamic hint}); + required BigInt amountSats}); - Future ldkNodeSignMessage( - {required LdkNode that, required List msg, dynamic hint}); + Future crateApiSpontaneousLdkSpontaneousPaymentSend( + {required LdkSpontaneousPayment that, + required BigInt amountMsat, + required PublicKey nodeId}); - Future ldkNodeSpendableOnchainBalanceSats( - {required LdkNode that, dynamic hint}); + Future crateApiSpontaneousLdkSpontaneousPaymentSendProbes( + {required LdkSpontaneousPayment that, + required BigInt amountMsat, + required PublicKey nodeId}); - Future ldkNodeStart({required LdkNode that, dynamic hint}); + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_ArcBolt12Payment; - Future ldkNodeStop({required LdkNode that, dynamic hint}); + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_ArcBolt12Payment; - Future ldkNodeSyncWallets({required LdkNode that, dynamic hint}); + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_ArcBolt12PaymentPtr; - Future ldkNodeTotalOnchainBalanceSats( - {required LdkNode that, dynamic hint}); + RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_Node; - Future ldkNodeUpdateChannelConfig( - {required LdkNode that, - required ChannelId channelId, - required PublicKey counterpartyNodeId, - required ChannelConfig channelConfig, - dynamic hint}); + RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_Node; - Future ldkNodeVerifySignature( - {required LdkNode that, - required List msg, - required String sig, - required PublicKey pkey, - dynamic hint}); + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_NodePtr; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_NodeBuilder; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_NodeBuilder; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_NodeBuilderPtr; + + RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_Builder; + + RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_Builder; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_BuilderPtr; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_NetworkGraph; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_NetworkGraph; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_NetworkGraphPtr; - Future ldkNodeWaitNextEvent({required LdkNode that, dynamic hint}); + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_Bolt11Payment; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_Bolt11Payment; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_Bolt11PaymentPtr; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_OnchainPayment; - Future socketAddressAsString( - {required SocketAddress that, dynamic hint}); + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_OnchainPayment; - Future socketAddressFromStr( - {required String address, dynamic hint}); + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_OnchainPaymentPtr; RustArcIncrementStrongCountFnType - get rust_arc_increment_strong_count_NodeSqliteStore; + get rust_arc_increment_strong_count_SpontaneousPayment; RustArcDecrementStrongCountFnType - get rust_arc_decrement_strong_count_NodeSqliteStore; + get rust_arc_decrement_strong_count_SpontaneousPayment; CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_NodeSqliteStorePtr; + get rust_arc_decrement_strong_count_SpontaneousPaymentPtr; } -class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { - LdkCoreApiImpl({ +class coreApiImpl extends coreApiImplPlatform implements coreApi { + coreApiImpl({ required super.handler, required super.wire, required super.generalizedFrbRustBinding, @@ -243,1190 +395,2259 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { }); @override - Future buildWithSqliteStore( - {required Config config, - ChainDataSourceConfig? chainDataSourceConfig, - EntropySourceConfig? entropySourceConfig, - GossipSourceConfig? gossipSourceConfig, - dynamic hint}) { + Future crateApiBolt11LdkBolt11PaymentClaimForHash( + {required LdkBolt11Payment that, + required PaymentHash paymentHash, + required BigInt claimableAmountMsat, + required PaymentPreimage preimage}) { 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); - return wire.wire_build_with_sqlite_store(port_, arg0, arg1, arg2, arg3); + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); + var arg1 = cst_encode_box_autoadd_payment_hash(paymentHash); + var arg2 = cst_encode_u_64(claimableAmountMsat); + var arg3 = cst_encode_box_autoadd_payment_preimage(preimage); + return wire + .wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hash( + port_, arg0, arg1, arg2, arg3); }, codec: DcoCodec( - decodeSuccessData: dco_decode_ldk_node, - decodeErrorData: dco_decode_builder_exception, + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kBuildWithSqliteStoreConstMeta, - argValues: [ - config, - chainDataSourceConfig, - entropySourceConfig, - gossipSourceConfig - ], + constMeta: kCrateApiBolt11LdkBolt11PaymentClaimForHashConstMeta, + argValues: [that, paymentHash, claimableAmountMsat, preimage], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kBuildWithSqliteStoreConstMeta => const TaskConstMeta( - debugName: "build_with_sqlite_store", - argNames: [ - "config", - "chainDataSourceConfig", - "entropySourceConfig", - "gossipSourceConfig" - ], + TaskConstMeta get kCrateApiBolt11LdkBolt11PaymentClaimForHashConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_claim_for_hash", + argNames: ["that", "paymentHash", "claimableAmountMsat", "preimage"], ); @override - Future ldkMnemonicGenerate({dynamic hint}) { + Future crateApiBolt11LdkBolt11PaymentFailForHash( + {required LdkBolt11Payment that, required PaymentHash paymentHash}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - return wire.wire_ldk_mnemonic_generate(port_); + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); + var arg1 = cst_encode_box_autoadd_payment_hash(paymentHash); + return wire.wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hash( + port_, arg0, arg1); }, codec: DcoCodec( - decodeSuccessData: dco_decode_ldk_mnemonic, - decodeErrorData: null, + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkMnemonicGenerateConstMeta, - argValues: [], + constMeta: kCrateApiBolt11LdkBolt11PaymentFailForHashConstMeta, + argValues: [that, paymentHash], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkMnemonicGenerateConstMeta => const TaskConstMeta( - debugName: "ldk_mnemonic_generate", - argNames: [], + TaskConstMeta get kCrateApiBolt11LdkBolt11PaymentFailForHashConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_fail_for_hash", + argNames: ["that", "paymentHash"], ); @override - Future ldkNodeCloseChannel( - {required LdkNode that, - required ChannelId channelId, - required PublicKey counterpartyNodeId, - dynamic hint}) { + Future crateApiBolt11LdkBolt11PaymentReceive( + {required LdkBolt11Payment that, + required BigInt amountMsat, + required String description, + required int expirySecs}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - 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); + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); + var arg1 = cst_encode_u_64(amountMsat); + var arg2 = cst_encode_String(description); + var arg3 = cst_encode_u_32(expirySecs); + return wire.wire__crate__api__bolt11__ldk_bolt_11_payment_receive( + port_, arg0, arg1, arg2, arg3); }, codec: DcoCodec( - decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_bolt_11_invoice, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeCloseChannelConstMeta, - argValues: [that, channelId, counterpartyNodeId], + constMeta: kCrateApiBolt11LdkBolt11PaymentReceiveConstMeta, + argValues: [that, amountMsat, description, expirySecs], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeCloseChannelConstMeta => const TaskConstMeta( - debugName: "ldk_node_close_channel", - argNames: ["that", "channelId", "counterpartyNodeId"], + TaskConstMeta get kCrateApiBolt11LdkBolt11PaymentReceiveConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_receive", + argNames: ["that", "amountMsat", "description", "expirySecs"], ); @override - Future ldkNodeConnect( - {required LdkNode that, - required PublicKey nodeId, - required SocketAddress address, - required bool persist, - dynamic hint}) { + Future crateApiBolt11LdkBolt11PaymentReceiveForHash( + {required LdkBolt11Payment that, + required PaymentHash paymentHash, + required BigInt amountMsat, + required String description, + required int expirySecs}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - 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_ldk_node_connect(port_, arg0, arg1, arg2, arg3); + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); + var arg1 = cst_encode_box_autoadd_payment_hash(paymentHash); + var arg2 = cst_encode_u_64(amountMsat); + var arg3 = cst_encode_String(description); + var arg4 = cst_encode_u_32(expirySecs); + return wire + .wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hash( + port_, arg0, arg1, arg2, arg3, arg4); }, codec: DcoCodec( - decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_bolt_11_invoice, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeConnectConstMeta, - argValues: [that, nodeId, address, persist], + constMeta: kCrateApiBolt11LdkBolt11PaymentReceiveForHashConstMeta, + argValues: [that, paymentHash, amountMsat, description, expirySecs], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeConnectConstMeta => const TaskConstMeta( - debugName: "ldk_node_connect", - argNames: ["that", "nodeId", "address", "persist"], + TaskConstMeta get kCrateApiBolt11LdkBolt11PaymentReceiveForHashConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_receive_for_hash", + argNames: [ + "that", + "paymentHash", + "amountMsat", + "description", + "expirySecs" + ], ); @override - Future ldkNodeConnectOpenChannel( - {required LdkNode that, - required SocketAddress socketAddress, - required PublicKey nodeId, - required int channelAmountSats, - int? pushToCounterpartyMsat, - required bool announceChannel, - ChannelConfig? channelConfig, - dynamic hint}) { + Future crateApiBolt11LdkBolt11PaymentReceiveVariableAmount( + {required LdkBolt11Payment that, + required String description, + required int expirySecs}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - 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_ldk_node_connect_open_channel( - port_, arg0, arg1, arg2, arg3, arg4, arg5, arg6); + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); + var arg1 = cst_encode_String(description); + var arg2 = cst_encode_u_32(expirySecs); + return wire + .wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount( + port_, arg0, arg1, arg2); }, codec: DcoCodec( - decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_bolt_11_invoice, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeConnectOpenChannelConstMeta, - argValues: [ - that, - socketAddress, - nodeId, - channelAmountSats, - pushToCounterpartyMsat, - announceChannel, - channelConfig - ], + constMeta: kCrateApiBolt11LdkBolt11PaymentReceiveVariableAmountConstMeta, + argValues: [that, description, expirySecs], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeConnectOpenChannelConstMeta => const TaskConstMeta( - debugName: "ldk_node_connect_open_channel", - argNames: [ - "that", - "socketAddress", - "nodeId", - "channelAmountSats", - "pushToCounterpartyMsat", - "announceChannel", - "channelConfig" - ], - ); + TaskConstMeta + get kCrateApiBolt11LdkBolt11PaymentReceiveVariableAmountConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_receive_variable_amount", + argNames: ["that", "description", "expirySecs"], + ); @override - Future ldkNodeDisconnect( - {required LdkNode that, - required PublicKey counterpartyNodeId, - dynamic hint}) { + Future + crateApiBolt11LdkBolt11PaymentReceiveVariableAmountForHash( + {required LdkBolt11Payment that, + required String description, + required int expirySecs, + required PaymentHash paymentHash}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - var arg1 = cst_encode_box_autoadd_public_key(counterpartyNodeId); - return wire.wire_ldk_node_disconnect(port_, arg0, arg1); + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); + var arg1 = cst_encode_String(description); + var arg2 = cst_encode_u_32(expirySecs); + var arg3 = cst_encode_box_autoadd_payment_hash(paymentHash); + return wire + .wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hash( + port_, arg0, arg1, arg2, arg3); }, codec: DcoCodec( - decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_bolt_11_invoice, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeDisconnectConstMeta, - argValues: [that, counterpartyNodeId], + constMeta: + kCrateApiBolt11LdkBolt11PaymentReceiveVariableAmountForHashConstMeta, + argValues: [that, description, expirySecs, paymentHash], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeDisconnectConstMeta => const TaskConstMeta( - debugName: "ldk_node_disconnect", - argNames: ["that", "counterpartyNodeId"], - ); + TaskConstMeta + get kCrateApiBolt11LdkBolt11PaymentReceiveVariableAmountForHashConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_receive_variable_amount_for_hash", + argNames: ["that", "description", "expirySecs", "paymentHash"], + ); @override - Future ldkNodeEventHandled({required LdkNode that, dynamic hint}) { + Future + crateApiBolt11LdkBolt11PaymentReceiveVariableAmountViaJitChannel( + {required LdkBolt11Payment that, + required String description, + required int expirySecs, + BigInt? maxProportionalLspFeeLimitPpmMsat}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_event_handled(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(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__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel( + port_, arg0, arg1, arg2, arg3); }, codec: DcoCodec( - decodeSuccessData: dco_decode_unit, - decodeErrorData: null, + decodeSuccessData: dco_decode_bolt_11_invoice, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeEventHandledConstMeta, - argValues: [that], + constMeta: + kCrateApiBolt11LdkBolt11PaymentReceiveVariableAmountViaJitChannelConstMeta, + argValues: [ + that, + description, + expirySecs, + maxProportionalLspFeeLimitPpmMsat + ], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeEventHandledConstMeta => const TaskConstMeta( - debugName: "ldk_node_event_handled", - argNames: ["that"], - ); + TaskConstMeta + get kCrateApiBolt11LdkBolt11PaymentReceiveVariableAmountViaJitChannelConstMeta => + const TaskConstMeta( + debugName: + "ldk_bolt_11_payment_receive_variable_amount_via_jit_channel", + argNames: [ + "that", + "description", + "expirySecs", + "maxProportionalLspFeeLimitPpmMsat" + ], + ); @override - Future ldkNodeIsRunning({required LdkNode that, dynamic hint}) { + Future crateApiBolt11LdkBolt11PaymentReceiveViaJitChannel( + {required LdkBolt11Payment that, + required BigInt amountMsat, + required String description, + required int expirySecs, + BigInt? maxTotalLspFeeLimitMsat}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_is_running(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(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__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel( + port_, arg0, arg1, arg2, arg3, arg4); }, codec: DcoCodec( - decodeSuccessData: dco_decode_bool, - decodeErrorData: null, + decodeSuccessData: dco_decode_bolt_11_invoice, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeIsRunningConstMeta, - argValues: [that], + constMeta: kCrateApiBolt11LdkBolt11PaymentReceiveViaJitChannelConstMeta, + argValues: [ + that, + amountMsat, + description, + expirySecs, + maxTotalLspFeeLimitMsat + ], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeIsRunningConstMeta => const TaskConstMeta( - debugName: "ldk_node_is_running", - argNames: ["that"], - ); + TaskConstMeta + get kCrateApiBolt11LdkBolt11PaymentReceiveViaJitChannelConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_receive_via_jit_channel", + argNames: [ + "that", + "amountMsat", + "description", + "expirySecs", + "maxTotalLspFeeLimitMsat" + ], + ); @override - Future> ldkNodeListChannels( - {required LdkNode that, dynamic hint}) { + Future crateApiBolt11LdkBolt11PaymentSend( + {required LdkBolt11Payment that, required Bolt11Invoice invoice}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_list_channels(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); + var arg1 = cst_encode_box_autoadd_bolt_11_invoice(invoice); + return wire.wire__crate__api__bolt11__ldk_bolt_11_payment_send( + port_, arg0, arg1); }, codec: DcoCodec( - decodeSuccessData: dco_decode_list_channel_details, - decodeErrorData: null, + decodeSuccessData: dco_decode_payment_id, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeListChannelsConstMeta, - argValues: [that], + constMeta: kCrateApiBolt11LdkBolt11PaymentSendConstMeta, + argValues: [that, invoice], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeListChannelsConstMeta => const TaskConstMeta( - debugName: "ldk_node_list_channels", - argNames: ["that"], + TaskConstMeta get kCrateApiBolt11LdkBolt11PaymentSendConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_send", + argNames: ["that", "invoice"], ); @override - Future> ldkNodeListPayments( - {required LdkNode that, dynamic hint}) { + Future crateApiBolt11LdkBolt11PaymentSendProbes( + {required LdkBolt11Payment that, required Bolt11Invoice invoice}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_list_payments(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); + var arg1 = cst_encode_box_autoadd_bolt_11_invoice(invoice); + return wire.wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes( + port_, arg0, arg1); }, codec: DcoCodec( - decodeSuccessData: dco_decode_list_payment_details, - decodeErrorData: null, + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeListPaymentsConstMeta, - argValues: [that], + constMeta: kCrateApiBolt11LdkBolt11PaymentSendProbesConstMeta, + argValues: [that, invoice], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeListPaymentsConstMeta => const TaskConstMeta( - debugName: "ldk_node_list_payments", - argNames: ["that"], + TaskConstMeta get kCrateApiBolt11LdkBolt11PaymentSendProbesConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_send_probes", + argNames: ["that", "invoice"], ); @override - Future> ldkNodeListPaymentsWithFilter( - {required LdkNode that, - required PaymentDirection paymentDirection, - dynamic hint}) { + Future crateApiBolt11LdkBolt11PaymentSendProbesUsingAmount( + {required LdkBolt11Payment that, + required Bolt11Invoice invoice, + required BigInt amountMsat}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - var arg1 = cst_encode_payment_direction(paymentDirection); - return wire.wire_ldk_node_list_payments_with_filter(port_, arg0, arg1); + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); + var arg1 = cst_encode_box_autoadd_bolt_11_invoice(invoice); + var arg2 = cst_encode_u_64(amountMsat); + return wire + .wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount( + port_, arg0, arg1, arg2); }, codec: DcoCodec( - decodeSuccessData: dco_decode_list_payment_details, - decodeErrorData: null, + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeListPaymentsWithFilterConstMeta, - argValues: [that, paymentDirection], + constMeta: kCrateApiBolt11LdkBolt11PaymentSendProbesUsingAmountConstMeta, + argValues: [that, invoice, amountMsat], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeListPaymentsWithFilterConstMeta => - const TaskConstMeta( - debugName: "ldk_node_list_payments_with_filter", - argNames: ["that", "paymentDirection"], - ); + TaskConstMeta + get kCrateApiBolt11LdkBolt11PaymentSendProbesUsingAmountConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_send_probes_using_amount", + argNames: ["that", "invoice", "amountMsat"], + ); @override - Future> ldkNodeListPeers( - {required LdkNode that, dynamic hint}) { + Future crateApiBolt11LdkBolt11PaymentSendUsingAmount( + {required LdkBolt11Payment that, + required Bolt11Invoice invoice, + required BigInt amountMsat}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_list_peers(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_bolt_11_payment(that); + var arg1 = cst_encode_box_autoadd_bolt_11_invoice(invoice); + var arg2 = cst_encode_u_64(amountMsat); + return wire + .wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount( + port_, arg0, arg1, arg2); }, codec: DcoCodec( - decodeSuccessData: dco_decode_list_peer_details, - decodeErrorData: null, + decodeSuccessData: dco_decode_payment_id, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeListPeersConstMeta, - argValues: [that], + constMeta: kCrateApiBolt11LdkBolt11PaymentSendUsingAmountConstMeta, + argValues: [that, invoice, amountMsat], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeListPeersConstMeta => const TaskConstMeta( - debugName: "ldk_node_list_peers", - argNames: ["that"], + TaskConstMeta get kCrateApiBolt11LdkBolt11PaymentSendUsingAmountConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_11_payment_send_using_amount", + argNames: ["that", "invoice", "amountMsat"], ); @override - Future?> ldkNodeListeningAddresses( - {required LdkNode that, dynamic hint}) { + Future crateApiBolt12LdkBolt12PaymentInitiateRefund( + {required LdkBolt12Payment that, + required BigInt amountMsat, + required int expirySecs}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_listening_addresses(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_bolt_12_payment(that); + var arg1 = cst_encode_u_64(amountMsat); + var arg2 = cst_encode_u_32(expirySecs); + return wire + .wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refund( + port_, arg0, arg1, arg2); }, codec: DcoCodec( - decodeSuccessData: dco_decode_opt_list_socket_address, - decodeErrorData: null, + decodeSuccessData: dco_decode_refund, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeListeningAddressesConstMeta, - argValues: [that], + constMeta: kCrateApiBolt12LdkBolt12PaymentInitiateRefundConstMeta, + argValues: [that, amountMsat, expirySecs], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeListeningAddressesConstMeta => const TaskConstMeta( - debugName: "ldk_node_listening_addresses", - argNames: ["that"], + TaskConstMeta get kCrateApiBolt12LdkBolt12PaymentInitiateRefundConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_12_payment_initiate_refund", + argNames: ["that", "amountMsat", "expirySecs"], ); @override - Future
ldkNodeNewOnchainAddress( - {required LdkNode that, dynamic hint}) { + Future crateApiBolt12LdkBolt12PaymentReceive( + {required LdkBolt12Payment that, + required BigInt amountMsat, + required String description}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_new_onchain_address(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_bolt_12_payment(that); + var arg1 = cst_encode_u_64(amountMsat); + var arg2 = cst_encode_String(description); + return wire.wire__crate__api__bolt12__ldk_bolt_12_payment_receive( + port_, arg0, arg1, arg2); }, codec: DcoCodec( - decodeSuccessData: dco_decode_address, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_offer, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeNewOnchainAddressConstMeta, - argValues: [that], + constMeta: kCrateApiBolt12LdkBolt12PaymentReceiveConstMeta, + argValues: [that, amountMsat, description], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeNewOnchainAddressConstMeta => const TaskConstMeta( - debugName: "ldk_node_new_onchain_address", - argNames: ["that"], + TaskConstMeta get kCrateApiBolt12LdkBolt12PaymentReceiveConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_12_payment_receive", + argNames: ["that", "amountMsat", "description"], ); @override - Future ldkNodeNextEvent({required LdkNode that, dynamic hint}) { + Future crateApiBolt12LdkBolt12PaymentReceiveVariableAmount( + {required LdkBolt12Payment that, required String description}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_next_event(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_bolt_12_payment(that); + var arg1 = cst_encode_String(description); + return wire + .wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amount( + port_, arg0, arg1); }, codec: DcoCodec( - decodeSuccessData: dco_decode_opt_box_autoadd_event, - decodeErrorData: null, + decodeSuccessData: dco_decode_offer, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeNextEventConstMeta, - argValues: [that], + constMeta: kCrateApiBolt12LdkBolt12PaymentReceiveVariableAmountConstMeta, + argValues: [that, description], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeNextEventConstMeta => const TaskConstMeta( - debugName: "ldk_node_next_event", - argNames: ["that"], - ); + TaskConstMeta + get kCrateApiBolt12LdkBolt12PaymentReceiveVariableAmountConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_12_payment_receive_variable_amount", + argNames: ["that", "description"], + ); @override - Future ldkNodeNodeId({required LdkNode that, dynamic hint}) { + Future crateApiBolt12LdkBolt12PaymentRequestRefundPayment( + {required LdkBolt12Payment that, required Refund refund}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_node_id(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_bolt_12_payment(that); + var arg1 = cst_encode_box_autoadd_refund(refund); + return wire + .wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_payment( + port_, arg0, arg1); }, codec: DcoCodec( - decodeSuccessData: dco_decode_public_key, - decodeErrorData: null, + decodeSuccessData: dco_decode_bolt_12_invoice, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeNodeIdConstMeta, - argValues: [that], + constMeta: kCrateApiBolt12LdkBolt12PaymentRequestRefundPaymentConstMeta, + argValues: [that, refund], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeNodeIdConstMeta => const TaskConstMeta( - debugName: "ldk_node_node_id", - argNames: ["that"], - ); + TaskConstMeta + get kCrateApiBolt12LdkBolt12PaymentRequestRefundPaymentConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_12_payment_request_refund_payment", + argNames: ["that", "refund"], + ); @override - Future ldkNodePayment( - {required LdkNode that, required PaymentHash paymentHash, dynamic hint}) { + Future crateApiBolt12LdkBolt12PaymentSend( + {required LdkBolt12Payment that, + required Offer offer, + String? payerNote}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - var arg1 = cst_encode_box_autoadd_payment_hash(paymentHash); - return wire.wire_ldk_node_payment(port_, arg0, arg1); + var arg0 = cst_encode_box_autoadd_ldk_bolt_12_payment(that); + var arg1 = cst_encode_box_autoadd_offer(offer); + var arg2 = cst_encode_opt_String(payerNote); + return wire.wire__crate__api__bolt12__ldk_bolt_12_payment_send( + port_, arg0, arg1, arg2); }, codec: DcoCodec( - decodeSuccessData: dco_decode_opt_box_autoadd_payment_details, - decodeErrorData: null, + decodeSuccessData: dco_decode_payment_id, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodePaymentConstMeta, - argValues: [that, paymentHash], + constMeta: kCrateApiBolt12LdkBolt12PaymentSendConstMeta, + argValues: [that, offer, payerNote], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodePaymentConstMeta => const TaskConstMeta( - debugName: "ldk_node_payment", - argNames: ["that", "paymentHash"], + TaskConstMeta get kCrateApiBolt12LdkBolt12PaymentSendConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_12_payment_send", + argNames: ["that", "offer", "payerNote"], ); @override - Future ldkNodeReceivePayment( - {required LdkNode that, - required int amountMsat, - required String description, - required int expirySecs, - dynamic hint}) { + Future crateApiBolt12LdkBolt12PaymentSendUsingAmount( + {required LdkBolt12Payment that, + required Offer offer, + String? payerNote, + required BigInt amountMsat}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - 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_ldk_node_receive_payment( - port_, arg0, arg1, arg2, arg3); + var arg0 = cst_encode_box_autoadd_ldk_bolt_12_payment(that); + var arg1 = cst_encode_box_autoadd_offer(offer); + var arg2 = cst_encode_opt_String(payerNote); + var arg3 = cst_encode_u_64(amountMsat); + return wire + .wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amount( + port_, arg0, arg1, arg2, arg3); }, codec: DcoCodec( - decodeSuccessData: dco_decode_bolt_11_invoice, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_payment_id, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeReceivePaymentConstMeta, - argValues: [that, amountMsat, description, expirySecs], + constMeta: kCrateApiBolt12LdkBolt12PaymentSendUsingAmountConstMeta, + argValues: [that, offer, payerNote, amountMsat], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeReceivePaymentConstMeta => const TaskConstMeta( - debugName: "ldk_node_receive_payment", - argNames: ["that", "amountMsat", "description", "expirySecs"], + TaskConstMeta get kCrateApiBolt12LdkBolt12PaymentSendUsingAmountConstMeta => + const TaskConstMeta( + debugName: "ldk_bolt_12_payment_send_using_amount", + argNames: ["that", "offer", "payerNote", "amountMsat"], ); @override - 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_ldk_node(that); - var arg1 = cst_encode_String(description); - var arg2 = cst_encode_u_32(expirySecs); - return wire.wire_ldk_node_receive_variable_amount_payment( - port_, arg0, arg1, arg2); + Builder crateApiBuilderNodeBuilderAutoAccessorGetBuilder( + {required NodeBuilder that}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + that); + return wire + .wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder( + arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_bolt_11_invoice, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_RustOpaque_ldk_nodeBuilder, + decodeErrorData: null, ), - constMeta: kLdkNodeReceiveVariableAmountPaymentConstMeta, - argValues: [that, description, expirySecs], + constMeta: kCrateApiBuilderNodeBuilderAutoAccessorGetBuilderConstMeta, + argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeReceiveVariableAmountPaymentConstMeta => - const TaskConstMeta( - debugName: "ldk_node_receive_variable_amount_payment", - argNames: ["that", "description", "expirySecs"], - ); + TaskConstMeta + get kCrateApiBuilderNodeBuilderAutoAccessorGetBuilderConstMeta => + const TaskConstMeta( + debugName: "NodeBuilder_auto_accessor_get_builder", + argNames: ["that"], + ); @override - Future ldkNodeRemovePayment( - {required LdkNode that, required PaymentHash paymentHash, dynamic hint}) { - return handler.executeNormal(NormalTask( - callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - var arg1 = cst_encode_box_autoadd_payment_hash(paymentHash); - return wire.wire_ldk_node_remove_payment(port_, arg0, arg1); + void crateApiBuilderNodeBuilderAutoAccessorSetBuilder( + {required NodeBuilder that, required Builder builder}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + that); + var arg1 = cst_encode_RustOpaque_ldk_nodeBuilder(builder); + return wire + .wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder( + arg0, arg1); }, codec: DcoCodec( decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeErrorData: null, ), - constMeta: kLdkNodeRemovePaymentConstMeta, - argValues: [that, paymentHash], + constMeta: kCrateApiBuilderNodeBuilderAutoAccessorSetBuilderConstMeta, + argValues: [that, builder], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeRemovePaymentConstMeta => const TaskConstMeta( - debugName: "ldk_node_remove_payment", - argNames: ["that", "paymentHash"], - ); + TaskConstMeta + get kCrateApiBuilderNodeBuilderAutoAccessorSetBuilderConstMeta => + const TaskConstMeta( + debugName: "NodeBuilder_auto_accessor_set_builder", + argNames: ["that", "builder"], + ); @override - Future ldkNodeSendAllToOnchainAddress( - {required LdkNode that, required Address address, dynamic hint}) { + Future crateApiBuilderNodeBuilderBuild({required NodeBuilder that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - var arg1 = cst_encode_box_autoadd_address(address); - return wire.wire_ldk_node_send_all_to_onchain_address( - port_, arg0, arg1); + var arg0 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + that); + return wire.wire__crate__api__builder__NodeBuilder_build(port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_txid, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_ldk_node, + decodeErrorData: dco_decode_ldk_builder_error, ), - constMeta: kLdkNodeSendAllToOnchainAddressConstMeta, - argValues: [that, address], + constMeta: kCrateApiBuilderNodeBuilderBuildConstMeta, + argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeSendAllToOnchainAddressConstMeta => + TaskConstMeta get kCrateApiBuilderNodeBuilderBuildConstMeta => const TaskConstMeta( - debugName: "ldk_node_send_all_to_onchain_address", - argNames: ["that", "address"], + debugName: "NodeBuilder_build", + argNames: ["that"], ); @override - Future ldkNodeSendPayment( - {required LdkNode that, required Bolt11Invoice invoice, dynamic hint}) { + Future crateApiBuilderNodeBuilderBuildWithFsStore( + {required NodeBuilder that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - var arg1 = cst_encode_box_autoadd_bolt_11_invoice(invoice); - return wire.wire_ldk_node_send_payment(port_, arg0, arg1); + var arg0 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + that); + return wire.wire__crate__api__builder__NodeBuilder_build_with_fs_store( + port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_payment_hash, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_ldk_node, + decodeErrorData: dco_decode_ldk_builder_error, ), - constMeta: kLdkNodeSendPaymentConstMeta, - argValues: [that, invoice], + constMeta: kCrateApiBuilderNodeBuilderBuildWithFsStoreConstMeta, + argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeSendPaymentConstMeta => const TaskConstMeta( - debugName: "ldk_node_send_payment", - argNames: ["that", "invoice"], + TaskConstMeta get kCrateApiBuilderNodeBuilderBuildWithFsStoreConstMeta => + const TaskConstMeta( + debugName: "NodeBuilder_build_with_fs_store", + argNames: ["that"], ); @override - Future ldkNodeSendPaymentProbes( - {required LdkNode that, required Bolt11Invoice invoice, dynamic hint}) { + Future crateApiBuilderNodeBuilderCreateBuilder( + {required Config config, + ChainDataSourceConfig? chainDataSourceConfig, + EntropySourceConfig? entropySourceConfig, + GossipSourceConfig? gossipSourceConfig, + LiquiditySourceConfig? liquiditySourceConfig}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - var arg1 = cst_encode_box_autoadd_bolt_11_invoice(invoice); - return wire.wire_ldk_node_send_payment_probes(port_, arg0, arg1); + 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__crate__api__builder__NodeBuilder_create_builder( + port_, arg0, arg1, arg2, arg3, arg4); }, codec: DcoCodec( - decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder, + decodeErrorData: dco_decode_ldk_builder_error, ), - constMeta: kLdkNodeSendPaymentProbesConstMeta, - argValues: [that, invoice], + constMeta: kCrateApiBuilderNodeBuilderCreateBuilderConstMeta, + argValues: [ + config, + chainDataSourceConfig, + entropySourceConfig, + gossipSourceConfig, + liquiditySourceConfig + ], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeSendPaymentProbesConstMeta => const TaskConstMeta( - debugName: "ldk_node_send_payment_probes", - argNames: ["that", "invoice"], + TaskConstMeta get kCrateApiBuilderNodeBuilderCreateBuilderConstMeta => + const TaskConstMeta( + debugName: "NodeBuilder_create_builder", + argNames: [ + "config", + "chainDataSourceConfig", + "entropySourceConfig", + "gossipSourceConfig", + "liquiditySourceConfig" + ], ); @override - Future ldkNodeSendPaymentProbesUsingAmount( - {required LdkNode that, - required Bolt11Invoice invoice, - required int amountMsat, - dynamic hint}) { + Future crateApiBuilderLdkMnemonicGenerate() { return handler.executeNormal(NormalTask( callFfi: (port_) { - 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_ldk_node_send_payment_probes_using_amount( - port_, arg0, arg1, arg2); + return wire.wire__crate__api__builder__ldk_mnemonic_generate(port_); }, codec: DcoCodec( - decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_ldk_mnemonic, + decodeErrorData: null, ), - constMeta: kLdkNodeSendPaymentProbesUsingAmountConstMeta, - argValues: [that, invoice, amountMsat], + constMeta: kCrateApiBuilderLdkMnemonicGenerateConstMeta, + argValues: [], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeSendPaymentProbesUsingAmountConstMeta => + TaskConstMeta get kCrateApiBuilderLdkMnemonicGenerateConstMeta => const TaskConstMeta( - debugName: "ldk_node_send_payment_probes_using_amount", - argNames: ["that", "invoice", "amountMsat"], + debugName: "ldk_mnemonic_generate", + argNames: [], ); @override - Future ldkNodeSendPaymentUsingAmount( - {required LdkNode that, - required Bolt11Invoice invoice, - required int amountMsat, - dynamic hint}) { + Future crateApiGraphLdkNetworkGraphChannel( + {required LdkNetworkGraph that, required BigInt shortChannelId}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - 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_ldk_node_send_payment_using_amount( - port_, arg0, arg1, arg2); + var arg0 = cst_encode_box_autoadd_ldk_network_graph(that); + var arg1 = cst_encode_u_64(shortChannelId); + return wire.wire__crate__api__graph__ldk_network_graph_channel( + port_, arg0, arg1); }, codec: DcoCodec( - decodeSuccessData: dco_decode_payment_hash, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_opt_box_autoadd_channel_info, + decodeErrorData: null, ), - constMeta: kLdkNodeSendPaymentUsingAmountConstMeta, - argValues: [that, invoice, amountMsat], + constMeta: kCrateApiGraphLdkNetworkGraphChannelConstMeta, + argValues: [that, shortChannelId], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeSendPaymentUsingAmountConstMeta => + TaskConstMeta get kCrateApiGraphLdkNetworkGraphChannelConstMeta => const TaskConstMeta( - debugName: "ldk_node_send_payment_using_amount", - argNames: ["that", "invoice", "amountMsat"], + debugName: "ldk_network_graph_channel", + argNames: ["that", "shortChannelId"], ); @override - Future ldkNodeSendSpontaneousPayment( - {required LdkNode that, - required int amountMsat, - required PublicKey nodeId, - dynamic hint}) { + Future crateApiGraphLdkNetworkGraphListChannels( + {required LdkNetworkGraph that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - 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_ldk_node_send_spontaneous_payment( - port_, arg0, arg1, arg2); + var arg0 = cst_encode_box_autoadd_ldk_network_graph(that); + return wire.wire__crate__api__graph__ldk_network_graph_list_channels( + port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_payment_hash, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_list_prim_u_64_strict, + decodeErrorData: null, ), - constMeta: kLdkNodeSendSpontaneousPaymentConstMeta, - argValues: [that, amountMsat, nodeId], + constMeta: kCrateApiGraphLdkNetworkGraphListChannelsConstMeta, + argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeSendSpontaneousPaymentConstMeta => + TaskConstMeta get kCrateApiGraphLdkNetworkGraphListChannelsConstMeta => const TaskConstMeta( - debugName: "ldk_node_send_spontaneous_payment", - argNames: ["that", "amountMsat", "nodeId"], + debugName: "ldk_network_graph_list_channels", + argNames: ["that"], ); @override - Future ldkNodeSendSpontaneousPaymentProbes( - {required LdkNode that, - required int amountMsat, - required PublicKey nodeId, - dynamic hint}) { + Future> crateApiGraphLdkNetworkGraphListNodes( + {required LdkNetworkGraph that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - 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_ldk_node_send_spontaneous_payment_probes( - port_, arg0, arg1, arg2); + var arg0 = cst_encode_box_autoadd_ldk_network_graph(that); + return wire.wire__crate__api__graph__ldk_network_graph_list_nodes( + port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_list_node_id, + decodeErrorData: null, ), - constMeta: kLdkNodeSendSpontaneousPaymentProbesConstMeta, - argValues: [that, amountMsat, nodeId], + constMeta: kCrateApiGraphLdkNetworkGraphListNodesConstMeta, + argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeSendSpontaneousPaymentProbesConstMeta => + TaskConstMeta get kCrateApiGraphLdkNetworkGraphListNodesConstMeta => const TaskConstMeta( - debugName: "ldk_node_send_spontaneous_payment_probes", - argNames: ["that", "amountMsat", "nodeId"], + debugName: "ldk_network_graph_list_nodes", + argNames: ["that"], ); @override - Future ldkNodeSendToOnchainAddress( - {required LdkNode that, - required Address address, - required int amountSats, - dynamic hint}) { + Future crateApiGraphLdkNetworkGraphNode( + {required LdkNetworkGraph that, required NodeId nodeId}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - 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_ldk_node_send_to_onchain_address( - port_, arg0, arg1, arg2); + var arg0 = cst_encode_box_autoadd_ldk_network_graph(that); + var arg1 = cst_encode_box_autoadd_node_id(nodeId); + return wire.wire__crate__api__graph__ldk_network_graph_node( + port_, arg0, arg1); }, codec: DcoCodec( - decodeSuccessData: dco_decode_txid, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_opt_box_autoadd_node_info, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeSendToOnchainAddressConstMeta, - argValues: [that, address, amountSats], + constMeta: kCrateApiGraphLdkNetworkGraphNodeConstMeta, + argValues: [that, nodeId], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeSendToOnchainAddressConstMeta => + TaskConstMeta get kCrateApiGraphLdkNetworkGraphNodeConstMeta => const TaskConstMeta( - debugName: "ldk_node_send_to_onchain_address", - argNames: ["that", "address", "amountSats"], + debugName: "ldk_network_graph_node", + argNames: ["that", "nodeId"], ); @override - Future ldkNodeSignMessage( - {required LdkNode that, required List msg, dynamic hint}) { + Future crateApiNodeLdkNodeBolt11Payment( + {required LdkNode ptr}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - var arg1 = cst_encode_list_prim_u_8_loose(msg); - return wire.wire_ldk_node_sign_message(port_, arg0, arg1); + var arg0 = cst_encode_box_autoadd_ldk_node(ptr); + return wire.wire__crate__api__node__ldk_node_bolt11_payment( + port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_String, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_ldk_bolt_11_payment, + decodeErrorData: null, ), - constMeta: kLdkNodeSignMessageConstMeta, - argValues: [that, msg], + constMeta: kCrateApiNodeLdkNodeBolt11PaymentConstMeta, + argValues: [ptr], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeSignMessageConstMeta => const TaskConstMeta( - debugName: "ldk_node_sign_message", - argNames: ["that", "msg"], + TaskConstMeta get kCrateApiNodeLdkNodeBolt11PaymentConstMeta => + const TaskConstMeta( + debugName: "ldk_node_bolt11_payment", + argNames: ["ptr"], ); @override - Future ldkNodeSpendableOnchainBalanceSats( - {required LdkNode that, dynamic hint}) { + Future crateApiNodeLdkNodeBolt12Payment( + {required LdkNode ptr}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_spendable_onchain_balance_sats(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_node(ptr); + return wire.wire__crate__api__node__ldk_node_bolt12_payment( + port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_u_64, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_ldk_bolt_12_payment, + decodeErrorData: null, ), - constMeta: kLdkNodeSpendableOnchainBalanceSatsConstMeta, - argValues: [that], + constMeta: kCrateApiNodeLdkNodeBolt12PaymentConstMeta, + argValues: [ptr], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeSpendableOnchainBalanceSatsConstMeta => + TaskConstMeta get kCrateApiNodeLdkNodeBolt12PaymentConstMeta => const TaskConstMeta( - debugName: "ldk_node_spendable_onchain_balance_sats", - argNames: ["that"], + debugName: "ldk_node_bolt12_payment", + argNames: ["ptr"], ); @override - Future ldkNodeStart({required LdkNode that, dynamic hint}) { + Future crateApiNodeLdkNodeCloseChannel( + {required LdkNode that, + required UserChannelId userChannelId, + required PublicKey counterpartyNodeId}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_start(port_, arg0); + var arg1 = cst_encode_box_autoadd_user_channel_id(userChannelId); + var arg2 = cst_encode_box_autoadd_public_key(counterpartyNodeId); + return wire.wire__crate__api__node__ldk_node_close_channel( + port_, arg0, arg1, arg2); }, codec: DcoCodec( decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeStartConstMeta, - argValues: [that], + constMeta: kCrateApiNodeLdkNodeCloseChannelConstMeta, + argValues: [that, userChannelId, counterpartyNodeId], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeStartConstMeta => const TaskConstMeta( - debugName: "ldk_node_start", - argNames: ["that"], + TaskConstMeta get kCrateApiNodeLdkNodeCloseChannelConstMeta => + const TaskConstMeta( + debugName: "ldk_node_close_channel", + argNames: ["that", "userChannelId", "counterpartyNodeId"], ); @override - Future ldkNodeStop({required LdkNode that, dynamic hint}) { + Future crateApiNodeLdkNodeConfig({required LdkNode that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_stop(port_, arg0); + return wire.wire__crate__api__node__ldk_node_config(port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_config, + decodeErrorData: null, ), - constMeta: kLdkNodeStopConstMeta, + constMeta: kCrateApiNodeLdkNodeConfigConstMeta, argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeStopConstMeta => const TaskConstMeta( - debugName: "ldk_node_stop", + TaskConstMeta get kCrateApiNodeLdkNodeConfigConstMeta => const TaskConstMeta( + debugName: "ldk_node_config", argNames: ["that"], ); @override - Future ldkNodeSyncWallets({required LdkNode that, dynamic hint}) { + Future crateApiNodeLdkNodeConnect( + {required LdkNode that, + required PublicKey nodeId, + required SocketAddress address, + required bool persist}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_sync_wallets(port_, arg0); + 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__crate__api__node__ldk_node_connect( + port_, arg0, arg1, arg2, arg3); }, codec: DcoCodec( decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeSyncWalletsConstMeta, - argValues: [that], + constMeta: kCrateApiNodeLdkNodeConnectConstMeta, + argValues: [that, nodeId, address, persist], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeSyncWalletsConstMeta => const TaskConstMeta( - debugName: "ldk_node_sync_wallets", - argNames: ["that"], + TaskConstMeta get kCrateApiNodeLdkNodeConnectConstMeta => const TaskConstMeta( + debugName: "ldk_node_connect", + argNames: ["that", "nodeId", "address", "persist"], ); @override - Future ldkNodeTotalOnchainBalanceSats( - {required LdkNode that, dynamic hint}) { + Future crateApiNodeLdkNodeConnectOpenChannel( + {required LdkNode that, + required SocketAddress socketAddress, + required PublicKey nodeId, + required BigInt channelAmountSats, + BigInt? pushToCounterpartyMsat, + required bool announceChannel, + ChannelConfig? channelConfig}) { 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); + 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__crate__api__node__ldk_node_connect_open_channel( + port_, arg0, arg1, arg2, arg3, arg4, arg5, arg6); }, codec: DcoCodec( - decodeSuccessData: dco_decode_u_64, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_user_channel_id, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeTotalOnchainBalanceSatsConstMeta, + constMeta: kCrateApiNodeLdkNodeConnectOpenChannelConstMeta, + argValues: [ + that, + socketAddress, + nodeId, + channelAmountSats, + pushToCounterpartyMsat, + announceChannel, + channelConfig + ], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeConnectOpenChannelConstMeta => + const TaskConstMeta( + debugName: "ldk_node_connect_open_channel", + argNames: [ + "that", + "socketAddress", + "nodeId", + "channelAmountSats", + "pushToCounterpartyMsat", + "announceChannel", + "channelConfig" + ], + ); + + @override + Future crateApiNodeLdkNodeDisconnect( + {required LdkNode that, required PublicKey counterpartyNodeId}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + var arg1 = cst_encode_box_autoadd_public_key(counterpartyNodeId); + return wire.wire__crate__api__node__ldk_node_disconnect( + port_, arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiNodeLdkNodeDisconnectConstMeta, + argValues: [that, counterpartyNodeId], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeDisconnectConstMeta => + const TaskConstMeta( + debugName: "ldk_node_disconnect", + argNames: ["that", "counterpartyNodeId"], + ); + + @override + Future crateApiNodeLdkNodeEventHandled({required LdkNode that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire__crate__api__node__ldk_node_event_handled(port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: null, + ), + constMeta: kCrateApiNodeLdkNodeEventHandledConstMeta, argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeTotalOnchainBalanceSatsConstMeta => + TaskConstMeta get kCrateApiNodeLdkNodeEventHandledConstMeta => const TaskConstMeta( - debugName: "ldk_node_total_onchain_balance_sats", + debugName: "ldk_node_event_handled", argNames: ["that"], ); @override - Future ldkNodeUpdateChannelConfig( + Future crateApiNodeLdkNodeForceCloseChannel( {required LdkNode that, - required ChannelId channelId, - required PublicKey counterpartyNodeId, - required ChannelConfig channelConfig, - dynamic hint}) { + required UserChannelId userChannelId, + required PublicKey counterpartyNodeId}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); - var arg1 = cst_encode_box_autoadd_channel_id(channelId); + var arg1 = cst_encode_box_autoadd_user_channel_id(userChannelId); var arg2 = cst_encode_box_autoadd_public_key(counterpartyNodeId); - var arg3 = cst_encode_box_autoadd_channel_config(channelConfig); - return wire.wire_ldk_node_update_channel_config( - port_, arg0, arg1, arg2, arg3); + return wire.wire__crate__api__node__ldk_node_force_close_channel( + port_, arg0, arg1, arg2); }, codec: DcoCodec( decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_exception, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeUpdateChannelConfigConstMeta, - argValues: [that, channelId, counterpartyNodeId, channelConfig], + constMeta: kCrateApiNodeLdkNodeForceCloseChannelConstMeta, + argValues: [that, userChannelId, counterpartyNodeId], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeUpdateChannelConfigConstMeta => const TaskConstMeta( - debugName: "ldk_node_update_channel_config", - argNames: ["that", "channelId", "counterpartyNodeId", "channelConfig"], + TaskConstMeta get kCrateApiNodeLdkNodeForceCloseChannelConstMeta => + const TaskConstMeta( + debugName: "ldk_node_force_close_channel", + argNames: ["that", "userChannelId", "counterpartyNodeId"], ); @override - Future ldkNodeVerifySignature( - {required LdkNode that, - required List msg, - required String sig, - required PublicKey pkey, - dynamic hint}) { + Future crateApiNodeLdkNodeListBalances( + {required LdkNode that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { 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_ldk_node_verify_signature( - port_, arg0, arg1, arg2, arg3); + return wire.wire__crate__api__node__ldk_node_list_balances(port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_bool, - decodeErrorData: dco_decode_node_exception, + decodeSuccessData: dco_decode_balance_details, + decodeErrorData: dco_decode_ldk_node_error, ), - constMeta: kLdkNodeVerifySignatureConstMeta, - argValues: [that, msg, sig, pkey], + constMeta: kCrateApiNodeLdkNodeListBalancesConstMeta, + argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeVerifySignatureConstMeta => const TaskConstMeta( - debugName: "ldk_node_verify_signature", - argNames: ["that", "msg", "sig", "pkey"], + TaskConstMeta get kCrateApiNodeLdkNodeListBalancesConstMeta => + const TaskConstMeta( + debugName: "ldk_node_list_balances", + argNames: ["that"], ); @override - Future ldkNodeWaitNextEvent({required LdkNode that, dynamic hint}) { + Future> crateApiNodeLdkNodeListChannels( + {required LdkNode that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_ldk_node(that); - return wire.wire_ldk_node_wait_next_event(port_, arg0); + return wire.wire__crate__api__node__ldk_node_list_channels(port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_event, + decodeSuccessData: dco_decode_list_channel_details, decodeErrorData: null, ), - constMeta: kLdkNodeWaitNextEventConstMeta, + constMeta: kCrateApiNodeLdkNodeListChannelsConstMeta, argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kLdkNodeWaitNextEventConstMeta => const TaskConstMeta( - debugName: "ldk_node_wait_next_event", + TaskConstMeta get kCrateApiNodeLdkNodeListChannelsConstMeta => + const TaskConstMeta( + debugName: "ldk_node_list_channels", argNames: ["that"], ); @override - Future socketAddressAsString( - {required SocketAddress that, dynamic hint}) { + Future> crateApiNodeLdkNodeListPayments( + {required LdkNode that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_socket_address(that); - return wire.wire_socket_address_as_string(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire__crate__api__node__ldk_node_list_payments(port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_String, + decodeSuccessData: dco_decode_list_payment_details, decodeErrorData: null, ), - constMeta: kSocketAddressAsStringConstMeta, + constMeta: kCrateApiNodeLdkNodeListPaymentsConstMeta, argValues: [that], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kSocketAddressAsStringConstMeta => const TaskConstMeta( - debugName: "socket_address_as_string", + TaskConstMeta get kCrateApiNodeLdkNodeListPaymentsConstMeta => + const TaskConstMeta( + debugName: "ldk_node_list_payments", argNames: ["that"], ); @override - Future socketAddressFromStr( - {required String address, dynamic hint}) { + Future> crateApiNodeLdkNodeListPaymentsWithFilter( + {required LdkNode that, required PaymentDirection paymentDirection}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_String(address); - return wire.wire_socket_address_from_str(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_node(that); + var arg1 = cst_encode_payment_direction(paymentDirection); + return wire.wire__crate__api__node__ldk_node_list_payments_with_filter( + port_, arg0, arg1); }, codec: DcoCodec( - decodeSuccessData: dco_decode_socket_address, - decodeErrorData: dco_decode_builder_exception, + decodeSuccessData: dco_decode_list_payment_details, + decodeErrorData: null, ), - constMeta: kSocketAddressFromStrConstMeta, - argValues: [address], + constMeta: kCrateApiNodeLdkNodeListPaymentsWithFilterConstMeta, + argValues: [that, paymentDirection], apiImpl: this, - hint: hint, )); } - TaskConstMeta get kSocketAddressFromStrConstMeta => const TaskConstMeta( - debugName: "socket_address_from_str", - argNames: ["address"], + TaskConstMeta get kCrateApiNodeLdkNodeListPaymentsWithFilterConstMeta => + const TaskConstMeta( + debugName: "ldk_node_list_payments_with_filter", + argNames: ["that", "paymentDirection"], ); - RustArcIncrementStrongCountFnType - get rust_arc_increment_strong_count_NodeSqliteStore => - wire.rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore; + @override + Future> crateApiNodeLdkNodeListPeers( + {required LdkNode that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire__crate__api__node__ldk_node_list_peers(port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_list_peer_details, + decodeErrorData: null, + ), + constMeta: kCrateApiNodeLdkNodeListPeersConstMeta, + argValues: [that], + apiImpl: this, + )); + } - RustArcDecrementStrongCountFnType - get rust_arc_decrement_strong_count_NodeSqliteStore => - wire.rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore; + TaskConstMeta get kCrateApiNodeLdkNodeListPeersConstMeta => + const TaskConstMeta( + debugName: "ldk_node_list_peers", + argNames: ["that"], + ); - @protected - NodeSqliteStore dco_decode_RustOpaque_NodeSqliteStore(dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - return NodeSqliteStore.dcoDecode(raw as List); + @override + Future?> crateApiNodeLdkNodeListeningAddresses( + {required LdkNode that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire__crate__api__node__ldk_node_listening_addresses( + port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_opt_list_socket_address, + decodeErrorData: null, + ), + constMeta: kCrateApiNodeLdkNodeListeningAddressesConstMeta, + argValues: [that], + apiImpl: this, + )); } - @protected - String dco_decode_String(dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - return raw as String; + TaskConstMeta get kCrateApiNodeLdkNodeListeningAddressesConstMeta => + const TaskConstMeta( + debugName: "ldk_node_listening_addresses", + argNames: ["that"], + ); + + @override + Future crateApiNodeLdkNodeNetworkGraph( + {required LdkNode ptr}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(ptr); + return wire.wire__crate__api__node__ldk_node_network_graph(port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_ldk_network_graph, + decodeErrorData: null, + ), + constMeta: kCrateApiNodeLdkNodeNetworkGraphConstMeta, + argValues: [ptr], + apiImpl: this, + )); } - @protected - Address dco_decode_address(dynamic raw) { + TaskConstMeta get kCrateApiNodeLdkNodeNetworkGraphConstMeta => + const TaskConstMeta( + debugName: "ldk_node_network_graph", + argNames: ["ptr"], + ); + + @override + Future crateApiNodeLdkNodeNextEvent({required LdkNode that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire__crate__api__node__ldk_node_next_event(port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_opt_box_autoadd_event, + decodeErrorData: null, + ), + constMeta: kCrateApiNodeLdkNodeNextEventConstMeta, + argValues: [that], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeNextEventConstMeta => + const TaskConstMeta( + debugName: "ldk_node_next_event", + argNames: ["that"], + ); + + @override + Future crateApiNodeLdkNodeNextEventAsync({required LdkNode that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire__crate__api__node__ldk_node_next_event_async( + port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_event, + decodeErrorData: null, + ), + constMeta: kCrateApiNodeLdkNodeNextEventAsyncConstMeta, + argValues: [that], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeNextEventAsyncConstMeta => + const TaskConstMeta( + debugName: "ldk_node_next_event_async", + argNames: ["that"], + ); + + @override + Future crateApiNodeLdkNodeNodeId({required LdkNode that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire__crate__api__node__ldk_node_node_id(port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_public_key, + decodeErrorData: null, + ), + constMeta: kCrateApiNodeLdkNodeNodeIdConstMeta, + argValues: [that], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeNodeIdConstMeta => const TaskConstMeta( + debugName: "ldk_node_node_id", + argNames: ["that"], + ); + + @override + Future crateApiNodeLdkNodeOnChainPayment( + {required LdkNode ptr}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(ptr); + return wire.wire__crate__api__node__ldk_node_on_chain_payment( + port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_ldk_on_chain_payment, + decodeErrorData: null, + ), + constMeta: kCrateApiNodeLdkNodeOnChainPaymentConstMeta, + argValues: [ptr], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeOnChainPaymentConstMeta => + const TaskConstMeta( + debugName: "ldk_node_on_chain_payment", + argNames: ["ptr"], + ); + + @override + Future crateApiNodeLdkNodePayment( + {required LdkNode that, required PaymentId paymentId}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + var arg1 = cst_encode_box_autoadd_payment_id(paymentId); + return wire.wire__crate__api__node__ldk_node_payment(port_, arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_opt_box_autoadd_payment_details, + decodeErrorData: null, + ), + constMeta: kCrateApiNodeLdkNodePaymentConstMeta, + argValues: [that, paymentId], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodePaymentConstMeta => const TaskConstMeta( + debugName: "ldk_node_payment", + argNames: ["that", "paymentId"], + ); + + @override + Future crateApiNodeLdkNodeRemovePayment( + {required LdkNode that, required PaymentId paymentId}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + var arg1 = cst_encode_box_autoadd_payment_id(paymentId); + return wire.wire__crate__api__node__ldk_node_remove_payment( + port_, arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiNodeLdkNodeRemovePaymentConstMeta, + argValues: [that, paymentId], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeRemovePaymentConstMeta => + const TaskConstMeta( + debugName: "ldk_node_remove_payment", + argNames: ["that", "paymentId"], + ); + + @override + Future crateApiNodeLdkNodeSignMessage( + {required LdkNode that, required List msg}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + var arg1 = cst_encode_list_prim_u_8_loose(msg); + return wire.wire__crate__api__node__ldk_node_sign_message( + port_, arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiNodeLdkNodeSignMessageConstMeta, + argValues: [that, msg], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeSignMessageConstMeta => + const TaskConstMeta( + debugName: "ldk_node_sign_message", + argNames: ["that", "msg"], + ); + + @override + Future crateApiNodeLdkNodeSpontaneousPayment( + {required LdkNode ptr}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(ptr); + return wire.wire__crate__api__node__ldk_node_spontaneous_payment( + port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_ldk_spontaneous_payment, + decodeErrorData: null, + ), + constMeta: kCrateApiNodeLdkNodeSpontaneousPaymentConstMeta, + argValues: [ptr], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeSpontaneousPaymentConstMeta => + const TaskConstMeta( + debugName: "ldk_node_spontaneous_payment", + argNames: ["ptr"], + ); + + @override + Future crateApiNodeLdkNodeStart({required LdkNode that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire__crate__api__node__ldk_node_start(port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiNodeLdkNodeStartConstMeta, + argValues: [that], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeStartConstMeta => const TaskConstMeta( + debugName: "ldk_node_start", + argNames: ["that"], + ); + + @override + Future crateApiNodeLdkNodeStatus({required LdkNode that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire__crate__api__node__ldk_node_status(port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_node_status, + decodeErrorData: null, + ), + constMeta: kCrateApiNodeLdkNodeStatusConstMeta, + argValues: [that], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeStatusConstMeta => const TaskConstMeta( + debugName: "ldk_node_status", + argNames: ["that"], + ); + + @override + Future crateApiNodeLdkNodeStop({required LdkNode that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire__crate__api__node__ldk_node_stop(port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiNodeLdkNodeStopConstMeta, + argValues: [that], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeStopConstMeta => const TaskConstMeta( + debugName: "ldk_node_stop", + argNames: ["that"], + ); + + @override + Future crateApiNodeLdkNodeSyncWallets({required LdkNode that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire__crate__api__node__ldk_node_sync_wallets(port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiNodeLdkNodeSyncWalletsConstMeta, + argValues: [that], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeSyncWalletsConstMeta => + const TaskConstMeta( + debugName: "ldk_node_sync_wallets", + argNames: ["that"], + ); + + @override + Future crateApiNodeLdkNodeUpdateChannelConfig( + {required LdkNode that, + required UserChannelId userChannelId, + required PublicKey counterpartyNodeId, + required ChannelConfig channelConfig}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + var arg1 = cst_encode_box_autoadd_user_channel_id(userChannelId); + var arg2 = cst_encode_box_autoadd_public_key(counterpartyNodeId); + var arg3 = cst_encode_box_autoadd_channel_config(channelConfig); + return wire.wire__crate__api__node__ldk_node_update_channel_config( + port_, arg0, arg1, arg2, arg3); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiNodeLdkNodeUpdateChannelConfigConstMeta, + argValues: [that, userChannelId, counterpartyNodeId, channelConfig], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeUpdateChannelConfigConstMeta => + const TaskConstMeta( + debugName: "ldk_node_update_channel_config", + argNames: [ + "that", + "userChannelId", + "counterpartyNodeId", + "channelConfig" + ], + ); + + @override + Future crateApiNodeLdkNodeVerifySignature( + {required LdkNode that, + required List msg, + required String sig, + required PublicKey publicKey}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + 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(publicKey); + return wire.wire__crate__api__node__ldk_node_verify_signature( + port_, arg0, arg1, arg2, arg3); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_bool, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiNodeLdkNodeVerifySignatureConstMeta, + argValues: [that, msg, sig, publicKey], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeVerifySignatureConstMeta => + const TaskConstMeta( + debugName: "ldk_node_verify_signature", + argNames: ["that", "msg", "sig", "publicKey"], + ); + + @override + Future crateApiNodeLdkNodeWaitNextEvent({required LdkNode that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire__crate__api__node__ldk_node_wait_next_event( + port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_event, + decodeErrorData: null, + ), + constMeta: kCrateApiNodeLdkNodeWaitNextEventConstMeta, + argValues: [that], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiNodeLdkNodeWaitNextEventConstMeta => + const TaskConstMeta( + debugName: "ldk_node_wait_next_event", + argNames: ["that"], + ); + + @override + Future
crateApiOnChainLdkOnChainPaymentNewAddress( + {required LdkOnChainPayment that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_on_chain_payment(that); + return wire + .wire__crate__api__on_chain__ldk_on_chain_payment_new_address( + port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_address, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiOnChainLdkOnChainPaymentNewAddressConstMeta, + argValues: [that], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiOnChainLdkOnChainPaymentNewAddressConstMeta => + const TaskConstMeta( + debugName: "ldk_on_chain_payment_new_address", + argNames: ["that"], + ); + + @override + Future crateApiOnChainLdkOnChainPaymentSendAllToAddress( + {required LdkOnChainPayment that, required Address address}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_on_chain_payment(that); + var arg1 = cst_encode_box_autoadd_address(address); + return wire + .wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address( + port_, arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_txid, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiOnChainLdkOnChainPaymentSendAllToAddressConstMeta, + argValues: [that, address], + apiImpl: this, + )); + } + + TaskConstMeta + get kCrateApiOnChainLdkOnChainPaymentSendAllToAddressConstMeta => + const TaskConstMeta( + debugName: "ldk_on_chain_payment_send_all_to_address", + argNames: ["that", "address"], + ); + + @override + Future crateApiOnChainLdkOnChainPaymentSendToAddress( + {required LdkOnChainPayment that, + required Address address, + required BigInt amountSats}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_on_chain_payment(that); + var arg1 = cst_encode_box_autoadd_address(address); + var arg2 = cst_encode_u_64(amountSats); + return wire + .wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address( + port_, arg0, arg1, arg2); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_txid, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiOnChainLdkOnChainPaymentSendToAddressConstMeta, + argValues: [that, address, amountSats], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiOnChainLdkOnChainPaymentSendToAddressConstMeta => + const TaskConstMeta( + debugName: "ldk_on_chain_payment_send_to_address", + argNames: ["that", "address", "amountSats"], + ); + + @override + Future crateApiSpontaneousLdkSpontaneousPaymentSend( + {required LdkSpontaneousPayment that, + required BigInt amountMsat, + required PublicKey nodeId}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_spontaneous_payment(that); + var arg1 = cst_encode_u_64(amountMsat); + var arg2 = cst_encode_box_autoadd_public_key(nodeId); + return wire.wire__crate__api__spontaneous__ldk_spontaneous_payment_send( + port_, arg0, arg1, arg2); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_payment_id, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiSpontaneousLdkSpontaneousPaymentSendConstMeta, + argValues: [that, amountMsat, nodeId], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiSpontaneousLdkSpontaneousPaymentSendConstMeta => + const TaskConstMeta( + debugName: "ldk_spontaneous_payment_send", + argNames: ["that", "amountMsat", "nodeId"], + ); + + @override + Future crateApiSpontaneousLdkSpontaneousPaymentSendProbes( + {required LdkSpontaneousPayment that, + required BigInt amountMsat, + required PublicKey nodeId}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_spontaneous_payment(that); + var arg1 = cst_encode_u_64(amountMsat); + var arg2 = cst_encode_box_autoadd_public_key(nodeId); + return wire + .wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes( + port_, arg0, arg1, arg2); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_ldk_node_error, + ), + constMeta: kCrateApiSpontaneousLdkSpontaneousPaymentSendProbesConstMeta, + argValues: [that, amountMsat, nodeId], + apiImpl: this, + )); + } + + TaskConstMeta + get kCrateApiSpontaneousLdkSpontaneousPaymentSendProbesConstMeta => + const TaskConstMeta( + debugName: "ldk_spontaneous_payment_send_probes", + argNames: ["that", "amountMsat", "nodeId"], + ); + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_ArcBolt12Payment => wire + .rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_ArcBolt12Payment => wire + .rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment; + + RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_Node => + wire.rust_arc_increment_strong_count_RustOpaque_Node; + + RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_Node => + wire.rust_arc_decrement_strong_count_RustOpaque_Node; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_NodeBuilder => wire + .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_NodeBuilder => wire + .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_Builder => + wire.rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilder; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_Builder => + wire.rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilder; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_NetworkGraph => wire + .rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraph; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_NetworkGraph => wire + .rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraph; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_Bolt11Payment => wire + .rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_Bolt11Payment => wire + .rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_OnchainPayment => wire + .rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_OnchainPayment => wire + .rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_SpontaneousPayment => wire + .rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_SpontaneousPayment => wire + .rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment; + + @protected + NodeBuilder + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return NodeBuilderImpl.frbInternalDcoDecode(raw as List); + } + + @protected + NodeBuilder + dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return NodeBuilderImpl.frbInternalDcoDecode(raw as List); + } + + @protected + NodeBuilder + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return NodeBuilderImpl.frbInternalDcoDecode(raw as List); + } + + @protected + ArcBolt12Payment dco_decode_RustOpaque_Arcldk_nodepaymentBolt12Payment( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return ArcBolt12PaymentImpl.frbInternalDcoDecode(raw as List); + } + + @protected + Node dco_decode_RustOpaque_Node(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return NodeImpl.frbInternalDcoDecode(raw as List); + } + + @protected + NodeBuilder + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return NodeBuilderImpl.frbInternalDcoDecode(raw as List); + } + + @protected + Builder dco_decode_RustOpaque_ldk_nodeBuilder(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return BuilderImpl.frbInternalDcoDecode(raw as List); + } + + @protected + NetworkGraph dco_decode_RustOpaque_ldk_nodegraphNetworkGraph(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return NetworkGraphImpl.frbInternalDcoDecode(raw as List); + } + + @protected + Bolt11Payment dco_decode_RustOpaque_ldk_nodepaymentBolt11Payment( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Bolt11PaymentImpl.frbInternalDcoDecode(raw as List); + } + + @protected + OnchainPayment dco_decode_RustOpaque_ldk_nodepaymentOnchainPayment( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return OnchainPaymentImpl.frbInternalDcoDecode(raw as List); + } + + @protected + SpontaneousPayment dco_decode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return SpontaneousPaymentImpl.frbInternalDcoDecode(raw as List); + } + + @protected + String dco_decode_String(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw as String; + } + + @protected + Address dco_decode_address(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 Address( + s: dco_decode_String(arr[0]), + ); + } + + @protected + AnchorChannelsConfig dco_decode_anchor_channels_config(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 AnchorChannelsConfig( + trustedPeersNoReserve: dco_decode_list_public_key(arr[0]), + perChannelReserveSats: dco_decode_u_64(arr[1]), + ); + } + + @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 + final arr = raw as List; + if (arr.length != 1) + throw Exception('unexpected arr length: expect 1 but see ${arr.length}'); + return Bolt11Invoice( + signedRawInvoice: dco_decode_String(arr[0]), + ); + } + + @protected + Bolt12Invoice dco_decode_bolt_12_invoice(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 Bolt12Invoice( + data: dco_decode_list_prim_u_8_strict(arr[0]), + ); + } + + @protected + Bolt12ParseError dco_decode_bolt_12_parse_error(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + switch (raw[0]) { + case 0: + return Bolt12ParseError_InvalidContinuation(); + case 1: + return Bolt12ParseError_InvalidBech32Hrp(); + case 2: + return Bolt12ParseError_Bech32( + dco_decode_String(raw[1]), + ); + case 3: + return Bolt12ParseError_Decode( + dco_decode_box_autoadd_decode_error(raw[1]), + ); + case 4: + return Bolt12ParseError_InvalidSemantics( + dco_decode_String(raw[1]), + ); + case 5: + return Bolt12ParseError_InvalidSignature( + dco_decode_String(raw[1]), + ); + default: + throw Exception("unreachable"); + } + } + + @protected + bool dco_decode_bool(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw as bool; + } + + @protected + Address dco_decode_box_autoadd_address(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_address(raw); + } + + @protected + AnchorChannelsConfig dco_decode_box_autoadd_anchor_channels_config( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_anchor_channels_config(raw); + } + + @protected + Bolt11Invoice dco_decode_box_autoadd_bolt_11_invoice(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_bolt_11_invoice(raw); + } + + @protected + Bolt12ParseError dco_decode_box_autoadd_bolt_12_parse_error(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_bolt_12_parse_error(raw); + } + + @protected + ChainDataSourceConfig dco_decode_box_autoadd_chain_data_source_config( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_chain_data_source_config(raw); + } + + @protected + ChannelConfig dco_decode_box_autoadd_channel_config(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_channel_config(raw); + } + + @protected + ChannelId dco_decode_box_autoadd_channel_id(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_channel_id(raw); + } + + @protected + ChannelInfo dco_decode_box_autoadd_channel_info(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_channel_info(raw); + } + + @protected + ChannelUpdateInfo dco_decode_box_autoadd_channel_update_info(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_channel_update_info(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 + return dco_decode_config(raw); + } + + @protected + DecodeError dco_decode_box_autoadd_decode_error(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_decode_error(raw); + } + + @protected + EntropySourceConfig dco_decode_box_autoadd_entropy_source_config( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_entropy_source_config(raw); + } + + @protected + Event dco_decode_box_autoadd_event(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_event(raw); + } + + @protected + GossipSourceConfig dco_decode_box_autoadd_gossip_source_config(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_gossip_source_config(raw); + } + + @protected + LdkBolt11Payment dco_decode_box_autoadd_ldk_bolt_11_payment(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_ldk_bolt_11_payment(raw); + } + + @protected + LdkBolt12Payment dco_decode_box_autoadd_ldk_bolt_12_payment(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 Address( - s: dco_decode_String(arr[0]), - ); + return dco_decode_ldk_bolt_12_payment(raw); } @protected - Bolt11Invoice dco_decode_bolt_11_invoice(dynamic raw) { + LdkMnemonic dco_decode_box_autoadd_ldk_mnemonic(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 Bolt11Invoice( - signedRawInvoice: dco_decode_String(arr[0]), - ); + return dco_decode_ldk_mnemonic(raw); } @protected - bool dco_decode_bool(dynamic raw) { + LdkNetworkGraph dco_decode_box_autoadd_ldk_network_graph(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return raw as bool; + return dco_decode_ldk_network_graph(raw); } @protected - Address dco_decode_box_autoadd_address(dynamic raw) { + LdkNode dco_decode_box_autoadd_ldk_node(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_address(raw); + return dco_decode_ldk_node(raw); } @protected - Bolt11Invoice dco_decode_box_autoadd_bolt_11_invoice(dynamic raw) { + LdkOnChainPayment dco_decode_box_autoadd_ldk_on_chain_payment(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_bolt_11_invoice(raw); + return dco_decode_ldk_on_chain_payment(raw); } @protected - ChainDataSourceConfig dco_decode_box_autoadd_chain_data_source_config( + LdkSpontaneousPayment dco_decode_box_autoadd_ldk_spontaneous_payment( dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_chain_data_source_config(raw); + return dco_decode_ldk_spontaneous_payment(raw); } @protected - ChannelConfig dco_decode_box_autoadd_channel_config(dynamic raw) { + LiquiditySourceConfig dco_decode_box_autoadd_liquidity_source_config( + dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_channel_config(raw); + return dco_decode_liquidity_source_config(raw); } @protected - ChannelId dco_decode_box_autoadd_channel_id(dynamic raw) { + LSPFeeLimits dco_decode_box_autoadd_lsp_fee_limits(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_channel_id(raw); + return dco_decode_lsp_fee_limits(raw); } @protected - Config dco_decode_box_autoadd_config(dynamic raw) { + MaxDustHTLCExposure dco_decode_box_autoadd_max_dust_htlc_exposure( + dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_config(raw); + return dco_decode_max_dust_htlc_exposure(raw); } @protected - EntropySourceConfig dco_decode_box_autoadd_entropy_source_config( + NodeAnnouncementInfo dco_decode_box_autoadd_node_announcement_info( dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_entropy_source_config(raw); + return dco_decode_node_announcement_info(raw); } @protected - Event dco_decode_box_autoadd_event(dynamic raw) { + NodeId dco_decode_box_autoadd_node_id(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_event(raw); + return dco_decode_node_id(raw); } @protected - GossipSourceConfig dco_decode_box_autoadd_gossip_source_config(dynamic raw) { + NodeInfo dco_decode_box_autoadd_node_info(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_gossip_source_config(raw); + return dco_decode_node_info(raw); } @protected - LdkMnemonic dco_decode_box_autoadd_ldk_mnemonic(dynamic raw) { + Offer dco_decode_box_autoadd_offer(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_ldk_mnemonic(raw); + return dco_decode_offer(raw); } @protected - LdkNode dco_decode_box_autoadd_ldk_node(dynamic raw) { + OfferId dco_decode_box_autoadd_offer_id(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_ldk_node(raw); + return dco_decode_offer_id(raw); } @protected @@ -1441,12 +2662,25 @@ 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 return dco_decode_payment_hash(raw); } + @protected + PaymentId dco_decode_box_autoadd_payment_id(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_payment_id(raw); + } + @protected PaymentPreimage dco_decode_box_autoadd_payment_preimage(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1465,6 +2699,12 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return dco_decode_public_key(raw); } + @protected + Refund dco_decode_box_autoadd_refund(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_refund(raw); + } + @protected SocketAddress dco_decode_box_autoadd_socket_address(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1472,27 +2712,33 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - int dco_decode_box_autoadd_u_32(dynamic raw) { + 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_64(dynamic raw) { + int dco_decode_box_autoadd_u_32(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_u_64(raw); + return raw as int; } @protected - UserChannelId dco_decode_box_autoadd_user_channel_id(dynamic raw) { + BigInt dco_decode_box_autoadd_u_64(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_user_channel_id(raw); + return dco_decode_u_64(raw); } @protected - BuilderException dco_decode_builder_exception(dynamic raw) { + UserChannelId dco_decode_box_autoadd_user_channel_id(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return BuilderException.values[raw as int]; + return dco_decode_user_channel_id(raw); } @protected @@ -1518,7 +2764,8 @@ 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_max_dust_htlc_exposure(arr[3]), + maxDustHtlcExposure: + dco_decode_opt_box_autoadd_max_dust_htlc_exposure(arr[3]), forceCloseAvoidanceMaxFeeSatoshis: dco_decode_u_64(arr[4]), acceptUnderpayingHtlcs: dco_decode_bool(arr[5]), ); @@ -1528,133 +2775,515 @@ 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 != 16) - throw Exception('unexpected arr length: expect 16 but see ${arr.length}'); + if (arr.length != 28) + throw Exception('unexpected arr length: expect 28 but see ${arr.length}'); return ChannelDetails( channelId: dco_decode_channel_id(arr[0]), counterpartyNodeId: dco_decode_public_key(arr[1]), - fundingTxo: dco_decode_opt_String(arr[2]), + fundingTxo: dco_decode_opt_box_autoadd_out_point(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]), - 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]), + 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]), + ); + } + + @protected + ChannelId dco_decode_channel_id(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 ChannelId( + data: dco_decode_u_8_array_32(arr[0]), + ); + } + + @protected + ChannelInfo dco_decode_channel_info(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 ChannelInfo( + nodeOne: dco_decode_node_id(arr[0]), + oneToTwo: dco_decode_opt_box_autoadd_channel_update_info(arr[1]), + nodeTwo: dco_decode_node_id(arr[2]), + twoToOne: dco_decode_opt_box_autoadd_channel_update_info(arr[3]), + capacitySats: dco_decode_opt_box_autoadd_u_64(arr[4]), + ); + } + + @protected + ChannelUpdateInfo dco_decode_channel_update_info(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + final arr = raw as List; + if (arr.length != 6) + throw Exception('unexpected arr length: expect 6 but see ${arr.length}'); + return ChannelUpdateInfo( + lastUpdate: dco_decode_u_32(arr[0]), + enabled: dco_decode_bool(arr[1]), + cltvExpiryDelta: dco_decode_u_16(arr[2]), + htlcMinimumMsat: dco_decode_u_64(arr[3]), + htlcMaximumMsat: dco_decode_u_64(arr[4]), + fees: dco_decode_routing_fees(arr[5]), + ); + } + + @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_LegacyCooperativeClosure(); + case 3: + return ClosureReason_CounterpartyInitiatedCooperativeClosure(); + case 4: + return ClosureReason_LocallyInitiatedCooperativeClosure(); + case 5: + return ClosureReason_CommitmentTxConfirmed(); + case 6: + return ClosureReason_FundingTimedOut(); + case 7: + return ClosureReason_ProcessingError( + err: dco_decode_String(raw[1]), + ); + case 8: + return ClosureReason_DisconnectedPeer(); + case 9: + return ClosureReason_OutdatedChannelManager(); + case 10: + return ClosureReason_CounterpartyCoopClosedUnfundedChannel(); + case 11: + return ClosureReason_FundingBatchClosure(); + case 12: + return ClosureReason_HTLCsTimedOut(); + default: + throw Exception("unreachable"); + } + } + + @protected + Config dco_decode_config(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + final arr = raw as List; + if (arr.length != 12) + throw Exception('unexpected arr length: expect 12 but see ${arr.length}'); + return Config( + storageDirPath: dco_decode_String(arr[0]), + logDirPath: dco_decode_opt_String(arr[1]), + network: dco_decode_network(arr[2]), + listeningAddresses: dco_decode_opt_list_socket_address(arr[3]), + defaultCltvExpiryDelta: dco_decode_u_32(arr[4]), + onchainWalletSyncIntervalSecs: dco_decode_u_64(arr[5]), + walletSyncIntervalSecs: dco_decode_u_64(arr[6]), + feeRateCacheUpdateIntervalSecs: dco_decode_u_64(arr[7]), + trustedPeers0Conf: dco_decode_list_public_key(arr[8]), + probingLiquidityLimitMultiplier: dco_decode_u_64(arr[9]), + logLevel: dco_decode_log_level(arr[10]), + anchorChannelsConfig: + dco_decode_opt_box_autoadd_anchor_channels_config(arr[11]), + ); + } + + @protected + DecodeError dco_decode_decode_error(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + switch (raw[0]) { + case 0: + return DecodeError_UnknownVersion(); + case 1: + return DecodeError_UnknownRequiredFeature(); + case 2: + return DecodeError_InvalidValue(); + case 3: + return DecodeError_ShortRead(); + case 4: + return DecodeError_BadLengthDescriptor(); + case 5: + return DecodeError_Io( + dco_decode_String(raw[1]), + ); + case 6: + return DecodeError_UnsupportedCompression(); + case 7: + return DecodeError_DangerousValue(); + default: + throw Exception("unreachable"); + } + } + + @protected + EntropySourceConfig dco_decode_entropy_source_config(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + switch (raw[0]) { + case 0: + return EntropySourceConfig_SeedFile( + dco_decode_String(raw[1]), + ); + case 1: + return EntropySourceConfig_SeedBytes( + dco_decode_u_8_array_64(raw[1]), + ); + case 2: + return EntropySourceConfig_Bip39Mnemonic( + mnemonic: dco_decode_box_autoadd_ldk_mnemonic(raw[1]), + passphrase: dco_decode_opt_String(raw[2]), + ); + default: + throw Exception("unreachable"); + } + } + + @protected + Event dco_decode_event(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + switch (raw[0]) { + case 0: + return Event_PaymentClaimable( + paymentId: dco_decode_box_autoadd_payment_id(raw[1]), + paymentHash: dco_decode_box_autoadd_payment_hash(raw[2]), + claimableAmountMsat: dco_decode_u_64(raw[3]), + claimDeadline: dco_decode_opt_box_autoadd_u_32(raw[4]), + ); + case 1: + return Event_PaymentSuccessful( + paymentId: dco_decode_opt_box_autoadd_payment_id(raw[1]), + paymentHash: dco_decode_box_autoadd_payment_hash(raw[2]), + feePaidMsat: dco_decode_opt_box_autoadd_u_64(raw[3]), + ); + case 2: + return Event_PaymentFailed( + paymentId: dco_decode_opt_box_autoadd_payment_id(raw[1]), + paymentHash: dco_decode_box_autoadd_payment_hash(raw[2]), + reason: dco_decode_opt_box_autoadd_payment_failure_reason(raw[3]), + ); + case 3: + return Event_PaymentReceived( + paymentId: dco_decode_opt_box_autoadd_payment_id(raw[1]), + paymentHash: dco_decode_box_autoadd_payment_hash(raw[2]), + amountMsat: dco_decode_u_64(raw[3]), + ); + case 4: + return Event_ChannelPending( + 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]), + ); + case 5: + return Event_ChannelReady( + 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 6: + 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]), + reason: dco_decode_opt_box_autoadd_closure_reason(raw[4]), + ); + default: + throw Exception("unreachable"); + } + } + + @protected + GossipSourceConfig dco_decode_gossip_source_config(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + switch (raw[0]) { + case 0: + return GossipSourceConfig_P2PNetwork(); + case 1: + return GossipSourceConfig_RapidGossipSync( + dco_decode_String(raw[1]), + ); + default: + throw Exception("unreachable"); + } + } + + @protected + int dco_decode_i_32(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw as int; + } + + @protected + LdkBolt11Payment dco_decode_ldk_bolt_11_payment(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 LdkBolt11Payment( + ptr: dco_decode_RustOpaque_ldk_nodepaymentBolt11Payment(arr[0]), + ); + } + + @protected + LdkBolt12Payment dco_decode_ldk_bolt_12_payment(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 LdkBolt12Payment( + ptr: dco_decode_RustOpaque_Arcldk_nodepaymentBolt12Payment(arr[0]), + ); + } + + @protected + LdkBuilderError dco_decode_ldk_builder_error(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return LdkBuilderError.values[raw as int]; + } + + @protected + LdkMnemonic dco_decode_ldk_mnemonic(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 LdkMnemonic( + seedPhrase: dco_decode_String(arr[0]), ); } @protected - ChannelId dco_decode_channel_id(dynamic raw) { + LdkNetworkGraph dco_decode_ldk_network_graph(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 ChannelId( - data: dco_decode_u_8_array_32(arr[0]), + return LdkNetworkGraph( + ptr: dco_decode_RustOpaque_ldk_nodegraphNetworkGraph(arr[0]), ); } @protected - Config dco_decode_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 != 11) - throw Exception('unexpected arr length: expect 11 but see ${arr.length}'); - return Config( - storageDirPath: dco_decode_String(arr[0]), - logDirPath: dco_decode_opt_String(arr[1]), - network: dco_decode_network(arr[2]), - listeningAddresses: dco_decode_opt_list_socket_address(arr[3]), - defaultCltvExpiryDelta: dco_decode_u_32(arr[4]), - onchainWalletSyncIntervalSecs: dco_decode_u_64(arr[5]), - walletSyncIntervalSecs: dco_decode_u_64(arr[6]), - feeRateCacheUpdateIntervalSecs: dco_decode_u_64(arr[7]), - trustedPeers0Conf: dco_decode_list_public_key(arr[8]), - probingLiquidityLimitMultiplier: dco_decode_u_64(arr[9]), - logLevel: dco_decode_log_level(arr[10]), + if (arr.length != 1) + throw Exception('unexpected arr length: expect 1 but see ${arr.length}'); + return LdkNode( + ptr: dco_decode_RustOpaque_Node(arr[0]), ); } @protected - EntropySourceConfig dco_decode_entropy_source_config(dynamic raw) { + LdkNodeError dco_decode_ldk_node_error(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs switch (raw[0]) { case 0: - return EntropySourceConfig_SeedFile( - dco_decode_String(raw[1]), - ); + return LdkNodeError_InvalidTxid(); case 1: - return EntropySourceConfig_SeedBytes( - dco_decode_u_8_array_64(raw[1]), - ); + return LdkNodeError_AlreadyRunning(); case 2: - return EntropySourceConfig_Bip39Mnemonic( - mnemonic: dco_decode_box_autoadd_ldk_mnemonic(raw[1]), - passphrase: dco_decode_opt_String(raw[2]), + return LdkNodeError_NotRunning(); + case 3: + return LdkNodeError_OnchainTxCreationFailed(); + case 4: + return LdkNodeError_ConnectionFailed(); + case 5: + return LdkNodeError_InvoiceCreationFailed(); + case 6: + return LdkNodeError_PaymentSendingFailed(); + case 7: + return LdkNodeError_ProbeSendingFailed(); + case 8: + return LdkNodeError_ChannelCreationFailed(); + case 9: + return LdkNodeError_ChannelClosingFailed(); + case 10: + return LdkNodeError_ChannelConfigUpdateFailed(); + case 11: + return LdkNodeError_PersistenceFailed(); + case 12: + return LdkNodeError_WalletOperationFailed(); + case 13: + return LdkNodeError_OnchainTxSigningFailed(); + case 14: + return LdkNodeError_MessageSigningFailed(); + case 15: + return LdkNodeError_TxSyncFailed(); + case 16: + return LdkNodeError_GossipUpdateFailed(); + case 17: + return LdkNodeError_InvalidAddress(); + case 18: + return LdkNodeError_InvalidSocketAddress(); + case 19: + return LdkNodeError_InvalidPublicKey(); + case 20: + return LdkNodeError_InvalidSecretKey(); + case 21: + return LdkNodeError_InvalidPaymentHash(); + case 22: + return LdkNodeError_InvalidPaymentPreimage(); + case 23: + return LdkNodeError_InvalidPaymentSecret(); + case 24: + return LdkNodeError_InvalidAmount(); + case 25: + return LdkNodeError_InvalidInvoice(); + case 26: + return LdkNodeError_InvalidChannelId(); + case 27: + return LdkNodeError_InvalidNetwork(); + case 28: + return LdkNodeError_DuplicatePayment(); + case 29: + return LdkNodeError_InsufficientFunds(); + case 30: + return LdkNodeError_FeerateEstimationUpdateFailed(); + case 31: + return LdkNodeError_LiquidityRequestFailed(); + case 32: + return LdkNodeError_LiquiditySourceUnavailable(); + case 33: + return LdkNodeError_LiquidityFeeTooHigh(); + case 34: + return LdkNodeError_InvalidPaymentId(); + case 35: + return LdkNodeError_Decode( + dco_decode_box_autoadd_decode_error(raw[1]), ); + case 36: + return LdkNodeError_Bolt12Parse( + dco_decode_box_autoadd_bolt_12_parse_error(raw[1]), + ); + case 37: + return LdkNodeError_InvoiceRequestCreationFailed(); + case 38: + return LdkNodeError_OfferCreationFailed(); + case 39: + return LdkNodeError_RefundCreationFailed(); + case 40: + return LdkNodeError_FeerateEstimationUpdateTimeout(); + case 41: + return LdkNodeError_WalletOperationTimeout(); + case 42: + return LdkNodeError_TxSyncTimeout(); + case 43: + return LdkNodeError_GossipUpdateTimeout(); + case 44: + return LdkNodeError_InvalidOfferId(); + case 45: + return LdkNodeError_InvalidNodeId(); + case 46: + return LdkNodeError_InvalidOffer(); + case 47: + return LdkNodeError_InvalidRefund(); + case 48: + return LdkNodeError_UnsupportedCurrency(); default: throw Exception("unreachable"); } } @protected - Event dco_decode_event(dynamic raw) { + LdkOnChainPayment dco_decode_ldk_on_chain_payment(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 LdkOnChainPayment( + ptr: dco_decode_RustOpaque_ldk_nodepaymentOnchainPayment(arr[0]), + ); + } + + @protected + LdkSpontaneousPayment dco_decode_ldk_spontaneous_payment(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 LdkSpontaneousPayment( + ptr: dco_decode_RustOpaque_ldk_nodepaymentSpontaneousPayment(arr[0]), + ); + } + + @protected + LightningBalance dco_decode_lightning_balance(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs switch (raw[0]) { case 0: - return Event_PaymentSuccessful( - paymentHash: dco_decode_box_autoadd_payment_hash(raw[1]), + 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 Event_PaymentFailed( - paymentHash: dco_decode_box_autoadd_payment_hash(raw[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 Event_PaymentReceived( - paymentHash: dco_decode_box_autoadd_payment_hash(raw[1]), - amountMsat: dco_decode_u_64(raw[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 Event_ChannelReady( + return LightningBalance_MaybeTimeoutClaimableHTLC( 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]), + 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 Event_ChannelClosed( + return LightningBalance_MaybePreimageClaimableHTLC( 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]), + 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 Event_ChannelPending( + return LightningBalance_CounterpartyRevokedOutputClaimable( 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]), - ); - default: - throw Exception("unreachable"); - } - } - - @protected - GossipSourceConfig dco_decode_gossip_source_config(dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - switch (raw[0]) { - case 0: - return GossipSourceConfig_P2PNetwork(); - case 1: - return GossipSourceConfig_RapidGossipSync( - dco_decode_String(raw[1]), + counterpartyNodeId: dco_decode_box_autoadd_public_key(raw[2]), + amountSatoshis: dco_decode_u_64(raw[3]), ); default: throw Exception("unreachable"); @@ -1662,37 +3291,33 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - int dco_decode_i_32(dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - return raw as int; - } - - @protected - LdkMnemonic dco_decode_ldk_mnemonic(dynamic raw) { + LiquiditySourceConfig dco_decode_liquidity_source_config(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 LdkMnemonic( - seedPhrase: dco_decode_String(arr[0]), + return LiquiditySourceConfig( + lsps2Service: + dco_decode_record_socket_address_public_key_opt_string(arr[0]), ); } @protected - LdkNode dco_decode_ldk_node(dynamic raw) { + List dco_decode_list_channel_details(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 LdkNode( - ptr: dco_decode_RustOpaque_NodeSqliteStore(arr[0]), - ); + return (raw as List).map(dco_decode_channel_details).toList(); } @protected - List dco_decode_list_channel_details(dynamic raw) { + 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_channel_details).toList(); + return (raw as List).map(dco_decode_lightning_balance).toList(); + } + + @protected + List dco_decode_list_node_id(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return (raw as List).map(dco_decode_node_id).toList(); } @protected @@ -1707,6 +3332,20 @@ 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 + Uint64List dco_decode_list_prim_u_64_strict(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dcoDecodeUint64List(raw); + } + @protected List dco_decode_list_prim_u_8_loose(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1737,6 +3376,18 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return LogLevel.values[raw as int]; } + @protected + LSPFeeLimits dco_decode_lsp_fee_limits(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 LSPFeeLimits( + maxTotalOpeningFeeMsat: dco_decode_opt_box_autoadd_u_64(arr[0]), + maxProportionalOpeningFeePpmMsat: dco_decode_opt_box_autoadd_u_64(arr[1]), + ); + } + @protected MaxDustHTLCExposure dco_decode_max_dust_htlc_exposure(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1761,9 +3412,82 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - NodeException dco_decode_node_exception(dynamic raw) { + NodeAnnouncementInfo dco_decode_node_announcement_info(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + final arr = raw as List; + if (arr.length != 3) + throw Exception('unexpected arr length: expect 3 but see ${arr.length}'); + return NodeAnnouncementInfo( + lastUpdate: dco_decode_u_32(arr[0]), + alias: dco_decode_String(arr[1]), + addresses: dco_decode_list_socket_address(arr[2]), + ); + } + + @protected + NodeId dco_decode_node_id(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 NodeId( + compressed: dco_decode_list_prim_u_8_strict(arr[0]), + ); + } + + @protected + NodeInfo dco_decode_node_info(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 NodeInfo( + channels: dco_decode_list_prim_u_64_strict(arr[0]), + announcementInfo: + dco_decode_opt_box_autoadd_node_announcement_info(arr[1]), + ); + } + + @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]), + ); + } + + @protected + Offer dco_decode_offer(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 Offer( + s: dco_decode_String(arr[0]), + ); + } + + @protected + OfferId dco_decode_offer_id(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return NodeException.values[raw as int]; + final arr = raw as List; + if (arr.length != 1) + throw Exception('unexpected arr length: expect 1 but see ${arr.length}'); + return OfferId( + field0: dco_decode_u_8_array_32(arr[0]), + ); } @protected @@ -1772,6 +3496,15 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return raw == null ? null : dco_decode_String(raw); } + @protected + AnchorChannelsConfig? dco_decode_opt_box_autoadd_anchor_channels_config( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw == null + ? null + : dco_decode_box_autoadd_anchor_channels_config(raw); + } + @protected ChainDataSourceConfig? dco_decode_opt_box_autoadd_chain_data_source_config( dynamic raw) { @@ -1787,6 +3520,31 @@ 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 + ChannelInfo? dco_decode_opt_box_autoadd_channel_info(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw == null ? null : dco_decode_box_autoadd_channel_info(raw); + } + + @protected + ChannelUpdateInfo? dco_decode_opt_box_autoadd_channel_update_info( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw == null ? null : dco_decode_box_autoadd_channel_update_info(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) { @@ -1811,12 +3569,72 @@ 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 + NodeAnnouncementInfo? dco_decode_opt_box_autoadd_node_announcement_info( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw == null + ? null + : dco_decode_box_autoadd_node_announcement_info(raw); + } + + @protected + NodeInfo? dco_decode_opt_box_autoadd_node_info(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw == null ? null : dco_decode_box_autoadd_node_info(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 + PaymentHash? dco_decode_opt_box_autoadd_payment_hash(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw == null ? null : dco_decode_box_autoadd_payment_hash(raw); + } + + @protected + PaymentId? dco_decode_opt_box_autoadd_payment_id(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw == null ? null : dco_decode_box_autoadd_payment_id(raw); + } + @protected PaymentPreimage? dco_decode_opt_box_autoadd_payment_preimage(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1835,6 +3653,12 @@ 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 @@ -1842,7 +3666,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - int? dco_decode_opt_box_autoadd_u_64(dynamic raw) { + BigInt? dco_decode_opt_box_autoadd_u_64(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs return raw == null ? null : dco_decode_box_autoadd_u_64(raw); } @@ -1869,15 +3693,14 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { PaymentDetails dco_decode_payment_details(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs final arr = raw as List; - if (arr.length != 6) - throw Exception('unexpected arr length: expect 6 but see ${arr.length}'); + if (arr.length != 5) + throw Exception('unexpected arr length: expect 5 but see ${arr.length}'); return PaymentDetails( - hash: dco_decode_payment_hash(arr[0]), - preimage: dco_decode_opt_box_autoadd_payment_preimage(arr[1]), - secret: dco_decode_opt_box_autoadd_payment_secret(arr[2]), - amountMsat: dco_decode_opt_box_autoadd_u_64(arr[3]), - direction: dco_decode_payment_direction(arr[4]), - status: dco_decode_payment_status(arr[5]), + id: dco_decode_payment_id(arr[0]), + kind: dco_decode_payment_kind(arr[1]), + amountMsat: dco_decode_opt_box_autoadd_u_64(arr[2]), + direction: dco_decode_payment_direction(arr[3]), + status: dco_decode_payment_status(arr[4]), ); } @@ -1887,6 +3710,12 @@ 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 @@ -1898,6 +3727,59 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { ); } + @protected + PaymentId dco_decode_payment_id(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 PaymentId( + field0: dco_decode_u_8_array_32(arr[0]), + ); + } + + @protected + PaymentKind dco_decode_payment_kind(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + switch (raw[0]) { + case 0: + return PaymentKind_Onchain(); + case 1: + return PaymentKind_Bolt11( + hash: dco_decode_box_autoadd_payment_hash(raw[1]), + preimage: dco_decode_opt_box_autoadd_payment_preimage(raw[2]), + secret: dco_decode_opt_box_autoadd_payment_secret(raw[3]), + ); + case 2: + return PaymentKind_Bolt11Jit( + hash: dco_decode_box_autoadd_payment_hash(raw[1]), + preimage: dco_decode_opt_box_autoadd_payment_preimage(raw[2]), + secret: dco_decode_opt_box_autoadd_payment_secret(raw[3]), + lspFeeLimits: dco_decode_box_autoadd_lsp_fee_limits(raw[4]), + ); + case 3: + return PaymentKind_Spontaneous( + hash: dco_decode_box_autoadd_payment_hash(raw[1]), + preimage: dco_decode_opt_box_autoadd_payment_preimage(raw[2]), + ); + case 4: + return PaymentKind_Bolt12Offer( + hash: dco_decode_opt_box_autoadd_payment_hash(raw[1]), + preimage: dco_decode_opt_box_autoadd_payment_preimage(raw[2]), + secret: dco_decode_opt_box_autoadd_payment_secret(raw[3]), + offerId: dco_decode_box_autoadd_offer_id(raw[4]), + ); + case 5: + return PaymentKind_Bolt12Refund( + hash: dco_decode_opt_box_autoadd_payment_hash(raw[1]), + preimage: dco_decode_opt_box_autoadd_payment_preimage(raw[2]), + secret: dco_decode_opt_box_autoadd_payment_secret(raw[3]), + ); + default: + throw Exception("unreachable"); + } + } + @protected PaymentPreimage dco_decode_payment_preimage(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1939,6 +3821,35 @@ 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 @@ -1950,6 +3861,44 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { ); } + @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]), + ); + } + + @protected + Refund dco_decode_refund(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 Refund( + s: dco_decode_String(arr[0]), + ); + } + + @protected + RoutingFees dco_decode_routing_fees(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 RoutingFees( + baseMsat: dco_decode_u_32(arr[0]), + proportionalMillionths: dco_decode_u_32(arr[1]), + ); + } + @protected SocketAddress dco_decode_socket_address(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -2009,9 +3958,9 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - int dco_decode_u_64(dynamic raw) { + BigInt dco_decode_u_64(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dcoDecodeI64OrU64(raw); + return dcoDecodeU64(raw); } @protected @@ -2063,21 +4012,103 @@ 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_u_64(arr[0]), + data: dco_decode_list_prim_u_8_strict(arr[0]), ); } @protected - int dco_decode_usize(dynamic raw) { + BigInt dco_decode_usize(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dcoDecodeI64OrU64(raw); + return dcoDecodeU64(raw); + } + + @protected + NodeBuilder + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return NodeBuilderImpl.frbInternalSseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + NodeBuilder + sse_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return NodeBuilderImpl.frbInternalSseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + NodeBuilder + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return NodeBuilderImpl.frbInternalSseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + ArcBolt12Payment sse_decode_RustOpaque_Arcldk_nodepaymentBolt12Payment( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return ArcBolt12PaymentImpl.frbInternalSseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Node sse_decode_RustOpaque_Node(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return NodeImpl.frbInternalSseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + NodeBuilder + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return NodeBuilderImpl.frbInternalSseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Builder sse_decode_RustOpaque_ldk_nodeBuilder(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return BuilderImpl.frbInternalSseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + NetworkGraph sse_decode_RustOpaque_ldk_nodegraphNetworkGraph( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return NetworkGraphImpl.frbInternalSseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Bolt11Payment sse_decode_RustOpaque_ldk_nodepaymentBolt11Payment( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return Bolt11PaymentImpl.frbInternalSseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + OnchainPayment sse_decode_RustOpaque_ldk_nodepaymentOnchainPayment( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return OnchainPaymentImpl.frbInternalSseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); } @protected - NodeSqliteStore sse_decode_RustOpaque_NodeSqliteStore( + SpontaneousPayment sse_decode_RustOpaque_ldk_nodepaymentSpontaneousPayment( SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return NodeSqliteStore.sseDecode( + return SpontaneousPaymentImpl.frbInternalSseDecode( sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); } @@ -2095,6 +4126,43 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return Address(s: var_s); } + @protected + AnchorChannelsConfig sse_decode_anchor_channels_config( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_trustedPeersNoReserve = sse_decode_list_public_key(deserializer); + var var_perChannelReserveSats = sse_decode_u_64(deserializer); + return AnchorChannelsConfig( + trustedPeersNoReserve: var_trustedPeersNoReserve, + perChannelReserveSats: var_perChannelReserveSats); + } + + @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 @@ -2102,6 +4170,41 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return Bolt11Invoice(signedRawInvoice: var_signedRawInvoice); } + @protected + Bolt12Invoice sse_decode_bolt_12_invoice(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_data = sse_decode_list_prim_u_8_strict(deserializer); + return Bolt12Invoice(data: var_data); + } + + @protected + Bolt12ParseError sse_decode_bolt_12_parse_error( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + var tag_ = sse_decode_i_32(deserializer); + switch (tag_) { + case 0: + return Bolt12ParseError_InvalidContinuation(); + case 1: + return Bolt12ParseError_InvalidBech32Hrp(); + case 2: + var var_field0 = sse_decode_String(deserializer); + return Bolt12ParseError_Bech32(var_field0); + case 3: + var var_field0 = sse_decode_box_autoadd_decode_error(deserializer); + return Bolt12ParseError_Decode(var_field0); + case 4: + var var_field0 = sse_decode_String(deserializer); + return Bolt12ParseError_InvalidSemantics(var_field0); + case 5: + var var_field0 = sse_decode_String(deserializer); + return Bolt12ParseError_InvalidSignature(var_field0); + default: + throw UnimplementedError(''); + } + } + @protected bool sse_decode_bool(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -2111,73 +4214,202 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { @protected Address sse_decode_box_autoadd_address(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_address(deserializer)); + return (sse_decode_address(deserializer)); + } + + @protected + AnchorChannelsConfig sse_decode_box_autoadd_anchor_channels_config( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_anchor_channels_config(deserializer)); + } + + @protected + Bolt11Invoice sse_decode_box_autoadd_bolt_11_invoice( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_bolt_11_invoice(deserializer)); + } + + @protected + Bolt12ParseError sse_decode_box_autoadd_bolt_12_parse_error( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_bolt_12_parse_error(deserializer)); + } + + @protected + ChainDataSourceConfig sse_decode_box_autoadd_chain_data_source_config( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_chain_data_source_config(deserializer)); + } + + @protected + ChannelConfig sse_decode_box_autoadd_channel_config( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_channel_config(deserializer)); + } + + @protected + ChannelId sse_decode_box_autoadd_channel_id(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_channel_id(deserializer)); + } + + @protected + ChannelInfo sse_decode_box_autoadd_channel_info( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_channel_info(deserializer)); + } + + @protected + ChannelUpdateInfo sse_decode_box_autoadd_channel_update_info( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_channel_update_info(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 + return (sse_decode_config(deserializer)); + } + + @protected + DecodeError sse_decode_box_autoadd_decode_error( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_decode_error(deserializer)); + } + + @protected + EntropySourceConfig sse_decode_box_autoadd_entropy_source_config( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_entropy_source_config(deserializer)); + } + + @protected + Event sse_decode_box_autoadd_event(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_event(deserializer)); + } + + @protected + GossipSourceConfig sse_decode_box_autoadd_gossip_source_config( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_gossip_source_config(deserializer)); + } + + @protected + LdkBolt11Payment sse_decode_box_autoadd_ldk_bolt_11_payment( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_ldk_bolt_11_payment(deserializer)); + } + + @protected + LdkBolt12Payment sse_decode_box_autoadd_ldk_bolt_12_payment( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_ldk_bolt_12_payment(deserializer)); + } + + @protected + LdkMnemonic sse_decode_box_autoadd_ldk_mnemonic( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_ldk_mnemonic(deserializer)); + } + + @protected + LdkNetworkGraph sse_decode_box_autoadd_ldk_network_graph( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_ldk_network_graph(deserializer)); + } + + @protected + LdkNode sse_decode_box_autoadd_ldk_node(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_ldk_node(deserializer)); } @protected - Bolt11Invoice sse_decode_box_autoadd_bolt_11_invoice( + LdkOnChainPayment sse_decode_box_autoadd_ldk_on_chain_payment( SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_bolt_11_invoice(deserializer)); + return (sse_decode_ldk_on_chain_payment(deserializer)); } @protected - ChainDataSourceConfig sse_decode_box_autoadd_chain_data_source_config( + LdkSpontaneousPayment sse_decode_box_autoadd_ldk_spontaneous_payment( SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_chain_data_source_config(deserializer)); + return (sse_decode_ldk_spontaneous_payment(deserializer)); } @protected - ChannelConfig sse_decode_box_autoadd_channel_config( + LiquiditySourceConfig sse_decode_box_autoadd_liquidity_source_config( SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_channel_config(deserializer)); + return (sse_decode_liquidity_source_config(deserializer)); } @protected - ChannelId sse_decode_box_autoadd_channel_id(SseDeserializer deserializer) { + LSPFeeLimits sse_decode_box_autoadd_lsp_fee_limits( + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_channel_id(deserializer)); + return (sse_decode_lsp_fee_limits(deserializer)); } @protected - Config sse_decode_box_autoadd_config(SseDeserializer deserializer) { + MaxDustHTLCExposure sse_decode_box_autoadd_max_dust_htlc_exposure( + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_config(deserializer)); + return (sse_decode_max_dust_htlc_exposure(deserializer)); } @protected - EntropySourceConfig sse_decode_box_autoadd_entropy_source_config( + NodeAnnouncementInfo sse_decode_box_autoadd_node_announcement_info( SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_entropy_source_config(deserializer)); + return (sse_decode_node_announcement_info(deserializer)); } @protected - Event sse_decode_box_autoadd_event(SseDeserializer deserializer) { + NodeId sse_decode_box_autoadd_node_id(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_event(deserializer)); + return (sse_decode_node_id(deserializer)); } @protected - GossipSourceConfig sse_decode_box_autoadd_gossip_source_config( - SseDeserializer deserializer) { + NodeInfo sse_decode_box_autoadd_node_info(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_gossip_source_config(deserializer)); + return (sse_decode_node_info(deserializer)); } @protected - LdkMnemonic sse_decode_box_autoadd_ldk_mnemonic( - SseDeserializer deserializer) { + Offer sse_decode_box_autoadd_offer(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_ldk_mnemonic(deserializer)); + return (sse_decode_offer(deserializer)); } @protected - LdkNode sse_decode_box_autoadd_ldk_node(SseDeserializer deserializer) { + OfferId sse_decode_box_autoadd_offer_id(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_ldk_node(deserializer)); + return (sse_decode_offer_id(deserializer)); } @protected @@ -2193,6 +4425,13 @@ 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) { @@ -2200,6 +4439,12 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return (sse_decode_payment_hash(deserializer)); } + @protected + PaymentId sse_decode_box_autoadd_payment_id(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_payment_id(deserializer)); + } + @protected PaymentPreimage sse_decode_box_autoadd_payment_preimage( SseDeserializer deserializer) { @@ -2220,6 +4465,12 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return (sse_decode_public_key(deserializer)); } + @protected + Refund sse_decode_box_autoadd_refund(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_refund(deserializer)); + } + @protected SocketAddress sse_decode_box_autoadd_socket_address( SseDeserializer deserializer) { @@ -2227,6 +4478,18 @@ 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 @@ -2234,7 +4497,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - int sse_decode_box_autoadd_u_64(SseDeserializer deserializer) { + BigInt sse_decode_box_autoadd_u_64(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs return (sse_decode_u_64(deserializer)); } @@ -2246,13 +4509,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return (sse_decode_user_channel_id(deserializer)); } - @protected - 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 BuilderException.values[inner]; - } - @protected ChainDataSourceConfig sse_decode_chain_data_source_config( SseDeserializer deserializer) { @@ -2275,7 +4531,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_max_dust_htlc_exposure(deserializer); + sse_decode_opt_box_autoadd_max_dust_htlc_exposure(deserializer); var var_forceCloseAvoidanceMaxFeeSatoshis = sse_decode_u_64(deserializer); var var_acceptUnderpayingHtlcs = sse_decode_bool(deserializer); return ChannelConfig( @@ -2294,13 +4550,12 @@ 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_String(deserializer); + var var_fundingTxo = sse_decode_opt_box_autoadd_out_point(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 = @@ -2310,6 +4565,27 @@ 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, @@ -2318,7 +4594,6 @@ 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, @@ -2326,7 +4601,26 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { isOutbound: var_isOutbound, isChannelReady: var_isChannelReady, isUsable: var_isUsable, - isPublic: var_isPublic); + 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); } @protected @@ -2336,6 +4630,82 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return ChannelId(data: var_data); } + @protected + ChannelInfo sse_decode_channel_info(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_nodeOne = sse_decode_node_id(deserializer); + var var_oneToTwo = + sse_decode_opt_box_autoadd_channel_update_info(deserializer); + var var_nodeTwo = sse_decode_node_id(deserializer); + var var_twoToOne = + sse_decode_opt_box_autoadd_channel_update_info(deserializer); + var var_capacitySats = sse_decode_opt_box_autoadd_u_64(deserializer); + return ChannelInfo( + nodeOne: var_nodeOne, + oneToTwo: var_oneToTwo, + nodeTwo: var_nodeTwo, + twoToOne: var_twoToOne, + capacitySats: var_capacitySats); + } + + @protected + ChannelUpdateInfo sse_decode_channel_update_info( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_lastUpdate = sse_decode_u_32(deserializer); + var var_enabled = sse_decode_bool(deserializer); + var var_cltvExpiryDelta = sse_decode_u_16(deserializer); + var var_htlcMinimumMsat = sse_decode_u_64(deserializer); + var var_htlcMaximumMsat = sse_decode_u_64(deserializer); + var var_fees = sse_decode_routing_fees(deserializer); + return ChannelUpdateInfo( + lastUpdate: var_lastUpdate, + enabled: var_enabled, + cltvExpiryDelta: var_cltvExpiryDelta, + htlcMinimumMsat: var_htlcMinimumMsat, + htlcMaximumMsat: var_htlcMaximumMsat, + fees: var_fees); + } + + @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_LegacyCooperativeClosure(); + case 3: + return ClosureReason_CounterpartyInitiatedCooperativeClosure(); + case 4: + return ClosureReason_LocallyInitiatedCooperativeClosure(); + case 5: + return ClosureReason_CommitmentTxConfirmed(); + case 6: + return ClosureReason_FundingTimedOut(); + case 7: + var var_err = sse_decode_String(deserializer); + return ClosureReason_ProcessingError(err: var_err); + case 8: + return ClosureReason_DisconnectedPeer(); + case 9: + return ClosureReason_OutdatedChannelManager(); + case 10: + return ClosureReason_CounterpartyCoopClosedUnfundedChannel(); + case 11: + return ClosureReason_FundingBatchClosure(); + case 12: + return ClosureReason_HTLCsTimedOut(); + default: + throw UnimplementedError(''); + } + } + @protected Config sse_decode_config(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -2351,6 +4721,8 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { var var_trustedPeers0Conf = sse_decode_list_public_key(deserializer); var var_probingLiquidityLimitMultiplier = sse_decode_u_64(deserializer); var var_logLevel = sse_decode_log_level(deserializer); + var var_anchorChannelsConfig = + sse_decode_opt_box_autoadd_anchor_channels_config(deserializer); return Config( storageDirPath: var_storageDirPath, logDirPath: var_logDirPath, @@ -2362,7 +4734,36 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { feeRateCacheUpdateIntervalSecs: var_feeRateCacheUpdateIntervalSecs, trustedPeers0Conf: var_trustedPeers0Conf, probingLiquidityLimitMultiplier: var_probingLiquidityLimitMultiplier, - logLevel: var_logLevel); + logLevel: var_logLevel, + anchorChannelsConfig: var_anchorChannelsConfig); + } + + @protected + DecodeError sse_decode_decode_error(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + var tag_ = sse_decode_i_32(deserializer); + switch (tag_) { + case 0: + return DecodeError_UnknownVersion(); + case 1: + return DecodeError_UnknownRequiredFeature(); + case 2: + return DecodeError_InvalidValue(); + case 3: + return DecodeError_ShortRead(); + case 4: + return DecodeError_BadLengthDescriptor(); + case 5: + var var_field0 = sse_decode_String(deserializer); + return DecodeError_Io(var_field0); + case 6: + return DecodeError_UnsupportedCompression(); + case 7: + return DecodeError_DangerousValue(); + default: + throw UnimplementedError(''); + } } @protected @@ -2395,51 +4796,78 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { var tag_ = sse_decode_i_32(deserializer); switch (tag_) { case 0: + var var_paymentId = sse_decode_box_autoadd_payment_id(deserializer); var var_paymentHash = sse_decode_box_autoadd_payment_hash(deserializer); - return Event_PaymentSuccessful(paymentHash: var_paymentHash); + var var_claimableAmountMsat = sse_decode_u_64(deserializer); + var var_claimDeadline = sse_decode_opt_box_autoadd_u_32(deserializer); + return Event_PaymentClaimable( + paymentId: var_paymentId, + paymentHash: var_paymentHash, + claimableAmountMsat: var_claimableAmountMsat, + claimDeadline: var_claimDeadline); case 1: + var var_paymentId = sse_decode_opt_box_autoadd_payment_id(deserializer); var var_paymentHash = sse_decode_box_autoadd_payment_hash(deserializer); - return Event_PaymentFailed(paymentHash: var_paymentHash); + var var_feePaidMsat = sse_decode_opt_box_autoadd_u_64(deserializer); + return Event_PaymentSuccessful( + paymentId: var_paymentId, + paymentHash: var_paymentHash, + feePaidMsat: var_feePaidMsat); case 2: + var var_paymentId = sse_decode_opt_box_autoadd_payment_id(deserializer); + 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( + paymentId: var_paymentId, + paymentHash: var_paymentHash, + reason: var_reason); + case 3: + var var_paymentId = sse_decode_opt_box_autoadd_payment_id(deserializer); var var_paymentHash = sse_decode_box_autoadd_payment_hash(deserializer); var var_amountMsat = sse_decode_u_64(deserializer); return Event_PaymentReceived( - paymentHash: var_paymentHash, amountMsat: var_amountMsat); - case 3: + paymentId: var_paymentId, + paymentHash: var_paymentHash, + amountMsat: var_amountMsat); + 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_formerTemporaryChannelId = + sse_decode_box_autoadd_channel_id(deserializer); var var_counterpartyNodeId = - sse_decode_opt_box_autoadd_public_key(deserializer); - return Event_ChannelReady( + 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, - counterpartyNodeId: var_counterpartyNodeId); - case 4: + formerTemporaryChannelId: var_formerTemporaryChannelId, + counterpartyNodeId: var_counterpartyNodeId, + fundingTxo: var_fundingTxo); + case 5: 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_ChannelClosed( + return Event_ChannelReady( channelId: var_channelId, userChannelId: var_userChannelId, counterpartyNodeId: var_counterpartyNodeId); - case 5: + case 6: 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); + var var_reason = + sse_decode_opt_box_autoadd_closure_reason(deserializer); + return Event_ChannelClosed( channelId: var_channelId, userChannelId: var_userChannelId, - formerTemporaryChannelId: var_formerTemporaryChannelId, counterpartyNodeId: var_counterpartyNodeId, - fundingTxo: var_fundingTxo); + reason: var_reason); default: throw UnimplementedError(''); } @@ -2468,6 +4896,31 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return deserializer.buffer.getInt32(); } + @protected + LdkBolt11Payment sse_decode_ldk_bolt_11_payment( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_ptr = + sse_decode_RustOpaque_ldk_nodepaymentBolt11Payment(deserializer); + return LdkBolt11Payment(ptr: var_ptr); + } + + @protected + LdkBolt12Payment sse_decode_ldk_bolt_12_payment( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_ptr = + sse_decode_RustOpaque_Arcldk_nodepaymentBolt12Payment(deserializer); + return LdkBolt12Payment(ptr: var_ptr); + } + + @protected + LdkBuilderError sse_decode_ldk_builder_error(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var inner = sse_decode_i_32(deserializer); + return LdkBuilderError.values[inner]; + } + @protected LdkMnemonic sse_decode_ldk_mnemonic(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -2475,22 +4928,275 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return LdkMnemonic(seedPhrase: var_seedPhrase); } + @protected + LdkNetworkGraph sse_decode_ldk_network_graph(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_ptr = sse_decode_RustOpaque_ldk_nodegraphNetworkGraph(deserializer); + return LdkNetworkGraph(ptr: var_ptr); + } + @protected LdkNode sse_decode_ldk_node(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - var var_ptr = sse_decode_RustOpaque_NodeSqliteStore(deserializer); + var var_ptr = sse_decode_RustOpaque_Node(deserializer); return LdkNode(ptr: var_ptr); } @protected - List sse_decode_list_channel_details( - SseDeserializer deserializer) { + LdkNodeError sse_decode_ldk_node_error(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + var tag_ = sse_decode_i_32(deserializer); + switch (tag_) { + case 0: + return LdkNodeError_InvalidTxid(); + case 1: + return LdkNodeError_AlreadyRunning(); + case 2: + return LdkNodeError_NotRunning(); + case 3: + return LdkNodeError_OnchainTxCreationFailed(); + case 4: + return LdkNodeError_ConnectionFailed(); + case 5: + return LdkNodeError_InvoiceCreationFailed(); + case 6: + return LdkNodeError_PaymentSendingFailed(); + case 7: + return LdkNodeError_ProbeSendingFailed(); + case 8: + return LdkNodeError_ChannelCreationFailed(); + case 9: + return LdkNodeError_ChannelClosingFailed(); + case 10: + return LdkNodeError_ChannelConfigUpdateFailed(); + case 11: + return LdkNodeError_PersistenceFailed(); + case 12: + return LdkNodeError_WalletOperationFailed(); + case 13: + return LdkNodeError_OnchainTxSigningFailed(); + case 14: + return LdkNodeError_MessageSigningFailed(); + case 15: + return LdkNodeError_TxSyncFailed(); + case 16: + return LdkNodeError_GossipUpdateFailed(); + case 17: + return LdkNodeError_InvalidAddress(); + case 18: + return LdkNodeError_InvalidSocketAddress(); + case 19: + return LdkNodeError_InvalidPublicKey(); + case 20: + return LdkNodeError_InvalidSecretKey(); + case 21: + return LdkNodeError_InvalidPaymentHash(); + case 22: + return LdkNodeError_InvalidPaymentPreimage(); + case 23: + return LdkNodeError_InvalidPaymentSecret(); + case 24: + return LdkNodeError_InvalidAmount(); + case 25: + return LdkNodeError_InvalidInvoice(); + case 26: + return LdkNodeError_InvalidChannelId(); + case 27: + return LdkNodeError_InvalidNetwork(); + case 28: + return LdkNodeError_DuplicatePayment(); + case 29: + return LdkNodeError_InsufficientFunds(); + case 30: + return LdkNodeError_FeerateEstimationUpdateFailed(); + case 31: + return LdkNodeError_LiquidityRequestFailed(); + case 32: + return LdkNodeError_LiquiditySourceUnavailable(); + case 33: + return LdkNodeError_LiquidityFeeTooHigh(); + case 34: + return LdkNodeError_InvalidPaymentId(); + case 35: + var var_field0 = sse_decode_box_autoadd_decode_error(deserializer); + return LdkNodeError_Decode(var_field0); + case 36: + var var_field0 = + sse_decode_box_autoadd_bolt_12_parse_error(deserializer); + return LdkNodeError_Bolt12Parse(var_field0); + case 37: + return LdkNodeError_InvoiceRequestCreationFailed(); + case 38: + return LdkNodeError_OfferCreationFailed(); + case 39: + return LdkNodeError_RefundCreationFailed(); + case 40: + return LdkNodeError_FeerateEstimationUpdateTimeout(); + case 41: + return LdkNodeError_WalletOperationTimeout(); + case 42: + return LdkNodeError_TxSyncTimeout(); + case 43: + return LdkNodeError_GossipUpdateTimeout(); + case 44: + return LdkNodeError_InvalidOfferId(); + case 45: + return LdkNodeError_InvalidNodeId(); + case 46: + return LdkNodeError_InvalidOffer(); + case 47: + return LdkNodeError_InvalidRefund(); + case 48: + return LdkNodeError_UnsupportedCurrency(); + default: + throw UnimplementedError(''); + } + } + + @protected + LdkOnChainPayment sse_decode_ldk_on_chain_payment( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_ptr = + sse_decode_RustOpaque_ldk_nodepaymentOnchainPayment(deserializer); + return LdkOnChainPayment(ptr: var_ptr); + } + + @protected + LdkSpontaneousPayment sse_decode_ldk_spontaneous_payment( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_ptr = + sse_decode_RustOpaque_ldk_nodepaymentSpontaneousPayment(deserializer); + return LdkSpontaneousPayment(ptr: var_ptr); + } + + @protected + LightningBalance sse_decode_lightning_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_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(''); + } + } + + @protected + LiquiditySourceConfig sse_decode_liquidity_source_config( + 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); + } + + @protected + List sse_decode_list_channel_details( + 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_channel_details(deserializer)); + } + 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_node_id(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var len_ = sse_decode_i_32(deserializer); - var ans_ = []; + var ans_ = []; for (var idx_ = 0; idx_ < len_; ++idx_) { - ans_.add(sse_decode_channel_details(deserializer)); + ans_.add(sse_decode_node_id(deserializer)); } return ans_; } @@ -2520,6 +5226,26 @@ 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 + Uint64List sse_decode_list_prim_u_64_strict(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var len_ = sse_decode_i_32(deserializer); + return deserializer.buffer.getUint64List(len_); + } + @protected List sse_decode_list_prim_u_8_loose(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -2566,6 +5292,18 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return LogLevel.values[inner]; } + @protected + LSPFeeLimits sse_decode_lsp_fee_limits(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_maxTotalOpeningFeeMsat = + sse_decode_opt_box_autoadd_u_64(deserializer); + var var_maxProportionalOpeningFeePpmMsat = + sse_decode_opt_box_autoadd_u_64(deserializer); + return LSPFeeLimits( + maxTotalOpeningFeeMsat: var_maxTotalOpeningFeeMsat, + maxProportionalOpeningFeePpmMsat: var_maxProportionalOpeningFeePpmMsat); + } + @protected MaxDustHTLCExposure sse_decode_max_dust_htlc_exposure( SseDeserializer deserializer) { @@ -2592,10 +5330,74 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - NodeException sse_decode_node_exception(SseDeserializer deserializer) { + NodeAnnouncementInfo sse_decode_node_announcement_info( + SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - var inner = sse_decode_i_32(deserializer); - return NodeException.values[inner]; + var var_lastUpdate = sse_decode_u_32(deserializer); + var var_alias = sse_decode_String(deserializer); + var var_addresses = sse_decode_list_socket_address(deserializer); + return NodeAnnouncementInfo( + lastUpdate: var_lastUpdate, alias: var_alias, addresses: var_addresses); + } + + @protected + NodeId sse_decode_node_id(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_compressed = sse_decode_list_prim_u_8_strict(deserializer); + return NodeId(compressed: var_compressed); + } + + @protected + NodeInfo sse_decode_node_info(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_channels = sse_decode_list_prim_u_64_strict(deserializer); + var var_announcementInfo = + sse_decode_opt_box_autoadd_node_announcement_info(deserializer); + return NodeInfo( + channels: var_channels, announcementInfo: var_announcementInfo); + } + + @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); + } + + @protected + Offer sse_decode_offer(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_s = sse_decode_String(deserializer); + return Offer(s: var_s); + } + + @protected + OfferId sse_decode_offer_id(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_field0 = sse_decode_u_8_array_32(deserializer); + return OfferId(field0: var_field0); } @protected @@ -2609,6 +5411,18 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } } + @protected + AnchorChannelsConfig? sse_decode_opt_box_autoadd_anchor_channels_config( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + if (sse_decode_bool(deserializer)) { + return (sse_decode_box_autoadd_anchor_channels_config(deserializer)); + } else { + return null; + } + } + @protected ChainDataSourceConfig? sse_decode_opt_box_autoadd_chain_data_source_config( SseDeserializer deserializer) { @@ -2633,6 +5447,54 @@ 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 + ChannelInfo? sse_decode_opt_box_autoadd_channel_info( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + if (sse_decode_bool(deserializer)) { + return (sse_decode_box_autoadd_channel_info(deserializer)); + } else { + return null; + } + } + + @protected + ChannelUpdateInfo? sse_decode_opt_box_autoadd_channel_update_info( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + if (sse_decode_bool(deserializer)) { + return (sse_decode_box_autoadd_channel_update_info(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) { @@ -2668,6 +5530,64 @@ 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 + NodeAnnouncementInfo? sse_decode_opt_box_autoadd_node_announcement_info( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + if (sse_decode_bool(deserializer)) { + return (sse_decode_box_autoadd_node_announcement_info(deserializer)); + } else { + return null; + } + } + + @protected + NodeInfo? sse_decode_opt_box_autoadd_node_info(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + if (sse_decode_bool(deserializer)) { + return (sse_decode_box_autoadd_node_info(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) { @@ -2680,6 +5600,42 @@ 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 + PaymentHash? sse_decode_opt_box_autoadd_payment_hash( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + if (sse_decode_bool(deserializer)) { + return (sse_decode_box_autoadd_payment_hash(deserializer)); + } else { + return null; + } + } + + @protected + PaymentId? sse_decode_opt_box_autoadd_payment_id( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + if (sse_decode_bool(deserializer)) { + return (sse_decode_box_autoadd_payment_id(deserializer)); + } else { + return null; + } + } + @protected PaymentPreimage? sse_decode_opt_box_autoadd_payment_preimage( SseDeserializer deserializer) { @@ -2716,6 +5672,17 @@ 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 @@ -2728,7 +5695,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - int? sse_decode_opt_box_autoadd_u_64(SseDeserializer deserializer) { + BigInt? sse_decode_opt_box_autoadd_u_64(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs if (sse_decode_bool(deserializer)) { @@ -2761,17 +5728,14 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { @protected PaymentDetails sse_decode_payment_details(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - var var_hash = sse_decode_payment_hash(deserializer); - var var_preimage = - sse_decode_opt_box_autoadd_payment_preimage(deserializer); - var var_secret = sse_decode_opt_box_autoadd_payment_secret(deserializer); + var var_id = sse_decode_payment_id(deserializer); + var var_kind = sse_decode_payment_kind(deserializer); var var_amountMsat = sse_decode_opt_box_autoadd_u_64(deserializer); var var_direction = sse_decode_payment_direction(deserializer); var var_status = sse_decode_payment_status(deserializer); return PaymentDetails( - hash: var_hash, - preimage: var_preimage, - secret: var_secret, + id: var_id, + kind: var_kind, amountMsat: var_amountMsat, direction: var_direction, status: var_status); @@ -2784,6 +5748,14 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return PaymentDirection.values[inner]; } + @protected + PaymentFailureReason sse_decode_payment_failure_reason( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var inner = sse_decode_i_32(deserializer); + return PaymentFailureReason.values[inner]; + } + @protected PaymentHash sse_decode_payment_hash(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -2791,6 +5763,72 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return PaymentHash(data: var_data); } + @protected + PaymentId sse_decode_payment_id(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_field0 = sse_decode_u_8_array_32(deserializer); + return PaymentId(field0: var_field0); + } + + @protected + PaymentKind sse_decode_payment_kind(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + var tag_ = sse_decode_i_32(deserializer); + switch (tag_) { + case 0: + return PaymentKind_Onchain(); + case 1: + var var_hash = sse_decode_box_autoadd_payment_hash(deserializer); + var var_preimage = + sse_decode_opt_box_autoadd_payment_preimage(deserializer); + var var_secret = + sse_decode_opt_box_autoadd_payment_secret(deserializer); + return PaymentKind_Bolt11( + hash: var_hash, preimage: var_preimage, secret: var_secret); + case 2: + var var_hash = sse_decode_box_autoadd_payment_hash(deserializer); + var var_preimage = + sse_decode_opt_box_autoadd_payment_preimage(deserializer); + var var_secret = + sse_decode_opt_box_autoadd_payment_secret(deserializer); + var var_lspFeeLimits = + sse_decode_box_autoadd_lsp_fee_limits(deserializer); + return PaymentKind_Bolt11Jit( + hash: var_hash, + preimage: var_preimage, + secret: var_secret, + lspFeeLimits: var_lspFeeLimits); + case 3: + var var_hash = sse_decode_box_autoadd_payment_hash(deserializer); + var var_preimage = + sse_decode_opt_box_autoadd_payment_preimage(deserializer); + return PaymentKind_Spontaneous(hash: var_hash, preimage: var_preimage); + case 4: + var var_hash = sse_decode_opt_box_autoadd_payment_hash(deserializer); + var var_preimage = + sse_decode_opt_box_autoadd_payment_preimage(deserializer); + var var_secret = + sse_decode_opt_box_autoadd_payment_secret(deserializer); + var var_offerId = sse_decode_box_autoadd_offer_id(deserializer); + return PaymentKind_Bolt12Offer( + hash: var_hash, + preimage: var_preimage, + secret: var_secret, + offerId: var_offerId); + case 5: + var var_hash = sse_decode_opt_box_autoadd_payment_hash(deserializer); + var var_preimage = + sse_decode_opt_box_autoadd_payment_preimage(deserializer); + var var_secret = + sse_decode_opt_box_autoadd_payment_secret(deserializer); + return PaymentKind_Bolt12Refund( + hash: var_hash, preimage: var_preimage, secret: var_secret); + default: + throw UnimplementedError(''); + } + } + @protected PaymentPreimage sse_decode_payment_preimage(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -2801,32 +5839,99 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { @protected PaymentSecret sse_decode_payment_secret(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - var var_data = sse_decode_u_8_array_32(deserializer); - return PaymentSecret(data: var_data); + var var_data = sse_decode_u_8_array_32(deserializer); + return PaymentSecret(data: var_data); + } + + @protected + PaymentStatus sse_decode_payment_status(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var inner = sse_decode_i_32(deserializer); + return PaymentStatus.values[inner]; + } + + @protected + PeerDetails sse_decode_peer_details(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_nodeId = sse_decode_public_key(deserializer); + var var_address = sse_decode_socket_address(deserializer); + var var_isConnected = sse_decode_bool(deserializer); + return PeerDetails( + 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_hex = sse_decode_String(deserializer); + return PublicKey(hex: var_hex); } @protected - PaymentStatus sse_decode_payment_status(SseDeserializer deserializer) { + (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 inner = sse_decode_i_32(deserializer); - return PaymentStatus.values[inner]; + 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); } @protected - PeerDetails sse_decode_peer_details(SseDeserializer deserializer) { + Refund sse_decode_refund(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - var var_nodeId = sse_decode_public_key(deserializer); - var var_address = sse_decode_socket_address(deserializer); - var var_isConnected = sse_decode_bool(deserializer); - return PeerDetails( - nodeId: var_nodeId, address: var_address, isConnected: var_isConnected); + var var_s = sse_decode_String(deserializer); + return Refund(s: var_s); } @protected - PublicKey sse_decode_public_key(SseDeserializer deserializer) { + RoutingFees sse_decode_routing_fees(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - var var_hex = sse_decode_String(deserializer); - return PublicKey(hex: var_hex); + var var_baseMsat = sse_decode_u_32(deserializer); + var var_proportionalMillionths = sse_decode_u_32(deserializer); + return RoutingFees( + baseMsat: var_baseMsat, + proportionalMillionths: var_proportionalMillionths); } @protected @@ -2885,9 +5990,9 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - int sse_decode_u_64(SseDeserializer deserializer) { + BigInt sse_decode_u_64(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return deserializer.buffer.getUint64(); + return deserializer.buffer.getBigUint64(); } @protected @@ -2939,33 +6044,103 @@ 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_u_64(deserializer); + var var_data = sse_decode_list_prim_u_8_strict(deserializer); return UserChannelId(data: var_data); } @protected - int sse_decode_usize(SseDeserializer deserializer) { + BigInt sse_decode_usize(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return deserializer.buffer.getUint64(); + return deserializer.buffer.getBigUint64(); } @protected - int cst_encode_RustOpaque_NodeSqliteStore(NodeSqliteStore raw) { + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder raw) { // Codec=Cst (C-struct based), see doc to use other codecs // ignore: invalid_use_of_internal_member - return raw.cstEncode(); + return (raw as NodeBuilderImpl).frbInternalCstEncode(move: true); } @protected - bool cst_encode_bool(bool raw) { + int cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder raw) { // Codec=Cst (C-struct based), see doc to use other codecs - return raw; +// ignore: invalid_use_of_internal_member + return (raw as NodeBuilderImpl).frbInternalCstEncode(move: false); } @protected - int cst_encode_builder_exception(BuilderException raw) { + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder raw) { // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_i_32(raw.index); +// ignore: invalid_use_of_internal_member + return (raw as NodeBuilderImpl).frbInternalCstEncode(move: false); + } + + @protected + int cst_encode_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ArcBolt12Payment raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return (raw as ArcBolt12PaymentImpl).frbInternalCstEncode(); + } + + @protected + int cst_encode_RustOpaque_Node(Node raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return (raw as NodeImpl).frbInternalCstEncode(); + } + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return (raw as NodeBuilderImpl).frbInternalCstEncode(); + } + + @protected + int cst_encode_RustOpaque_ldk_nodeBuilder(Builder raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return (raw as BuilderImpl).frbInternalCstEncode(); + } + + @protected + int cst_encode_RustOpaque_ldk_nodegraphNetworkGraph(NetworkGraph raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return (raw as NetworkGraphImpl).frbInternalCstEncode(); + } + + @protected + int cst_encode_RustOpaque_ldk_nodepaymentBolt11Payment(Bolt11Payment raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return (raw as Bolt11PaymentImpl).frbInternalCstEncode(); + } + + @protected + int cst_encode_RustOpaque_ldk_nodepaymentOnchainPayment(OnchainPayment raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return (raw as OnchainPaymentImpl).frbInternalCstEncode(); + } + + @protected + int cst_encode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + SpontaneousPayment raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return (raw as SpontaneousPaymentImpl).frbInternalCstEncode(); + } + + @protected + bool cst_encode_bool(bool raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw; } @protected @@ -2974,6 +6149,12 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return raw; } + @protected + int cst_encode_ldk_builder_error(LdkBuilderError raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return cst_encode_i_32(raw.index); + } + @protected int cst_encode_log_level(LogLevel raw) { // Codec=Cst (C-struct based), see doc to use other codecs @@ -2987,13 +6168,13 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - int cst_encode_node_exception(NodeException raw) { + int cst_encode_payment_direction(PaymentDirection raw) { // Codec=Cst (C-struct based), see doc to use other codecs return cst_encode_i_32(raw.index); } @protected - int cst_encode_payment_direction(PaymentDirection raw) { + 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); } @@ -3029,114 +6210,389 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - int cst_encode_usize(int raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw; + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize( + (self as NodeBuilderImpl).frbInternalSseEncode(move: true), serializer); + } + + @protected + void + sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize( + (self as NodeBuilderImpl).frbInternalSseEncode(move: false), + serializer); + } + + @protected + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize( + (self as NodeBuilderImpl).frbInternalSseEncode(move: false), + serializer); + } + + @protected + void sse_encode_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ArcBolt12Payment self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize( + (self as ArcBolt12PaymentImpl).frbInternalSseEncode(move: null), + serializer); + } + + @protected + void sse_encode_RustOpaque_Node(Node self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize( + (self as NodeImpl).frbInternalSseEncode(move: null), serializer); + } + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize( + (self as NodeBuilderImpl).frbInternalSseEncode(move: null), serializer); + } + + @protected + void sse_encode_RustOpaque_ldk_nodeBuilder( + Builder self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize( + (self as BuilderImpl).frbInternalSseEncode(move: null), serializer); + } + + @protected + void sse_encode_RustOpaque_ldk_nodegraphNetworkGraph( + NetworkGraph self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize( + (self as NetworkGraphImpl).frbInternalSseEncode(move: null), + serializer); + } + + @protected + void sse_encode_RustOpaque_ldk_nodepaymentBolt11Payment( + Bolt11Payment self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize( + (self as Bolt11PaymentImpl).frbInternalSseEncode(move: null), + serializer); + } + + @protected + void sse_encode_RustOpaque_ldk_nodepaymentOnchainPayment( + OnchainPayment self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize( + (self as OnchainPaymentImpl).frbInternalSseEncode(move: null), + serializer); + } + + @protected + void sse_encode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + SpontaneousPayment self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize( + (self as SpontaneousPaymentImpl).frbInternalSseEncode(move: null), + serializer); + } + + @protected + void sse_encode_String(String self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_list_prim_u_8_strict(utf8.encoder.convert(self), serializer); + } + + @protected + void sse_encode_address(Address self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_String(self.s, serializer); + } + + @protected + void sse_encode_anchor_channels_config( + AnchorChannelsConfig self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_list_public_key(self.trustedPeersNoReserve, serializer); + sse_encode_u_64(self.perChannelReserveSats, 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) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_String(self.signedRawInvoice, serializer); + } + + @protected + void sse_encode_bolt_12_invoice( + Bolt12Invoice self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_list_prim_u_8_strict(self.data, serializer); + } + + @protected + void sse_encode_bolt_12_parse_error( + Bolt12ParseError self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + switch (self) { + case Bolt12ParseError_InvalidContinuation(): + sse_encode_i_32(0, serializer); + case Bolt12ParseError_InvalidBech32Hrp(): + sse_encode_i_32(1, serializer); + case Bolt12ParseError_Bech32(field0: final field0): + sse_encode_i_32(2, serializer); + sse_encode_String(field0, serializer); + case Bolt12ParseError_Decode(field0: final field0): + sse_encode_i_32(3, serializer); + sse_encode_box_autoadd_decode_error(field0, serializer); + case Bolt12ParseError_InvalidSemantics(field0: final field0): + sse_encode_i_32(4, serializer); + sse_encode_String(field0, serializer); + case Bolt12ParseError_InvalidSignature(field0: final field0): + sse_encode_i_32(5, serializer); + sse_encode_String(field0, serializer); + default: + throw UnimplementedError(''); + } + } + + @protected + void sse_encode_bool(bool self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + serializer.buffer.putUint8(self ? 1 : 0); + } + + @protected + void sse_encode_box_autoadd_address(Address self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_address(self, serializer); + } + + @protected + void sse_encode_box_autoadd_anchor_channels_config( + AnchorChannelsConfig self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_anchor_channels_config(self, serializer); + } + + @protected + void sse_encode_box_autoadd_bolt_11_invoice( + Bolt11Invoice self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_bolt_11_invoice(self, serializer); + } + + @protected + void sse_encode_box_autoadd_bolt_12_parse_error( + Bolt12ParseError self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_bolt_12_parse_error(self, serializer); + } + + @protected + void sse_encode_box_autoadd_chain_data_source_config( + ChainDataSourceConfig self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_chain_data_source_config(self, serializer); + } + + @protected + void sse_encode_box_autoadd_channel_config( + ChannelConfig self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_channel_config(self, serializer); + } + + @protected + void sse_encode_box_autoadd_channel_id( + ChannelId self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_channel_id(self, serializer); + } + + @protected + void sse_encode_box_autoadd_channel_info( + ChannelInfo self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_channel_info(self, serializer); + } + + @protected + void sse_encode_box_autoadd_channel_update_info( + ChannelUpdateInfo self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_channel_update_info(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 + sse_encode_config(self, serializer); + } + + @protected + void sse_encode_box_autoadd_decode_error( + DecodeError self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_decode_error(self, serializer); } @protected - void sse_encode_RustOpaque_NodeSqliteStore( - NodeSqliteStore self, SseSerializer serializer) { + void sse_encode_box_autoadd_entropy_source_config( + EntropySourceConfig self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_entropy_source_config(self, serializer); + } + + @protected + void sse_encode_box_autoadd_event(Event self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_usize(self.sseEncode(move: null), serializer); + sse_encode_event(self, serializer); + } + + @protected + void sse_encode_box_autoadd_gossip_source_config( + GossipSourceConfig self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_gossip_source_config(self, serializer); } @protected - void sse_encode_String(String self, SseSerializer serializer) { + void sse_encode_box_autoadd_ldk_bolt_11_payment( + LdkBolt11Payment self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_list_prim_u_8_strict(utf8.encoder.convert(self), serializer); + sse_encode_ldk_bolt_11_payment(self, serializer); } @protected - void sse_encode_address(Address self, SseSerializer serializer) { + void sse_encode_box_autoadd_ldk_bolt_12_payment( + LdkBolt12Payment self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_String(self.s, serializer); + sse_encode_ldk_bolt_12_payment(self, serializer); } @protected - void sse_encode_bolt_11_invoice( - Bolt11Invoice 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_String(self.signedRawInvoice, serializer); + sse_encode_ldk_mnemonic(self, serializer); } @protected - void sse_encode_bool(bool self, SseSerializer serializer) { + void sse_encode_box_autoadd_ldk_network_graph( + LdkNetworkGraph self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - serializer.buffer.putUint8(self ? 1 : 0); + sse_encode_ldk_network_graph(self, serializer); } @protected - void sse_encode_box_autoadd_address(Address 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_address(self, serializer); + sse_encode_ldk_node(self, serializer); } @protected - void sse_encode_box_autoadd_bolt_11_invoice( - Bolt11Invoice self, SseSerializer serializer) { + void sse_encode_box_autoadd_ldk_on_chain_payment( + LdkOnChainPayment self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_bolt_11_invoice(self, serializer); + sse_encode_ldk_on_chain_payment(self, serializer); } @protected - void sse_encode_box_autoadd_chain_data_source_config( - ChainDataSourceConfig self, SseSerializer serializer) { + void sse_encode_box_autoadd_ldk_spontaneous_payment( + LdkSpontaneousPayment self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_chain_data_source_config(self, serializer); + sse_encode_ldk_spontaneous_payment(self, serializer); } @protected - void sse_encode_box_autoadd_channel_config( - ChannelConfig self, SseSerializer serializer) { + void sse_encode_box_autoadd_liquidity_source_config( + LiquiditySourceConfig self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_channel_config(self, serializer); + sse_encode_liquidity_source_config(self, serializer); } @protected - void sse_encode_box_autoadd_channel_id( - ChannelId self, SseSerializer serializer) { + void sse_encode_box_autoadd_lsp_fee_limits( + LSPFeeLimits self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_channel_id(self, serializer); + sse_encode_lsp_fee_limits(self, serializer); } @protected - void sse_encode_box_autoadd_config(Config self, SseSerializer serializer) { + 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_config(self, serializer); + sse_encode_max_dust_htlc_exposure(self, serializer); } @protected - void sse_encode_box_autoadd_entropy_source_config( - EntropySourceConfig self, SseSerializer serializer) { + void sse_encode_box_autoadd_node_announcement_info( + NodeAnnouncementInfo self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_entropy_source_config(self, serializer); + sse_encode_node_announcement_info(self, serializer); } @protected - void sse_encode_box_autoadd_event(Event self, SseSerializer serializer) { + void sse_encode_box_autoadd_node_id(NodeId self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_event(self, serializer); + sse_encode_node_id(self, serializer); } @protected - void sse_encode_box_autoadd_gossip_source_config( - GossipSourceConfig self, SseSerializer serializer) { + void sse_encode_box_autoadd_node_info( + NodeInfo self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_gossip_source_config(self, serializer); + sse_encode_node_info(self, serializer); } @protected - void sse_encode_box_autoadd_ldk_mnemonic( - LdkMnemonic self, SseSerializer serializer) { + void sse_encode_box_autoadd_offer(Offer self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_ldk_mnemonic(self, serializer); + sse_encode_offer(self, serializer); } @protected - void sse_encode_box_autoadd_ldk_node(LdkNode self, SseSerializer serializer) { + void sse_encode_box_autoadd_offer_id(OfferId self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_ldk_node(self, serializer); + sse_encode_offer_id(self, serializer); } @protected @@ -3153,6 +6609,13 @@ 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) { @@ -3160,6 +6623,13 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_payment_hash(self, serializer); } + @protected + void sse_encode_box_autoadd_payment_id( + PaymentId self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_payment_id(self, serializer); + } + @protected void sse_encode_box_autoadd_payment_preimage( PaymentPreimage self, SseSerializer serializer) { @@ -3181,6 +6651,12 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_public_key(self, serializer); } + @protected + void sse_encode_box_autoadd_refund(Refund self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_refund(self, serializer); + } + @protected void sse_encode_box_autoadd_socket_address( SocketAddress self, SseSerializer serializer) { @@ -3188,6 +6664,18 @@ 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 @@ -3195,7 +6683,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - void sse_encode_box_autoadd_u_64(int self, SseSerializer serializer) { + void sse_encode_box_autoadd_u_64(BigInt self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_u_64(self, serializer); } @@ -3207,13 +6695,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_user_channel_id(self, serializer); } - @protected - 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); - } - @protected void sse_encode_chain_data_source_config( ChainDataSourceConfig self, SseSerializer serializer) { @@ -3222,6 +6703,8 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { case ChainDataSourceConfig_Esplora(field0: final field0): sse_encode_i_32(0, serializer); sse_encode_String(field0, serializer); + default: + throw UnimplementedError(''); } } @@ -3231,7 +6714,8 @@ 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_max_dust_htlc_exposure(self.maxDustHtlcExposure, serializer); + sse_encode_opt_box_autoadd_max_dust_htlc_exposure( + self.maxDustHtlcExposure, serializer); sse_encode_u_64(self.forceCloseAvoidanceMaxFeeSatoshis, serializer); sse_encode_bool(self.acceptUnderpayingHtlcs, serializer); } @@ -3242,13 +6726,12 @@ 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_String(self.fundingTxo, serializer); + sse_encode_opt_box_autoadd_out_point(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); @@ -3257,6 +6740,24 @@ 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 @@ -3265,6 +6766,65 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_u_8_array_32(self.data, serializer); } + @protected + void sse_encode_channel_info(ChannelInfo self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_node_id(self.nodeOne, serializer); + sse_encode_opt_box_autoadd_channel_update_info(self.oneToTwo, serializer); + sse_encode_node_id(self.nodeTwo, serializer); + sse_encode_opt_box_autoadd_channel_update_info(self.twoToOne, serializer); + sse_encode_opt_box_autoadd_u_64(self.capacitySats, serializer); + } + + @protected + void sse_encode_channel_update_info( + ChannelUpdateInfo self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_u_32(self.lastUpdate, serializer); + sse_encode_bool(self.enabled, serializer); + sse_encode_u_16(self.cltvExpiryDelta, serializer); + sse_encode_u_64(self.htlcMinimumMsat, serializer); + sse_encode_u_64(self.htlcMaximumMsat, serializer); + sse_encode_routing_fees(self.fees, 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_LegacyCooperativeClosure(): + sse_encode_i_32(2, serializer); + case ClosureReason_CounterpartyInitiatedCooperativeClosure(): + sse_encode_i_32(3, serializer); + case ClosureReason_LocallyInitiatedCooperativeClosure(): + sse_encode_i_32(4, serializer); + case ClosureReason_CommitmentTxConfirmed(): + sse_encode_i_32(5, serializer); + case ClosureReason_FundingTimedOut(): + sse_encode_i_32(6, serializer); + case ClosureReason_ProcessingError(err: final err): + sse_encode_i_32(7, serializer); + sse_encode_String(err, serializer); + case ClosureReason_DisconnectedPeer(): + sse_encode_i_32(8, serializer); + case ClosureReason_OutdatedChannelManager(): + sse_encode_i_32(9, serializer); + case ClosureReason_CounterpartyCoopClosedUnfundedChannel(): + sse_encode_i_32(10, serializer); + case ClosureReason_FundingBatchClosure(): + sse_encode_i_32(11, serializer); + case ClosureReason_HTLCsTimedOut(): + sse_encode_i_32(12, serializer); + default: + throw UnimplementedError(''); + } + } + @protected void sse_encode_config(Config self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -3279,6 +6839,34 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_list_public_key(self.trustedPeers0Conf, serializer); sse_encode_u_64(self.probingLiquidityLimitMultiplier, serializer); sse_encode_log_level(self.logLevel, serializer); + sse_encode_opt_box_autoadd_anchor_channels_config( + self.anchorChannelsConfig, serializer); + } + + @protected + void sse_encode_decode_error(DecodeError self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + switch (self) { + case DecodeError_UnknownVersion(): + sse_encode_i_32(0, serializer); + case DecodeError_UnknownRequiredFeature(): + sse_encode_i_32(1, serializer); + case DecodeError_InvalidValue(): + sse_encode_i_32(2, serializer); + case DecodeError_ShortRead(): + sse_encode_i_32(3, serializer); + case DecodeError_BadLengthDescriptor(): + sse_encode_i_32(4, serializer); + case DecodeError_Io(field0: final field0): + sse_encode_i_32(5, serializer); + sse_encode_String(field0, serializer); + case DecodeError_UnsupportedCompression(): + sse_encode_i_32(6, serializer); + case DecodeError_DangerousValue(): + sse_encode_i_32(7, serializer); + default: + throw UnimplementedError(''); + } } @protected @@ -3299,6 +6887,8 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_i_32(2, serializer); sse_encode_box_autoadd_ldk_mnemonic(mnemonic, serializer); sse_encode_opt_String(passphrase, serializer); + default: + throw UnimplementedError(''); } } @@ -3306,50 +6896,79 @@ 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): + case Event_PaymentClaimable( + paymentId: final paymentId, + paymentHash: final paymentHash, + claimableAmountMsat: final claimableAmountMsat, + claimDeadline: final claimDeadline + ): sse_encode_i_32(0, serializer); + sse_encode_box_autoadd_payment_id(paymentId, serializer); sse_encode_box_autoadd_payment_hash(paymentHash, serializer); - case Event_PaymentFailed(paymentHash: final paymentHash): + sse_encode_u_64(claimableAmountMsat, serializer); + sse_encode_opt_box_autoadd_u_32(claimDeadline, serializer); + case Event_PaymentSuccessful( + paymentId: final paymentId, + paymentHash: final paymentHash, + feePaidMsat: final feePaidMsat + ): sse_encode_i_32(1, serializer); + sse_encode_opt_box_autoadd_payment_id(paymentId, serializer); + sse_encode_box_autoadd_payment_hash(paymentHash, serializer); + sse_encode_opt_box_autoadd_u_64(feePaidMsat, serializer); + case Event_PaymentFailed( + paymentId: final paymentId, + paymentHash: final paymentHash, + reason: final reason + ): + sse_encode_i_32(2, serializer); + sse_encode_opt_box_autoadd_payment_id(paymentId, serializer); sse_encode_box_autoadd_payment_hash(paymentHash, serializer); + sse_encode_opt_box_autoadd_payment_failure_reason(reason, serializer); case Event_PaymentReceived( + paymentId: final paymentId, paymentHash: final paymentHash, amountMsat: final amountMsat ): - sse_encode_i_32(2, serializer); + sse_encode_i_32(3, serializer); + sse_encode_opt_box_autoadd_payment_id(paymentId, serializer); sse_encode_box_autoadd_payment_hash(paymentHash, serializer); sse_encode_u_64(amountMsat, serializer); - case Event_ChannelReady( + case Event_ChannelPending( channelId: final channelId, userChannelId: final userChannelId, - counterpartyNodeId: final counterpartyNodeId + formerTemporaryChannelId: final formerTemporaryChannelId, + counterpartyNodeId: final counterpartyNodeId, + fundingTxo: final fundingTxo ): - sse_encode_i_32(3, serializer); + sse_encode_i_32(4, 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); - case Event_ChannelClosed( + 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( channelId: final channelId, userChannelId: final userChannelId, counterpartyNodeId: final counterpartyNodeId ): - sse_encode_i_32(4, serializer); + 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); - case Event_ChannelPending( + case Event_ChannelClosed( channelId: final channelId, userChannelId: final userChannelId, - formerTemporaryChannelId: final formerTemporaryChannelId, counterpartyNodeId: final counterpartyNodeId, - fundingTxo: final fundingTxo + reason: final reason ): - sse_encode_i_32(5, serializer); + sse_encode_i_32(6, 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); + sse_encode_opt_box_autoadd_public_key(counterpartyNodeId, serializer); + sse_encode_opt_box_autoadd_closure_reason(reason, serializer); + default: + throw UnimplementedError(''); } } @@ -3363,6 +6982,8 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { case GossipSourceConfig_RapidGossipSync(field0: final field0): sse_encode_i_32(1, serializer); sse_encode_String(field0, serializer); + default: + throw UnimplementedError(''); } } @@ -3372,6 +6993,27 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { serializer.buffer.putInt32(self); } + @protected + void sse_encode_ldk_bolt_11_payment( + LdkBolt11Payment self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_RustOpaque_ldk_nodepaymentBolt11Payment(self.ptr, serializer); + } + + @protected + void sse_encode_ldk_bolt_12_payment( + LdkBolt12Payment self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_RustOpaque_Arcldk_nodepaymentBolt12Payment(self.ptr, serializer); + } + + @protected + void sse_encode_ldk_builder_error( + LdkBuilderError self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_i_32(self.index, serializer); + } + @protected void sse_encode_ldk_mnemonic(LdkMnemonic self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -3379,18 +7021,256 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - void sse_encode_ldk_node(LdkNode self, SseSerializer serializer) { + void sse_encode_ldk_network_graph( + LdkNetworkGraph self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_RustOpaque_ldk_nodegraphNetworkGraph(self.ptr, serializer); + } + + @protected + void sse_encode_ldk_node(LdkNode self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_RustOpaque_Node(self.ptr, serializer); + } + + @protected + void sse_encode_ldk_node_error(LdkNodeError self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + switch (self) { + case LdkNodeError_InvalidTxid(): + sse_encode_i_32(0, serializer); + case LdkNodeError_AlreadyRunning(): + sse_encode_i_32(1, serializer); + case LdkNodeError_NotRunning(): + sse_encode_i_32(2, serializer); + case LdkNodeError_OnchainTxCreationFailed(): + sse_encode_i_32(3, serializer); + case LdkNodeError_ConnectionFailed(): + sse_encode_i_32(4, serializer); + case LdkNodeError_InvoiceCreationFailed(): + sse_encode_i_32(5, serializer); + case LdkNodeError_PaymentSendingFailed(): + sse_encode_i_32(6, serializer); + case LdkNodeError_ProbeSendingFailed(): + sse_encode_i_32(7, serializer); + case LdkNodeError_ChannelCreationFailed(): + sse_encode_i_32(8, serializer); + case LdkNodeError_ChannelClosingFailed(): + sse_encode_i_32(9, serializer); + case LdkNodeError_ChannelConfigUpdateFailed(): + sse_encode_i_32(10, serializer); + case LdkNodeError_PersistenceFailed(): + sse_encode_i_32(11, serializer); + case LdkNodeError_WalletOperationFailed(): + sse_encode_i_32(12, serializer); + case LdkNodeError_OnchainTxSigningFailed(): + sse_encode_i_32(13, serializer); + case LdkNodeError_MessageSigningFailed(): + sse_encode_i_32(14, serializer); + case LdkNodeError_TxSyncFailed(): + sse_encode_i_32(15, serializer); + case LdkNodeError_GossipUpdateFailed(): + sse_encode_i_32(16, serializer); + case LdkNodeError_InvalidAddress(): + sse_encode_i_32(17, serializer); + case LdkNodeError_InvalidSocketAddress(): + sse_encode_i_32(18, serializer); + case LdkNodeError_InvalidPublicKey(): + sse_encode_i_32(19, serializer); + case LdkNodeError_InvalidSecretKey(): + sse_encode_i_32(20, serializer); + case LdkNodeError_InvalidPaymentHash(): + sse_encode_i_32(21, serializer); + case LdkNodeError_InvalidPaymentPreimage(): + sse_encode_i_32(22, serializer); + case LdkNodeError_InvalidPaymentSecret(): + sse_encode_i_32(23, serializer); + case LdkNodeError_InvalidAmount(): + sse_encode_i_32(24, serializer); + case LdkNodeError_InvalidInvoice(): + sse_encode_i_32(25, serializer); + case LdkNodeError_InvalidChannelId(): + sse_encode_i_32(26, serializer); + case LdkNodeError_InvalidNetwork(): + sse_encode_i_32(27, serializer); + case LdkNodeError_DuplicatePayment(): + sse_encode_i_32(28, serializer); + case LdkNodeError_InsufficientFunds(): + sse_encode_i_32(29, serializer); + case LdkNodeError_FeerateEstimationUpdateFailed(): + sse_encode_i_32(30, serializer); + case LdkNodeError_LiquidityRequestFailed(): + sse_encode_i_32(31, serializer); + case LdkNodeError_LiquiditySourceUnavailable(): + sse_encode_i_32(32, serializer); + case LdkNodeError_LiquidityFeeTooHigh(): + sse_encode_i_32(33, serializer); + case LdkNodeError_InvalidPaymentId(): + sse_encode_i_32(34, serializer); + case LdkNodeError_Decode(field0: final field0): + sse_encode_i_32(35, serializer); + sse_encode_box_autoadd_decode_error(field0, serializer); + case LdkNodeError_Bolt12Parse(field0: final field0): + sse_encode_i_32(36, serializer); + sse_encode_box_autoadd_bolt_12_parse_error(field0, serializer); + case LdkNodeError_InvoiceRequestCreationFailed(): + sse_encode_i_32(37, serializer); + case LdkNodeError_OfferCreationFailed(): + sse_encode_i_32(38, serializer); + case LdkNodeError_RefundCreationFailed(): + sse_encode_i_32(39, serializer); + case LdkNodeError_FeerateEstimationUpdateTimeout(): + sse_encode_i_32(40, serializer); + case LdkNodeError_WalletOperationTimeout(): + sse_encode_i_32(41, serializer); + case LdkNodeError_TxSyncTimeout(): + sse_encode_i_32(42, serializer); + case LdkNodeError_GossipUpdateTimeout(): + sse_encode_i_32(43, serializer); + case LdkNodeError_InvalidOfferId(): + sse_encode_i_32(44, serializer); + case LdkNodeError_InvalidNodeId(): + sse_encode_i_32(45, serializer); + case LdkNodeError_InvalidOffer(): + sse_encode_i_32(46, serializer); + case LdkNodeError_InvalidRefund(): + sse_encode_i_32(47, serializer); + case LdkNodeError_UnsupportedCurrency(): + sse_encode_i_32(48, serializer); + default: + throw UnimplementedError(''); + } + } + + @protected + void sse_encode_ldk_on_chain_payment( + LdkOnChainPayment self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_RustOpaque_ldk_nodepaymentOnchainPayment(self.ptr, serializer); + } + + @protected + void sse_encode_ldk_spontaneous_payment( + LdkSpontaneousPayment self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + self.ptr, serializer); + } + + @protected + void sse_encode_lightning_balance( + LightningBalance 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); + default: + throw UnimplementedError(''); + } + } + + @protected + void sse_encode_liquidity_source_config( + LiquiditySourceConfig 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); + } + + @protected + void sse_encode_list_channel_details( + 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_channel_details(item, serializer); + } + } + + @protected + void sse_encode_list_lightning_balance( + List self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_RustOpaque_NodeSqliteStore(self.ptr, serializer); + sse_encode_i_32(self.length, serializer); + for (final item in self) { + sse_encode_lightning_balance(item, serializer); + } } @protected - void sse_encode_list_channel_details( - List self, SseSerializer serializer) { + void sse_encode_list_node_id(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_channel_details(item, serializer); + sse_encode_node_id(item, serializer); } } @@ -3414,6 +7294,24 @@ 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_64_strict( + Uint64List self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_i_32(self.length, serializer); + serializer.buffer.putUint64List(self); + } + @protected void sse_encode_list_prim_u_8_loose( List self, SseSerializer serializer) { @@ -3457,6 +7355,14 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_i_32(self.index, serializer); } + @protected + void sse_encode_lsp_fee_limits(LSPFeeLimits self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_opt_box_autoadd_u_64(self.maxTotalOpeningFeeMsat, serializer); + sse_encode_opt_box_autoadd_u_64( + self.maxProportionalOpeningFeePpmMsat, serializer); + } + @protected void sse_encode_max_dust_htlc_exposure( MaxDustHTLCExposure self, SseSerializer serializer) { @@ -3468,6 +7374,8 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { case MaxDustHTLCExposure_FeeRateMultiplier(field0: final field0): sse_encode_i_32(1, serializer); sse_encode_u_64(field0, serializer); + default: + throw UnimplementedError(''); } } @@ -3478,9 +7386,55 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - void sse_encode_node_exception(NodeException self, SseSerializer serializer) { + void sse_encode_node_announcement_info( + NodeAnnouncementInfo self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_i_32(self.index, serializer); + sse_encode_u_32(self.lastUpdate, serializer); + sse_encode_String(self.alias, serializer); + sse_encode_list_socket_address(self.addresses, serializer); + } + + @protected + void sse_encode_node_id(NodeId self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_list_prim_u_8_strict(self.compressed, serializer); + } + + @protected + void sse_encode_node_info(NodeInfo self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_list_prim_u_64_strict(self.channels, serializer); + sse_encode_opt_box_autoadd_node_announcement_info( + self.announcementInfo, 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_offer(Offer self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_String(self.s, serializer); + } + + @protected + void sse_encode_offer_id(OfferId self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_u_8_array_32(self.field0, serializer); } @protected @@ -3493,6 +7447,17 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } } + @protected + void sse_encode_opt_box_autoadd_anchor_channels_config( + AnchorChannelsConfig? 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_anchor_channels_config(self, serializer); + } + } + @protected void sse_encode_opt_box_autoadd_chain_data_source_config( ChainDataSourceConfig? self, SseSerializer serializer) { @@ -3515,6 +7480,50 @@ 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_channel_info( + ChannelInfo? 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_info(self, serializer); + } + } + + @protected + void sse_encode_opt_box_autoadd_channel_update_info( + ChannelUpdateInfo? 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_update_info(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) { @@ -3547,6 +7556,61 @@ 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_node_announcement_info( + NodeAnnouncementInfo? 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_node_announcement_info(self, serializer); + } + } + + @protected + void sse_encode_opt_box_autoadd_node_info( + NodeInfo? 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_node_info(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) { @@ -3558,6 +7622,39 @@ 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_hash( + PaymentHash? 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_hash(self, serializer); + } + } + + @protected + void sse_encode_opt_box_autoadd_payment_id( + PaymentId? 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_id(self, serializer); + } + } + @protected void sse_encode_opt_box_autoadd_payment_preimage( PaymentPreimage? self, SseSerializer serializer) { @@ -3591,6 +7688,16 @@ 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 @@ -3602,7 +7709,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - void sse_encode_opt_box_autoadd_u_64(int? self, SseSerializer serializer) { + void sse_encode_opt_box_autoadd_u_64(BigInt? self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_bool(self != null, serializer); @@ -3633,9 +7740,8 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { void sse_encode_payment_details( PaymentDetails self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_payment_hash(self.hash, serializer); - sse_encode_opt_box_autoadd_payment_preimage(self.preimage, serializer); - sse_encode_opt_box_autoadd_payment_secret(self.secret, serializer); + sse_encode_payment_id(self.id, serializer); + sse_encode_payment_kind(self.kind, serializer); sse_encode_opt_box_autoadd_u_64(self.amountMsat, serializer); sse_encode_payment_direction(self.direction, serializer); sse_encode_payment_status(self.status, serializer); @@ -3648,12 +7754,80 @@ 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 sse_encode_u_8_array_32(self.data, serializer); } + @protected + void sse_encode_payment_id(PaymentId self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_u_8_array_32(self.field0, serializer); + } + + @protected + void sse_encode_payment_kind(PaymentKind self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + switch (self) { + case PaymentKind_Onchain(): + sse_encode_i_32(0, serializer); + case PaymentKind_Bolt11( + hash: final hash, + preimage: final preimage, + secret: final secret + ): + sse_encode_i_32(1, serializer); + sse_encode_box_autoadd_payment_hash(hash, serializer); + sse_encode_opt_box_autoadd_payment_preimage(preimage, serializer); + sse_encode_opt_box_autoadd_payment_secret(secret, serializer); + case PaymentKind_Bolt11Jit( + hash: final hash, + preimage: final preimage, + secret: final secret, + lspFeeLimits: final lspFeeLimits + ): + sse_encode_i_32(2, serializer); + sse_encode_box_autoadd_payment_hash(hash, serializer); + sse_encode_opt_box_autoadd_payment_preimage(preimage, serializer); + sse_encode_opt_box_autoadd_payment_secret(secret, serializer); + sse_encode_box_autoadd_lsp_fee_limits(lspFeeLimits, serializer); + case PaymentKind_Spontaneous(hash: final hash, preimage: final preimage): + sse_encode_i_32(3, serializer); + sse_encode_box_autoadd_payment_hash(hash, serializer); + sse_encode_opt_box_autoadd_payment_preimage(preimage, serializer); + case PaymentKind_Bolt12Offer( + hash: final hash, + preimage: final preimage, + secret: final secret, + offerId: final offerId + ): + sse_encode_i_32(4, serializer); + sse_encode_opt_box_autoadd_payment_hash(hash, serializer); + sse_encode_opt_box_autoadd_payment_preimage(preimage, serializer); + sse_encode_opt_box_autoadd_payment_secret(secret, serializer); + sse_encode_box_autoadd_offer_id(offerId, serializer); + case PaymentKind_Bolt12Refund( + hash: final hash, + preimage: final preimage, + secret: final secret + ): + sse_encode_i_32(5, serializer); + sse_encode_opt_box_autoadd_payment_hash(hash, serializer); + sse_encode_opt_box_autoadd_payment_preimage(preimage, serializer); + sse_encode_opt_box_autoadd_payment_secret(secret, serializer); + default: + throw UnimplementedError(''); + } + } + @protected void sse_encode_payment_preimage( PaymentPreimage self, SseSerializer serializer) { @@ -3681,12 +7855,75 @@ 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); + default: + throw UnimplementedError(''); + } + } + @protected void sse_encode_public_key(PublicKey self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_String(self.hex, 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); + } + + @protected + void sse_encode_refund(Refund self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_String(self.s, serializer); + } + + @protected + void sse_encode_routing_fees(RoutingFees self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_u_32(self.baseMsat, serializer); + sse_encode_u_32(self.proportionalMillionths, serializer); + } + @protected void sse_encode_socket_address(SocketAddress self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -3717,6 +7954,8 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_i_32(4, serializer); sse_encode_String(addr, serializer); sse_encode_u_16(port, serializer); + default: + throw UnimplementedError(''); } } @@ -3739,9 +7978,9 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - void sse_encode_u_64(int self, SseSerializer serializer) { + void sse_encode_u_64(BigInt self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - serializer.buffer.putUint64(self); + serializer.buffer.putBigUint64(self); } @protected @@ -3789,12 +8028,192 @@ 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_u_64(self.data, serializer); + sse_encode_list_prim_u_8_strict(self.data, serializer); } @protected - void sse_encode_usize(int self, SseSerializer serializer) { + void sse_encode_usize(BigInt self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - serializer.buffer.putUint64(self); + serializer.buffer.putBigUint64(self); } } + +@sealed +class ArcBolt12PaymentImpl extends RustOpaque implements ArcBolt12Payment { + // Not to be used by end users + ArcBolt12PaymentImpl.frbInternalDcoDecode(List wire) + : super.frbInternalDcoDecode(wire, _kStaticData); + + // Not to be used by end users + ArcBolt12PaymentImpl.frbInternalSseDecode( + BigInt ptr, int externalSizeOnNative) + : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + core.instance.api.rust_arc_increment_strong_count_ArcBolt12Payment, + rustArcDecrementStrongCount: + core.instance.api.rust_arc_decrement_strong_count_ArcBolt12Payment, + rustArcDecrementStrongCountPtr: + core.instance.api.rust_arc_decrement_strong_count_ArcBolt12PaymentPtr, + ); +} + +@sealed +class Bolt11PaymentImpl extends RustOpaque implements Bolt11Payment { + // Not to be used by end users + Bolt11PaymentImpl.frbInternalDcoDecode(List wire) + : super.frbInternalDcoDecode(wire, _kStaticData); + + // Not to be used by end users + Bolt11PaymentImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative) + : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + core.instance.api.rust_arc_increment_strong_count_Bolt11Payment, + rustArcDecrementStrongCount: + core.instance.api.rust_arc_decrement_strong_count_Bolt11Payment, + rustArcDecrementStrongCountPtr: + core.instance.api.rust_arc_decrement_strong_count_Bolt11PaymentPtr, + ); +} + +@sealed +class BuilderImpl extends RustOpaque implements Builder { + // Not to be used by end users + BuilderImpl.frbInternalDcoDecode(List wire) + : super.frbInternalDcoDecode(wire, _kStaticData); + + // Not to be used by end users + BuilderImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative) + : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + core.instance.api.rust_arc_increment_strong_count_Builder, + rustArcDecrementStrongCount: + core.instance.api.rust_arc_decrement_strong_count_Builder, + rustArcDecrementStrongCountPtr: + core.instance.api.rust_arc_decrement_strong_count_BuilderPtr, + ); +} + +@sealed +class NetworkGraphImpl extends RustOpaque implements NetworkGraph { + // Not to be used by end users + NetworkGraphImpl.frbInternalDcoDecode(List wire) + : super.frbInternalDcoDecode(wire, _kStaticData); + + // Not to be used by end users + NetworkGraphImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative) + : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + core.instance.api.rust_arc_increment_strong_count_NetworkGraph, + rustArcDecrementStrongCount: + core.instance.api.rust_arc_decrement_strong_count_NetworkGraph, + rustArcDecrementStrongCountPtr: + core.instance.api.rust_arc_decrement_strong_count_NetworkGraphPtr, + ); +} + +@sealed +class NodeBuilderImpl extends RustOpaque implements NodeBuilder { + // Not to be used by end users + NodeBuilderImpl.frbInternalDcoDecode(List wire) + : super.frbInternalDcoDecode(wire, _kStaticData); + + // Not to be used by end users + NodeBuilderImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative) + : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + core.instance.api.rust_arc_increment_strong_count_NodeBuilder, + rustArcDecrementStrongCount: + core.instance.api.rust_arc_decrement_strong_count_NodeBuilder, + rustArcDecrementStrongCountPtr: + core.instance.api.rust_arc_decrement_strong_count_NodeBuilderPtr, + ); + + Builder get builder => + core.instance.api.crateApiBuilderNodeBuilderAutoAccessorGetBuilder( + that: this, + ); + + void set builder(Builder builder) => + core.instance.api.crateApiBuilderNodeBuilderAutoAccessorSetBuilder( + that: this, builder: builder); + + Future build() => core.instance.api.crateApiBuilderNodeBuilderBuild( + that: this, + ); + + Future buildWithFsStore() => + core.instance.api.crateApiBuilderNodeBuilderBuildWithFsStore( + that: this, + ); +} + +@sealed +class NodeImpl extends RustOpaque implements Node { + // Not to be used by end users + NodeImpl.frbInternalDcoDecode(List wire) + : super.frbInternalDcoDecode(wire, _kStaticData); + + // Not to be used by end users + NodeImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative) + : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + core.instance.api.rust_arc_increment_strong_count_Node, + rustArcDecrementStrongCount: + core.instance.api.rust_arc_decrement_strong_count_Node, + rustArcDecrementStrongCountPtr: + core.instance.api.rust_arc_decrement_strong_count_NodePtr, + ); +} + +@sealed +class OnchainPaymentImpl extends RustOpaque implements OnchainPayment { + // Not to be used by end users + OnchainPaymentImpl.frbInternalDcoDecode(List wire) + : super.frbInternalDcoDecode(wire, _kStaticData); + + // Not to be used by end users + OnchainPaymentImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative) + : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + core.instance.api.rust_arc_increment_strong_count_OnchainPayment, + rustArcDecrementStrongCount: + core.instance.api.rust_arc_decrement_strong_count_OnchainPayment, + rustArcDecrementStrongCountPtr: + core.instance.api.rust_arc_decrement_strong_count_OnchainPaymentPtr, + ); +} + +@sealed +class SpontaneousPaymentImpl extends RustOpaque implements SpontaneousPayment { + // Not to be used by end users + SpontaneousPaymentImpl.frbInternalDcoDecode(List wire) + : super.frbInternalDcoDecode(wire, _kStaticData); + + // Not to be used by end users + SpontaneousPaymentImpl.frbInternalSseDecode( + BigInt ptr, int externalSizeOnNative) + : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + core.instance.api.rust_arc_increment_strong_count_SpontaneousPayment, + rustArcDecrementStrongCount: + core.instance.api.rust_arc_decrement_strong_count_SpontaneousPayment, + rustArcDecrementStrongCountPtr: + core.instance.api.rust_arc_decrement_strong_count_SpontaneousPaymentPtr, + ); +} diff --git a/lib/src/generated/frb_generated.io.dart b/lib/src/generated/frb_generated.io.dart index f729196..a49e574 100644 --- a/lib/src/generated/frb_generated.io.dart +++ b/lib/src/generated/frb_generated.io.dart @@ -1,19 +1,26 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. +// Generated by `flutter_rust_bridge`@ 2.0.0. // 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 -import 'api/error.dart'; +import 'api/bolt11.dart'; +import 'api/bolt12.dart'; +import 'api/builder.dart'; +import 'api/graph.dart'; import 'api/node.dart'; +import 'api/on_chain.dart'; +import 'api/spontaneous.dart'; import 'api/types.dart'; import 'dart:async'; import 'dart:convert'; import 'dart:ffi' as ffi; import 'frb_generated.dart'; +import 'lib.dart'; import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated_io.dart'; +import 'utils/error.dart'; -abstract class LdkCoreApiImplPlatform extends BaseApiImpl { - LdkCoreApiImplPlatform({ +abstract class coreApiImplPlatform extends BaseApiImpl { + coreApiImplPlatform({ required super.handler, required super.wire, required super.generalizedFrbRustBinding, @@ -21,11 +28,78 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { }); CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_NodeSqliteStorePtr => - wire._rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStorePtr; + get rust_arc_decrement_strong_count_ArcBolt12PaymentPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12PaymentPtr; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_NodePtr => + wire._rust_arc_decrement_strong_count_RustOpaque_NodePtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_NodeBuilderPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilderPtr; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_BuilderPtr => + wire._rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilderPtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_NetworkGraphPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraphPtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_Bolt11PaymentPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11PaymentPtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_OnchainPaymentPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPaymentPtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_SpontaneousPaymentPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPaymentPtr; + + @protected + NodeBuilder + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + dynamic raw); + + @protected + NodeBuilder + dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + dynamic raw); + + @protected + NodeBuilder + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + dynamic raw); + + @protected + ArcBolt12Payment dco_decode_RustOpaque_Arcldk_nodepaymentBolt12Payment( + dynamic raw); + + @protected + Node dco_decode_RustOpaque_Node(dynamic raw); + + @protected + NodeBuilder + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + dynamic raw); + + @protected + Builder dco_decode_RustOpaque_ldk_nodeBuilder(dynamic raw); + + @protected + NetworkGraph dco_decode_RustOpaque_ldk_nodegraphNetworkGraph(dynamic raw); + + @protected + Bolt11Payment dco_decode_RustOpaque_ldk_nodepaymentBolt11Payment(dynamic raw); + + @protected + OnchainPayment dco_decode_RustOpaque_ldk_nodepaymentOnchainPayment( + dynamic raw); @protected - NodeSqliteStore dco_decode_RustOpaque_NodeSqliteStore(dynamic raw); + SpontaneousPayment dco_decode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + dynamic raw); @protected String dco_decode_String(dynamic raw); @@ -33,18 +107,40 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected Address dco_decode_address(dynamic raw); + @protected + AnchorChannelsConfig dco_decode_anchor_channels_config(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); + @protected + Bolt12Invoice dco_decode_bolt_12_invoice(dynamic raw); + + @protected + Bolt12ParseError dco_decode_bolt_12_parse_error(dynamic raw); + @protected bool dco_decode_bool(dynamic raw); @protected Address dco_decode_box_autoadd_address(dynamic raw); + @protected + AnchorChannelsConfig dco_decode_box_autoadd_anchor_channels_config( + dynamic raw); + @protected Bolt11Invoice dco_decode_box_autoadd_bolt_11_invoice(dynamic raw); + @protected + Bolt12ParseError dco_decode_box_autoadd_bolt_12_parse_error(dynamic raw); + @protected ChainDataSourceConfig dco_decode_box_autoadd_chain_data_source_config( dynamic raw); @@ -55,9 +151,21 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected ChannelId dco_decode_box_autoadd_channel_id(dynamic raw); + @protected + ChannelInfo dco_decode_box_autoadd_channel_info(dynamic raw); + + @protected + ChannelUpdateInfo dco_decode_box_autoadd_channel_update_info(dynamic raw); + + @protected + ClosureReason dco_decode_box_autoadd_closure_reason(dynamic raw); + @protected Config dco_decode_box_autoadd_config(dynamic raw); + @protected + DecodeError dco_decode_box_autoadd_decode_error(dynamic raw); + @protected EntropySourceConfig dco_decode_box_autoadd_entropy_source_config(dynamic raw); @@ -67,21 +175,71 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected GossipSourceConfig dco_decode_box_autoadd_gossip_source_config(dynamic raw); + @protected + LdkBolt11Payment dco_decode_box_autoadd_ldk_bolt_11_payment(dynamic raw); + + @protected + LdkBolt12Payment dco_decode_box_autoadd_ldk_bolt_12_payment(dynamic raw); + @protected LdkMnemonic dco_decode_box_autoadd_ldk_mnemonic(dynamic raw); + @protected + LdkNetworkGraph dco_decode_box_autoadd_ldk_network_graph(dynamic raw); + @protected LdkNode dco_decode_box_autoadd_ldk_node(dynamic raw); + @protected + LdkOnChainPayment dco_decode_box_autoadd_ldk_on_chain_payment(dynamic raw); + + @protected + LdkSpontaneousPayment dco_decode_box_autoadd_ldk_spontaneous_payment( + dynamic raw); + + @protected + LiquiditySourceConfig dco_decode_box_autoadd_liquidity_source_config( + dynamic raw); + + @protected + LSPFeeLimits dco_decode_box_autoadd_lsp_fee_limits(dynamic raw); + + @protected + MaxDustHTLCExposure dco_decode_box_autoadd_max_dust_htlc_exposure( + dynamic raw); + + @protected + NodeAnnouncementInfo dco_decode_box_autoadd_node_announcement_info( + dynamic raw); + + @protected + NodeId dco_decode_box_autoadd_node_id(dynamic raw); + + @protected + NodeInfo dco_decode_box_autoadd_node_info(dynamic raw); + + @protected + Offer dco_decode_box_autoadd_offer(dynamic raw); + + @protected + OfferId dco_decode_box_autoadd_offer_id(dynamic raw); + @protected OutPoint dco_decode_box_autoadd_out_point(dynamic raw); @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); + @protected + PaymentId dco_decode_box_autoadd_payment_id(dynamic raw); + @protected PaymentPreimage dco_decode_box_autoadd_payment_preimage(dynamic raw); @@ -91,20 +249,26 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected PublicKey dco_decode_box_autoadd_public_key(dynamic raw); + @protected + Refund dco_decode_box_autoadd_refund(dynamic raw); + @protected SocketAddress dco_decode_box_autoadd_socket_address(dynamic raw); @protected - int dco_decode_box_autoadd_u_32(dynamic raw); + Txid dco_decode_box_autoadd_txid(dynamic raw); @protected - int dco_decode_box_autoadd_u_64(dynamic raw); + int dco_decode_box_autoadd_u_16(dynamic raw); @protected - UserChannelId dco_decode_box_autoadd_user_channel_id(dynamic raw); + int dco_decode_box_autoadd_u_32(dynamic raw); + + @protected + BigInt dco_decode_box_autoadd_u_64(dynamic raw); @protected - BuilderException dco_decode_builder_exception(dynamic raw); + UserChannelId dco_decode_box_autoadd_user_channel_id(dynamic raw); @protected ChainDataSourceConfig dco_decode_chain_data_source_config(dynamic raw); @@ -118,9 +282,21 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected ChannelId dco_decode_channel_id(dynamic raw); + @protected + ChannelInfo dco_decode_channel_info(dynamic raw); + + @protected + ChannelUpdateInfo dco_decode_channel_update_info(dynamic raw); + + @protected + ClosureReason dco_decode_closure_reason(dynamic raw); + @protected Config dco_decode_config(dynamic raw); + @protected + DecodeError dco_decode_decode_error(dynamic raw); + @protected EntropySourceConfig dco_decode_entropy_source_config(dynamic raw); @@ -133,21 +309,60 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected int dco_decode_i_32(dynamic raw); + @protected + LdkBolt11Payment dco_decode_ldk_bolt_11_payment(dynamic raw); + + @protected + LdkBolt12Payment dco_decode_ldk_bolt_12_payment(dynamic raw); + + @protected + LdkBuilderError dco_decode_ldk_builder_error(dynamic raw); + @protected LdkMnemonic dco_decode_ldk_mnemonic(dynamic raw); + @protected + LdkNetworkGraph dco_decode_ldk_network_graph(dynamic raw); + @protected LdkNode dco_decode_ldk_node(dynamic raw); + @protected + LdkNodeError dco_decode_ldk_node_error(dynamic raw); + + @protected + LdkOnChainPayment dco_decode_ldk_on_chain_payment(dynamic raw); + + @protected + LdkSpontaneousPayment dco_decode_ldk_spontaneous_payment(dynamic raw); + + @protected + LightningBalance dco_decode_lightning_balance(dynamic raw); + + @protected + LiquiditySourceConfig dco_decode_liquidity_source_config(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_node_id(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 + Uint64List dco_decode_list_prim_u_64_strict(dynamic raw); + @protected List dco_decode_list_prim_u_8_loose(dynamic raw); @@ -163,6 +378,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected LogLevel dco_decode_log_level(dynamic raw); + @protected + LSPFeeLimits dco_decode_lsp_fee_limits(dynamic raw); + @protected MaxDustHTLCExposure dco_decode_max_dust_htlc_exposure(dynamic raw); @@ -170,11 +388,30 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { Network dco_decode_network(dynamic raw); @protected - NodeException dco_decode_node_exception(dynamic raw); + NodeAnnouncementInfo dco_decode_node_announcement_info(dynamic raw); + + @protected + NodeId dco_decode_node_id(dynamic raw); + + @protected + NodeInfo dco_decode_node_info(dynamic raw); + + @protected + NodeStatus dco_decode_node_status(dynamic raw); + + @protected + Offer dco_decode_offer(dynamic raw); + + @protected + OfferId dco_decode_offer_id(dynamic raw); @protected String? dco_decode_opt_String(dynamic raw); + @protected + AnchorChannelsConfig? dco_decode_opt_box_autoadd_anchor_channels_config( + dynamic raw); + @protected ChainDataSourceConfig? dco_decode_opt_box_autoadd_chain_data_source_config( dynamic raw); @@ -182,6 +419,19 @@ 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 + ChannelInfo? dco_decode_opt_box_autoadd_channel_info(dynamic raw); + + @protected + ChannelUpdateInfo? dco_decode_opt_box_autoadd_channel_update_info( + 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); @@ -193,9 +443,37 @@ 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 + NodeAnnouncementInfo? dco_decode_opt_box_autoadd_node_announcement_info( + dynamic raw); + + @protected + NodeInfo? dco_decode_opt_box_autoadd_node_info(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 + PaymentHash? dco_decode_opt_box_autoadd_payment_hash(dynamic raw); + + @protected + PaymentId? dco_decode_opt_box_autoadd_payment_id(dynamic raw); + @protected PaymentPreimage? dco_decode_opt_box_autoadd_payment_preimage(dynamic raw); @@ -205,11 +483,14 @@ 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); @protected - int? dco_decode_opt_box_autoadd_u_64(dynamic raw); + BigInt? dco_decode_opt_box_autoadd_u_64(dynamic raw); @protected List? dco_decode_opt_list_socket_address(dynamic raw); @@ -223,9 +504,18 @@ 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); + @protected + PaymentId dco_decode_payment_id(dynamic raw); + + @protected + PaymentKind dco_decode_payment_kind(dynamic raw); + @protected PaymentPreimage dco_decode_payment_preimage(dynamic raw); @@ -238,9 +528,22 @@ 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 + Refund dco_decode_refund(dynamic raw); + + @protected + RoutingFees dco_decode_routing_fees(dynamic raw); + @protected SocketAddress dco_decode_socket_address(dynamic raw); @@ -254,7 +557,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { int dco_decode_u_32(dynamic raw); @protected - int dco_decode_u_64(dynamic raw); + BigInt dco_decode_u_64(dynamic raw); @protected int dco_decode_u_8(dynamic raw); @@ -281,140 +584,331 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { UserChannelId dco_decode_user_channel_id(dynamic raw); @protected - int dco_decode_usize(dynamic raw); + BigInt dco_decode_usize(dynamic raw); @protected - NodeSqliteStore sse_decode_RustOpaque_NodeSqliteStore( - SseDeserializer deserializer); + NodeBuilder + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + SseDeserializer deserializer); @protected - String sse_decode_String(SseDeserializer deserializer); + NodeBuilder + sse_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + SseDeserializer deserializer); @protected - Address sse_decode_address(SseDeserializer deserializer); + NodeBuilder + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + SseDeserializer deserializer); @protected - Bolt11Invoice sse_decode_bolt_11_invoice(SseDeserializer deserializer); + ArcBolt12Payment sse_decode_RustOpaque_Arcldk_nodepaymentBolt12Payment( + SseDeserializer deserializer); @protected - bool sse_decode_bool(SseDeserializer deserializer); + Node sse_decode_RustOpaque_Node(SseDeserializer deserializer); @protected - Address sse_decode_box_autoadd_address(SseDeserializer deserializer); + NodeBuilder + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + SseDeserializer deserializer); @protected - Bolt11Invoice sse_decode_box_autoadd_bolt_11_invoice( + Builder sse_decode_RustOpaque_ldk_nodeBuilder(SseDeserializer deserializer); + + @protected + NetworkGraph sse_decode_RustOpaque_ldk_nodegraphNetworkGraph( SseDeserializer deserializer); @protected - ChainDataSourceConfig sse_decode_box_autoadd_chain_data_source_config( + Bolt11Payment sse_decode_RustOpaque_ldk_nodepaymentBolt11Payment( SseDeserializer deserializer); @protected - ChannelConfig sse_decode_box_autoadd_channel_config( + OnchainPayment sse_decode_RustOpaque_ldk_nodepaymentOnchainPayment( SseDeserializer deserializer); @protected - ChannelId sse_decode_box_autoadd_channel_id(SseDeserializer deserializer); + SpontaneousPayment sse_decode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + SseDeserializer deserializer); @protected - Config sse_decode_box_autoadd_config(SseDeserializer deserializer); + String sse_decode_String(SseDeserializer deserializer); @protected - EntropySourceConfig sse_decode_box_autoadd_entropy_source_config( + Address sse_decode_address(SseDeserializer deserializer); + + @protected + AnchorChannelsConfig sse_decode_anchor_channels_config( SseDeserializer deserializer); @protected - Event sse_decode_box_autoadd_event(SseDeserializer deserializer); + BalanceDetails sse_decode_balance_details(SseDeserializer deserializer); @protected - GossipSourceConfig sse_decode_box_autoadd_gossip_source_config( - SseDeserializer deserializer); + BestBlock sse_decode_best_block(SseDeserializer deserializer); @protected - LdkMnemonic sse_decode_box_autoadd_ldk_mnemonic(SseDeserializer deserializer); + Bolt11Invoice sse_decode_bolt_11_invoice(SseDeserializer deserializer); @protected - LdkNode sse_decode_box_autoadd_ldk_node(SseDeserializer deserializer); + Bolt12Invoice sse_decode_bolt_12_invoice(SseDeserializer deserializer); @protected - OutPoint sse_decode_box_autoadd_out_point(SseDeserializer deserializer); + Bolt12ParseError sse_decode_bolt_12_parse_error(SseDeserializer deserializer); @protected - PaymentDetails sse_decode_box_autoadd_payment_details( - SseDeserializer deserializer); + bool sse_decode_bool(SseDeserializer deserializer); @protected - PaymentHash sse_decode_box_autoadd_payment_hash(SseDeserializer deserializer); + Address sse_decode_box_autoadd_address(SseDeserializer deserializer); @protected - PaymentPreimage sse_decode_box_autoadd_payment_preimage( + AnchorChannelsConfig sse_decode_box_autoadd_anchor_channels_config( SseDeserializer deserializer); @protected - PaymentSecret sse_decode_box_autoadd_payment_secret( + Bolt11Invoice sse_decode_box_autoadd_bolt_11_invoice( SseDeserializer deserializer); @protected - PublicKey sse_decode_box_autoadd_public_key(SseDeserializer deserializer); + Bolt12ParseError sse_decode_box_autoadd_bolt_12_parse_error( + SseDeserializer deserializer); @protected - SocketAddress sse_decode_box_autoadd_socket_address( + ChainDataSourceConfig sse_decode_box_autoadd_chain_data_source_config( SseDeserializer deserializer); @protected - int sse_decode_box_autoadd_u_32(SseDeserializer deserializer); + ChannelConfig sse_decode_box_autoadd_channel_config( + SseDeserializer deserializer); @protected - int sse_decode_box_autoadd_u_64(SseDeserializer deserializer); + ChannelId sse_decode_box_autoadd_channel_id(SseDeserializer deserializer); @protected - UserChannelId sse_decode_box_autoadd_user_channel_id( - SseDeserializer deserializer); + ChannelInfo sse_decode_box_autoadd_channel_info(SseDeserializer deserializer); @protected - BuilderException sse_decode_builder_exception(SseDeserializer deserializer); + ChannelUpdateInfo sse_decode_box_autoadd_channel_update_info( + SseDeserializer deserializer); @protected - ChainDataSourceConfig sse_decode_chain_data_source_config( + ClosureReason sse_decode_box_autoadd_closure_reason( SseDeserializer deserializer); @protected - ChannelConfig sse_decode_channel_config(SseDeserializer deserializer); + Config sse_decode_box_autoadd_config(SseDeserializer deserializer); @protected - ChannelDetails sse_decode_channel_details(SseDeserializer deserializer); + DecodeError sse_decode_box_autoadd_decode_error(SseDeserializer deserializer); @protected - ChannelId sse_decode_channel_id(SseDeserializer deserializer); + EntropySourceConfig sse_decode_box_autoadd_entropy_source_config( + SseDeserializer deserializer); @protected - Config sse_decode_config(SseDeserializer deserializer); + Event sse_decode_box_autoadd_event(SseDeserializer deserializer); @protected - EntropySourceConfig sse_decode_entropy_source_config( + GossipSourceConfig sse_decode_box_autoadd_gossip_source_config( SseDeserializer deserializer); @protected - Event sse_decode_event(SseDeserializer deserializer); + LdkBolt11Payment sse_decode_box_autoadd_ldk_bolt_11_payment( + SseDeserializer deserializer); @protected - GossipSourceConfig sse_decode_gossip_source_config( + LdkBolt12Payment sse_decode_box_autoadd_ldk_bolt_12_payment( SseDeserializer deserializer); @protected - int sse_decode_i_32(SseDeserializer deserializer); + LdkMnemonic sse_decode_box_autoadd_ldk_mnemonic(SseDeserializer deserializer); + + @protected + LdkNetworkGraph sse_decode_box_autoadd_ldk_network_graph( + SseDeserializer deserializer); + + @protected + LdkNode sse_decode_box_autoadd_ldk_node(SseDeserializer deserializer); + + @protected + LdkOnChainPayment sse_decode_box_autoadd_ldk_on_chain_payment( + SseDeserializer deserializer); + + @protected + LdkSpontaneousPayment sse_decode_box_autoadd_ldk_spontaneous_payment( + SseDeserializer deserializer); + + @protected + LiquiditySourceConfig sse_decode_box_autoadd_liquidity_source_config( + SseDeserializer deserializer); + + @protected + LSPFeeLimits sse_decode_box_autoadd_lsp_fee_limits( + SseDeserializer deserializer); + + @protected + MaxDustHTLCExposure sse_decode_box_autoadd_max_dust_htlc_exposure( + SseDeserializer deserializer); + + @protected + NodeAnnouncementInfo sse_decode_box_autoadd_node_announcement_info( + SseDeserializer deserializer); + + @protected + NodeId sse_decode_box_autoadd_node_id(SseDeserializer deserializer); + + @protected + NodeInfo sse_decode_box_autoadd_node_info(SseDeserializer deserializer); + + @protected + Offer sse_decode_box_autoadd_offer(SseDeserializer deserializer); + + @protected + OfferId sse_decode_box_autoadd_offer_id(SseDeserializer deserializer); + + @protected + OutPoint sse_decode_box_autoadd_out_point(SseDeserializer deserializer); + + @protected + 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); + + @protected + PaymentId sse_decode_box_autoadd_payment_id(SseDeserializer deserializer); + + @protected + PaymentPreimage sse_decode_box_autoadd_payment_preimage( + SseDeserializer deserializer); + + @protected + PaymentSecret sse_decode_box_autoadd_payment_secret( + SseDeserializer deserializer); + + @protected + PublicKey sse_decode_box_autoadd_public_key(SseDeserializer deserializer); + + @protected + Refund sse_decode_box_autoadd_refund(SseDeserializer deserializer); + + @protected + 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); + + @protected + BigInt sse_decode_box_autoadd_u_64(SseDeserializer deserializer); + + @protected + UserChannelId sse_decode_box_autoadd_user_channel_id( + SseDeserializer deserializer); + + @protected + ChainDataSourceConfig sse_decode_chain_data_source_config( + SseDeserializer deserializer); + + @protected + ChannelConfig sse_decode_channel_config(SseDeserializer deserializer); + + @protected + ChannelDetails sse_decode_channel_details(SseDeserializer deserializer); + + @protected + ChannelId sse_decode_channel_id(SseDeserializer deserializer); + + @protected + ChannelInfo sse_decode_channel_info(SseDeserializer deserializer); + + @protected + ChannelUpdateInfo sse_decode_channel_update_info( + SseDeserializer deserializer); + + @protected + ClosureReason sse_decode_closure_reason(SseDeserializer deserializer); + + @protected + Config sse_decode_config(SseDeserializer deserializer); + + @protected + DecodeError sse_decode_decode_error(SseDeserializer deserializer); + + @protected + EntropySourceConfig sse_decode_entropy_source_config( + SseDeserializer deserializer); + + @protected + Event sse_decode_event(SseDeserializer deserializer); + + @protected + GossipSourceConfig sse_decode_gossip_source_config( + SseDeserializer deserializer); + + @protected + int sse_decode_i_32(SseDeserializer deserializer); + + @protected + LdkBolt11Payment sse_decode_ldk_bolt_11_payment(SseDeserializer deserializer); + + @protected + LdkBolt12Payment sse_decode_ldk_bolt_12_payment(SseDeserializer deserializer); + + @protected + LdkBuilderError sse_decode_ldk_builder_error(SseDeserializer deserializer); @protected LdkMnemonic sse_decode_ldk_mnemonic(SseDeserializer deserializer); + @protected + LdkNetworkGraph sse_decode_ldk_network_graph(SseDeserializer deserializer); + @protected LdkNode sse_decode_ldk_node(SseDeserializer deserializer); + @protected + LdkNodeError sse_decode_ldk_node_error(SseDeserializer deserializer); + + @protected + LdkOnChainPayment sse_decode_ldk_on_chain_payment( + SseDeserializer deserializer); + + @protected + LdkSpontaneousPayment sse_decode_ldk_spontaneous_payment( + SseDeserializer deserializer); + + @protected + LightningBalance sse_decode_lightning_balance(SseDeserializer deserializer); + + @protected + LiquiditySourceConfig sse_decode_liquidity_source_config( + 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_node_id(SseDeserializer deserializer); + @protected List sse_decode_list_payment_details( SseDeserializer deserializer); @@ -422,6 +916,13 @@ 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 + Uint64List sse_decode_list_prim_u_64_strict(SseDeserializer deserializer); + @protected List sse_decode_list_prim_u_8_loose(SseDeserializer deserializer); @@ -438,6 +939,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected LogLevel sse_decode_log_level(SseDeserializer deserializer); + @protected + LSPFeeLimits sse_decode_lsp_fee_limits(SseDeserializer deserializer); + @protected MaxDustHTLCExposure sse_decode_max_dust_htlc_exposure( SseDeserializer deserializer); @@ -446,11 +950,31 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { Network sse_decode_network(SseDeserializer deserializer); @protected - NodeException sse_decode_node_exception(SseDeserializer deserializer); + NodeAnnouncementInfo sse_decode_node_announcement_info( + SseDeserializer deserializer); + + @protected + NodeId sse_decode_node_id(SseDeserializer deserializer); + + @protected + NodeInfo sse_decode_node_info(SseDeserializer deserializer); + + @protected + NodeStatus sse_decode_node_status(SseDeserializer deserializer); + + @protected + Offer sse_decode_offer(SseDeserializer deserializer); + + @protected + OfferId sse_decode_offer_id(SseDeserializer deserializer); @protected String? sse_decode_opt_String(SseDeserializer deserializer); + @protected + AnchorChannelsConfig? sse_decode_opt_box_autoadd_anchor_channels_config( + SseDeserializer deserializer); + @protected ChainDataSourceConfig? sse_decode_opt_box_autoadd_chain_data_source_config( SseDeserializer deserializer); @@ -459,6 +983,22 @@ 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 + ChannelInfo? sse_decode_opt_box_autoadd_channel_info( + SseDeserializer deserializer); + + @protected + ChannelUpdateInfo? sse_decode_opt_box_autoadd_channel_update_info( + 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); @@ -470,10 +1010,40 @@ 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 + NodeAnnouncementInfo? sse_decode_opt_box_autoadd_node_announcement_info( + SseDeserializer deserializer); + + @protected + NodeInfo? sse_decode_opt_box_autoadd_node_info(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 + PaymentHash? sse_decode_opt_box_autoadd_payment_hash( + SseDeserializer deserializer); + + @protected + PaymentId? sse_decode_opt_box_autoadd_payment_id( + SseDeserializer deserializer); + @protected PaymentPreimage? sse_decode_opt_box_autoadd_payment_preimage( SseDeserializer deserializer); @@ -486,11 +1056,14 @@ 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); @protected - int? sse_decode_opt_box_autoadd_u_64(SseDeserializer deserializer); + BigInt? sse_decode_opt_box_autoadd_u_64(SseDeserializer deserializer); @protected List? sse_decode_opt_list_socket_address( @@ -505,9 +1078,19 @@ 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); + @protected + PaymentId sse_decode_payment_id(SseDeserializer deserializer); + + @protected + PaymentKind sse_decode_payment_kind(SseDeserializer deserializer); + @protected PaymentPreimage sse_decode_payment_preimage(SseDeserializer deserializer); @@ -520,9 +1103,24 @@ 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 + Refund sse_decode_refund(SseDeserializer deserializer); + + @protected + RoutingFees sse_decode_routing_fees(SseDeserializer deserializer); + @protected SocketAddress sse_decode_socket_address(SseDeserializer deserializer); @@ -536,7 +1134,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { int sse_decode_u_32(SseDeserializer deserializer); @protected - int sse_decode_u_64(SseDeserializer deserializer); + BigInt sse_decode_u_64(SseDeserializer deserializer); @protected int sse_decode_u_8(SseDeserializer deserializer); @@ -563,7 +1161,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { UserChannelId sse_decode_user_channel_id(SseDeserializer deserializer); @protected - int sse_decode_usize(SseDeserializer deserializer); + BigInt sse_decode_usize(SseDeserializer deserializer); @protected ffi.Pointer cst_encode_String(String raw) { @@ -579,6 +1177,15 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ptr; } + @protected + ffi.Pointer + cst_encode_box_autoadd_anchor_channels_config(AnchorChannelsConfig raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_anchor_channels_config(); + cst_api_fill_to_wire_anchor_channels_config(raw, ptr.ref); + return ptr; + } + @protected ffi.Pointer cst_encode_box_autoadd_bolt_11_invoice( Bolt11Invoice raw) { @@ -588,6 +1195,15 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ptr; } + @protected + ffi.Pointer + cst_encode_box_autoadd_bolt_12_parse_error(Bolt12ParseError raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_bolt_12_parse_error(); + cst_api_fill_to_wire_bolt_12_parse_error(raw, ptr.ref); + return ptr; + } + @protected ffi.Pointer cst_encode_box_autoadd_chain_data_source_config( @@ -616,6 +1232,33 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ptr; } + @protected + ffi.Pointer cst_encode_box_autoadd_channel_info( + ChannelInfo raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_channel_info(); + cst_api_fill_to_wire_channel_info(raw, ptr.ref); + return ptr; + } + + @protected + ffi.Pointer + cst_encode_box_autoadd_channel_update_info(ChannelUpdateInfo raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_channel_update_info(); + cst_api_fill_to_wire_channel_update_info(raw, ptr.ref); + 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 @@ -624,6 +1267,15 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ptr; } + @protected + ffi.Pointer cst_encode_box_autoadd_decode_error( + DecodeError raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_decode_error(); + cst_api_fill_to_wire_decode_error(raw, ptr.ref); + return ptr; + } + @protected ffi.Pointer cst_encode_box_autoadd_entropy_source_config(EntropySourceConfig raw) { @@ -651,26 +1303,142 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { } @protected - ffi.Pointer cst_encode_box_autoadd_ldk_mnemonic( - LdkMnemonic raw) { + ffi.Pointer + cst_encode_box_autoadd_ldk_bolt_11_payment(LdkBolt11Payment raw) { // Codec=Cst (C-struct based), see doc to use other codecs - final ptr = wire.cst_new_box_autoadd_ldk_mnemonic(); - cst_api_fill_to_wire_ldk_mnemonic(raw, ptr.ref); + final ptr = wire.cst_new_box_autoadd_ldk_bolt_11_payment(); + cst_api_fill_to_wire_ldk_bolt_11_payment(raw, ptr.ref); return ptr; } @protected - ffi.Pointer cst_encode_box_autoadd_ldk_node(LdkNode raw) { + ffi.Pointer + cst_encode_box_autoadd_ldk_bolt_12_payment(LdkBolt12Payment raw) { // Codec=Cst (C-struct based), see doc to use other codecs - final ptr = wire.cst_new_box_autoadd_ldk_node(); - cst_api_fill_to_wire_ldk_node(raw, ptr.ref); + final ptr = wire.cst_new_box_autoadd_ldk_bolt_12_payment(); + cst_api_fill_to_wire_ldk_bolt_12_payment(raw, ptr.ref); return ptr; } @protected - ffi.Pointer cst_encode_box_autoadd_out_point( - OutPoint raw) { - // Codec=Cst (C-struct based), see doc to use other codecs + 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_ldk_mnemonic(); + cst_api_fill_to_wire_ldk_mnemonic(raw, ptr.ref); + return ptr; + } + + @protected + ffi.Pointer + cst_encode_box_autoadd_ldk_network_graph(LdkNetworkGraph raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_ldk_network_graph(); + cst_api_fill_to_wire_ldk_network_graph(raw, ptr.ref); + return ptr; + } + + @protected + 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_ldk_node(); + cst_api_fill_to_wire_ldk_node(raw, ptr.ref); + return ptr; + } + + @protected + ffi.Pointer + cst_encode_box_autoadd_ldk_on_chain_payment(LdkOnChainPayment raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_ldk_on_chain_payment(); + cst_api_fill_to_wire_ldk_on_chain_payment(raw, ptr.ref); + return ptr; + } + + @protected + ffi.Pointer + cst_encode_box_autoadd_ldk_spontaneous_payment( + LdkSpontaneousPayment raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_ldk_spontaneous_payment(); + cst_api_fill_to_wire_ldk_spontaneous_payment(raw, ptr.ref); + return ptr; + } + + @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_lsp_fee_limits( + LSPFeeLimits raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_lsp_fee_limits(); + cst_api_fill_to_wire_lsp_fee_limits(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_node_announcement_info(NodeAnnouncementInfo raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_node_announcement_info(); + cst_api_fill_to_wire_node_announcement_info(raw, ptr.ref); + return ptr; + } + + @protected + ffi.Pointer cst_encode_box_autoadd_node_id(NodeId raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_node_id(); + cst_api_fill_to_wire_node_id(raw, ptr.ref); + return ptr; + } + + @protected + ffi.Pointer cst_encode_box_autoadd_node_info( + NodeInfo raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_node_info(); + cst_api_fill_to_wire_node_info(raw, ptr.ref); + return ptr; + } + + @protected + ffi.Pointer cst_encode_box_autoadd_offer(Offer raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_offer(); + cst_api_fill_to_wire_offer(raw, ptr.ref); + return ptr; + } + + @protected + ffi.Pointer cst_encode_box_autoadd_offer_id(OfferId raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_offer_id(); + cst_api_fill_to_wire_offer_id(raw, ptr.ref); + return ptr; + } + + @protected + ffi.Pointer cst_encode_box_autoadd_out_point( + OutPoint raw) { + // Codec=Cst (C-struct based), see doc to use other codecs final ptr = wire.cst_new_box_autoadd_out_point(); cst_api_fill_to_wire_out_point(raw, ptr.ref); return ptr; @@ -685,6 +1453,14 @@ 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) { @@ -694,6 +1470,15 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ptr; } + @protected + ffi.Pointer cst_encode_box_autoadd_payment_id( + PaymentId raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_payment_id(); + cst_api_fill_to_wire_payment_id(raw, ptr.ref); + return ptr; + } + @protected ffi.Pointer cst_encode_box_autoadd_payment_preimage(PaymentPreimage raw) { @@ -721,6 +1506,14 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ptr; } + @protected + ffi.Pointer cst_encode_box_autoadd_refund(Refund raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_refund(); + cst_api_fill_to_wire_refund(raw, ptr.ref); + return ptr; + } + @protected ffi.Pointer cst_encode_box_autoadd_socket_address( SocketAddress raw) { @@ -730,6 +1523,20 @@ 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 @@ -737,7 +1544,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { } @protected - ffi.Pointer cst_encode_box_autoadd_u_64(int raw) { + ffi.Pointer cst_encode_box_autoadd_u_64(BigInt raw) { // Codec=Cst (C-struct based), see doc to use other codecs return wire.cst_new_box_autoadd_u_64(cst_encode_u_64(raw)); } @@ -762,6 +1569,27 @@ 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_node_id(List raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ans = wire.cst_new_list_node_id(raw.length); + for (var i = 0; i < raw.length; ++i) { + cst_api_fill_to_wire_node_id(raw[i], ans.ref.ptr[i]); + } + return ans; + } + @protected ffi.Pointer cst_encode_list_payment_details( List raw) { @@ -784,6 +1612,26 @@ 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_64_strict( + Uint64List raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ans = wire.cst_new_list_prim_u_64_strict(raw.length); + ans.ref.ptr.asTypedList(raw.length).setAll(0, raw.inner); + return ans; + } + @protected ffi.Pointer cst_encode_list_prim_u_8_loose( List raw) { @@ -831,6 +1679,16 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return raw == null ? ffi.nullptr : cst_encode_String(raw); } + @protected + ffi.Pointer + cst_encode_opt_box_autoadd_anchor_channels_config( + AnchorChannelsConfig? raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw == null + ? ffi.nullptr + : cst_encode_box_autoadd_anchor_channels_config(raw); + } + @protected ffi.Pointer cst_encode_opt_box_autoadd_chain_data_source_config( @@ -850,6 +1708,38 @@ 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_channel_info( + ChannelInfo? raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw == null ? ffi.nullptr : cst_encode_box_autoadd_channel_info(raw); + } + + @protected + ffi.Pointer + cst_encode_opt_box_autoadd_channel_update_info(ChannelUpdateInfo? raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw == null + ? ffi.nullptr + : cst_encode_box_autoadd_channel_update_info(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( @@ -875,6 +1765,50 @@ 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_node_announcement_info( + NodeAnnouncementInfo? raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw == null + ? ffi.nullptr + : cst_encode_box_autoadd_node_announcement_info(raw); + } + + @protected + ffi.Pointer cst_encode_opt_box_autoadd_node_info( + NodeInfo? raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw == null ? ffi.nullptr : cst_encode_box_autoadd_node_info(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) { @@ -884,6 +1818,29 @@ 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_hash( + PaymentHash? raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw == null ? ffi.nullptr : cst_encode_box_autoadd_payment_hash(raw); + } + + @protected + ffi.Pointer cst_encode_opt_box_autoadd_payment_id( + PaymentId? raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw == null ? ffi.nullptr : cst_encode_box_autoadd_payment_id(raw); + } + @protected ffi.Pointer cst_encode_opt_box_autoadd_payment_preimage(PaymentPreimage? raw) { @@ -909,6 +1866,12 @@ 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 @@ -916,7 +1879,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { } @protected - ffi.Pointer cst_encode_opt_box_autoadd_u_64(int? raw) { + ffi.Pointer cst_encode_opt_box_autoadd_u_64(BigInt? raw) { // Codec=Cst (C-struct based), see doc to use other codecs return raw == null ? ffi.nullptr : cst_encode_box_autoadd_u_64(raw); } @@ -929,9 +1892,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { } @protected - int cst_encode_u_64(int raw) { + int cst_encode_u_64(BigInt raw) { // Codec=Cst (C-struct based), see doc to use other codecs - return raw.toInt(); + return raw.toSigned(64).toInt(); } @protected @@ -979,29 +1942,124 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ans; } + @protected + int cst_encode_usize(BigInt raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw.toSigned(64).toInt(); + } + @protected void cst_api_fill_to_wire_address(Address apiObj, wire_cst_address wireObj) { wireObj.s = cst_encode_String(apiObj.s); } + @protected + void cst_api_fill_to_wire_anchor_channels_config( + AnchorChannelsConfig apiObj, wire_cst_anchor_channels_config wireObj) { + wireObj.trusted_peers_no_reserve = + cst_encode_list_public_key(apiObj.trustedPeersNoReserve); + wireObj.per_channel_reserve_sats = + cst_encode_u_64(apiObj.perChannelReserveSats); + } + + @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) { wireObj.signed_raw_invoice = cst_encode_String(apiObj.signedRawInvoice); } + @protected + void cst_api_fill_to_wire_bolt_12_invoice( + Bolt12Invoice apiObj, wire_cst_bolt_12_invoice wireObj) { + wireObj.data = cst_encode_list_prim_u_8_strict(apiObj.data); + } + + @protected + void cst_api_fill_to_wire_bolt_12_parse_error( + Bolt12ParseError apiObj, wire_cst_bolt_12_parse_error wireObj) { + if (apiObj is Bolt12ParseError_InvalidContinuation) { + wireObj.tag = 0; + return; + } + if (apiObj is Bolt12ParseError_InvalidBech32Hrp) { + wireObj.tag = 1; + return; + } + if (apiObj is Bolt12ParseError_Bech32) { + var pre_field0 = cst_encode_String(apiObj.field0); + wireObj.tag = 2; + wireObj.kind.Bech32.field0 = pre_field0; + return; + } + if (apiObj is Bolt12ParseError_Decode) { + var pre_field0 = cst_encode_box_autoadd_decode_error(apiObj.field0); + wireObj.tag = 3; + wireObj.kind.Decode.field0 = pre_field0; + return; + } + if (apiObj is Bolt12ParseError_InvalidSemantics) { + var pre_field0 = cst_encode_String(apiObj.field0); + wireObj.tag = 4; + wireObj.kind.InvalidSemantics.field0 = pre_field0; + return; + } + if (apiObj is Bolt12ParseError_InvalidSignature) { + var pre_field0 = cst_encode_String(apiObj.field0); + wireObj.tag = 5; + wireObj.kind.InvalidSignature.field0 = pre_field0; + return; + } + } + @protected void cst_api_fill_to_wire_box_autoadd_address( Address apiObj, ffi.Pointer wireObj) { cst_api_fill_to_wire_address(apiObj, wireObj.ref); } + @protected + void cst_api_fill_to_wire_box_autoadd_anchor_channels_config( + AnchorChannelsConfig apiObj, + ffi.Pointer wireObj) { + cst_api_fill_to_wire_anchor_channels_config(apiObj, wireObj.ref); + } + @protected void cst_api_fill_to_wire_box_autoadd_bolt_11_invoice( Bolt11Invoice apiObj, ffi.Pointer wireObj) { cst_api_fill_to_wire_bolt_11_invoice(apiObj, wireObj.ref); } + @protected + void cst_api_fill_to_wire_box_autoadd_bolt_12_parse_error( + Bolt12ParseError apiObj, + ffi.Pointer wireObj) { + cst_api_fill_to_wire_bolt_12_parse_error(apiObj, wireObj.ref); + } + @protected void cst_api_fill_to_wire_box_autoadd_chain_data_source_config( ChainDataSourceConfig apiObj, @@ -1021,12 +2079,37 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { cst_api_fill_to_wire_channel_id(apiObj, wireObj.ref); } + @protected + void cst_api_fill_to_wire_box_autoadd_channel_info( + ChannelInfo apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_channel_info(apiObj, wireObj.ref); + } + + @protected + void cst_api_fill_to_wire_box_autoadd_channel_update_info( + ChannelUpdateInfo apiObj, + ffi.Pointer wireObj) { + cst_api_fill_to_wire_channel_update_info(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) { cst_api_fill_to_wire_config(apiObj, wireObj.ref); } + @protected + void cst_api_fill_to_wire_box_autoadd_decode_error( + DecodeError apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_decode_error(apiObj, wireObj.ref); + } + @protected void cst_api_fill_to_wire_box_autoadd_entropy_source_config( EntropySourceConfig apiObj, @@ -1048,17 +2131,102 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { } @protected - 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); + void cst_api_fill_to_wire_box_autoadd_ldk_bolt_11_payment( + LdkBolt11Payment apiObj, + ffi.Pointer wireObj) { + cst_api_fill_to_wire_ldk_bolt_11_payment(apiObj, wireObj.ref); } @protected - void cst_api_fill_to_wire_box_autoadd_ldk_node( + void cst_api_fill_to_wire_box_autoadd_ldk_bolt_12_payment( + LdkBolt12Payment apiObj, + ffi.Pointer wireObj) { + cst_api_fill_to_wire_ldk_bolt_12_payment(apiObj, wireObj.ref); + } + + @protected + 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_ldk_network_graph( + LdkNetworkGraph apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_ldk_network_graph(apiObj, wireObj.ref); + } + + @protected + 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 + void cst_api_fill_to_wire_box_autoadd_ldk_on_chain_payment( + LdkOnChainPayment apiObj, + ffi.Pointer wireObj) { + cst_api_fill_to_wire_ldk_on_chain_payment(apiObj, wireObj.ref); + } + + @protected + void cst_api_fill_to_wire_box_autoadd_ldk_spontaneous_payment( + LdkSpontaneousPayment apiObj, + ffi.Pointer wireObj) { + cst_api_fill_to_wire_ldk_spontaneous_payment(apiObj, wireObj.ref); + } + + @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_lsp_fee_limits( + LSPFeeLimits apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_lsp_fee_limits(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_node_announcement_info( + NodeAnnouncementInfo apiObj, + ffi.Pointer wireObj) { + cst_api_fill_to_wire_node_announcement_info(apiObj, wireObj.ref); + } + + @protected + void cst_api_fill_to_wire_box_autoadd_node_id( + NodeId apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_node_id(apiObj, wireObj.ref); + } + + @protected + void cst_api_fill_to_wire_box_autoadd_node_info( + NodeInfo apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_node_info(apiObj, wireObj.ref); + } + + @protected + void cst_api_fill_to_wire_box_autoadd_offer( + Offer apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_offer(apiObj, wireObj.ref); + } + + @protected + void cst_api_fill_to_wire_box_autoadd_offer_id( + OfferId apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_offer_id(apiObj, wireObj.ref); + } + @protected void cst_api_fill_to_wire_box_autoadd_out_point( OutPoint apiObj, ffi.Pointer wireObj) { @@ -1077,6 +2245,12 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { cst_api_fill_to_wire_payment_hash(apiObj, wireObj.ref); } + @protected + void cst_api_fill_to_wire_box_autoadd_payment_id( + PaymentId apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_payment_id(apiObj, wireObj.ref); + } + @protected void cst_api_fill_to_wire_box_autoadd_payment_preimage( PaymentPreimage apiObj, ffi.Pointer wireObj) { @@ -1095,12 +2269,24 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { cst_api_fill_to_wire_public_key(apiObj, wireObj.ref); } + @protected + void cst_api_fill_to_wire_box_autoadd_refund( + Refund apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_refund(apiObj, wireObj.ref); + } + @protected void cst_api_fill_to_wire_box_autoadd_socket_address( SocketAddress apiObj, ffi.Pointer wireObj) { 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) { @@ -1126,8 +2312,9 @@ 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); - cst_api_fill_to_wire_max_dust_htlc_exposure( - apiObj.maxDustHtlcExposure, wireObj.max_dust_htlc_exposure); + wireObj.max_dust_htlc_exposure = + cst_encode_opt_box_autoadd_max_dust_htlc_exposure( + apiObj.maxDustHtlcExposure); wireObj.force_close_avoidance_max_fee_satoshis = cst_encode_u_64(apiObj.forceCloseAvoidanceMaxFeeSatoshis); wireObj.accept_underpaying_htlcs = @@ -1140,7 +2327,8 @@ 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_String(apiObj.fundingTxo); + wireObj.funding_txo = + cst_encode_opt_box_autoadd_out_point(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); @@ -1148,7 +2336,6 @@ 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); @@ -1160,6 +2347,36 @@ 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 @@ -1168,6 +2385,91 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { wireObj.data = cst_encode_u_8_array_32(apiObj.data); } + @protected + void cst_api_fill_to_wire_channel_info( + ChannelInfo apiObj, wire_cst_channel_info wireObj) { + cst_api_fill_to_wire_node_id(apiObj.nodeOne, wireObj.node_one); + wireObj.one_to_two = + cst_encode_opt_box_autoadd_channel_update_info(apiObj.oneToTwo); + cst_api_fill_to_wire_node_id(apiObj.nodeTwo, wireObj.node_two); + wireObj.two_to_one = + cst_encode_opt_box_autoadd_channel_update_info(apiObj.twoToOne); + wireObj.capacity_sats = + cst_encode_opt_box_autoadd_u_64(apiObj.capacitySats); + } + + @protected + void cst_api_fill_to_wire_channel_update_info( + ChannelUpdateInfo apiObj, wire_cst_channel_update_info wireObj) { + wireObj.last_update = cst_encode_u_32(apiObj.lastUpdate); + wireObj.enabled = cst_encode_bool(apiObj.enabled); + wireObj.cltv_expiry_delta = cst_encode_u_16(apiObj.cltvExpiryDelta); + wireObj.htlc_minimum_msat = cst_encode_u_64(apiObj.htlcMinimumMsat); + wireObj.htlc_maximum_msat = cst_encode_u_64(apiObj.htlcMaximumMsat); + cst_api_fill_to_wire_routing_fees(apiObj.fees, wireObj.fees); + } + + @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_LegacyCooperativeClosure) { + wireObj.tag = 2; + return; + } + if (apiObj is ClosureReason_CounterpartyInitiatedCooperativeClosure) { + wireObj.tag = 3; + return; + } + if (apiObj is ClosureReason_LocallyInitiatedCooperativeClosure) { + wireObj.tag = 4; + return; + } + if (apiObj is ClosureReason_CommitmentTxConfirmed) { + wireObj.tag = 5; + return; + } + if (apiObj is ClosureReason_FundingTimedOut) { + wireObj.tag = 6; + return; + } + if (apiObj is ClosureReason_ProcessingError) { + var pre_err = cst_encode_String(apiObj.err); + wireObj.tag = 7; + wireObj.kind.ProcessingError.err = pre_err; + return; + } + if (apiObj is ClosureReason_DisconnectedPeer) { + wireObj.tag = 8; + return; + } + if (apiObj is ClosureReason_OutdatedChannelManager) { + wireObj.tag = 9; + return; + } + if (apiObj is ClosureReason_CounterpartyCoopClosedUnfundedChannel) { + wireObj.tag = 10; + return; + } + if (apiObj is ClosureReason_FundingBatchClosure) { + wireObj.tag = 11; + return; + } + if (apiObj is ClosureReason_HTLCsTimedOut) { + wireObj.tag = 12; + return; + } + } + @protected void cst_api_fill_to_wire_config(Config apiObj, wire_cst_config wireObj) { wireObj.storage_dir_path = cst_encode_String(apiObj.storageDirPath); @@ -1188,6 +2490,48 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { wireObj.probing_liquidity_limit_multiplier = cst_encode_u_64(apiObj.probingLiquidityLimitMultiplier); wireObj.log_level = cst_encode_log_level(apiObj.logLevel); + wireObj.anchor_channels_config = + cst_encode_opt_box_autoadd_anchor_channels_config( + apiObj.anchorChannelsConfig); + } + + @protected + void cst_api_fill_to_wire_decode_error( + DecodeError apiObj, wire_cst_decode_error wireObj) { + if (apiObj is DecodeError_UnknownVersion) { + wireObj.tag = 0; + return; + } + if (apiObj is DecodeError_UnknownRequiredFeature) { + wireObj.tag = 1; + return; + } + if (apiObj is DecodeError_InvalidValue) { + wireObj.tag = 2; + return; + } + if (apiObj is DecodeError_ShortRead) { + wireObj.tag = 3; + return; + } + if (apiObj is DecodeError_BadLengthDescriptor) { + wireObj.tag = 4; + return; + } + if (apiObj is DecodeError_Io) { + var pre_field0 = cst_encode_String(apiObj.field0); + wireObj.tag = 5; + wireObj.kind.Io.field0 = pre_field0; + return; + } + if (apiObj is DecodeError_UnsupportedCompression) { + wireObj.tag = 6; + return; + } + if (apiObj is DecodeError_DangerousValue) { + wireObj.tag = 7; + return; + } } @protected @@ -1217,36 +2561,86 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected void cst_api_fill_to_wire_event(Event apiObj, wire_cst_event wireObj) { - if (apiObj is Event_PaymentSuccessful) { + if (apiObj is Event_PaymentClaimable) { + var pre_payment_id = cst_encode_box_autoadd_payment_id(apiObj.paymentId); var pre_payment_hash = cst_encode_box_autoadd_payment_hash(apiObj.paymentHash); + var pre_claimable_amount_msat = + cst_encode_u_64(apiObj.claimableAmountMsat); + var pre_claim_deadline = + cst_encode_opt_box_autoadd_u_32(apiObj.claimDeadline); wireObj.tag = 0; + wireObj.kind.PaymentClaimable.payment_id = pre_payment_id; + wireObj.kind.PaymentClaimable.payment_hash = pre_payment_hash; + wireObj.kind.PaymentClaimable.claimable_amount_msat = + pre_claimable_amount_msat; + wireObj.kind.PaymentClaimable.claim_deadline = pre_claim_deadline; + return; + } + if (apiObj is Event_PaymentSuccessful) { + var pre_payment_id = + cst_encode_opt_box_autoadd_payment_id(apiObj.paymentId); + 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 = 1; + wireObj.kind.PaymentSuccessful.payment_id = pre_payment_id; 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_id = + cst_encode_opt_box_autoadd_payment_id(apiObj.paymentId); var pre_payment_hash = cst_encode_box_autoadd_payment_hash(apiObj.paymentHash); - wireObj.tag = 1; + var pre_reason = + cst_encode_opt_box_autoadd_payment_failure_reason(apiObj.reason); + wireObj.tag = 2; + wireObj.kind.PaymentFailed.payment_id = pre_payment_id; wireObj.kind.PaymentFailed.payment_hash = pre_payment_hash; + wireObj.kind.PaymentFailed.reason = pre_reason; return; } if (apiObj is Event_PaymentReceived) { + var pre_payment_id = + cst_encode_opt_box_autoadd_payment_id(apiObj.paymentId); var pre_payment_hash = cst_encode_box_autoadd_payment_hash(apiObj.paymentHash); var pre_amount_msat = cst_encode_u_64(apiObj.amountMsat); - wireObj.tag = 2; + wireObj.tag = 3; + wireObj.kind.PaymentReceived.payment_id = pre_payment_id; wireObj.kind.PaymentReceived.payment_hash = pre_payment_hash; wireObj.kind.PaymentReceived.amount_msat = pre_amount_msat; return; } + 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_box_autoadd_public_key(apiObj.counterpartyNodeId); + var pre_funding_txo = cst_encode_box_autoadd_out_point(apiObj.fundingTxo); + wireObj.tag = 4; + 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; + return; + } 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_counterparty_node_id = cst_encode_opt_box_autoadd_public_key(apiObj.counterpartyNodeId); - wireObj.tag = 3; + wireObj.tag = 5; 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; @@ -1258,30 +2652,13 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { 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; + var pre_reason = cst_encode_opt_box_autoadd_closure_reason(apiObj.reason); + wireObj.tag = 6; 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_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_box_autoadd_public_key(apiObj.counterpartyNodeId); - var pre_funding_txo = cst_encode_box_autoadd_out_point(apiObj.fundingTxo); - wireObj.tag = 5; - 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.ChannelClosed.reason = pre_reason; return; } } @@ -1302,1318 +2679,2829 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { } @protected - 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_ldk_node( - LdkNode apiObj, wire_cst_ldk_node wireObj) { - wireObj.ptr = cst_encode_RustOpaque_NodeSqliteStore(apiObj.ptr); - } - - @protected - void cst_api_fill_to_wire_max_dust_htlc_exposure( - MaxDustHTLCExposure apiObj, wire_cst_max_dust_htlc_exposure wireObj) { - if (apiObj is MaxDustHTLCExposure_FixedLimitMsat) { - var pre_field0 = cst_encode_u_64(apiObj.field0); - wireObj.tag = 0; - wireObj.kind.FixedLimitMsat.field0 = pre_field0; - return; - } - if (apiObj is MaxDustHTLCExposure_FeeRateMultiplier) { - var pre_field0 = cst_encode_u_64(apiObj.field0); - wireObj.tag = 1; - wireObj.kind.FeeRateMultiplier.field0 = pre_field0; - return; - } - } - - @protected - void cst_api_fill_to_wire_out_point( - OutPoint apiObj, wire_cst_out_point wireObj) { - cst_api_fill_to_wire_txid(apiObj.txid, wireObj.txid); - wireObj.vout = cst_encode_u_32(apiObj.vout); - } - - @protected - void cst_api_fill_to_wire_payment_details( - PaymentDetails apiObj, wire_cst_payment_details wireObj) { - cst_api_fill_to_wire_payment_hash(apiObj.hash, wireObj.hash); - wireObj.preimage = - cst_encode_opt_box_autoadd_payment_preimage(apiObj.preimage); - wireObj.secret = cst_encode_opt_box_autoadd_payment_secret(apiObj.secret); - wireObj.amount_msat = cst_encode_opt_box_autoadd_u_64(apiObj.amountMsat); - wireObj.direction = cst_encode_payment_direction(apiObj.direction); - wireObj.status = cst_encode_payment_status(apiObj.status); - } - - @protected - void cst_api_fill_to_wire_payment_hash( - PaymentHash apiObj, wire_cst_payment_hash wireObj) { - wireObj.data = cst_encode_u_8_array_32(apiObj.data); + void cst_api_fill_to_wire_ldk_bolt_11_payment( + LdkBolt11Payment apiObj, wire_cst_ldk_bolt_11_payment wireObj) { + wireObj.ptr = + cst_encode_RustOpaque_ldk_nodepaymentBolt11Payment(apiObj.ptr); } @protected - void cst_api_fill_to_wire_payment_preimage( - PaymentPreimage apiObj, wire_cst_payment_preimage wireObj) { - wireObj.data = cst_encode_u_8_array_32(apiObj.data); + void cst_api_fill_to_wire_ldk_bolt_12_payment( + LdkBolt12Payment apiObj, wire_cst_ldk_bolt_12_payment wireObj) { + wireObj.ptr = + cst_encode_RustOpaque_Arcldk_nodepaymentBolt12Payment(apiObj.ptr); } @protected - void cst_api_fill_to_wire_payment_secret( - PaymentSecret apiObj, wire_cst_payment_secret wireObj) { - wireObj.data = cst_encode_u_8_array_32(apiObj.data); + 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_peer_details( - PeerDetails apiObj, wire_cst_peer_details wireObj) { - cst_api_fill_to_wire_public_key(apiObj.nodeId, wireObj.node_id); - cst_api_fill_to_wire_socket_address(apiObj.address, wireObj.address); - wireObj.is_connected = cst_encode_bool(apiObj.isConnected); + void cst_api_fill_to_wire_ldk_network_graph( + LdkNetworkGraph apiObj, wire_cst_ldk_network_graph wireObj) { + wireObj.ptr = cst_encode_RustOpaque_ldk_nodegraphNetworkGraph(apiObj.ptr); } @protected - void cst_api_fill_to_wire_public_key( - PublicKey apiObj, wire_cst_public_key wireObj) { - wireObj.hex = cst_encode_String(apiObj.hex); + void cst_api_fill_to_wire_ldk_node( + LdkNode apiObj, wire_cst_ldk_node wireObj) { + wireObj.ptr = cst_encode_RustOpaque_Node(apiObj.ptr); } @protected - void cst_api_fill_to_wire_socket_address( - SocketAddress apiObj, wire_cst_socket_address wireObj) { - if (apiObj is SocketAddress_TcpIpV4) { - var pre_addr = cst_encode_u_8_array_4(apiObj.addr); - var pre_port = cst_encode_u_16(apiObj.port); + void cst_api_fill_to_wire_ldk_node_error( + LdkNodeError apiObj, wire_cst_ldk_node_error wireObj) { + if (apiObj is LdkNodeError_InvalidTxid) { wireObj.tag = 0; - wireObj.kind.TcpIpV4.addr = pre_addr; - wireObj.kind.TcpIpV4.port = pre_port; return; } - if (apiObj is SocketAddress_TcpIpV6) { - var pre_addr = cst_encode_u_8_array_16(apiObj.addr); - var pre_port = cst_encode_u_16(apiObj.port); + if (apiObj is LdkNodeError_AlreadyRunning) { wireObj.tag = 1; - wireObj.kind.TcpIpV6.addr = pre_addr; - wireObj.kind.TcpIpV6.port = pre_port; return; } - if (apiObj is SocketAddress_OnionV2) { - var pre_field0 = cst_encode_u_8_array_12(apiObj.field0); + if (apiObj is LdkNodeError_NotRunning) { wireObj.tag = 2; - wireObj.kind.OnionV2.field0 = pre_field0; return; } - if (apiObj is SocketAddress_OnionV3) { - var pre_ed25519_pubkey = cst_encode_u_8_array_32(apiObj.ed25519Pubkey); - var pre_checksum = cst_encode_u_16(apiObj.checksum); - var pre_version = cst_encode_u_8(apiObj.version); - var pre_port = cst_encode_u_16(apiObj.port); + if (apiObj is LdkNodeError_OnchainTxCreationFailed) { wireObj.tag = 3; - wireObj.kind.OnionV3.ed25519_pubkey = pre_ed25519_pubkey; - wireObj.kind.OnionV3.checksum = pre_checksum; - wireObj.kind.OnionV3.version = pre_version; - wireObj.kind.OnionV3.port = pre_port; return; } - if (apiObj is SocketAddress_Hostname) { - var pre_addr = cst_encode_String(apiObj.addr); - var pre_port = cst_encode_u_16(apiObj.port); + if (apiObj is LdkNodeError_ConnectionFailed) { wireObj.tag = 4; - wireObj.kind.Hostname.addr = pre_addr; - wireObj.kind.Hostname.port = pre_port; + return; + } + if (apiObj is LdkNodeError_InvoiceCreationFailed) { + wireObj.tag = 5; + return; + } + if (apiObj is LdkNodeError_PaymentSendingFailed) { + wireObj.tag = 6; + return; + } + if (apiObj is LdkNodeError_ProbeSendingFailed) { + wireObj.tag = 7; + return; + } + if (apiObj is LdkNodeError_ChannelCreationFailed) { + wireObj.tag = 8; + return; + } + if (apiObj is LdkNodeError_ChannelClosingFailed) { + wireObj.tag = 9; + return; + } + if (apiObj is LdkNodeError_ChannelConfigUpdateFailed) { + wireObj.tag = 10; + return; + } + if (apiObj is LdkNodeError_PersistenceFailed) { + wireObj.tag = 11; + return; + } + if (apiObj is LdkNodeError_WalletOperationFailed) { + wireObj.tag = 12; + return; + } + if (apiObj is LdkNodeError_OnchainTxSigningFailed) { + wireObj.tag = 13; + return; + } + if (apiObj is LdkNodeError_MessageSigningFailed) { + wireObj.tag = 14; + return; + } + if (apiObj is LdkNodeError_TxSyncFailed) { + wireObj.tag = 15; + return; + } + if (apiObj is LdkNodeError_GossipUpdateFailed) { + wireObj.tag = 16; + return; + } + if (apiObj is LdkNodeError_InvalidAddress) { + wireObj.tag = 17; + return; + } + if (apiObj is LdkNodeError_InvalidSocketAddress) { + wireObj.tag = 18; + return; + } + if (apiObj is LdkNodeError_InvalidPublicKey) { + wireObj.tag = 19; + return; + } + if (apiObj is LdkNodeError_InvalidSecretKey) { + wireObj.tag = 20; + return; + } + if (apiObj is LdkNodeError_InvalidPaymentHash) { + wireObj.tag = 21; + return; + } + if (apiObj is LdkNodeError_InvalidPaymentPreimage) { + wireObj.tag = 22; + return; + } + if (apiObj is LdkNodeError_InvalidPaymentSecret) { + wireObj.tag = 23; + return; + } + if (apiObj is LdkNodeError_InvalidAmount) { + wireObj.tag = 24; + return; + } + if (apiObj is LdkNodeError_InvalidInvoice) { + wireObj.tag = 25; + return; + } + if (apiObj is LdkNodeError_InvalidChannelId) { + wireObj.tag = 26; + return; + } + if (apiObj is LdkNodeError_InvalidNetwork) { + wireObj.tag = 27; + return; + } + if (apiObj is LdkNodeError_DuplicatePayment) { + wireObj.tag = 28; + return; + } + if (apiObj is LdkNodeError_InsufficientFunds) { + wireObj.tag = 29; + return; + } + if (apiObj is LdkNodeError_FeerateEstimationUpdateFailed) { + wireObj.tag = 30; + return; + } + if (apiObj is LdkNodeError_LiquidityRequestFailed) { + wireObj.tag = 31; + return; + } + if (apiObj is LdkNodeError_LiquiditySourceUnavailable) { + wireObj.tag = 32; + return; + } + if (apiObj is LdkNodeError_LiquidityFeeTooHigh) { + wireObj.tag = 33; + return; + } + if (apiObj is LdkNodeError_InvalidPaymentId) { + wireObj.tag = 34; + return; + } + if (apiObj is LdkNodeError_Decode) { + var pre_field0 = cst_encode_box_autoadd_decode_error(apiObj.field0); + wireObj.tag = 35; + wireObj.kind.Decode.field0 = pre_field0; + return; + } + if (apiObj is LdkNodeError_Bolt12Parse) { + var pre_field0 = + cst_encode_box_autoadd_bolt_12_parse_error(apiObj.field0); + wireObj.tag = 36; + wireObj.kind.Bolt12Parse.field0 = pre_field0; + return; + } + if (apiObj is LdkNodeError_InvoiceRequestCreationFailed) { + wireObj.tag = 37; + return; + } + if (apiObj is LdkNodeError_OfferCreationFailed) { + wireObj.tag = 38; + return; + } + if (apiObj is LdkNodeError_RefundCreationFailed) { + wireObj.tag = 39; + return; + } + if (apiObj is LdkNodeError_FeerateEstimationUpdateTimeout) { + wireObj.tag = 40; + return; + } + if (apiObj is LdkNodeError_WalletOperationTimeout) { + wireObj.tag = 41; + return; + } + if (apiObj is LdkNodeError_TxSyncTimeout) { + wireObj.tag = 42; + return; + } + if (apiObj is LdkNodeError_GossipUpdateTimeout) { + wireObj.tag = 43; + return; + } + if (apiObj is LdkNodeError_InvalidOfferId) { + wireObj.tag = 44; + return; + } + if (apiObj is LdkNodeError_InvalidNodeId) { + wireObj.tag = 45; + return; + } + if (apiObj is LdkNodeError_InvalidOffer) { + wireObj.tag = 46; + return; + } + if (apiObj is LdkNodeError_InvalidRefund) { + wireObj.tag = 47; + return; + } + if (apiObj is LdkNodeError_UnsupportedCurrency) { + wireObj.tag = 48; return; } } @protected - void cst_api_fill_to_wire_txid(Txid apiObj, wire_cst_txid wireObj) { - wireObj.hash = cst_encode_String(apiObj.hash); + void cst_api_fill_to_wire_ldk_on_chain_payment( + LdkOnChainPayment apiObj, wire_cst_ldk_on_chain_payment wireObj) { + wireObj.ptr = + cst_encode_RustOpaque_ldk_nodepaymentOnchainPayment(apiObj.ptr); } @protected - void cst_api_fill_to_wire_user_channel_id( - UserChannelId apiObj, wire_cst_user_channel_id wireObj) { - wireObj.data = cst_encode_u_64(apiObj.data); + void cst_api_fill_to_wire_ldk_spontaneous_payment( + LdkSpontaneousPayment apiObj, wire_cst_ldk_spontaneous_payment wireObj) { + wireObj.ptr = + cst_encode_RustOpaque_ldk_nodepaymentSpontaneousPayment(apiObj.ptr); } @protected - int cst_encode_RustOpaque_NodeSqliteStore(NodeSqliteStore raw); + 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; + } + } @protected - bool cst_encode_bool(bool raw); + 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); + } @protected - int cst_encode_builder_exception(BuilderException raw); + void cst_api_fill_to_wire_lsp_fee_limits( + LSPFeeLimits apiObj, wire_cst_lsp_fee_limits wireObj) { + wireObj.max_total_opening_fee_msat = + cst_encode_opt_box_autoadd_u_64(apiObj.maxTotalOpeningFeeMsat); + wireObj.max_proportional_opening_fee_ppm_msat = + cst_encode_opt_box_autoadd_u_64( + apiObj.maxProportionalOpeningFeePpmMsat); + } @protected - int cst_encode_i_32(int raw); + void cst_api_fill_to_wire_max_dust_htlc_exposure( + MaxDustHTLCExposure apiObj, wire_cst_max_dust_htlc_exposure wireObj) { + if (apiObj is MaxDustHTLCExposure_FixedLimitMsat) { + var pre_field0 = cst_encode_u_64(apiObj.field0); + wireObj.tag = 0; + wireObj.kind.FixedLimitMsat.field0 = pre_field0; + return; + } + if (apiObj is MaxDustHTLCExposure_FeeRateMultiplier) { + var pre_field0 = cst_encode_u_64(apiObj.field0); + wireObj.tag = 1; + wireObj.kind.FeeRateMultiplier.field0 = pre_field0; + return; + } + } @protected - int cst_encode_log_level(LogLevel raw); + void cst_api_fill_to_wire_node_announcement_info( + NodeAnnouncementInfo apiObj, wire_cst_node_announcement_info wireObj) { + wireObj.last_update = cst_encode_u_32(apiObj.lastUpdate); + wireObj.alias = cst_encode_String(apiObj.alias); + wireObj.addresses = cst_encode_list_socket_address(apiObj.addresses); + } @protected - int cst_encode_network(Network raw); + void cst_api_fill_to_wire_node_id(NodeId apiObj, wire_cst_node_id wireObj) { + wireObj.compressed = cst_encode_list_prim_u_8_strict(apiObj.compressed); + } @protected - int cst_encode_node_exception(NodeException raw); + void cst_api_fill_to_wire_node_info( + NodeInfo apiObj, wire_cst_node_info wireObj) { + wireObj.channels = cst_encode_list_prim_u_64_strict(apiObj.channels); + wireObj.announcement_info = + cst_encode_opt_box_autoadd_node_announcement_info( + apiObj.announcementInfo); + } @protected - int cst_encode_payment_direction(PaymentDirection raw); + 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 - int cst_encode_payment_status(PaymentStatus raw); + void cst_api_fill_to_wire_offer(Offer apiObj, wire_cst_offer wireObj) { + wireObj.s = cst_encode_String(apiObj.s); + } @protected - int cst_encode_u_16(int raw); + void cst_api_fill_to_wire_offer_id( + OfferId apiObj, wire_cst_offer_id wireObj) { + wireObj.field0 = cst_encode_u_8_array_32(apiObj.field0); + } @protected - int cst_encode_u_32(int raw); + void cst_api_fill_to_wire_out_point( + OutPoint apiObj, wire_cst_out_point wireObj) { + cst_api_fill_to_wire_txid(apiObj.txid, wireObj.txid); + wireObj.vout = cst_encode_u_32(apiObj.vout); + } @protected - int cst_encode_u_8(int raw); + void cst_api_fill_to_wire_payment_details( + PaymentDetails apiObj, wire_cst_payment_details wireObj) { + cst_api_fill_to_wire_payment_id(apiObj.id, wireObj.id); + cst_api_fill_to_wire_payment_kind(apiObj.kind, wireObj.kind); + wireObj.amount_msat = cst_encode_opt_box_autoadd_u_64(apiObj.amountMsat); + wireObj.direction = cst_encode_payment_direction(apiObj.direction); + wireObj.status = cst_encode_payment_status(apiObj.status); + } @protected - void cst_encode_unit(void raw); + void cst_api_fill_to_wire_payment_hash( + PaymentHash apiObj, wire_cst_payment_hash wireObj) { + wireObj.data = cst_encode_u_8_array_32(apiObj.data); + } @protected - int cst_encode_usize(int raw); + void cst_api_fill_to_wire_payment_id( + PaymentId apiObj, wire_cst_payment_id wireObj) { + wireObj.field0 = cst_encode_u_8_array_32(apiObj.field0); + } @protected - void sse_encode_RustOpaque_NodeSqliteStore( - NodeSqliteStore self, SseSerializer serializer); + void cst_api_fill_to_wire_payment_kind( + PaymentKind apiObj, wire_cst_payment_kind wireObj) { + if (apiObj is PaymentKind_Onchain) { + wireObj.tag = 0; + return; + } + if (apiObj is PaymentKind_Bolt11) { + var pre_hash = cst_encode_box_autoadd_payment_hash(apiObj.hash); + var pre_preimage = + cst_encode_opt_box_autoadd_payment_preimage(apiObj.preimage); + var pre_secret = cst_encode_opt_box_autoadd_payment_secret(apiObj.secret); + wireObj.tag = 1; + wireObj.kind.Bolt11.hash = pre_hash; + wireObj.kind.Bolt11.preimage = pre_preimage; + wireObj.kind.Bolt11.secret = pre_secret; + return; + } + if (apiObj is PaymentKind_Bolt11Jit) { + var pre_hash = cst_encode_box_autoadd_payment_hash(apiObj.hash); + var pre_preimage = + cst_encode_opt_box_autoadd_payment_preimage(apiObj.preimage); + var pre_secret = cst_encode_opt_box_autoadd_payment_secret(apiObj.secret); + var pre_lsp_fee_limits = + cst_encode_box_autoadd_lsp_fee_limits(apiObj.lspFeeLimits); + wireObj.tag = 2; + wireObj.kind.Bolt11Jit.hash = pre_hash; + wireObj.kind.Bolt11Jit.preimage = pre_preimage; + wireObj.kind.Bolt11Jit.secret = pre_secret; + wireObj.kind.Bolt11Jit.lsp_fee_limits = pre_lsp_fee_limits; + return; + } + if (apiObj is PaymentKind_Spontaneous) { + var pre_hash = cst_encode_box_autoadd_payment_hash(apiObj.hash); + var pre_preimage = + cst_encode_opt_box_autoadd_payment_preimage(apiObj.preimage); + wireObj.tag = 3; + wireObj.kind.Spontaneous.hash = pre_hash; + wireObj.kind.Spontaneous.preimage = pre_preimage; + return; + } + if (apiObj is PaymentKind_Bolt12Offer) { + var pre_hash = cst_encode_opt_box_autoadd_payment_hash(apiObj.hash); + var pre_preimage = + cst_encode_opt_box_autoadd_payment_preimage(apiObj.preimage); + var pre_secret = cst_encode_opt_box_autoadd_payment_secret(apiObj.secret); + var pre_offer_id = cst_encode_box_autoadd_offer_id(apiObj.offerId); + wireObj.tag = 4; + wireObj.kind.Bolt12Offer.hash = pre_hash; + wireObj.kind.Bolt12Offer.preimage = pre_preimage; + wireObj.kind.Bolt12Offer.secret = pre_secret; + wireObj.kind.Bolt12Offer.offer_id = pre_offer_id; + return; + } + if (apiObj is PaymentKind_Bolt12Refund) { + var pre_hash = cst_encode_opt_box_autoadd_payment_hash(apiObj.hash); + var pre_preimage = + cst_encode_opt_box_autoadd_payment_preimage(apiObj.preimage); + var pre_secret = cst_encode_opt_box_autoadd_payment_secret(apiObj.secret); + wireObj.tag = 5; + wireObj.kind.Bolt12Refund.hash = pre_hash; + wireObj.kind.Bolt12Refund.preimage = pre_preimage; + wireObj.kind.Bolt12Refund.secret = pre_secret; + return; + } + } @protected - void sse_encode_String(String self, SseSerializer serializer); + void cst_api_fill_to_wire_payment_preimage( + PaymentPreimage apiObj, wire_cst_payment_preimage wireObj) { + wireObj.data = cst_encode_u_8_array_32(apiObj.data); + } @protected - void sse_encode_address(Address self, SseSerializer serializer); + void cst_api_fill_to_wire_payment_secret( + PaymentSecret apiObj, wire_cst_payment_secret wireObj) { + wireObj.data = cst_encode_u_8_array_32(apiObj.data); + } @protected - void sse_encode_bolt_11_invoice(Bolt11Invoice self, SseSerializer serializer); + void cst_api_fill_to_wire_peer_details( + PeerDetails apiObj, wire_cst_peer_details wireObj) { + cst_api_fill_to_wire_public_key(apiObj.nodeId, wireObj.node_id); + cst_api_fill_to_wire_socket_address(apiObj.address, wireObj.address); + wireObj.is_connected = cst_encode_bool(apiObj.isConnected); + } @protected - void sse_encode_bool(bool self, SseSerializer serializer); + 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 sse_encode_box_autoadd_address(Address self, SseSerializer serializer); + void cst_api_fill_to_wire_public_key( + PublicKey apiObj, wire_cst_public_key wireObj) { + wireObj.hex = cst_encode_String(apiObj.hex); + } @protected - void sse_encode_box_autoadd_bolt_11_invoice( - Bolt11Invoice self, SseSerializer serializer); + 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); + } @protected - void sse_encode_box_autoadd_chain_data_source_config( - ChainDataSourceConfig self, SseSerializer serializer); + void cst_api_fill_to_wire_refund(Refund apiObj, wire_cst_refund wireObj) { + wireObj.s = cst_encode_String(apiObj.s); + } @protected - void sse_encode_box_autoadd_channel_config( - ChannelConfig self, SseSerializer serializer); + void cst_api_fill_to_wire_routing_fees( + RoutingFees apiObj, wire_cst_routing_fees wireObj) { + wireObj.base_msat = cst_encode_u_32(apiObj.baseMsat); + wireObj.proportional_millionths = + cst_encode_u_32(apiObj.proportionalMillionths); + } @protected - void sse_encode_box_autoadd_channel_id( - ChannelId self, SseSerializer serializer); + void cst_api_fill_to_wire_socket_address( + SocketAddress apiObj, wire_cst_socket_address wireObj) { + if (apiObj is SocketAddress_TcpIpV4) { + var pre_addr = cst_encode_u_8_array_4(apiObj.addr); + var pre_port = cst_encode_u_16(apiObj.port); + wireObj.tag = 0; + wireObj.kind.TcpIpV4.addr = pre_addr; + wireObj.kind.TcpIpV4.port = pre_port; + return; + } + if (apiObj is SocketAddress_TcpIpV6) { + var pre_addr = cst_encode_u_8_array_16(apiObj.addr); + var pre_port = cst_encode_u_16(apiObj.port); + wireObj.tag = 1; + wireObj.kind.TcpIpV6.addr = pre_addr; + wireObj.kind.TcpIpV6.port = pre_port; + return; + } + if (apiObj is SocketAddress_OnionV2) { + var pre_field0 = cst_encode_u_8_array_12(apiObj.field0); + wireObj.tag = 2; + wireObj.kind.OnionV2.field0 = pre_field0; + return; + } + if (apiObj is SocketAddress_OnionV3) { + var pre_ed25519_pubkey = cst_encode_u_8_array_32(apiObj.ed25519Pubkey); + var pre_checksum = cst_encode_u_16(apiObj.checksum); + var pre_version = cst_encode_u_8(apiObj.version); + var pre_port = cst_encode_u_16(apiObj.port); + wireObj.tag = 3; + wireObj.kind.OnionV3.ed25519_pubkey = pre_ed25519_pubkey; + wireObj.kind.OnionV3.checksum = pre_checksum; + wireObj.kind.OnionV3.version = pre_version; + wireObj.kind.OnionV3.port = pre_port; + return; + } + if (apiObj is SocketAddress_Hostname) { + var pre_addr = cst_encode_String(apiObj.addr); + var pre_port = cst_encode_u_16(apiObj.port); + wireObj.tag = 4; + wireObj.kind.Hostname.addr = pre_addr; + wireObj.kind.Hostname.port = pre_port; + return; + } + } @protected - void sse_encode_box_autoadd_config(Config self, SseSerializer serializer); + void cst_api_fill_to_wire_txid(Txid apiObj, wire_cst_txid wireObj) { + wireObj.hash = cst_encode_String(apiObj.hash); + } @protected - void sse_encode_box_autoadd_entropy_source_config( - EntropySourceConfig self, SseSerializer serializer); + 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); + } @protected - void sse_encode_box_autoadd_event(Event self, SseSerializer serializer); + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder raw); @protected - void sse_encode_box_autoadd_gossip_source_config( - GossipSourceConfig self, SseSerializer serializer); + int cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder raw); @protected - void sse_encode_box_autoadd_ldk_mnemonic( - LdkMnemonic self, SseSerializer serializer); + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder raw); @protected - void sse_encode_box_autoadd_ldk_node(LdkNode self, SseSerializer serializer); + int cst_encode_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ArcBolt12Payment raw); @protected - void sse_encode_box_autoadd_out_point( - OutPoint self, SseSerializer serializer); + int cst_encode_RustOpaque_Node(Node raw); @protected - void sse_encode_box_autoadd_payment_details( - PaymentDetails self, SseSerializer serializer); + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder raw); @protected - void sse_encode_box_autoadd_payment_hash( - PaymentHash self, SseSerializer serializer); + int cst_encode_RustOpaque_ldk_nodeBuilder(Builder raw); @protected - void sse_encode_box_autoadd_payment_preimage( - PaymentPreimage self, SseSerializer serializer); + int cst_encode_RustOpaque_ldk_nodegraphNetworkGraph(NetworkGraph raw); @protected - void sse_encode_box_autoadd_payment_secret( - PaymentSecret self, SseSerializer serializer); + int cst_encode_RustOpaque_ldk_nodepaymentBolt11Payment(Bolt11Payment raw); @protected - void sse_encode_box_autoadd_public_key( - PublicKey self, SseSerializer serializer); + int cst_encode_RustOpaque_ldk_nodepaymentOnchainPayment(OnchainPayment raw); @protected - void sse_encode_box_autoadd_socket_address( - SocketAddress self, SseSerializer serializer); + int cst_encode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + SpontaneousPayment raw); @protected - void sse_encode_box_autoadd_u_32(int self, SseSerializer serializer); + bool cst_encode_bool(bool raw); @protected - void sse_encode_box_autoadd_u_64(int self, SseSerializer serializer); + int cst_encode_i_32(int raw); @protected - void sse_encode_box_autoadd_user_channel_id( - UserChannelId self, SseSerializer serializer); + int cst_encode_ldk_builder_error(LdkBuilderError raw); @protected - void sse_encode_builder_exception( - BuilderException self, SseSerializer serializer); + int cst_encode_log_level(LogLevel raw); @protected - void sse_encode_chain_data_source_config( - ChainDataSourceConfig self, SseSerializer serializer); + int cst_encode_network(Network raw); @protected - void sse_encode_channel_config(ChannelConfig self, SseSerializer serializer); + int cst_encode_payment_direction(PaymentDirection raw); @protected - void sse_encode_channel_details( - ChannelDetails self, SseSerializer serializer); + int cst_encode_payment_failure_reason(PaymentFailureReason raw); @protected - void sse_encode_channel_id(ChannelId self, SseSerializer serializer); + int cst_encode_payment_status(PaymentStatus raw); @protected - void sse_encode_config(Config self, SseSerializer serializer); + int cst_encode_u_16(int raw); @protected - void sse_encode_entropy_source_config( - EntropySourceConfig self, SseSerializer serializer); + int cst_encode_u_32(int raw); @protected - void sse_encode_event(Event self, SseSerializer serializer); + int cst_encode_u_8(int raw); @protected - void sse_encode_gossip_source_config( - GossipSourceConfig self, SseSerializer serializer); + void cst_encode_unit(void raw); @protected - void sse_encode_i_32(int self, SseSerializer serializer); + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder self, SseSerializer serializer); @protected - void sse_encode_ldk_mnemonic(LdkMnemonic self, SseSerializer serializer); + void + sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder self, SseSerializer serializer); @protected - void sse_encode_ldk_node(LdkNode self, SseSerializer serializer); + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder self, SseSerializer serializer); @protected - void sse_encode_list_channel_details( - List self, SseSerializer serializer); + void sse_encode_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ArcBolt12Payment self, SseSerializer serializer); @protected - void sse_encode_list_payment_details( - List self, SseSerializer serializer); + void sse_encode_RustOpaque_Node(Node self, SseSerializer serializer); @protected - void sse_encode_list_peer_details( - List self, SseSerializer serializer); + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + NodeBuilder self, SseSerializer serializer); @protected - void sse_encode_list_prim_u_8_loose(List self, SseSerializer serializer); + void sse_encode_RustOpaque_ldk_nodeBuilder( + Builder self, SseSerializer serializer); @protected - void sse_encode_list_prim_u_8_strict( - Uint8List self, SseSerializer serializer); + void sse_encode_RustOpaque_ldk_nodegraphNetworkGraph( + NetworkGraph self, SseSerializer serializer); @protected - void sse_encode_list_public_key( - List self, SseSerializer serializer); + void sse_encode_RustOpaque_ldk_nodepaymentBolt11Payment( + Bolt11Payment self, SseSerializer serializer); @protected - void sse_encode_list_socket_address( - List self, SseSerializer serializer); + void sse_encode_RustOpaque_ldk_nodepaymentOnchainPayment( + OnchainPayment self, SseSerializer serializer); @protected - void sse_encode_log_level(LogLevel self, SseSerializer serializer); + void sse_encode_RustOpaque_ldk_nodepaymentSpontaneousPayment( + SpontaneousPayment self, SseSerializer serializer); @protected - void sse_encode_max_dust_htlc_exposure( - MaxDustHTLCExposure self, SseSerializer serializer); + void sse_encode_String(String self, SseSerializer serializer); @protected - void sse_encode_network(Network self, SseSerializer serializer); + void sse_encode_address(Address self, SseSerializer serializer); @protected - void sse_encode_node_exception(NodeException self, SseSerializer serializer); + void sse_encode_anchor_channels_config( + AnchorChannelsConfig self, SseSerializer serializer); @protected - void sse_encode_opt_String(String? self, SseSerializer serializer); + void sse_encode_balance_details( + BalanceDetails self, SseSerializer serializer); @protected - void sse_encode_opt_box_autoadd_chain_data_source_config( - ChainDataSourceConfig? self, SseSerializer serializer); + void sse_encode_best_block(BestBlock self, SseSerializer serializer); @protected - void sse_encode_opt_box_autoadd_channel_config( - ChannelConfig? self, SseSerializer serializer); + void sse_encode_bolt_11_invoice(Bolt11Invoice self, SseSerializer serializer); @protected - void sse_encode_opt_box_autoadd_entropy_source_config( - EntropySourceConfig? self, SseSerializer serializer); + void sse_encode_bolt_12_invoice(Bolt12Invoice self, SseSerializer serializer); @protected - void sse_encode_opt_box_autoadd_event(Event? self, SseSerializer serializer); + void sse_encode_bolt_12_parse_error( + Bolt12ParseError self, SseSerializer serializer); @protected - void sse_encode_opt_box_autoadd_gossip_source_config( - GossipSourceConfig? self, SseSerializer serializer); + void sse_encode_bool(bool self, SseSerializer serializer); @protected - void sse_encode_opt_box_autoadd_payment_details( - PaymentDetails? self, SseSerializer serializer); + void sse_encode_box_autoadd_address(Address self, SseSerializer serializer); @protected - void sse_encode_opt_box_autoadd_payment_preimage( - PaymentPreimage? self, SseSerializer serializer); + void sse_encode_box_autoadd_anchor_channels_config( + AnchorChannelsConfig self, SseSerializer serializer); @protected - void sse_encode_opt_box_autoadd_payment_secret( - PaymentSecret? self, SseSerializer serializer); + void sse_encode_box_autoadd_bolt_11_invoice( + Bolt11Invoice self, SseSerializer serializer); @protected - void sse_encode_opt_box_autoadd_public_key( - PublicKey? self, SseSerializer serializer); + void sse_encode_box_autoadd_bolt_12_parse_error( + Bolt12ParseError self, SseSerializer serializer); @protected - void sse_encode_opt_box_autoadd_u_32(int? self, SseSerializer serializer); + void sse_encode_box_autoadd_chain_data_source_config( + ChainDataSourceConfig self, SseSerializer serializer); @protected - void sse_encode_opt_box_autoadd_u_64(int? self, SseSerializer serializer); + void sse_encode_box_autoadd_channel_config( + ChannelConfig self, SseSerializer serializer); @protected - void sse_encode_opt_list_socket_address( - List? self, SseSerializer serializer); + void sse_encode_box_autoadd_channel_id( + ChannelId self, SseSerializer serializer); @protected - void sse_encode_out_point(OutPoint self, SseSerializer serializer); + void sse_encode_box_autoadd_channel_info( + ChannelInfo self, SseSerializer serializer); @protected - void sse_encode_payment_details( - PaymentDetails self, SseSerializer serializer); + void sse_encode_box_autoadd_channel_update_info( + ChannelUpdateInfo self, SseSerializer serializer); @protected - void sse_encode_payment_direction( - PaymentDirection self, SseSerializer serializer); + void sse_encode_box_autoadd_closure_reason( + ClosureReason self, SseSerializer serializer); @protected - void sse_encode_payment_hash(PaymentHash self, SseSerializer serializer); + void sse_encode_box_autoadd_config(Config self, SseSerializer serializer); @protected - void sse_encode_payment_preimage( - PaymentPreimage self, SseSerializer serializer); + void sse_encode_box_autoadd_decode_error( + DecodeError self, SseSerializer serializer); @protected - void sse_encode_payment_secret(PaymentSecret self, SseSerializer serializer); + void sse_encode_box_autoadd_entropy_source_config( + EntropySourceConfig self, SseSerializer serializer); @protected - void sse_encode_payment_status(PaymentStatus self, SseSerializer serializer); + void sse_encode_box_autoadd_event(Event self, SseSerializer serializer); @protected - void sse_encode_peer_details(PeerDetails self, SseSerializer serializer); + void sse_encode_box_autoadd_gossip_source_config( + GossipSourceConfig self, SseSerializer serializer); @protected - void sse_encode_public_key(PublicKey self, SseSerializer serializer); + void sse_encode_box_autoadd_ldk_bolt_11_payment( + LdkBolt11Payment self, SseSerializer serializer); @protected - void sse_encode_socket_address(SocketAddress self, SseSerializer serializer); + void sse_encode_box_autoadd_ldk_bolt_12_payment( + LdkBolt12Payment self, SseSerializer serializer); @protected - void sse_encode_txid(Txid self, SseSerializer serializer); + void sse_encode_box_autoadd_ldk_mnemonic( + LdkMnemonic self, SseSerializer serializer); @protected - void sse_encode_u_16(int self, SseSerializer serializer); + void sse_encode_box_autoadd_ldk_network_graph( + LdkNetworkGraph self, SseSerializer serializer); @protected - void sse_encode_u_32(int self, SseSerializer serializer); + void sse_encode_box_autoadd_ldk_node(LdkNode self, SseSerializer serializer); @protected - void sse_encode_u_64(int self, SseSerializer serializer); + void sse_encode_box_autoadd_ldk_on_chain_payment( + LdkOnChainPayment self, SseSerializer serializer); @protected - void sse_encode_u_8(int self, SseSerializer serializer); + void sse_encode_box_autoadd_ldk_spontaneous_payment( + LdkSpontaneousPayment self, SseSerializer serializer); @protected - void sse_encode_u_8_array_12(U8Array12 self, SseSerializer serializer); + void sse_encode_box_autoadd_liquidity_source_config( + LiquiditySourceConfig self, SseSerializer serializer); @protected - void sse_encode_u_8_array_16(U8Array16 self, SseSerializer serializer); + void sse_encode_box_autoadd_lsp_fee_limits( + LSPFeeLimits self, SseSerializer serializer); @protected - void sse_encode_u_8_array_32(U8Array32 self, SseSerializer serializer); + void sse_encode_box_autoadd_max_dust_htlc_exposure( + MaxDustHTLCExposure self, SseSerializer serializer); @protected - void sse_encode_u_8_array_4(U8Array4 self, SseSerializer serializer); + void sse_encode_box_autoadd_node_announcement_info( + NodeAnnouncementInfo self, SseSerializer serializer); @protected - void sse_encode_u_8_array_64(U8Array64 self, SseSerializer serializer); + void sse_encode_box_autoadd_node_id(NodeId self, SseSerializer serializer); @protected - void sse_encode_unit(void self, SseSerializer serializer); + void sse_encode_box_autoadd_node_info( + NodeInfo self, SseSerializer serializer); + + @protected + void sse_encode_box_autoadd_offer(Offer self, SseSerializer serializer); + + @protected + void sse_encode_box_autoadd_offer_id(OfferId self, SseSerializer serializer); + + @protected + void sse_encode_box_autoadd_out_point( + OutPoint self, SseSerializer serializer); + + @protected + 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); + + @protected + void sse_encode_box_autoadd_payment_id( + PaymentId self, SseSerializer serializer); + + @protected + void sse_encode_box_autoadd_payment_preimage( + PaymentPreimage self, SseSerializer serializer); + + @protected + void sse_encode_box_autoadd_payment_secret( + PaymentSecret self, SseSerializer serializer); + + @protected + void sse_encode_box_autoadd_public_key( + PublicKey self, SseSerializer serializer); + + @protected + void sse_encode_box_autoadd_refund(Refund self, SseSerializer serializer); + + @protected + 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); + + @protected + void sse_encode_box_autoadd_u_64(BigInt self, SseSerializer serializer); + + @protected + void sse_encode_box_autoadd_user_channel_id( + UserChannelId self, SseSerializer serializer); + + @protected + void sse_encode_chain_data_source_config( + ChainDataSourceConfig self, SseSerializer serializer); + + @protected + void sse_encode_channel_config(ChannelConfig self, SseSerializer serializer); + + @protected + void sse_encode_channel_details( + ChannelDetails self, SseSerializer serializer); + + @protected + void sse_encode_channel_id(ChannelId self, SseSerializer serializer); + + @protected + void sse_encode_channel_info(ChannelInfo self, SseSerializer serializer); + + @protected + void sse_encode_channel_update_info( + ChannelUpdateInfo self, SseSerializer serializer); + + @protected + void sse_encode_closure_reason(ClosureReason self, SseSerializer serializer); + + @protected + void sse_encode_config(Config self, SseSerializer serializer); + + @protected + void sse_encode_decode_error(DecodeError self, SseSerializer serializer); + + @protected + void sse_encode_entropy_source_config( + EntropySourceConfig self, SseSerializer serializer); + + @protected + void sse_encode_event(Event self, SseSerializer serializer); + + @protected + void sse_encode_gossip_source_config( + GossipSourceConfig self, SseSerializer serializer); + + @protected + void sse_encode_i_32(int self, SseSerializer serializer); + + @protected + void sse_encode_ldk_bolt_11_payment( + LdkBolt11Payment self, SseSerializer serializer); + + @protected + void sse_encode_ldk_bolt_12_payment( + LdkBolt12Payment self, SseSerializer serializer); + + @protected + void sse_encode_ldk_builder_error( + LdkBuilderError self, SseSerializer serializer); + + @protected + void sse_encode_ldk_mnemonic(LdkMnemonic self, SseSerializer serializer); + + @protected + void sse_encode_ldk_network_graph( + LdkNetworkGraph self, SseSerializer serializer); + + @protected + void sse_encode_ldk_node(LdkNode self, SseSerializer serializer); + + @protected + void sse_encode_ldk_node_error(LdkNodeError self, SseSerializer serializer); + + @protected + void sse_encode_ldk_on_chain_payment( + LdkOnChainPayment self, SseSerializer serializer); + + @protected + void sse_encode_ldk_spontaneous_payment( + LdkSpontaneousPayment self, SseSerializer serializer); + + @protected + void sse_encode_lightning_balance( + LightningBalance self, SseSerializer serializer); + + @protected + void sse_encode_liquidity_source_config( + LiquiditySourceConfig 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_node_id(List self, SseSerializer serializer); + + @protected + void sse_encode_list_payment_details( + List self, SseSerializer serializer); + + @protected + 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_64_strict( + Uint64List self, SseSerializer serializer); + + @protected + void sse_encode_list_prim_u_8_loose(List self, SseSerializer serializer); + + @protected + void sse_encode_list_prim_u_8_strict( + Uint8List self, SseSerializer serializer); + + @protected + void sse_encode_list_public_key( + List self, SseSerializer serializer); + + @protected + void sse_encode_list_socket_address( + List self, SseSerializer serializer); + + @protected + void sse_encode_log_level(LogLevel self, SseSerializer serializer); + + @protected + void sse_encode_lsp_fee_limits(LSPFeeLimits self, SseSerializer serializer); + + @protected + void sse_encode_max_dust_htlc_exposure( + MaxDustHTLCExposure self, SseSerializer serializer); + + @protected + void sse_encode_network(Network self, SseSerializer serializer); + + @protected + void sse_encode_node_announcement_info( + NodeAnnouncementInfo self, SseSerializer serializer); + + @protected + void sse_encode_node_id(NodeId self, SseSerializer serializer); + + @protected + void sse_encode_node_info(NodeInfo self, SseSerializer serializer); + + @protected + void sse_encode_node_status(NodeStatus self, SseSerializer serializer); + + @protected + void sse_encode_offer(Offer self, SseSerializer serializer); + + @protected + void sse_encode_offer_id(OfferId self, SseSerializer serializer); + + @protected + void sse_encode_opt_String(String? self, SseSerializer serializer); + + @protected + void sse_encode_opt_box_autoadd_anchor_channels_config( + AnchorChannelsConfig? self, SseSerializer serializer); + + @protected + void sse_encode_opt_box_autoadd_chain_data_source_config( + ChainDataSourceConfig? self, SseSerializer serializer); + + @protected + 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_channel_info( + ChannelInfo? self, SseSerializer serializer); + + @protected + void sse_encode_opt_box_autoadd_channel_update_info( + ChannelUpdateInfo? 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); + + @protected + void sse_encode_opt_box_autoadd_event(Event? self, SseSerializer serializer); + + @protected + 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_node_announcement_info( + NodeAnnouncementInfo? self, SseSerializer serializer); + + @protected + void sse_encode_opt_box_autoadd_node_info( + NodeInfo? 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_hash( + PaymentHash? self, SseSerializer serializer); + + @protected + void sse_encode_opt_box_autoadd_payment_id( + PaymentId? self, SseSerializer serializer); + + @protected + void sse_encode_opt_box_autoadd_payment_preimage( + PaymentPreimage? self, SseSerializer serializer); + + @protected + void sse_encode_opt_box_autoadd_payment_secret( + PaymentSecret? self, SseSerializer serializer); + + @protected + 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); + + @protected + void sse_encode_opt_box_autoadd_u_64(BigInt? self, SseSerializer serializer); + + @protected + void sse_encode_opt_list_socket_address( + List? self, SseSerializer serializer); + + @protected + void sse_encode_out_point(OutPoint self, SseSerializer serializer); + + @protected + void sse_encode_payment_details( + PaymentDetails self, SseSerializer serializer); + + @protected + 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); + + @protected + void sse_encode_payment_id(PaymentId self, SseSerializer serializer); + + @protected + void sse_encode_payment_kind(PaymentKind self, SseSerializer serializer); + + @protected + void sse_encode_payment_preimage( + PaymentPreimage self, SseSerializer serializer); + + @protected + void sse_encode_payment_secret(PaymentSecret self, SseSerializer serializer); + + @protected + void sse_encode_payment_status(PaymentStatus self, SseSerializer serializer); + + @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_refund(Refund self, SseSerializer serializer); + + @protected + void sse_encode_routing_fees(RoutingFees self, SseSerializer serializer); + + @protected + void sse_encode_socket_address(SocketAddress self, SseSerializer serializer); + + @protected + void sse_encode_txid(Txid self, SseSerializer serializer); + + @protected + void sse_encode_u_16(int self, SseSerializer serializer); + + @protected + void sse_encode_u_32(int self, SseSerializer serializer); + + @protected + void sse_encode_u_64(BigInt self, SseSerializer serializer); + + @protected + void sse_encode_u_8(int self, SseSerializer serializer); + + @protected + void sse_encode_u_8_array_12(U8Array12 self, SseSerializer serializer); + + @protected + void sse_encode_u_8_array_16(U8Array16 self, SseSerializer serializer); + + @protected + void sse_encode_u_8_array_32(U8Array32 self, SseSerializer serializer); + + @protected + void sse_encode_u_8_array_4(U8Array4 self, SseSerializer serializer); + + @protected + void sse_encode_u_8_array_64(U8Array64 self, SseSerializer serializer); + + @protected + void sse_encode_unit(void self, SseSerializer serializer); + + @protected + void sse_encode_user_channel_id(UserChannelId self, SseSerializer serializer); + + @protected + void sse_encode_usize(BigInt self, SseSerializer serializer); +} + +// Section: wire_class + +// ignore_for_file: camel_case_types, non_constant_identifier_names, avoid_positional_boolean_parameters, annotate_overrides, constant_identifier_names +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +// ignore_for_file: type=lint + +/// generated by flutter_rust_bridge +class coreWire implements BaseWire { + factory coreWire.fromExternalLibrary(ExternalLibrary lib) => + coreWire(lib.ffiDynamicLibrary); + + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + coreWire(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + coreWire.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + void store_dart_post_cobject( + DartPostCObjectFnType ptr, + ) { + return _store_dart_post_cobject( + ptr, + ); + } + + late final _store_dart_post_cobjectPtr = + _lookup>( + 'store_dart_post_cobject'); + late final _store_dart_post_cobject = _store_dart_post_cobjectPtr + .asFunction(); + + void wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hash( + int port_, + ffi.Pointer that, + ffi.Pointer payment_hash, + int claimable_amount_msat, + ffi.Pointer preimage, + ) { + return _wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hash( + port_, + that, + payment_hash, + claimable_amount_msat, + preimage, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hashPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Uint64, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hash'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hash = + _wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hashPtr + .asFunction< + void Function( + int, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + + void wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hash( + int port_, + ffi.Pointer that, + ffi.Pointer payment_hash, + ) { + return _wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hash( + port_, + that, + payment_hash, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hashPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hash'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hash = + _wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hashPtr + .asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer)>(); + + void wire__crate__api__bolt11__ldk_bolt_11_payment_receive( + int port_, + ffi.Pointer that, + int amount_msat, + ffi.Pointer description, + int expiry_secs, + ) { + return _wire__crate__api__bolt11__ldk_bolt_11_payment_receive( + port_, + that, + amount_msat, + description, + expiry_secs, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receivePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Uint64, + ffi.Pointer, + ffi.Uint32)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive = + _wire__crate__api__bolt11__ldk_bolt_11_payment_receivePtr.asFunction< + void Function(int, ffi.Pointer, int, + ffi.Pointer, int)>(); + + void wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hash( + int port_, + ffi.Pointer that, + ffi.Pointer payment_hash, + int amount_msat, + ffi.Pointer description, + int expiry_secs, + ) { + return _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hash( + port_, + that, + payment_hash, + amount_msat, + description, + expiry_secs, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hashPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Uint64, + ffi.Pointer, + ffi.Uint32)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hash'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hash = + _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hashPtr + .asFunction< + void Function( + int, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + int)>(); + + void wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount( + int port_, + ffi.Pointer that, + ffi.Pointer description, + int expiry_secs, + ) { + return _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount( + port_, + that, + description, + expiry_secs, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amountPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Uint32)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount = + _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amountPtr + .asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer, int)>(); + + void + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hash( + int port_, + ffi.Pointer that, + ffi.Pointer description, + int expiry_secs, + ffi.Pointer payment_hash, + ) { + return _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hash( + port_, + that, + description, + expiry_secs, + payment_hash, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hashPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Uint32, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hash'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hash = + _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hashPtr + .asFunction< + void Function( + int, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + + void + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_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__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel( + port_, + that, + description, + expiry_secs, + max_proportional_lsp_fee_limit_ppm_msat, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channelPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Uint32, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel = + _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channelPtr + .asFunction< + void Function( + int, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + + void wire__crate__api__bolt11__ldk_bolt_11_payment_receive_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__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel( + port_, + that, + amount_msat, + description, + expiry_secs, + max_total_lsp_fee_limit_msat, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_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__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel = + _wire__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channelPtr + .asFunction< + void Function( + int, + ffi.Pointer, + int, + ffi.Pointer, + int, + ffi.Pointer)>(); + + void wire__crate__api__bolt11__ldk_bolt_11_payment_send( + int port_, + ffi.Pointer that, + ffi.Pointer invoice, + ) { + return _wire__crate__api__bolt11__ldk_bolt_11_payment_send( + port_, + that, + invoice, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_sendPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_send = + _wire__crate__api__bolt11__ldk_bolt_11_payment_sendPtr.asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer)>(); + + void wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes( + int port_, + ffi.Pointer that, + ffi.Pointer invoice, + ) { + return _wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes( + port_, + that, + invoice, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_send_probesPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes = + _wire__crate__api__bolt11__ldk_bolt_11_payment_send_probesPtr.asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer)>(); + + void wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount( + int port_, + ffi.Pointer that, + ffi.Pointer invoice, + int amount_msat, + ) { + return _wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount( + port_, + that, + invoice, + amount_msat, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amountPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Uint64)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount = + _wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amountPtr + .asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer, int)>(); + + void wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount( + int port_, + ffi.Pointer that, + ffi.Pointer invoice, + int amount_msat, + ) { + return _wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount( + port_, + that, + invoice, + amount_msat, + ); + } + + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amountPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Uint64)>>( + 'frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount'); + late final _wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount = + _wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amountPtr + .asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer, int)>(); + + void wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refund( + int port_, + ffi.Pointer that, + int amount_msat, + int expiry_secs, + ) { + return _wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refund( + port_, + that, + amount_msat, + expiry_secs, + ); + } + + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refundPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Uint64, + ffi.Uint32)>>( + 'frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refund'); + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refund = + _wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refundPtr + .asFunction< + void Function( + int, ffi.Pointer, int, int)>(); + + void wire__crate__api__bolt12__ldk_bolt_12_payment_receive( + int port_, + ffi.Pointer that, + int amount_msat, + ffi.Pointer description, + ) { + return _wire__crate__api__bolt12__ldk_bolt_12_payment_receive( + port_, + that, + amount_msat, + description, + ); + } + + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_receivePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Uint64, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_receive'); + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_receive = + _wire__crate__api__bolt12__ldk_bolt_12_payment_receivePtr.asFunction< + void Function(int, ffi.Pointer, int, + ffi.Pointer)>(); + + void wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amount( + int port_, + ffi.Pointer that, + ffi.Pointer description, + ) { + return _wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amount( + port_, + that, + description, + ); + } + + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amountPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amount'); + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amount = + _wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amountPtr + .asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer)>(); + + void wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_payment( + int port_, + ffi.Pointer that, + ffi.Pointer refund, + ) { + return _wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_payment( + port_, + that, + refund, + ); + } + + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_paymentPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_payment'); + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_payment = + _wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_paymentPtr + .asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer)>(); + + void wire__crate__api__bolt12__ldk_bolt_12_payment_send( + int port_, + ffi.Pointer that, + ffi.Pointer offer, + ffi.Pointer payer_note, + ) { + return _wire__crate__api__bolt12__ldk_bolt_12_payment_send( + port_, + that, + offer, + payer_note, + ); + } + + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_sendPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_send'); + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_send = + _wire__crate__api__bolt12__ldk_bolt_12_payment_sendPtr.asFunction< + void Function( + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); - @protected - void sse_encode_user_channel_id(UserChannelId self, SseSerializer serializer); + void wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amount( + int port_, + ffi.Pointer that, + ffi.Pointer offer, + ffi.Pointer payer_note, + int amount_msat, + ) { + return _wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amount( + port_, + that, + offer, + payer_note, + amount_msat, + ); + } - @protected - void sse_encode_usize(int self, SseSerializer serializer); -} + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amountPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Uint64)>>( + 'frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amount'); + late final _wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amount = + _wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amountPtr + .asFunction< + void Function( + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); -// Section: wire_class + WireSyncRust2DartDco + wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder( + int that, + ) { + return _wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder( + that, + ); + } -// ignore_for_file: camel_case_types, non_constant_identifier_names, avoid_positional_boolean_parameters, annotate_overrides, constant_identifier_names -// AUTO GENERATED FILE, DO NOT EDIT. -// -// Generated by `package:ffigen`. -// ignore_for_file: type=lint + late final _wire__crate__api__builder__NodeBuilder_auto_accessor_get_builderPtr = + _lookup>( + 'frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder'); + late final _wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder = + _wire__crate__api__builder__NodeBuilder_auto_accessor_get_builderPtr + .asFunction(); -/// generated by flutter_rust_bridge -class LdkCoreWire implements BaseWire { - factory LdkCoreWire.fromExternalLibrary(ExternalLibrary lib) => - LdkCoreWire(lib.ffiDynamicLibrary); + WireSyncRust2DartDco + wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder( + int that, + int builder, + ) { + return _wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder( + that, + builder, + ); + } - /// Holds the symbol lookup function. - final ffi.Pointer Function(String symbolName) - _lookup; + late final _wire__crate__api__builder__NodeBuilder_auto_accessor_set_builderPtr = + _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function(ffi.UintPtr, ffi.UintPtr)>>( + 'frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder'); + late final _wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder = + _wire__crate__api__builder__NodeBuilder_auto_accessor_set_builderPtr + .asFunction(); - /// The symbols are looked up in [dynamicLibrary]. - LdkCoreWire(ffi.DynamicLibrary dynamicLibrary) - : _lookup = dynamicLibrary.lookup; + void wire__crate__api__builder__NodeBuilder_build( + int port_, + int that, + ) { + return _wire__crate__api__builder__NodeBuilder_build( + port_, + that, + ); + } - /// The symbols are looked up with [lookup]. - LdkCoreWire.fromLookup( - ffi.Pointer Function(String symbolName) - lookup) - : _lookup = lookup; + late final _wire__crate__api__builder__NodeBuilder_buildPtr = + _lookup>( + 'frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_build'); + late final _wire__crate__api__builder__NodeBuilder_build = + _wire__crate__api__builder__NodeBuilder_buildPtr + .asFunction(); - void store_dart_post_cobject( - DartPostCObjectFnType ptr, + void wire__crate__api__builder__NodeBuilder_build_with_fs_store( + int port_, + int that, ) { - return _store_dart_post_cobject( - ptr, + return _wire__crate__api__builder__NodeBuilder_build_with_fs_store( + port_, + that, ); } - late final _store_dart_post_cobjectPtr = - _lookup>( - 'store_dart_post_cobject'); - late final _store_dart_post_cobject = _store_dart_post_cobjectPtr - .asFunction(); + late final _wire__crate__api__builder__NodeBuilder_build_with_fs_storePtr = + _lookup>( + 'frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_build_with_fs_store'); + late final _wire__crate__api__builder__NodeBuilder_build_with_fs_store = + _wire__crate__api__builder__NodeBuilder_build_with_fs_storePtr + .asFunction(); - void wire_build_with_sqlite_store( + void wire__crate__api__builder__NodeBuilder_create_builder( 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, ) { - return _wire_build_with_sqlite_store( + return _wire__crate__api__builder__NodeBuilder_create_builder( port_, config, chain_data_source_config, entropy_source_config, gossip_source_config, + liquidity_source_config, ); } - late final _wire_build_with_sqlite_storePtr = _lookup< + late final _wire__crate__api__builder__NodeBuilder_create_builderPtr = _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< + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_create_builder'); + late final _wire__crate__api__builder__NodeBuilder_create_builder = + _wire__crate__api__builder__NodeBuilder_create_builderPtr.asFunction< void Function( int, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer)>(); - void wire_ldk_mnemonic_generate( + void wire__crate__api__builder__ldk_mnemonic_generate( int port_, ) { - return _wire_ldk_mnemonic_generate( + return _wire__crate__api__builder__ldk_mnemonic_generate( port_, ); } - late final _wire_ldk_mnemonic_generatePtr = + late final _wire__crate__api__builder__ldk_mnemonic_generatePtr = _lookup>( - 'frbgen_ldk_node_wire_ldk_mnemonic_generate'); - late final _wire_ldk_mnemonic_generate = - _wire_ldk_mnemonic_generatePtr.asFunction(); + 'frbgen_ldk_node_wire__crate__api__builder__ldk_mnemonic_generate'); + late final _wire__crate__api__builder__ldk_mnemonic_generate = + _wire__crate__api__builder__ldk_mnemonic_generatePtr + .asFunction(); - void wire_ldk_node_close_channel( + void wire__crate__api__graph__ldk_network_graph_channel( int port_, - ffi.Pointer that, - ffi.Pointer channel_id, - ffi.Pointer counterparty_node_id, + ffi.Pointer that, + int short_channel_id, ) { - return _wire_ldk_node_close_channel( + return _wire__crate__api__graph__ldk_network_graph_channel( port_, that, - channel_id, - counterparty_node_id, + short_channel_id, ); } - late final _wire_ldk_node_close_channelPtr = _lookup< + late final _wire__crate__api__graph__ldk_network_graph_channelPtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - ffi.Int64, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>( - '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)>(); - - void wire_ldk_node_connect( + ffi.Void Function(ffi.Int64, + ffi.Pointer, ffi.Uint64)>>( + 'frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_channel'); + late final _wire__crate__api__graph__ldk_network_graph_channel = + _wire__crate__api__graph__ldk_network_graph_channelPtr.asFunction< + void Function(int, ffi.Pointer, int)>(); + + void wire__crate__api__graph__ldk_network_graph_list_channels( int port_, - ffi.Pointer that, - ffi.Pointer node_id, - ffi.Pointer address, - bool persist, + ffi.Pointer that, ) { - return _wire_ldk_node_connect( + return _wire__crate__api__graph__ldk_network_graph_list_channels( port_, that, - node_id, - address, - persist, ); } - late final _wire_ldk_node_connectPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Int64, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - 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, - bool)>(); - - void wire_ldk_node_connect_open_channel( + late final _wire__crate__api__graph__ldk_network_graph_list_channelsPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_list_channels'); + late final _wire__crate__api__graph__ldk_network_graph_list_channels = + _wire__crate__api__graph__ldk_network_graph_list_channelsPtr.asFunction< + void Function(int, ffi.Pointer)>(); + + void wire__crate__api__graph__ldk_network_graph_list_nodes( int port_, - 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, + ffi.Pointer that, ) { - return _wire_ldk_node_connect_open_channel( + return _wire__crate__api__graph__ldk_network_graph_list_nodes( port_, that, - socket_address, - node_id, - channel_amount_sats, - push_to_counterparty_msat, - announce_channel, - channel_config, ); } - late final _wire_ldk_node_connect_open_channelPtr = _lookup< + late final _wire__crate__api__graph__ldk_network_graph_list_nodesPtr = _lookup< ffi.NativeFunction< ffi.Void Function( - ffi.Int64, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Uint64, - ffi.Pointer, - ffi.Bool, - ffi.Pointer)>>( - '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, - int, - ffi.Pointer, - bool, - ffi.Pointer)>(); + ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_list_nodes'); + late final _wire__crate__api__graph__ldk_network_graph_list_nodes = + _wire__crate__api__graph__ldk_network_graph_list_nodesPtr.asFunction< + void Function(int, ffi.Pointer)>(); - void wire_ldk_node_disconnect( + void wire__crate__api__graph__ldk_network_graph_node( int port_, - ffi.Pointer that, - ffi.Pointer counterparty_node_id, + ffi.Pointer that, + ffi.Pointer node_id, ) { - return _wire_ldk_node_disconnect( + return _wire__crate__api__graph__ldk_network_graph_node( port_, that, - counterparty_node_id, + node_id, ); } - late final _wire_ldk_node_disconnectPtr = _lookup< + late final _wire__crate__api__graph__ldk_network_graph_nodePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - 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_ldk_node_event_handled( + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_node'); + late final _wire__crate__api__graph__ldk_network_graph_node = + _wire__crate__api__graph__ldk_network_graph_nodePtr.asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer)>(); + + void wire__crate__api__node__ldk_node_bolt11_payment( int port_, - ffi.Pointer that, + ffi.Pointer ptr, ) { - return _wire_ldk_node_event_handled( + return _wire__crate__api__node__ldk_node_bolt11_payment( port_, - that, + ptr, ); } - late final _wire_ldk_node_event_handledPtr = _lookup< + late final _wire__crate__api__node__ldk_node_bolt11_paymentPtr = _lookup< ffi.NativeFunction< 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)>(); + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_bolt11_payment'); + late final _wire__crate__api__node__ldk_node_bolt11_payment = + _wire__crate__api__node__ldk_node_bolt11_paymentPtr + .asFunction)>(); - void wire_ldk_node_is_running( + void wire__crate__api__node__ldk_node_bolt12_payment( int port_, - ffi.Pointer that, + ffi.Pointer ptr, ) { - return _wire_ldk_node_is_running( + return _wire__crate__api__node__ldk_node_bolt12_payment( port_, - that, + ptr, ); } - late final _wire_ldk_node_is_runningPtr = _lookup< + late final _wire__crate__api__node__ldk_node_bolt12_paymentPtr = _lookup< ffi.NativeFunction< 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)>(); + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_bolt12_payment'); + late final _wire__crate__api__node__ldk_node_bolt12_payment = + _wire__crate__api__node__ldk_node_bolt12_paymentPtr + .asFunction)>(); - void wire_ldk_node_list_channels( + void wire__crate__api__node__ldk_node_close_channel( int port_, ffi.Pointer that, + ffi.Pointer user_channel_id, + ffi.Pointer counterparty_node_id, ) { - return _wire_ldk_node_list_channels( + return _wire__crate__api__node__ldk_node_close_channel( port_, that, + user_channel_id, + counterparty_node_id, ); } - late final _wire_ldk_node_list_channelsPtr = _lookup< + late final _wire__crate__api__node__ldk_node_close_channelPtr = _lookup< ffi.NativeFunction< - 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)>(); + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_close_channel'); + late final _wire__crate__api__node__ldk_node_close_channel = + _wire__crate__api__node__ldk_node_close_channelPtr.asFunction< + void Function( + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); - void wire_ldk_node_list_payments( + void wire__crate__api__node__ldk_node_config( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_list_payments( + return _wire__crate__api__node__ldk_node_config( port_, that, ); } - late final _wire_ldk_node_list_paymentsPtr = _lookup< + late final _wire__crate__api__node__ldk_node_configPtr = _lookup< ffi.NativeFunction< 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)>(); + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_config'); + late final _wire__crate__api__node__ldk_node_config = + _wire__crate__api__node__ldk_node_configPtr + .asFunction)>(); - void wire_ldk_node_list_payments_with_filter( + void wire__crate__api__node__ldk_node_connect( int port_, ffi.Pointer that, - int payment_direction, + ffi.Pointer node_id, + ffi.Pointer address, + bool persist, ) { - return _wire_ldk_node_list_payments_with_filter( + return _wire__crate__api__node__ldk_node_connect( port_, that, - payment_direction, + node_id, + address, + persist, ); } - late final _wire_ldk_node_list_payments_with_filterPtr = _lookup< + late final _wire__crate__api__node__ldk_node_connectPtr = _lookup< ffi.NativeFunction< ffi.Void Function( - 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)>(); + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_connect'); + late final _wire__crate__api__node__ldk_node_connect = + _wire__crate__api__node__ldk_node_connectPtr.asFunction< + void Function( + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool)>(); - void wire_ldk_node_list_peers( + void wire__crate__api__node__ldk_node_connect_open_channel( int port_, 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_ldk_node_list_peers( + return _wire__crate__api__node__ldk_node_connect_open_channel( port_, that, + socket_address, + node_id, + channel_amount_sats, + push_to_counterparty_msat, + announce_channel, + channel_config, ); } - late final _wire_ldk_node_list_peersPtr = _lookup< + late final _wire__crate__api__node__ldk_node_connect_open_channelPtr = _lookup< ffi.NativeFunction< - 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)>(); + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Uint64, + ffi.Pointer, + ffi.Bool, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_connect_open_channel'); + late final _wire__crate__api__node__ldk_node_connect_open_channel = + _wire__crate__api__node__ldk_node_connect_open_channelPtr.asFunction< + void Function( + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + bool, + ffi.Pointer)>(); - void wire_ldk_node_listening_addresses( + void wire__crate__api__node__ldk_node_disconnect( int port_, ffi.Pointer that, + ffi.Pointer counterparty_node_id, ) { - return _wire_ldk_node_listening_addresses( + return _wire__crate__api__node__ldk_node_disconnect( port_, that, + counterparty_node_id, ); } - late final _wire_ldk_node_listening_addressesPtr = _lookup< + late final _wire__crate__api__node__ldk_node_disconnectPtr = _lookup< ffi.NativeFunction< - 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)>(); + ffi.Void Function(ffi.Int64, ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_disconnect'); + late final _wire__crate__api__node__ldk_node_disconnect = + _wire__crate__api__node__ldk_node_disconnectPtr.asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer)>(); - void wire_ldk_node_new_onchain_address( + void wire__crate__api__node__ldk_node_event_handled( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_new_onchain_address( + return _wire__crate__api__node__ldk_node_event_handled( port_, that, ); } - late final _wire_ldk_node_new_onchain_addressPtr = _lookup< + late final _wire__crate__api__node__ldk_node_event_handledPtr = _lookup< ffi.NativeFunction< 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 + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_event_handled'); + late final _wire__crate__api__node__ldk_node_event_handled = + _wire__crate__api__node__ldk_node_event_handledPtr .asFunction)>(); - void wire_ldk_node_next_event( + void wire__crate__api__node__ldk_node_force_close_channel( int port_, ffi.Pointer that, + ffi.Pointer user_channel_id, + ffi.Pointer counterparty_node_id, ) { - return _wire_ldk_node_next_event( + return _wire__crate__api__node__ldk_node_force_close_channel( port_, that, + user_channel_id, + counterparty_node_id, ); } - late final _wire_ldk_node_next_eventPtr = _lookup< + late final _wire__crate__api__node__ldk_node_force_close_channelPtr = _lookup< ffi.NativeFunction< - 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)>(); + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_force_close_channel'); + late final _wire__crate__api__node__ldk_node_force_close_channel = + _wire__crate__api__node__ldk_node_force_close_channelPtr.asFunction< + void Function( + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); - void wire_ldk_node_node_id( + void wire__crate__api__node__ldk_node_list_balances( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_node_id( + return _wire__crate__api__node__ldk_node_list_balances( port_, that, ); } - late final _wire_ldk_node_node_idPtr = _lookup< + late final _wire__crate__api__node__ldk_node_list_balancesPtr = _lookup< ffi.NativeFunction< 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)>(); + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_list_balances'); + late final _wire__crate__api__node__ldk_node_list_balances = + _wire__crate__api__node__ldk_node_list_balancesPtr + .asFunction)>(); - void wire_ldk_node_payment( + void wire__crate__api__node__ldk_node_list_channels( int port_, ffi.Pointer that, - ffi.Pointer payment_hash, ) { - return _wire_ldk_node_payment( + return _wire__crate__api__node__ldk_node_list_channels( port_, that, - payment_hash, ); } - late final _wire_ldk_node_paymentPtr = _lookup< + late final _wire__crate__api__node__ldk_node_list_channelsPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - 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)>(); + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_list_channels'); + late final _wire__crate__api__node__ldk_node_list_channels = + _wire__crate__api__node__ldk_node_list_channelsPtr + .asFunction)>(); - void wire_ldk_node_receive_payment( + void wire__crate__api__node__ldk_node_list_payments( int port_, ffi.Pointer that, - int amount_msat, - ffi.Pointer description, - int expiry_secs, ) { - return _wire_ldk_node_receive_payment( + return _wire__crate__api__node__ldk_node_list_payments( port_, that, - amount_msat, - description, - expiry_secs, ); } - late final _wire_ldk_node_receive_paymentPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Int64, - ffi.Pointer, - ffi.Uint64, - ffi.Pointer, - 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)>(); + late final _wire__crate__api__node__ldk_node_list_paymentsPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_list_payments'); + late final _wire__crate__api__node__ldk_node_list_payments = + _wire__crate__api__node__ldk_node_list_paymentsPtr + .asFunction)>(); - void wire_ldk_node_receive_variable_amount_payment( + void wire__crate__api__node__ldk_node_list_payments_with_filter( int port_, ffi.Pointer that, - ffi.Pointer description, - int expiry_secs, + int payment_direction, ) { - return _wire_ldk_node_receive_variable_amount_payment( + return _wire__crate__api__node__ldk_node_list_payments_with_filter( port_, that, - description, - expiry_secs, + payment_direction, ); } - late final _wire_ldk_node_receive_variable_amount_paymentPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - ffi.Pointer, ffi.Uint32)>>( - '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)>(); + late final _wire__crate__api__node__ldk_node_list_payments_with_filterPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, ffi.Pointer, ffi.Int32)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_list_payments_with_filter'); + late final _wire__crate__api__node__ldk_node_list_payments_with_filter = + _wire__crate__api__node__ldk_node_list_payments_with_filterPtr.asFunction< + void Function(int, ffi.Pointer, int)>(); - void wire_ldk_node_remove_payment( + void wire__crate__api__node__ldk_node_list_peers( int port_, ffi.Pointer that, - ffi.Pointer payment_hash, ) { - return _wire_ldk_node_remove_payment( + return _wire__crate__api__node__ldk_node_list_peers( port_, that, - payment_hash, ); } - late final _wire_ldk_node_remove_paymentPtr = _lookup< + late final _wire__crate__api__node__ldk_node_list_peersPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - 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)>(); + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_list_peers'); + late final _wire__crate__api__node__ldk_node_list_peers = + _wire__crate__api__node__ldk_node_list_peersPtr + .asFunction)>(); - void wire_ldk_node_send_all_to_onchain_address( + void wire__crate__api__node__ldk_node_listening_addresses( int port_, ffi.Pointer that, - ffi.Pointer address, ) { - return _wire_ldk_node_send_all_to_onchain_address( + return _wire__crate__api__node__ldk_node_listening_addresses( port_, that, - address, ); } - late final _wire_ldk_node_send_all_to_onchain_addressPtr = _lookup< + late final _wire__crate__api__node__ldk_node_listening_addressesPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - 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)>(); + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_listening_addresses'); + late final _wire__crate__api__node__ldk_node_listening_addresses = + _wire__crate__api__node__ldk_node_listening_addressesPtr + .asFunction)>(); - void wire_ldk_node_send_payment( + void wire__crate__api__node__ldk_node_network_graph( int port_, - ffi.Pointer that, - ffi.Pointer invoice, + ffi.Pointer ptr, ) { - return _wire_ldk_node_send_payment( + return _wire__crate__api__node__ldk_node_network_graph( port_, - that, - invoice, + ptr, ); } - late final _wire_ldk_node_send_paymentPtr = _lookup< + late final _wire__crate__api__node__ldk_node_network_graphPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - 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)>(); + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_network_graph'); + late final _wire__crate__api__node__ldk_node_network_graph = + _wire__crate__api__node__ldk_node_network_graphPtr + .asFunction)>(); - void wire_ldk_node_send_payment_probes( + void wire__crate__api__node__ldk_node_next_event( int port_, ffi.Pointer that, - ffi.Pointer invoice, ) { - return _wire_ldk_node_send_payment_probes( + return _wire__crate__api__node__ldk_node_next_event( port_, that, - invoice, ); } - late final _wire_ldk_node_send_payment_probesPtr = _lookup< + late final _wire__crate__api__node__ldk_node_next_eventPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - 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)>(); + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_next_event'); + late final _wire__crate__api__node__ldk_node_next_event = + _wire__crate__api__node__ldk_node_next_eventPtr + .asFunction)>(); - void wire_ldk_node_send_payment_probes_using_amount( + void wire__crate__api__node__ldk_node_next_event_async( int port_, ffi.Pointer that, - ffi.Pointer invoice, - int amount_msat, ) { - return _wire_ldk_node_send_payment_probes_using_amount( + return _wire__crate__api__node__ldk_node_next_event_async( port_, that, - invoice, - amount_msat, ); } - late final _wire_ldk_node_send_payment_probes_using_amountPtr = _lookup< + late final _wire__crate__api__node__ldk_node_next_event_asyncPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - ffi.Pointer, ffi.Uint64)>>( - '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)>(); + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_next_event_async'); + late final _wire__crate__api__node__ldk_node_next_event_async = + _wire__crate__api__node__ldk_node_next_event_asyncPtr + .asFunction)>(); - void wire_ldk_node_send_payment_using_amount( + void wire__crate__api__node__ldk_node_node_id( int port_, ffi.Pointer that, - ffi.Pointer invoice, - int amount_msat, ) { - return _wire_ldk_node_send_payment_using_amount( + return _wire__crate__api__node__ldk_node_node_id( port_, that, - invoice, - amount_msat, ); } - late final _wire_ldk_node_send_payment_using_amountPtr = _lookup< + late final _wire__crate__api__node__ldk_node_node_idPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - ffi.Pointer, ffi.Uint64)>>( - '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)>(); + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_node_id'); + late final _wire__crate__api__node__ldk_node_node_id = + _wire__crate__api__node__ldk_node_node_idPtr + .asFunction)>(); - void wire_ldk_node_send_spontaneous_payment( + void wire__crate__api__node__ldk_node_on_chain_payment( int port_, - ffi.Pointer that, - int amount_msat, - ffi.Pointer node_id, + ffi.Pointer ptr, ) { - return _wire_ldk_node_send_spontaneous_payment( + return _wire__crate__api__node__ldk_node_on_chain_payment( port_, - that, - amount_msat, - node_id, + ptr, ); } - late final _wire_ldk_node_send_spontaneous_paymentPtr = _lookup< + late final _wire__crate__api__node__ldk_node_on_chain_paymentPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, - ffi.Uint64, ffi.Pointer)>>( - '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)>(); + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_on_chain_payment'); + late final _wire__crate__api__node__ldk_node_on_chain_payment = + _wire__crate__api__node__ldk_node_on_chain_paymentPtr + .asFunction)>(); - void wire_ldk_node_send_spontaneous_payment_probes( + void wire__crate__api__node__ldk_node_payment( int port_, ffi.Pointer that, - int amount_msat, - ffi.Pointer node_id, + ffi.Pointer payment_id, ) { - return _wire_ldk_node_send_spontaneous_payment_probes( + return _wire__crate__api__node__ldk_node_payment( port_, that, - amount_msat, - node_id, + payment_id, ); } - late final _wire_ldk_node_send_spontaneous_payment_probesPtr = _lookup< + late final _wire__crate__api__node__ldk_node_paymentPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Int64, ffi.Pointer, - ffi.Uint64, ffi.Pointer)>>( - '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)>(); + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_payment'); + late final _wire__crate__api__node__ldk_node_payment = + _wire__crate__api__node__ldk_node_paymentPtr.asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer)>(); - void wire_ldk_node_send_to_onchain_address( + void wire__crate__api__node__ldk_node_remove_payment( int port_, ffi.Pointer that, - ffi.Pointer address, - int amount_sats, + ffi.Pointer payment_id, ) { - return _wire_ldk_node_send_to_onchain_address( + return _wire__crate__api__node__ldk_node_remove_payment( port_, that, - address, - amount_sats, + payment_id, ); } - late final _wire_ldk_node_send_to_onchain_addressPtr = _lookup< + late final _wire__crate__api__node__ldk_node_remove_paymentPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Int64, ffi.Pointer, - ffi.Pointer, ffi.Uint64)>>( - '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< + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_remove_payment'); + late final _wire__crate__api__node__ldk_node_remove_payment = + _wire__crate__api__node__ldk_node_remove_paymentPtr.asFunction< void Function(int, ffi.Pointer, - ffi.Pointer, int)>(); + ffi.Pointer)>(); - void wire_ldk_node_sign_message( + void wire__crate__api__node__ldk_node_sign_message( int port_, ffi.Pointer that, ffi.Pointer msg, ) { - return _wire_ldk_node_sign_message( + return _wire__crate__api__node__ldk_node_sign_message( port_, that, msg, ); } - late final _wire_ldk_node_sign_messagePtr = _lookup< + late final _wire__crate__api__node__ldk_node_sign_messagePtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Int64, ffi.Pointer, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_ldk_node_sign_message'); - late final _wire_ldk_node_sign_message = - _wire_ldk_node_sign_messagePtr.asFunction< + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_sign_message'); + late final _wire__crate__api__node__ldk_node_sign_message = + _wire__crate__api__node__ldk_node_sign_messagePtr.asFunction< void Function(int, ffi.Pointer, ffi.Pointer)>(); - void wire_ldk_node_spendable_onchain_balance_sats( + void wire__crate__api__node__ldk_node_spontaneous_payment( int port_, - ffi.Pointer that, + ffi.Pointer ptr, ) { - return _wire_ldk_node_spendable_onchain_balance_sats( + return _wire__crate__api__node__ldk_node_spontaneous_payment( port_, - that, + ptr, ); } - late final _wire_ldk_node_spendable_onchain_balance_satsPtr = _lookup< + late final _wire__crate__api__node__ldk_node_spontaneous_paymentPtr = _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 + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_spontaneous_payment'); + late final _wire__crate__api__node__ldk_node_spontaneous_payment = + _wire__crate__api__node__ldk_node_spontaneous_paymentPtr .asFunction)>(); - void wire_ldk_node_start( + void wire__crate__api__node__ldk_node_start( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_start( + return _wire__crate__api__node__ldk_node_start( port_, that, ); } - late final _wire_ldk_node_startPtr = _lookup< + late final _wire__crate__api__node__ldk_node_startPtr = _lookup< ffi.NativeFunction< 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)>(); + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_start'); + late final _wire__crate__api__node__ldk_node_start = + _wire__crate__api__node__ldk_node_startPtr + .asFunction)>(); - void wire_ldk_node_stop( + void wire__crate__api__node__ldk_node_status( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_stop( + return _wire__crate__api__node__ldk_node_status( port_, that, ); } - late final _wire_ldk_node_stopPtr = _lookup< + late final _wire__crate__api__node__ldk_node_statusPtr = _lookup< ffi.NativeFunction< 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)>(); + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_status'); + late final _wire__crate__api__node__ldk_node_status = + _wire__crate__api__node__ldk_node_statusPtr + .asFunction)>(); - void wire_ldk_node_sync_wallets( + void wire__crate__api__node__ldk_node_stop( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_sync_wallets( + return _wire__crate__api__node__ldk_node_stop( port_, that, ); } - late final _wire_ldk_node_sync_walletsPtr = _lookup< + late final _wire__crate__api__node__ldk_node_stopPtr = _lookup< ffi.NativeFunction< 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)>(); + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_stop'); + late final _wire__crate__api__node__ldk_node_stop = + _wire__crate__api__node__ldk_node_stopPtr + .asFunction)>(); - void wire_ldk_node_total_onchain_balance_sats( + void wire__crate__api__node__ldk_node_sync_wallets( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_total_onchain_balance_sats( + return _wire__crate__api__node__ldk_node_sync_wallets( port_, that, ); } - late final _wire_ldk_node_total_onchain_balance_satsPtr = _lookup< + late final _wire__crate__api__node__ldk_node_sync_walletsPtr = _lookup< ffi.NativeFunction< 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 + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_sync_wallets'); + late final _wire__crate__api__node__ldk_node_sync_wallets = + _wire__crate__api__node__ldk_node_sync_walletsPtr .asFunction)>(); - void wire_ldk_node_update_channel_config( + void wire__crate__api__node__ldk_node_update_channel_config( int port_, ffi.Pointer that, - ffi.Pointer channel_id, + ffi.Pointer user_channel_id, ffi.Pointer counterparty_node_id, ffi.Pointer channel_config, ) { - return _wire_ldk_node_update_channel_config( + return _wire__crate__api__node__ldk_node_update_channel_config( port_, that, - channel_id, + user_channel_id, counterparty_node_id, channel_config, ); } - late final _wire_ldk_node_update_channel_configPtr = _lookup< + late final _wire__crate__api__node__ldk_node_update_channel_configPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Int64, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_ldk_node_update_channel_config'); - late final _wire_ldk_node_update_channel_config = - _wire_ldk_node_update_channel_configPtr.asFunction< + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_update_channel_config'); + late final _wire__crate__api__node__ldk_node_update_channel_config = + _wire__crate__api__node__ldk_node_update_channel_configPtr.asFunction< void Function( int, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - void wire_ldk_node_verify_signature( + void wire__crate__api__node__ldk_node_verify_signature( int port_, ffi.Pointer that, ffi.Pointer msg, ffi.Pointer sig, - ffi.Pointer pkey, + ffi.Pointer public_key, ) { - return _wire_ldk_node_verify_signature( + return _wire__crate__api__node__ldk_node_verify_signature( port_, that, msg, sig, - pkey, + public_key, ); } - late final _wire_ldk_node_verify_signaturePtr = _lookup< + late final _wire__crate__api__node__ldk_node_verify_signaturePtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Int64, @@ -2621,9 +5509,9 @@ class LdkCoreWire implements BaseWire { ffi.Pointer, ffi.Pointer, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_ldk_node_verify_signature'); - late final _wire_ldk_node_verify_signature = - _wire_ldk_node_verify_signaturePtr.asFunction< + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_verify_signature'); + late final _wire__crate__api__node__ldk_node_verify_signature = + _wire__crate__api__node__ldk_node_verify_signaturePtr.asFunction< void Function( int, ffi.Pointer, @@ -2631,88 +5519,402 @@ class LdkCoreWire implements BaseWire { ffi.Pointer, ffi.Pointer)>(); - void wire_ldk_node_wait_next_event( + void wire__crate__api__node__ldk_node_wait_next_event( int port_, ffi.Pointer that, ) { - return _wire_ldk_node_wait_next_event( + return _wire__crate__api__node__ldk_node_wait_next_event( port_, that, ); } - late final _wire_ldk_node_wait_next_eventPtr = _lookup< + late final _wire__crate__api__node__ldk_node_wait_next_eventPtr = _lookup< ffi.NativeFunction< 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)>(); + 'frbgen_ldk_node_wire__crate__api__node__ldk_node_wait_next_event'); + late final _wire__crate__api__node__ldk_node_wait_next_event = + _wire__crate__api__node__ldk_node_wait_next_eventPtr + .asFunction)>(); - void wire_socket_address_as_string( + void wire__crate__api__on_chain__ldk_on_chain_payment_new_address( int port_, - ffi.Pointer that, + ffi.Pointer that, ) { - return _wire_socket_address_as_string( + return _wire__crate__api__on_chain__ldk_on_chain_payment_new_address( port_, that, ); } - late final _wire_socket_address_as_stringPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - 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)>(); + late final _wire__crate__api__on_chain__ldk_on_chain_payment_new_addressPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_new_address'); + late final _wire__crate__api__on_chain__ldk_on_chain_payment_new_address = + _wire__crate__api__on_chain__ldk_on_chain_payment_new_addressPtr + .asFunction< + void Function(int, ffi.Pointer)>(); - void wire_socket_address_from_str( + void wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address( int port_, - ffi.Pointer address, + ffi.Pointer that, + ffi.Pointer address, ) { - return _wire_socket_address_from_str( + return _wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address( port_, + that, 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)>(); + late final _wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_addressPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address'); + late final _wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address = + _wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_addressPtr + .asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer)>(); + + void wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address( + int port_, + ffi.Pointer that, + ffi.Pointer address, + int amount_sats, + ) { + return _wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address( + port_, + that, + address, + amount_sats, + ); + } + + late final _wire__crate__api__on_chain__ldk_on_chain_payment_send_to_addressPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Uint64)>>( + 'frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address'); + late final _wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address = + _wire__crate__api__on_chain__ldk_on_chain_payment_send_to_addressPtr + .asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer, int)>(); + + void wire__crate__api__spontaneous__ldk_spontaneous_payment_send( + int port_, + ffi.Pointer that, + int amount_msat, + ffi.Pointer node_id, + ) { + return _wire__crate__api__spontaneous__ldk_spontaneous_payment_send( + port_, + that, + amount_msat, + node_id, + ); + } + + late final _wire__crate__api__spontaneous__ldk_spontaneous_payment_sendPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Uint64, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__spontaneous__ldk_spontaneous_payment_send'); + late final _wire__crate__api__spontaneous__ldk_spontaneous_payment_send = + _wire__crate__api__spontaneous__ldk_spontaneous_payment_sendPtr + .asFunction< + void Function(int, ffi.Pointer, + int, ffi.Pointer)>(); + + void wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes( + int port_, + ffi.Pointer that, + int amount_msat, + ffi.Pointer node_id, + ) { + return _wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes( + port_, + that, + amount_msat, + node_id, + ); + } + + late final _wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probesPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Uint64, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes'); + late final _wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes = + _wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probesPtr + .asFunction< + void Function(int, ffi.Pointer, + int, ffi.Pointer)>(); + + void + rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12PaymentPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment'); + late final _rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment = + _rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12PaymentPtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12PaymentPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment'); + late final _rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment = + _rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12PaymentPtr + .asFunction)>(); + + void rust_arc_increment_strong_count_RustOpaque_Node( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_Node( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_NodePtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_Node'); + late final _rust_arc_increment_strong_count_RustOpaque_Node = + _rust_arc_increment_strong_count_RustOpaque_NodePtr + .asFunction)>(); + + void rust_arc_decrement_strong_count_RustOpaque_Node( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_Node( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_NodePtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_Node'); + late final _rust_arc_decrement_strong_count_RustOpaque_Node = + _rust_arc_decrement_strong_count_RustOpaque_NodePtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilderPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder'); + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder = + _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilderPtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilderPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder'); + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder = + _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilderPtr + .asFunction)>(); + + void rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilder( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilder( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilderPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilder'); + late final _rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilder = + _rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilderPtr + .asFunction)>(); + + void rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilder( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilder( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilderPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilder'); + late final _rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilder = + _rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilderPtr + .asFunction)>(); + + void rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraph( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraph( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraphPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraph'); + late final _rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraph = + _rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraphPtr + .asFunction)>(); + + void rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraph( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraph( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraphPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraph'); + late final _rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraph = + _rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraphPtr + .asFunction)>(); + + void rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( + ptr, + ); + } - void rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore( + late final _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11PaymentPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment'); + late final _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment = + _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11PaymentPtr + .asFunction)>(); + + void rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11PaymentPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment'); + late final _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment = + _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11PaymentPtr + .asFunction)>(); + + void rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPaymentPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment'); + late final _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment = + _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPaymentPtr + .asFunction)>(); + + void rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPaymentPtr = + _lookup)>>( + 'frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment'); + late final _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment = + _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPaymentPtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( ffi.Pointer ptr, ) { - return _rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore( + return _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( ptr, ); } - late final _rust_arc_increment_strong_count_RustOpaque_NodeSqliteStorePtr = + late final _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPaymentPtr = _lookup)>>( - 'frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore'); - late final _rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore = - _rust_arc_increment_strong_count_RustOpaque_NodeSqliteStorePtr + 'frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment'); + late final _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment = + _rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPaymentPtr .asFunction)>(); - void rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore( + void + rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( ffi.Pointer ptr, ) { - return _rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore( + return _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( ptr, ); } - late final _rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStorePtr = + late final _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPaymentPtr = _lookup)>>( - 'frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore'); - late final _rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore = - _rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStorePtr + 'frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment'); + late final _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment = + _rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPaymentPtr .asFunction)>(); ffi.Pointer cst_new_box_autoadd_address() { @@ -2725,6 +5927,19 @@ class LdkCoreWire implements BaseWire { late final _cst_new_box_autoadd_address = _cst_new_box_autoadd_addressPtr .asFunction Function()>(); + ffi.Pointer + cst_new_box_autoadd_anchor_channels_config() { + return _cst_new_box_autoadd_anchor_channels_config(); + } + + late final _cst_new_box_autoadd_anchor_channels_configPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_anchor_channels_config'); + late final _cst_new_box_autoadd_anchor_channels_config = + _cst_new_box_autoadd_anchor_channels_configPtr.asFunction< + ffi.Pointer Function()>(); + ffi.Pointer cst_new_box_autoadd_bolt_11_invoice() { return _cst_new_box_autoadd_bolt_11_invoice(); } @@ -2736,6 +5951,19 @@ class LdkCoreWire implements BaseWire { _cst_new_box_autoadd_bolt_11_invoicePtr .asFunction Function()>(); + ffi.Pointer + cst_new_box_autoadd_bolt_12_parse_error() { + return _cst_new_box_autoadd_bolt_12_parse_error(); + } + + late final _cst_new_box_autoadd_bolt_12_parse_errorPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_bolt_12_parse_error'); + late final _cst_new_box_autoadd_bolt_12_parse_error = + _cst_new_box_autoadd_bolt_12_parse_errorPtr + .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_chain_data_source_config() { return _cst_new_box_autoadd_chain_data_source_config(); @@ -2771,6 +5999,41 @@ class LdkCoreWire implements BaseWire { _cst_new_box_autoadd_channel_idPtr .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_channel_info() { + return _cst_new_box_autoadd_channel_info(); + } + + late final _cst_new_box_autoadd_channel_infoPtr = _lookup< + ffi.NativeFunction Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_channel_info'); + late final _cst_new_box_autoadd_channel_info = + _cst_new_box_autoadd_channel_infoPtr + .asFunction Function()>(); + + ffi.Pointer + cst_new_box_autoadd_channel_update_info() { + return _cst_new_box_autoadd_channel_update_info(); + } + + late final _cst_new_box_autoadd_channel_update_infoPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_channel_update_info'); + late final _cst_new_box_autoadd_channel_update_info = + _cst_new_box_autoadd_channel_update_infoPtr + .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(); } @@ -2781,6 +6044,17 @@ class LdkCoreWire implements BaseWire { late final _cst_new_box_autoadd_config = _cst_new_box_autoadd_configPtr .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_decode_error() { + return _cst_new_box_autoadd_decode_error(); + } + + late final _cst_new_box_autoadd_decode_errorPtr = _lookup< + ffi.NativeFunction Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_decode_error'); + late final _cst_new_box_autoadd_decode_error = + _cst_new_box_autoadd_decode_errorPtr + .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_entropy_source_config() { return _cst_new_box_autoadd_entropy_source_config(); @@ -2809,13 +6083,39 @@ class LdkCoreWire implements BaseWire { return _cst_new_box_autoadd_gossip_source_config(); } - late final _cst_new_box_autoadd_gossip_source_configPtr = _lookup< + late final _cst_new_box_autoadd_gossip_source_configPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_gossip_source_config'); + late final _cst_new_box_autoadd_gossip_source_config = + _cst_new_box_autoadd_gossip_source_configPtr + .asFunction Function()>(); + + ffi.Pointer + cst_new_box_autoadd_ldk_bolt_11_payment() { + return _cst_new_box_autoadd_ldk_bolt_11_payment(); + } + + late final _cst_new_box_autoadd_ldk_bolt_11_paymentPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_ldk_bolt_11_payment'); + late final _cst_new_box_autoadd_ldk_bolt_11_payment = + _cst_new_box_autoadd_ldk_bolt_11_paymentPtr + .asFunction Function()>(); + + ffi.Pointer + cst_new_box_autoadd_ldk_bolt_12_payment() { + return _cst_new_box_autoadd_ldk_bolt_12_payment(); + } + + late final _cst_new_box_autoadd_ldk_bolt_12_paymentPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function()>>( - 'frbgen_ldk_node_cst_new_box_autoadd_gossip_source_config'); - late final _cst_new_box_autoadd_gossip_source_config = - _cst_new_box_autoadd_gossip_source_configPtr - .asFunction Function()>(); + ffi.Pointer Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_ldk_bolt_12_payment'); + late final _cst_new_box_autoadd_ldk_bolt_12_payment = + _cst_new_box_autoadd_ldk_bolt_12_paymentPtr + .asFunction Function()>(); ffi.Pointer cst_new_box_autoadd_ldk_mnemonic() { return _cst_new_box_autoadd_ldk_mnemonic(); @@ -2828,6 +6128,19 @@ class LdkCoreWire implements BaseWire { _cst_new_box_autoadd_ldk_mnemonicPtr .asFunction Function()>(); + ffi.Pointer + cst_new_box_autoadd_ldk_network_graph() { + return _cst_new_box_autoadd_ldk_network_graph(); + } + + late final _cst_new_box_autoadd_ldk_network_graphPtr = _lookup< + ffi + .NativeFunction Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_ldk_network_graph'); + late final _cst_new_box_autoadd_ldk_network_graph = + _cst_new_box_autoadd_ldk_network_graphPtr + .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_ldk_node() { return _cst_new_box_autoadd_ldk_node(); } @@ -2838,6 +6151,122 @@ class LdkCoreWire implements BaseWire { late final _cst_new_box_autoadd_ldk_node = _cst_new_box_autoadd_ldk_nodePtr .asFunction Function()>(); + ffi.Pointer + cst_new_box_autoadd_ldk_on_chain_payment() { + return _cst_new_box_autoadd_ldk_on_chain_payment(); + } + + late final _cst_new_box_autoadd_ldk_on_chain_paymentPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_ldk_on_chain_payment'); + late final _cst_new_box_autoadd_ldk_on_chain_payment = + _cst_new_box_autoadd_ldk_on_chain_paymentPtr + .asFunction Function()>(); + + ffi.Pointer + cst_new_box_autoadd_ldk_spontaneous_payment() { + return _cst_new_box_autoadd_ldk_spontaneous_payment(); + } + + late final _cst_new_box_autoadd_ldk_spontaneous_paymentPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_ldk_spontaneous_payment'); + late final _cst_new_box_autoadd_ldk_spontaneous_payment = + _cst_new_box_autoadd_ldk_spontaneous_paymentPtr.asFunction< + ffi.Pointer 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_lsp_fee_limits() { + return _cst_new_box_autoadd_lsp_fee_limits(); + } + + late final _cst_new_box_autoadd_lsp_fee_limitsPtr = _lookup< + ffi.NativeFunction Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_lsp_fee_limits'); + late final _cst_new_box_autoadd_lsp_fee_limits = + _cst_new_box_autoadd_lsp_fee_limitsPtr + .asFunction 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_node_announcement_info() { + return _cst_new_box_autoadd_node_announcement_info(); + } + + late final _cst_new_box_autoadd_node_announcement_infoPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_node_announcement_info'); + late final _cst_new_box_autoadd_node_announcement_info = + _cst_new_box_autoadd_node_announcement_infoPtr.asFunction< + ffi.Pointer Function()>(); + + ffi.Pointer cst_new_box_autoadd_node_id() { + return _cst_new_box_autoadd_node_id(); + } + + late final _cst_new_box_autoadd_node_idPtr = + _lookup Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_node_id'); + late final _cst_new_box_autoadd_node_id = _cst_new_box_autoadd_node_idPtr + .asFunction Function()>(); + + ffi.Pointer cst_new_box_autoadd_node_info() { + return _cst_new_box_autoadd_node_info(); + } + + late final _cst_new_box_autoadd_node_infoPtr = + _lookup Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_node_info'); + late final _cst_new_box_autoadd_node_info = _cst_new_box_autoadd_node_infoPtr + .asFunction Function()>(); + + ffi.Pointer cst_new_box_autoadd_offer() { + return _cst_new_box_autoadd_offer(); + } + + late final _cst_new_box_autoadd_offerPtr = + _lookup Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_offer'); + late final _cst_new_box_autoadd_offer = _cst_new_box_autoadd_offerPtr + .asFunction Function()>(); + + ffi.Pointer cst_new_box_autoadd_offer_id() { + return _cst_new_box_autoadd_offer_id(); + } + + late final _cst_new_box_autoadd_offer_idPtr = + _lookup Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_offer_id'); + late final _cst_new_box_autoadd_offer_id = _cst_new_box_autoadd_offer_idPtr + .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_out_point() { return _cst_new_box_autoadd_out_point(); } @@ -2859,6 +6288,21 @@ 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(); } @@ -2870,6 +6314,17 @@ class LdkCoreWire implements BaseWire { _cst_new_box_autoadd_payment_hashPtr .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_payment_id() { + return _cst_new_box_autoadd_payment_id(); + } + + late final _cst_new_box_autoadd_payment_idPtr = + _lookup Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_payment_id'); + late final _cst_new_box_autoadd_payment_id = + _cst_new_box_autoadd_payment_idPtr + .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_payment_preimage() { return _cst_new_box_autoadd_payment_preimage(); @@ -2905,6 +6360,16 @@ class LdkCoreWire implements BaseWire { _cst_new_box_autoadd_public_keyPtr .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_refund() { + return _cst_new_box_autoadd_refund(); + } + + late final _cst_new_box_autoadd_refundPtr = + _lookup Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_refund'); + late final _cst_new_box_autoadd_refund = _cst_new_box_autoadd_refundPtr + .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_socket_address() { return _cst_new_box_autoadd_socket_address(); } @@ -2916,6 +6381,30 @@ 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, ) { @@ -2970,6 +6459,37 @@ 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_node_id( + int len, + ) { + return _cst_new_list_node_id( + len, + ); + } + + late final _cst_new_list_node_idPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Int32)>>('frbgen_ldk_node_cst_new_list_node_id'); + late final _cst_new_list_node_id = _cst_new_list_node_idPtr + .asFunction Function(int)>(); + ffi.Pointer cst_new_list_payment_details( int len, ) { @@ -3000,6 +6520,39 @@ 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_64_strict( + int len, + ) { + return _cst_new_list_prim_u_64_strict( + len, + ); + } + + late final _cst_new_list_prim_u_64_strictPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Int32)>>('frbgen_ldk_node_cst_new_list_prim_u_64_strict'); + late final _cst_new_list_prim_u_64_strict = _cst_new_list_prim_u_64_strictPtr + .asFunction Function(int)>(); + ffi.Pointer cst_new_list_prim_u_8_loose( int len, ) { @@ -3071,10 +6624,19 @@ class LdkCoreWire implements BaseWire { _dummy_method_to_enforce_bundlingPtr.asFunction(); } -typedef DartPostCObjectFnType = ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function(DartPort port_id, ffi.Pointer message)>>; +typedef DartPostCObjectFnType + = ffi.Pointer>; +typedef DartPostCObjectFnTypeFunction = ffi.Bool Function( + DartPort port_id, ffi.Pointer message); +typedef DartDartPostCObjectFnTypeFunction = bool Function( + DartDartPort port_id, ffi.Pointer message); typedef DartPort = ffi.Int64; +typedef DartDartPort = int; + +final class wire_cst_ldk_bolt_11_payment extends ffi.Struct { + @ffi.UintPtr() + external int ptr; +} final class wire_cst_list_prim_u_8_strict extends ffi.Struct { external ffi.Pointer ptr; @@ -3083,6 +6645,31 @@ final class wire_cst_list_prim_u_8_strict extends ffi.Struct { external int len; } +final class wire_cst_payment_hash extends ffi.Struct { + external ffi.Pointer data; +} + +final class wire_cst_payment_preimage extends ffi.Struct { + external ffi.Pointer data; +} + +final class wire_cst_bolt_11_invoice extends ffi.Struct { + external ffi.Pointer signed_raw_invoice; +} + +final class wire_cst_ldk_bolt_12_payment extends ffi.Struct { + @ffi.UintPtr() + external int ptr; +} + +final class wire_cst_refund extends ffi.Struct { + external ffi.Pointer s; +} + +final class wire_cst_offer extends ffi.Struct { + external ffi.Pointer s; +} + final class wire_cst_SocketAddress_TcpIpV4 extends ffi.Struct { external ffi.Pointer addr; @@ -3158,6 +6745,13 @@ final class wire_cst_list_public_key extends ffi.Struct { external int len; } +final class wire_cst_anchor_channels_config extends ffi.Struct { + external ffi.Pointer trusted_peers_no_reserve; + + @ffi.Uint64() + external int per_channel_reserve_sats; +} + final class wire_cst_config extends ffi.Struct { external ffi.Pointer storage_dir_path; @@ -3187,6 +6781,8 @@ final class wire_cst_config extends ffi.Struct { @ffi.Int32() external int log_level; + + external ffi.Pointer anchor_channels_config; } final class wire_cst_ChainDataSourceConfig_Esplora extends ffi.Struct { @@ -3252,12 +6848,34 @@ 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_network_graph extends ffi.Struct { + @ffi.UintPtr() + external int ptr; +} + +final class wire_cst_node_id extends ffi.Struct { + external ffi.Pointer compressed; +} + final class wire_cst_ldk_node extends ffi.Struct { @ffi.UintPtr() external int ptr; } -final class wire_cst_channel_id extends ffi.Struct { +final class wire_cst_user_channel_id extends ffi.Struct { external ffi.Pointer data; } @@ -3294,7 +6912,7 @@ final class wire_cst_channel_config extends ffi.Struct { @ffi.Uint16() external int cltv_expiry_delta; - external wire_cst_max_dust_htlc_exposure max_dust_htlc_exposure; + external ffi.Pointer max_dust_htlc_exposure; @ffi.Uint64() external int force_close_avoidance_max_fee_satoshis; @@ -3303,59 +6921,178 @@ final class wire_cst_channel_config extends ffi.Struct { external bool accept_underpaying_htlcs; } -final class wire_cst_payment_hash extends ffi.Struct { - external ffi.Pointer data; +final class wire_cst_payment_id extends ffi.Struct { + external ffi.Pointer field0; +} + +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_ldk_on_chain_payment extends ffi.Struct { + @ffi.UintPtr() + external int ptr; } 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_ldk_spontaneous_payment extends ffi.Struct { + @ffi.UintPtr() + external int ptr; } -final class wire_cst_list_prim_u_8_loose extends ffi.Struct { - external ffi.Pointer ptr; +final class wire_cst_Bolt12ParseError_Bech32 extends ffi.Struct { + external ffi.Pointer field0; +} + +final class wire_cst_DecodeError_Io extends ffi.Struct { + external ffi.Pointer field0; +} + +final class DecodeErrorKind extends ffi.Union { + external wire_cst_DecodeError_Io Io; +} +final class wire_cst_decode_error extends ffi.Struct { @ffi.Int32() - external int len; + external int tag; + + external DecodeErrorKind kind; } -final class wire_cst_Event_PaymentSuccessful extends ffi.Struct { - external ffi.Pointer payment_hash; +final class wire_cst_Bolt12ParseError_Decode extends ffi.Struct { + external ffi.Pointer field0; } -final class wire_cst_Event_PaymentFailed extends ffi.Struct { - external ffi.Pointer payment_hash; +final class wire_cst_Bolt12ParseError_InvalidSemantics extends ffi.Struct { + external ffi.Pointer field0; } -final class wire_cst_Event_PaymentReceived extends ffi.Struct { - external ffi.Pointer payment_hash; +final class wire_cst_Bolt12ParseError_InvalidSignature extends ffi.Struct { + external ffi.Pointer field0; +} + +final class Bolt12ParseErrorKind extends ffi.Union { + external wire_cst_Bolt12ParseError_Bech32 Bech32; + + external wire_cst_Bolt12ParseError_Decode Decode; + + external wire_cst_Bolt12ParseError_InvalidSemantics InvalidSemantics; + + external wire_cst_Bolt12ParseError_InvalidSignature InvalidSignature; +} + +final class wire_cst_bolt_12_parse_error extends ffi.Struct { + @ffi.Int32() + external int tag; + + external Bolt12ParseErrorKind kind; +} + +final class wire_cst_channel_id extends ffi.Struct { + external ffi.Pointer data; +} + +final class wire_cst_routing_fees extends ffi.Struct { + @ffi.Uint32() + external int base_msat; + + @ffi.Uint32() + external int proportional_millionths; +} + +final class wire_cst_channel_update_info extends ffi.Struct { + @ffi.Uint32() + external int last_update; + + @ffi.Bool() + external bool enabled; + + @ffi.Uint16() + external int cltv_expiry_delta; @ffi.Uint64() - external int amount_msat; + external int htlc_minimum_msat; + + @ffi.Uint64() + external int htlc_maximum_msat; + + external wire_cst_routing_fees fees; } -final class wire_cst_user_channel_id extends ffi.Struct { +final class wire_cst_channel_info extends ffi.Struct { + external wire_cst_node_id node_one; + + external ffi.Pointer one_to_two; + + external wire_cst_node_id node_two; + + external ffi.Pointer two_to_one; + + external ffi.Pointer capacity_sats; +} + +final class wire_cst_ClosureReason_CounterpartyForceClosed extends ffi.Struct { + external ffi.Pointer peer_msg; +} + +final class wire_cst_ClosureReason_ProcessingError extends ffi.Struct { + external ffi.Pointer err; +} + +final class ClosureReasonKind extends ffi.Union { + external wire_cst_ClosureReason_CounterpartyForceClosed + CounterpartyForceClosed; + + external wire_cst_ClosureReason_ProcessingError ProcessingError; +} + +final class wire_cst_closure_reason extends ffi.Struct { + @ffi.Int32() + external int tag; + + external ClosureReasonKind kind; +} + +final class wire_cst_Event_PaymentClaimable extends ffi.Struct { + external ffi.Pointer payment_id; + + external ffi.Pointer payment_hash; + @ffi.Uint64() - external int data; + external int claimable_amount_msat; + + external ffi.Pointer claim_deadline; } -final class wire_cst_Event_ChannelReady extends ffi.Struct { - external ffi.Pointer channel_id; +final class wire_cst_Event_PaymentSuccessful extends ffi.Struct { + external ffi.Pointer payment_id; - external ffi.Pointer user_channel_id; + external ffi.Pointer payment_hash; - external ffi.Pointer counterparty_node_id; + external ffi.Pointer fee_paid_msat; } -final class wire_cst_Event_ChannelClosed extends ffi.Struct { - external ffi.Pointer channel_id; +final class wire_cst_Event_PaymentFailed extends ffi.Struct { + external ffi.Pointer payment_id; - external ffi.Pointer user_channel_id; + external ffi.Pointer payment_hash; - external ffi.Pointer counterparty_node_id; + external ffi.Pointer reason; +} + +final class wire_cst_Event_PaymentReceived extends ffi.Struct { + external ffi.Pointer payment_id; + + external ffi.Pointer payment_hash; + + @ffi.Uint64() + external int amount_msat; } final class wire_cst_txid extends ffi.Struct { @@ -3381,18 +7118,38 @@ final class wire_cst_Event_ChannelPending extends ffi.Struct { external ffi.Pointer funding_txo; } +final class wire_cst_Event_ChannelReady extends ffi.Struct { + external ffi.Pointer channel_id; + + external ffi.Pointer user_channel_id; + + external ffi.Pointer counterparty_node_id; +} + +final class wire_cst_Event_ChannelClosed extends ffi.Struct { + external ffi.Pointer channel_id; + + external ffi.Pointer user_channel_id; + + external ffi.Pointer counterparty_node_id; + + external ffi.Pointer reason; +} + final class EventKind extends ffi.Union { + external wire_cst_Event_PaymentClaimable PaymentClaimable; + external wire_cst_Event_PaymentSuccessful PaymentSuccessful; external wire_cst_Event_PaymentFailed PaymentFailed; 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 { @@ -3402,20 +7159,107 @@ final class wire_cst_event extends ffi.Struct { external EventKind kind; } -final class wire_cst_payment_preimage extends ffi.Struct { - external ffi.Pointer data; +final class wire_cst_lsp_fee_limits extends ffi.Struct { + external ffi.Pointer max_total_opening_fee_msat; + + external ffi.Pointer max_proportional_opening_fee_ppm_msat; +} + +final class wire_cst_node_announcement_info extends ffi.Struct { + @ffi.Uint32() + external int last_update; + + external ffi.Pointer alias; + + external ffi.Pointer addresses; +} + +final class wire_cst_list_prim_u_64_strict extends ffi.Struct { + external ffi.Pointer ptr; + + @ffi.Int32() + external int len; +} + +final class wire_cst_node_info extends ffi.Struct { + external ffi.Pointer channels; + + external ffi.Pointer announcement_info; +} + +final class wire_cst_offer_id extends ffi.Struct { + external ffi.Pointer field0; } final class wire_cst_payment_secret extends ffi.Struct { external ffi.Pointer data; } -final class wire_cst_payment_details extends ffi.Struct { - external wire_cst_payment_hash hash; +final class wire_cst_PaymentKind_Bolt11 extends ffi.Struct { + external ffi.Pointer hash; + + external ffi.Pointer preimage; + + external ffi.Pointer secret; +} + +final class wire_cst_PaymentKind_Bolt11Jit extends ffi.Struct { + external ffi.Pointer hash; + + external ffi.Pointer preimage; + + external ffi.Pointer secret; + + external ffi.Pointer lsp_fee_limits; +} + +final class wire_cst_PaymentKind_Spontaneous extends ffi.Struct { + external ffi.Pointer hash; + + external ffi.Pointer preimage; +} + +final class wire_cst_PaymentKind_Bolt12Offer extends ffi.Struct { + external ffi.Pointer hash; + + external ffi.Pointer preimage; + + external ffi.Pointer secret; + + external ffi.Pointer offer_id; +} + +final class wire_cst_PaymentKind_Bolt12Refund extends ffi.Struct { + external ffi.Pointer hash; external ffi.Pointer preimage; external ffi.Pointer secret; +} + +final class PaymentKindKind extends ffi.Union { + external wire_cst_PaymentKind_Bolt11 Bolt11; + + external wire_cst_PaymentKind_Bolt11Jit Bolt11Jit; + + external wire_cst_PaymentKind_Spontaneous Spontaneous; + + external wire_cst_PaymentKind_Bolt12Offer Bolt12Offer; + + external wire_cst_PaymentKind_Bolt12Refund Bolt12Refund; +} + +final class wire_cst_payment_kind extends ffi.Struct { + @ffi.Int32() + external int tag; + + external PaymentKindKind kind; +} + +final class wire_cst_payment_details extends ffi.Struct { + external wire_cst_payment_id id; + + external wire_cst_payment_kind kind; external ffi.Pointer amount_msat; @@ -3431,7 +7275,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; @@ -3443,9 +7287,6 @@ 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; @@ -3467,6 +7308,38 @@ 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 { @@ -3476,6 +7349,125 @@ 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_node_id 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; @@ -3498,3 +7490,130 @@ 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_bolt_12_invoice extends ffi.Struct { + external ffi.Pointer data; +} + +final class wire_cst_LdkNodeError_Decode extends ffi.Struct { + external ffi.Pointer field0; +} + +final class wire_cst_LdkNodeError_Bolt12Parse extends ffi.Struct { + external ffi.Pointer field0; +} + +final class LdkNodeErrorKind extends ffi.Union { + external wire_cst_LdkNodeError_Decode Decode; + + external wire_cst_LdkNodeError_Bolt12Parse Bolt12Parse; +} + +final class wire_cst_ldk_node_error extends ffi.Struct { + @ffi.Int32() + external int tag; + + external LdkNodeErrorKind kind; +} + +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 deleted file mode 100644 index 7aa410c..0000000 --- a/lib/src/generated/frb_generated.web.dart +++ /dev/null @@ -1,1846 +0,0 @@ -// This file is automatically generated, so please do not edit it. -// 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 - -import 'api/error.dart'; -import 'api/node.dart'; -import 'api/types.dart'; -import 'dart:async'; -import 'dart:convert'; -import 'frb_generated.dart'; -import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated_web.dart'; - -abstract class LdkCoreApiImplPlatform extends BaseApiImpl { - LdkCoreApiImplPlatform({ - required super.handler, - required super.wire, - required super.generalizedFrbRustBinding, - required super.portManager, - }); - - CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_NodeSqliteStorePtr => - wire.rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore; - - @protected - NodeSqliteStore dco_decode_RustOpaque_NodeSqliteStore(dynamic raw); - - @protected - String dco_decode_String(dynamic raw); - - @protected - Address dco_decode_address(dynamic raw); - - @protected - Bolt11Invoice dco_decode_bolt_11_invoice(dynamic raw); - - @protected - bool dco_decode_bool(dynamic raw); - - @protected - Address dco_decode_box_autoadd_address(dynamic raw); - - @protected - Bolt11Invoice dco_decode_box_autoadd_bolt_11_invoice(dynamic raw); - - @protected - ChainDataSourceConfig dco_decode_box_autoadd_chain_data_source_config( - dynamic raw); - - @protected - ChannelConfig dco_decode_box_autoadd_channel_config(dynamic raw); - - @protected - ChannelId dco_decode_box_autoadd_channel_id(dynamic raw); - - @protected - Config dco_decode_box_autoadd_config(dynamic raw); - - @protected - EntropySourceConfig dco_decode_box_autoadd_entropy_source_config(dynamic raw); - - @protected - Event dco_decode_box_autoadd_event(dynamic raw); - - @protected - GossipSourceConfig dco_decode_box_autoadd_gossip_source_config(dynamic raw); - - @protected - LdkMnemonic dco_decode_box_autoadd_ldk_mnemonic(dynamic raw); - - @protected - LdkNode dco_decode_box_autoadd_ldk_node(dynamic raw); - - @protected - OutPoint dco_decode_box_autoadd_out_point(dynamic raw); - - @protected - PaymentDetails dco_decode_box_autoadd_payment_details(dynamic raw); - - @protected - PaymentHash dco_decode_box_autoadd_payment_hash(dynamic raw); - - @protected - PaymentPreimage dco_decode_box_autoadd_payment_preimage(dynamic raw); - - @protected - PaymentSecret dco_decode_box_autoadd_payment_secret(dynamic raw); - - @protected - PublicKey dco_decode_box_autoadd_public_key(dynamic raw); - - @protected - SocketAddress dco_decode_box_autoadd_socket_address(dynamic raw); - - @protected - int dco_decode_box_autoadd_u_32(dynamic raw); - - @protected - int dco_decode_box_autoadd_u_64(dynamic raw); - - @protected - UserChannelId dco_decode_box_autoadd_user_channel_id(dynamic raw); - - @protected - BuilderException dco_decode_builder_exception(dynamic raw); - - @protected - ChainDataSourceConfig dco_decode_chain_data_source_config(dynamic raw); - - @protected - ChannelConfig dco_decode_channel_config(dynamic raw); - - @protected - ChannelDetails dco_decode_channel_details(dynamic raw); - - @protected - ChannelId dco_decode_channel_id(dynamic raw); - - @protected - Config dco_decode_config(dynamic raw); - - @protected - EntropySourceConfig dco_decode_entropy_source_config(dynamic raw); - - @protected - Event dco_decode_event(dynamic raw); - - @protected - GossipSourceConfig dco_decode_gossip_source_config(dynamic raw); - - @protected - int dco_decode_i_32(dynamic raw); - - @protected - LdkMnemonic dco_decode_ldk_mnemonic(dynamic raw); - - @protected - LdkNode dco_decode_ldk_node(dynamic raw); - - @protected - List dco_decode_list_channel_details(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_prim_u_8_loose(dynamic raw); - - @protected - Uint8List dco_decode_list_prim_u_8_strict(dynamic raw); - - @protected - List dco_decode_list_public_key(dynamic raw); - - @protected - List dco_decode_list_socket_address(dynamic raw); - - @protected - LogLevel dco_decode_log_level(dynamic raw); - - @protected - MaxDustHTLCExposure dco_decode_max_dust_htlc_exposure(dynamic raw); - - @protected - Network dco_decode_network(dynamic raw); - - @protected - NodeException dco_decode_node_exception(dynamic raw); - - @protected - String? dco_decode_opt_String(dynamic raw); - - @protected - ChainDataSourceConfig? dco_decode_opt_box_autoadd_chain_data_source_config( - dynamic raw); - - @protected - ChannelConfig? dco_decode_opt_box_autoadd_channel_config(dynamic raw); - - @protected - EntropySourceConfig? dco_decode_opt_box_autoadd_entropy_source_config( - dynamic raw); - - @protected - Event? dco_decode_opt_box_autoadd_event(dynamic raw); - - @protected - GossipSourceConfig? dco_decode_opt_box_autoadd_gossip_source_config( - dynamic raw); - - @protected - PaymentDetails? dco_decode_opt_box_autoadd_payment_details(dynamic raw); - - @protected - PaymentPreimage? dco_decode_opt_box_autoadd_payment_preimage(dynamic raw); - - @protected - PaymentSecret? dco_decode_opt_box_autoadd_payment_secret(dynamic raw); - - @protected - PublicKey? dco_decode_opt_box_autoadd_public_key(dynamic raw); - - @protected - int? dco_decode_opt_box_autoadd_u_32(dynamic raw); - - @protected - int? dco_decode_opt_box_autoadd_u_64(dynamic raw); - - @protected - List? dco_decode_opt_list_socket_address(dynamic raw); - - @protected - OutPoint dco_decode_out_point(dynamic raw); - - @protected - PaymentDetails dco_decode_payment_details(dynamic raw); - - @protected - PaymentDirection dco_decode_payment_direction(dynamic raw); - - @protected - PaymentHash dco_decode_payment_hash(dynamic raw); - - @protected - PaymentPreimage dco_decode_payment_preimage(dynamic raw); - - @protected - PaymentSecret dco_decode_payment_secret(dynamic raw); - - @protected - PaymentStatus dco_decode_payment_status(dynamic raw); - - @protected - PeerDetails dco_decode_peer_details(dynamic raw); - - @protected - PublicKey dco_decode_public_key(dynamic raw); - - @protected - SocketAddress dco_decode_socket_address(dynamic raw); - - @protected - Txid dco_decode_txid(dynamic raw); - - @protected - int dco_decode_u_16(dynamic raw); - - @protected - int dco_decode_u_32(dynamic raw); - - @protected - int dco_decode_u_64(dynamic raw); - - @protected - int dco_decode_u_8(dynamic raw); - - @protected - U8Array12 dco_decode_u_8_array_12(dynamic raw); - - @protected - U8Array16 dco_decode_u_8_array_16(dynamic raw); - - @protected - U8Array32 dco_decode_u_8_array_32(dynamic raw); - - @protected - U8Array4 dco_decode_u_8_array_4(dynamic raw); - - @protected - U8Array64 dco_decode_u_8_array_64(dynamic raw); - - @protected - void dco_decode_unit(dynamic raw); - - @protected - UserChannelId dco_decode_user_channel_id(dynamic raw); - - @protected - int dco_decode_usize(dynamic raw); - - @protected - NodeSqliteStore sse_decode_RustOpaque_NodeSqliteStore( - SseDeserializer deserializer); - - @protected - String sse_decode_String(SseDeserializer deserializer); - - @protected - Address sse_decode_address(SseDeserializer deserializer); - - @protected - Bolt11Invoice sse_decode_bolt_11_invoice(SseDeserializer deserializer); - - @protected - bool sse_decode_bool(SseDeserializer deserializer); - - @protected - Address sse_decode_box_autoadd_address(SseDeserializer deserializer); - - @protected - Bolt11Invoice sse_decode_box_autoadd_bolt_11_invoice( - SseDeserializer deserializer); - - @protected - ChainDataSourceConfig sse_decode_box_autoadd_chain_data_source_config( - SseDeserializer deserializer); - - @protected - ChannelConfig sse_decode_box_autoadd_channel_config( - SseDeserializer deserializer); - - @protected - ChannelId sse_decode_box_autoadd_channel_id(SseDeserializer deserializer); - - @protected - Config sse_decode_box_autoadd_config(SseDeserializer deserializer); - - @protected - EntropySourceConfig sse_decode_box_autoadd_entropy_source_config( - SseDeserializer deserializer); - - @protected - Event sse_decode_box_autoadd_event(SseDeserializer deserializer); - - @protected - GossipSourceConfig sse_decode_box_autoadd_gossip_source_config( - SseDeserializer deserializer); - - @protected - LdkMnemonic sse_decode_box_autoadd_ldk_mnemonic(SseDeserializer deserializer); - - @protected - LdkNode sse_decode_box_autoadd_ldk_node(SseDeserializer deserializer); - - @protected - OutPoint sse_decode_box_autoadd_out_point(SseDeserializer deserializer); - - @protected - PaymentDetails sse_decode_box_autoadd_payment_details( - SseDeserializer deserializer); - - @protected - PaymentHash sse_decode_box_autoadd_payment_hash(SseDeserializer deserializer); - - @protected - PaymentPreimage sse_decode_box_autoadd_payment_preimage( - SseDeserializer deserializer); - - @protected - PaymentSecret sse_decode_box_autoadd_payment_secret( - SseDeserializer deserializer); - - @protected - PublicKey sse_decode_box_autoadd_public_key(SseDeserializer deserializer); - - @protected - SocketAddress sse_decode_box_autoadd_socket_address( - SseDeserializer deserializer); - - @protected - int sse_decode_box_autoadd_u_32(SseDeserializer deserializer); - - @protected - int sse_decode_box_autoadd_u_64(SseDeserializer deserializer); - - @protected - UserChannelId sse_decode_box_autoadd_user_channel_id( - SseDeserializer deserializer); - - @protected - BuilderException sse_decode_builder_exception(SseDeserializer deserializer); - - @protected - ChainDataSourceConfig sse_decode_chain_data_source_config( - SseDeserializer deserializer); - - @protected - ChannelConfig sse_decode_channel_config(SseDeserializer deserializer); - - @protected - ChannelDetails sse_decode_channel_details(SseDeserializer deserializer); - - @protected - ChannelId sse_decode_channel_id(SseDeserializer deserializer); - - @protected - Config sse_decode_config(SseDeserializer deserializer); - - @protected - EntropySourceConfig sse_decode_entropy_source_config( - SseDeserializer deserializer); - - @protected - Event sse_decode_event(SseDeserializer deserializer); - - @protected - GossipSourceConfig sse_decode_gossip_source_config( - SseDeserializer deserializer); - - @protected - int sse_decode_i_32(SseDeserializer deserializer); - - @protected - LdkMnemonic sse_decode_ldk_mnemonic(SseDeserializer deserializer); - - @protected - LdkNode sse_decode_ldk_node(SseDeserializer deserializer); - - @protected - List sse_decode_list_channel_details( - SseDeserializer deserializer); - - @protected - List sse_decode_list_payment_details( - SseDeserializer deserializer); - - @protected - List sse_decode_list_peer_details(SseDeserializer deserializer); - - @protected - List sse_decode_list_prim_u_8_loose(SseDeserializer deserializer); - - @protected - Uint8List sse_decode_list_prim_u_8_strict(SseDeserializer deserializer); - - @protected - List sse_decode_list_public_key(SseDeserializer deserializer); - - @protected - List sse_decode_list_socket_address( - SseDeserializer deserializer); - - @protected - LogLevel sse_decode_log_level(SseDeserializer deserializer); - - @protected - MaxDustHTLCExposure sse_decode_max_dust_htlc_exposure( - SseDeserializer deserializer); - - @protected - Network sse_decode_network(SseDeserializer deserializer); - - @protected - NodeException sse_decode_node_exception(SseDeserializer deserializer); - - @protected - String? sse_decode_opt_String(SseDeserializer deserializer); - - @protected - ChainDataSourceConfig? sse_decode_opt_box_autoadd_chain_data_source_config( - SseDeserializer deserializer); - - @protected - ChannelConfig? sse_decode_opt_box_autoadd_channel_config( - SseDeserializer deserializer); - - @protected - EntropySourceConfig? sse_decode_opt_box_autoadd_entropy_source_config( - SseDeserializer deserializer); - - @protected - Event? sse_decode_opt_box_autoadd_event(SseDeserializer deserializer); - - @protected - GossipSourceConfig? sse_decode_opt_box_autoadd_gossip_source_config( - SseDeserializer deserializer); - - @protected - PaymentDetails? sse_decode_opt_box_autoadd_payment_details( - SseDeserializer deserializer); - - @protected - PaymentPreimage? sse_decode_opt_box_autoadd_payment_preimage( - SseDeserializer deserializer); - - @protected - PaymentSecret? sse_decode_opt_box_autoadd_payment_secret( - SseDeserializer deserializer); - - @protected - PublicKey? sse_decode_opt_box_autoadd_public_key( - SseDeserializer deserializer); - - @protected - int? sse_decode_opt_box_autoadd_u_32(SseDeserializer deserializer); - - @protected - int? sse_decode_opt_box_autoadd_u_64(SseDeserializer deserializer); - - @protected - List? sse_decode_opt_list_socket_address( - SseDeserializer deserializer); - - @protected - OutPoint sse_decode_out_point(SseDeserializer deserializer); - - @protected - PaymentDetails sse_decode_payment_details(SseDeserializer deserializer); - - @protected - PaymentDirection sse_decode_payment_direction(SseDeserializer deserializer); - - @protected - PaymentHash sse_decode_payment_hash(SseDeserializer deserializer); - - @protected - PaymentPreimage sse_decode_payment_preimage(SseDeserializer deserializer); - - @protected - PaymentSecret sse_decode_payment_secret(SseDeserializer deserializer); - - @protected - PaymentStatus sse_decode_payment_status(SseDeserializer deserializer); - - @protected - PeerDetails sse_decode_peer_details(SseDeserializer deserializer); - - @protected - PublicKey sse_decode_public_key(SseDeserializer deserializer); - - @protected - SocketAddress sse_decode_socket_address(SseDeserializer deserializer); - - @protected - Txid sse_decode_txid(SseDeserializer deserializer); - - @protected - int sse_decode_u_16(SseDeserializer deserializer); - - @protected - int sse_decode_u_32(SseDeserializer deserializer); - - @protected - int sse_decode_u_64(SseDeserializer deserializer); - - @protected - int sse_decode_u_8(SseDeserializer deserializer); - - @protected - U8Array12 sse_decode_u_8_array_12(SseDeserializer deserializer); - - @protected - U8Array16 sse_decode_u_8_array_16(SseDeserializer deserializer); - - @protected - U8Array32 sse_decode_u_8_array_32(SseDeserializer deserializer); - - @protected - U8Array4 sse_decode_u_8_array_4(SseDeserializer deserializer); - - @protected - U8Array64 sse_decode_u_8_array_64(SseDeserializer deserializer); - - @protected - void sse_decode_unit(SseDeserializer deserializer); - - @protected - UserChannelId sse_decode_user_channel_id(SseDeserializer deserializer); - - @protected - int sse_decode_usize(SseDeserializer deserializer); - - @protected - String cst_encode_String(String raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw; - } - - @protected - List cst_encode_address(Address raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_String(raw.s)]; - } - - @protected - List cst_encode_bolt_11_invoice(Bolt11Invoice raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_String(raw.signedRawInvoice)]; - } - - @protected - List cst_encode_box_autoadd_address(Address raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_address(raw); - } - - @protected - List cst_encode_box_autoadd_bolt_11_invoice(Bolt11Invoice raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_bolt_11_invoice(raw); - } - - @protected - List cst_encode_box_autoadd_chain_data_source_config( - ChainDataSourceConfig raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_chain_data_source_config(raw); - } - - @protected - List cst_encode_box_autoadd_channel_config(ChannelConfig raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_channel_config(raw); - } - - @protected - List cst_encode_box_autoadd_channel_id(ChannelId raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_channel_id(raw); - } - - @protected - List cst_encode_box_autoadd_config(Config raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_config(raw); - } - - @protected - List cst_encode_box_autoadd_entropy_source_config( - EntropySourceConfig raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_entropy_source_config(raw); - } - - @protected - List cst_encode_box_autoadd_event(Event raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_event(raw); - } - - @protected - List cst_encode_box_autoadd_gossip_source_config( - GossipSourceConfig raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_gossip_source_config(raw); - } - - @protected - List cst_encode_box_autoadd_ldk_mnemonic(LdkMnemonic raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_ldk_mnemonic(raw); - } - - @protected - List cst_encode_box_autoadd_ldk_node(LdkNode raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_ldk_node(raw); - } - - @protected - List cst_encode_box_autoadd_out_point(OutPoint raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_out_point(raw); - } - - @protected - List cst_encode_box_autoadd_payment_details(PaymentDetails raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_payment_details(raw); - } - - @protected - List cst_encode_box_autoadd_payment_hash(PaymentHash raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_payment_hash(raw); - } - - @protected - List cst_encode_box_autoadd_payment_preimage(PaymentPreimage raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_payment_preimage(raw); - } - - @protected - List cst_encode_box_autoadd_payment_secret(PaymentSecret raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_payment_secret(raw); - } - - @protected - List cst_encode_box_autoadd_public_key(PublicKey raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_public_key(raw); - } - - @protected - List cst_encode_box_autoadd_socket_address(SocketAddress raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_socket_address(raw); - } - - @protected - int cst_encode_box_autoadd_u_32(int raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_u_32(raw); - } - - @protected - Object cst_encode_box_autoadd_u_64(int raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_u_64(raw); - } - - @protected - List cst_encode_box_autoadd_user_channel_id(UserChannelId raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_user_channel_id(raw); - } - - @protected - List cst_encode_chain_data_source_config(ChainDataSourceConfig raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - if (raw is ChainDataSourceConfig_Esplora) { - return [0, cst_encode_String(raw.field0)]; - } - - throw Exception('unreachable'); - } - - @protected - List cst_encode_channel_config(ChannelConfig raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [ - cst_encode_u_32(raw.forwardingFeeProportionalMillionths), - cst_encode_u_32(raw.forwardingFeeBaseMsat), - cst_encode_u_16(raw.cltvExpiryDelta), - cst_encode_max_dust_htlc_exposure(raw.maxDustHtlcExposure), - cst_encode_u_64(raw.forceCloseAvoidanceMaxFeeSatoshis), - cst_encode_bool(raw.acceptUnderpayingHtlcs) - ]; - } - - @protected - List cst_encode_channel_details(ChannelDetails raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [ - cst_encode_channel_id(raw.channelId), - cst_encode_public_key(raw.counterpartyNodeId), - 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), - cst_encode_opt_box_autoadd_u_32(raw.confirmations), - cst_encode_bool(raw.isOutbound), - cst_encode_bool(raw.isChannelReady), - cst_encode_bool(raw.isUsable), - cst_encode_bool(raw.isPublic) - ]; - } - - @protected - List cst_encode_channel_id(ChannelId raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_u_8_array_32(raw.data)]; - } - - @protected - List cst_encode_config(Config raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [ - cst_encode_String(raw.storageDirPath), - cst_encode_opt_String(raw.logDirPath), - cst_encode_network(raw.network), - cst_encode_opt_list_socket_address(raw.listeningAddresses), - cst_encode_u_32(raw.defaultCltvExpiryDelta), - cst_encode_u_64(raw.onchainWalletSyncIntervalSecs), - cst_encode_u_64(raw.walletSyncIntervalSecs), - cst_encode_u_64(raw.feeRateCacheUpdateIntervalSecs), - cst_encode_list_public_key(raw.trustedPeers0Conf), - cst_encode_u_64(raw.probingLiquidityLimitMultiplier), - cst_encode_log_level(raw.logLevel) - ]; - } - - @protected - List cst_encode_entropy_source_config(EntropySourceConfig raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - if (raw is EntropySourceConfig_SeedFile) { - return [0, cst_encode_String(raw.field0)]; - } - if (raw is EntropySourceConfig_SeedBytes) { - return [1, cst_encode_u_8_array_64(raw.field0)]; - } - if (raw is EntropySourceConfig_Bip39Mnemonic) { - return [ - 2, - cst_encode_box_autoadd_ldk_mnemonic(raw.mnemonic), - cst_encode_opt_String(raw.passphrase) - ]; - } - - throw Exception('unreachable'); - } - - @protected - 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)]; - } - if (raw is Event_PaymentFailed) { - return [1, cst_encode_box_autoadd_payment_hash(raw.paymentHash)]; - } - if (raw is Event_PaymentReceived) { - return [ - 2, - cst_encode_box_autoadd_payment_hash(raw.paymentHash), - cst_encode_u_64(raw.amountMsat) - ]; - } - 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_opt_box_autoadd_public_key(raw.counterpartyNodeId) - ]; - } - if (raw is Event_ChannelClosed) { - return [ - 4, - 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) - ]; - } - 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_box_autoadd_channel_id(raw.formerTemporaryChannelId), - cst_encode_box_autoadd_public_key(raw.counterpartyNodeId), - cst_encode_box_autoadd_out_point(raw.fundingTxo) - ]; - } - - throw Exception('unreachable'); - } - - @protected - List cst_encode_gossip_source_config(GossipSourceConfig raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - if (raw is GossipSourceConfig_P2PNetwork) { - return [0]; - } - if (raw is GossipSourceConfig_RapidGossipSync) { - return [1, cst_encode_String(raw.field0)]; - } - - throw Exception('unreachable'); - } - - @protected - List cst_encode_ldk_mnemonic(LdkMnemonic raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_String(raw.seedPhrase)]; - } - - @protected - List cst_encode_ldk_node(LdkNode raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_RustOpaque_NodeSqliteStore(raw.ptr)]; - } - - @protected - List cst_encode_list_channel_details(List raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw.map(cst_encode_channel_details).toList(); - } - - @protected - List cst_encode_list_payment_details(List raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw.map(cst_encode_payment_details).toList(); - } - - @protected - List cst_encode_list_peer_details(List raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw.map(cst_encode_peer_details).toList(); - } - - @protected - List cst_encode_list_prim_u_8_loose(List raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw; - } - - @protected - Uint8List cst_encode_list_prim_u_8_strict(Uint8List raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw; - } - - @protected - List cst_encode_list_public_key(List raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw.map(cst_encode_public_key).toList(); - } - - @protected - List cst_encode_list_socket_address(List raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw.map(cst_encode_socket_address).toList(); - } - - @protected - List cst_encode_max_dust_htlc_exposure(MaxDustHTLCExposure raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - if (raw is MaxDustHTLCExposure_FixedLimitMsat) { - return [0, cst_encode_u_64(raw.field0)]; - } - if (raw is MaxDustHTLCExposure_FeeRateMultiplier) { - return [1, cst_encode_u_64(raw.field0)]; - } - - throw Exception('unreachable'); - } - - @protected - String? cst_encode_opt_String(String? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? null : cst_encode_String(raw); - } - - @protected - List? cst_encode_opt_box_autoadd_chain_data_source_config( - ChainDataSourceConfig? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null - ? null - : cst_encode_box_autoadd_chain_data_source_config(raw); - } - - @protected - List? cst_encode_opt_box_autoadd_channel_config(ChannelConfig? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? null : cst_encode_box_autoadd_channel_config(raw); - } - - @protected - List? cst_encode_opt_box_autoadd_entropy_source_config( - EntropySourceConfig? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null - ? null - : cst_encode_box_autoadd_entropy_source_config(raw); - } - - @protected - List? cst_encode_opt_box_autoadd_event(Event? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? null : cst_encode_box_autoadd_event(raw); - } - - @protected - List? cst_encode_opt_box_autoadd_gossip_source_config( - GossipSourceConfig? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null - ? null - : cst_encode_box_autoadd_gossip_source_config(raw); - } - - @protected - List? cst_encode_opt_box_autoadd_payment_details( - PaymentDetails? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? null : cst_encode_box_autoadd_payment_details(raw); - } - - @protected - List? cst_encode_opt_box_autoadd_payment_preimage( - PaymentPreimage? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? null : cst_encode_box_autoadd_payment_preimage(raw); - } - - @protected - List? cst_encode_opt_box_autoadd_payment_secret(PaymentSecret? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? null : cst_encode_box_autoadd_payment_secret(raw); - } - - @protected - List? cst_encode_opt_box_autoadd_public_key(PublicKey? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? null : cst_encode_box_autoadd_public_key(raw); - } - - @protected - int? cst_encode_opt_box_autoadd_u_32(int? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? null : cst_encode_box_autoadd_u_32(raw); - } - - @protected - Object? cst_encode_opt_box_autoadd_u_64(int? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? null : cst_encode_box_autoadd_u_64(raw); - } - - @protected - List? cst_encode_opt_list_socket_address(List? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? null : cst_encode_list_socket_address(raw); - } - - @protected - List cst_encode_out_point(OutPoint raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_txid(raw.txid), cst_encode_u_32(raw.vout)]; - } - - @protected - List cst_encode_payment_details(PaymentDetails raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [ - cst_encode_payment_hash(raw.hash), - cst_encode_opt_box_autoadd_payment_preimage(raw.preimage), - cst_encode_opt_box_autoadd_payment_secret(raw.secret), - cst_encode_opt_box_autoadd_u_64(raw.amountMsat), - cst_encode_payment_direction(raw.direction), - cst_encode_payment_status(raw.status) - ]; - } - - @protected - List cst_encode_payment_hash(PaymentHash raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_u_8_array_32(raw.data)]; - } - - @protected - List cst_encode_payment_preimage(PaymentPreimage raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_u_8_array_32(raw.data)]; - } - - @protected - List cst_encode_payment_secret(PaymentSecret raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_u_8_array_32(raw.data)]; - } - - @protected - List cst_encode_peer_details(PeerDetails raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [ - cst_encode_public_key(raw.nodeId), - cst_encode_socket_address(raw.address), - cst_encode_bool(raw.isConnected) - ]; - } - - @protected - List cst_encode_public_key(PublicKey raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_String(raw.hex)]; - } - - @protected - List cst_encode_socket_address(SocketAddress raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - if (raw is SocketAddress_TcpIpV4) { - return [0, cst_encode_u_8_array_4(raw.addr), cst_encode_u_16(raw.port)]; - } - if (raw is SocketAddress_TcpIpV6) { - return [1, cst_encode_u_8_array_16(raw.addr), cst_encode_u_16(raw.port)]; - } - if (raw is SocketAddress_OnionV2) { - return [2, cst_encode_u_8_array_12(raw.field0)]; - } - if (raw is SocketAddress_OnionV3) { - return [ - 3, - cst_encode_u_8_array_32(raw.ed25519Pubkey), - cst_encode_u_16(raw.checksum), - cst_encode_u_8(raw.version), - cst_encode_u_16(raw.port) - ]; - } - if (raw is SocketAddress_Hostname) { - return [4, cst_encode_String(raw.addr), cst_encode_u_16(raw.port)]; - } - - throw Exception('unreachable'); - } - - @protected - List cst_encode_txid(Txid raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_String(raw.hash)]; - } - - @protected - Object cst_encode_u_64(int raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return castNativeBigInt(raw); - } - - @protected - Uint8List cst_encode_u_8_array_12(U8Array12 raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return Uint8List.fromList(raw); - } - - @protected - Uint8List cst_encode_u_8_array_16(U8Array16 raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return Uint8List.fromList(raw); - } - - @protected - Uint8List cst_encode_u_8_array_32(U8Array32 raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return Uint8List.fromList(raw); - } - - @protected - Uint8List cst_encode_u_8_array_4(U8Array4 raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return Uint8List.fromList(raw); - } - - @protected - Uint8List cst_encode_u_8_array_64(U8Array64 raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return Uint8List.fromList(raw); - } - - @protected - List cst_encode_user_channel_id(UserChannelId raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_u_64(raw.data)]; - } - - @protected - int cst_encode_RustOpaque_NodeSqliteStore(NodeSqliteStore raw); - - @protected - bool cst_encode_bool(bool raw); - - @protected - int cst_encode_builder_exception(BuilderException raw); - - @protected - int cst_encode_i_32(int raw); - - @protected - int cst_encode_log_level(LogLevel raw); - - @protected - int cst_encode_network(Network raw); - - @protected - int cst_encode_node_exception(NodeException raw); - - @protected - int cst_encode_payment_direction(PaymentDirection raw); - - @protected - int cst_encode_payment_status(PaymentStatus raw); - - @protected - int cst_encode_u_16(int raw); - - @protected - int cst_encode_u_32(int raw); - - @protected - int cst_encode_u_8(int raw); - - @protected - void cst_encode_unit(void raw); - - @protected - int cst_encode_usize(int raw); - - @protected - void sse_encode_RustOpaque_NodeSqliteStore( - NodeSqliteStore self, SseSerializer serializer); - - @protected - void sse_encode_String(String self, SseSerializer serializer); - - @protected - void sse_encode_address(Address self, SseSerializer serializer); - - @protected - void sse_encode_bolt_11_invoice(Bolt11Invoice self, SseSerializer serializer); - - @protected - void sse_encode_bool(bool self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_address(Address self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_bolt_11_invoice( - Bolt11Invoice self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_chain_data_source_config( - ChainDataSourceConfig self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_channel_config( - ChannelConfig self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_channel_id( - ChannelId self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_config(Config self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_entropy_source_config( - EntropySourceConfig self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_event(Event self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_gossip_source_config( - GossipSourceConfig self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_ldk_mnemonic( - LdkMnemonic self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_ldk_node(LdkNode self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_out_point( - OutPoint self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_payment_details( - PaymentDetails self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_payment_hash( - PaymentHash self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_payment_preimage( - PaymentPreimage self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_payment_secret( - PaymentSecret self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_public_key( - PublicKey self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_socket_address( - SocketAddress self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_u_32(int self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_u_64(int self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_user_channel_id( - UserChannelId self, SseSerializer serializer); - - @protected - void sse_encode_builder_exception( - BuilderException self, SseSerializer serializer); - - @protected - void sse_encode_chain_data_source_config( - ChainDataSourceConfig self, SseSerializer serializer); - - @protected - void sse_encode_channel_config(ChannelConfig self, SseSerializer serializer); - - @protected - void sse_encode_channel_details( - ChannelDetails self, SseSerializer serializer); - - @protected - void sse_encode_channel_id(ChannelId self, SseSerializer serializer); - - @protected - void sse_encode_config(Config self, SseSerializer serializer); - - @protected - void sse_encode_entropy_source_config( - EntropySourceConfig self, SseSerializer serializer); - - @protected - void sse_encode_event(Event self, SseSerializer serializer); - - @protected - void sse_encode_gossip_source_config( - GossipSourceConfig self, SseSerializer serializer); - - @protected - void sse_encode_i_32(int self, SseSerializer serializer); - - @protected - void sse_encode_ldk_mnemonic(LdkMnemonic self, SseSerializer serializer); - - @protected - 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_payment_details( - List self, SseSerializer serializer); - - @protected - void sse_encode_list_peer_details( - List self, SseSerializer serializer); - - @protected - void sse_encode_list_prim_u_8_loose(List self, SseSerializer serializer); - - @protected - void sse_encode_list_prim_u_8_strict( - Uint8List self, SseSerializer serializer); - - @protected - void sse_encode_list_public_key( - List self, SseSerializer serializer); - - @protected - void sse_encode_list_socket_address( - List self, SseSerializer serializer); - - @protected - void sse_encode_log_level(LogLevel self, SseSerializer serializer); - - @protected - void sse_encode_max_dust_htlc_exposure( - MaxDustHTLCExposure self, SseSerializer serializer); - - @protected - void sse_encode_network(Network self, SseSerializer serializer); - - @protected - void sse_encode_node_exception(NodeException self, SseSerializer serializer); - - @protected - void sse_encode_opt_String(String? self, SseSerializer serializer); - - @protected - void sse_encode_opt_box_autoadd_chain_data_source_config( - ChainDataSourceConfig? self, SseSerializer serializer); - - @protected - void sse_encode_opt_box_autoadd_channel_config( - ChannelConfig? self, SseSerializer serializer); - - @protected - void sse_encode_opt_box_autoadd_entropy_source_config( - EntropySourceConfig? self, SseSerializer serializer); - - @protected - void sse_encode_opt_box_autoadd_event(Event? self, SseSerializer serializer); - - @protected - void sse_encode_opt_box_autoadd_gossip_source_config( - GossipSourceConfig? self, SseSerializer serializer); - - @protected - void sse_encode_opt_box_autoadd_payment_details( - PaymentDetails? self, SseSerializer serializer); - - @protected - void sse_encode_opt_box_autoadd_payment_preimage( - PaymentPreimage? self, SseSerializer serializer); - - @protected - void sse_encode_opt_box_autoadd_payment_secret( - PaymentSecret? self, SseSerializer serializer); - - @protected - void sse_encode_opt_box_autoadd_public_key( - PublicKey? self, SseSerializer serializer); - - @protected - void sse_encode_opt_box_autoadd_u_32(int? self, SseSerializer serializer); - - @protected - void sse_encode_opt_box_autoadd_u_64(int? self, SseSerializer serializer); - - @protected - void sse_encode_opt_list_socket_address( - List? self, SseSerializer serializer); - - @protected - void sse_encode_out_point(OutPoint self, SseSerializer serializer); - - @protected - void sse_encode_payment_details( - PaymentDetails self, SseSerializer serializer); - - @protected - void sse_encode_payment_direction( - PaymentDirection self, SseSerializer serializer); - - @protected - void sse_encode_payment_hash(PaymentHash self, SseSerializer serializer); - - @protected - void sse_encode_payment_preimage( - PaymentPreimage self, SseSerializer serializer); - - @protected - void sse_encode_payment_secret(PaymentSecret self, SseSerializer serializer); - - @protected - void sse_encode_payment_status(PaymentStatus self, SseSerializer serializer); - - @protected - void sse_encode_peer_details(PeerDetails self, SseSerializer serializer); - - @protected - void sse_encode_public_key(PublicKey self, SseSerializer serializer); - - @protected - void sse_encode_socket_address(SocketAddress self, SseSerializer serializer); - - @protected - void sse_encode_txid(Txid self, SseSerializer serializer); - - @protected - void sse_encode_u_16(int self, SseSerializer serializer); - - @protected - void sse_encode_u_32(int self, SseSerializer serializer); - - @protected - void sse_encode_u_64(int self, SseSerializer serializer); - - @protected - void sse_encode_u_8(int self, SseSerializer serializer); - - @protected - void sse_encode_u_8_array_12(U8Array12 self, SseSerializer serializer); - - @protected - void sse_encode_u_8_array_16(U8Array16 self, SseSerializer serializer); - - @protected - void sse_encode_u_8_array_32(U8Array32 self, SseSerializer serializer); - - @protected - void sse_encode_u_8_array_4(U8Array4 self, SseSerializer serializer); - - @protected - void sse_encode_u_8_array_64(U8Array64 self, SseSerializer serializer); - - @protected - void sse_encode_unit(void self, SseSerializer serializer); - - @protected - void sse_encode_user_channel_id(UserChannelId self, SseSerializer serializer); - - @protected - void sse_encode_usize(int self, SseSerializer serializer); -} - -// Section: wire_class - -class LdkCoreWire implements BaseWire { - LdkCoreWire.fromExternalLibrary(ExternalLibrary lib); - - 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_ldk_mnemonic_generate(NativePortType port_) => - wasmModule.wire_ldk_mnemonic_generate(port_); - - 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_ldk_node_connect(NativePortType port_, List that, - List node_id, List address, bool persist) => - wasmModule.wire_ldk_node_connect(port_, that, node_id, address, persist); - - void wire_ldk_node_connect_open_channel( - NativePortType port_, - List that, - List socket_address, - List node_id, - Object channel_amount_sats, - Object? push_to_counterparty_msat, - bool announce_channel, - List? channel_config) => - wasmModule.wire_ldk_node_connect_open_channel( - port_, - that, - socket_address, - node_id, - channel_amount_sats, - push_to_counterparty_msat, - announce_channel, - channel_config); - - void wire_ldk_node_disconnect(NativePortType port_, List that, - List counterparty_node_id) => - wasmModule.wire_ldk_node_disconnect(port_, that, counterparty_node_id); - - void wire_ldk_node_event_handled(NativePortType port_, List that) => - wasmModule.wire_ldk_node_event_handled(port_, that); - - void wire_ldk_node_is_running(NativePortType port_, List that) => - wasmModule.wire_ldk_node_is_running(port_, that); - - void wire_ldk_node_list_channels(NativePortType port_, List that) => - wasmModule.wire_ldk_node_list_channels(port_, that); - - void wire_ldk_node_list_payments(NativePortType port_, List that) => - wasmModule.wire_ldk_node_list_payments(port_, that); - - void wire_ldk_node_list_payments_with_filter( - NativePortType port_, List that, int payment_direction) => - wasmModule.wire_ldk_node_list_payments_with_filter( - port_, that, payment_direction); - - void wire_ldk_node_list_peers(NativePortType port_, List that) => - wasmModule.wire_ldk_node_list_peers(port_, that); - - void wire_ldk_node_listening_addresses( - NativePortType port_, List that) => - wasmModule.wire_ldk_node_listening_addresses(port_, that); - - void wire_ldk_node_new_onchain_address( - NativePortType port_, List that) => - wasmModule.wire_ldk_node_new_onchain_address(port_, that); - - void wire_ldk_node_next_event(NativePortType port_, List that) => - wasmModule.wire_ldk_node_next_event(port_, that); - - void wire_ldk_node_node_id(NativePortType port_, List that) => - wasmModule.wire_ldk_node_node_id(port_, that); - - void wire_ldk_node_payment(NativePortType port_, List that, - List payment_hash) => - wasmModule.wire_ldk_node_payment(port_, that, payment_hash); - - void wire_ldk_node_receive_payment(NativePortType port_, List that, - Object amount_msat, String description, int expiry_secs) => - wasmModule.wire_ldk_node_receive_payment( - port_, that, amount_msat, description, expiry_secs); - - void wire_ldk_node_receive_variable_amount_payment(NativePortType port_, - List that, String description, int expiry_secs) => - wasmModule.wire_ldk_node_receive_variable_amount_payment( - port_, that, description, expiry_secs); - - void wire_ldk_node_remove_payment(NativePortType port_, List that, - List payment_hash) => - wasmModule.wire_ldk_node_remove_payment(port_, that, payment_hash); - - void wire_ldk_node_send_all_to_onchain_address( - NativePortType port_, List that, List address) => - wasmModule.wire_ldk_node_send_all_to_onchain_address( - port_, that, address); - - void wire_ldk_node_send_payment( - NativePortType port_, List that, List invoice) => - wasmModule.wire_ldk_node_send_payment(port_, that, invoice); - - void wire_ldk_node_send_payment_probes( - NativePortType port_, List that, List invoice) => - wasmModule.wire_ldk_node_send_payment_probes(port_, that, invoice); - - void wire_ldk_node_send_payment_probes_using_amount(NativePortType port_, - List that, List invoice, Object amount_msat) => - wasmModule.wire_ldk_node_send_payment_probes_using_amount( - port_, that, invoice, amount_msat); - - void wire_ldk_node_send_payment_using_amount(NativePortType port_, - List that, List invoice, Object amount_msat) => - wasmModule.wire_ldk_node_send_payment_using_amount( - port_, that, invoice, amount_msat); - - void wire_ldk_node_send_spontaneous_payment(NativePortType port_, - List that, Object amount_msat, List node_id) => - wasmModule.wire_ldk_node_send_spontaneous_payment( - port_, that, amount_msat, node_id); - - void wire_ldk_node_send_spontaneous_payment_probes(NativePortType port_, - List that, Object amount_msat, List node_id) => - wasmModule.wire_ldk_node_send_spontaneous_payment_probes( - port_, that, amount_msat, node_id); - - void wire_ldk_node_send_to_onchain_address(NativePortType port_, - List that, List address, Object amount_sats) => - wasmModule.wire_ldk_node_send_to_onchain_address( - port_, that, address, amount_sats); - - void wire_ldk_node_sign_message( - NativePortType port_, List that, List 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_ldk_node_start(NativePortType port_, List that) => - wasmModule.wire_ldk_node_start(port_, that); - - void wire_ldk_node_stop(NativePortType port_, List that) => - wasmModule.wire_ldk_node_stop(port_, that); - - void wire_ldk_node_sync_wallets(NativePortType port_, List that) => - wasmModule.wire_ldk_node_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_ldk_node_update_channel_config( - NativePortType port_, - List that, - List channel_id, - List counterparty_node_id, - List channel_config) => - wasmModule.wire_ldk_node_update_channel_config( - port_, that, channel_id, counterparty_node_id, channel_config); - - void wire_ldk_node_verify_signature(NativePortType port_, List that, - List msg, String sig, List pkey) => - wasmModule.wire_ldk_node_verify_signature(port_, that, msg, sig, pkey); - - void wire_ldk_node_wait_next_event( - NativePortType port_, List that) => - wasmModule.wire_ldk_node_wait_next_event(port_, that); - - 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) => - wasmModule - .rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore(ptr); - - void rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore( - dynamic ptr) => - wasmModule - .rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore(ptr); -} - -@JS('wasm_bindgen') -external LdkCoreWasmModule get wasmModule; - -@JS() -@anonymous -class LdkCoreWasmModule implements WasmModule { - @override - external Object /* Promise */ call([String? moduleName]); - - @override - external LdkCoreWasmModule bind(dynamic thisArg, String moduleName); - - 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_ldk_node_close_channel( - NativePortType port_, - List that, - List channel_id, - List counterparty_node_id); - - external void wire_ldk_node_connect(NativePortType port_, List that, - List node_id, List address, bool persist); - - external void wire_ldk_node_connect_open_channel( - NativePortType port_, - List that, - List socket_address, - List node_id, - Object channel_amount_sats, - Object? push_to_counterparty_msat, - bool announce_channel, - List? channel_config); - - external void wire_ldk_node_disconnect(NativePortType port_, - List that, List counterparty_node_id); - - external void wire_ldk_node_event_handled( - NativePortType port_, List that); - - external void wire_ldk_node_is_running( - NativePortType port_, List that); - - external void wire_ldk_node_list_channels( - NativePortType port_, List that); - - external void wire_ldk_node_list_payments( - NativePortType port_, List that); - - external void wire_ldk_node_list_payments_with_filter( - NativePortType port_, List that, int payment_direction); - - external void wire_ldk_node_list_peers( - NativePortType port_, List that); - - external void wire_ldk_node_listening_addresses( - NativePortType port_, List that); - - external void wire_ldk_node_new_onchain_address( - NativePortType port_, List that); - - external void wire_ldk_node_next_event( - NativePortType port_, List that); - - external void wire_ldk_node_node_id(NativePortType port_, List that); - - external void wire_ldk_node_payment( - NativePortType port_, List that, List payment_hash); - - external void wire_ldk_node_receive_payment( - NativePortType port_, - List that, - Object amount_msat, - String description, - int expiry_secs); - - external void wire_ldk_node_receive_variable_amount_payment( - NativePortType port_, - List that, - String description, - int expiry_secs); - - external void wire_ldk_node_remove_payment( - NativePortType port_, List that, List payment_hash); - - external void wire_ldk_node_send_all_to_onchain_address( - NativePortType port_, List that, List address); - - external void wire_ldk_node_send_payment( - NativePortType port_, List that, List invoice); - - external void wire_ldk_node_send_payment_probes( - NativePortType port_, List that, List invoice); - - external void wire_ldk_node_send_payment_probes_using_amount( - NativePortType port_, - List that, - List invoice, - Object amount_msat); - - external void wire_ldk_node_send_payment_using_amount(NativePortType port_, - List that, List invoice, Object amount_msat); - - external void wire_ldk_node_send_spontaneous_payment(NativePortType port_, - List that, Object amount_msat, List node_id); - - external void wire_ldk_node_send_spontaneous_payment_probes( - NativePortType port_, - List that, - Object amount_msat, - List node_id); - - external void wire_ldk_node_send_to_onchain_address(NativePortType port_, - List that, List address, Object amount_sats); - - external void wire_ldk_node_sign_message( - NativePortType port_, List that, List msg); - - 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_ldk_node_stop(NativePortType port_, List that); - - external void wire_ldk_node_sync_wallets( - NativePortType port_, List that); - - external void wire_ldk_node_total_onchain_balance_sats( - NativePortType port_, List that); - - external void wire_ldk_node_update_channel_config( - NativePortType port_, - List that, - List channel_id, - List counterparty_node_id, - List channel_config); - - external void wire_ldk_node_verify_signature(NativePortType port_, - List that, List msg, String sig, List pkey); - - external void wire_ldk_node_wait_next_event( - NativePortType port_, List that); - - 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); - - external void rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore( - dynamic ptr); -} diff --git a/lib/src/generated/lib.dart b/lib/src/generated/lib.dart new file mode 100644 index 0000000..1672b4b --- /dev/null +++ b/lib/src/generated/lib.dart @@ -0,0 +1,90 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0. + +// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import + +import 'frb_generated.dart'; +import 'package:collection/collection.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; + +// Rust type: RustOpaqueNom +abstract class NetworkGraph implements RustOpaqueInterface {} + +// Rust type: RustOpaqueNom +abstract class Bolt11Payment implements RustOpaqueInterface {} + +// Rust type: RustOpaqueNom +abstract class OnchainPayment implements RustOpaqueInterface {} + +// Rust type: RustOpaqueNom +abstract class SpontaneousPayment implements RustOpaqueInterface {} + +class U8Array12 extends NonGrowableListView { + static const arraySize = 12; + + @internal + Uint8List get inner => _inner; + final Uint8List _inner; + + U8Array12(this._inner) + : assert(_inner.length == arraySize), + super(_inner); + + U8Array12.init() : this(Uint8List(arraySize)); +} + +class U8Array16 extends NonGrowableListView { + static const arraySize = 16; + + @internal + Uint8List get inner => _inner; + final Uint8List _inner; + + U8Array16(this._inner) + : assert(_inner.length == arraySize), + super(_inner); + + U8Array16.init() : this(Uint8List(arraySize)); +} + +class U8Array32 extends NonGrowableListView { + static const arraySize = 32; + + @internal + Uint8List get inner => _inner; + final Uint8List _inner; + + U8Array32(this._inner) + : assert(_inner.length == arraySize), + super(_inner); + + U8Array32.init() : this(Uint8List(arraySize)); +} + +class U8Array4 extends NonGrowableListView { + static const arraySize = 4; + + @internal + Uint8List get inner => _inner; + final Uint8List _inner; + + U8Array4(this._inner) + : assert(_inner.length == arraySize), + super(_inner); + + U8Array4.init() : this(Uint8List(arraySize)); +} + +class U8Array64 extends NonGrowableListView { + static const arraySize = 64; + + @internal + Uint8List get inner => _inner; + final Uint8List _inner; + + U8Array64(this._inner) + : assert(_inner.length == arraySize), + super(_inner); + + U8Array64.init() : this(Uint8List(arraySize)); +} diff --git a/lib/src/generated/utils/error.dart b/lib/src/generated/utils/error.dart new file mode 100644 index 0000000..4579b40 --- /dev/null +++ b/lib/src/generated/utils/error.dart @@ -0,0 +1,272 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0. + +// 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'; +import 'package:freezed_annotation/freezed_annotation.dart' hide protected; +part 'error.freezed.dart'; + +@freezed +sealed class Bolt12ParseError with _$Bolt12ParseError { + const Bolt12ParseError._(); + + const factory Bolt12ParseError.invalidContinuation() = + Bolt12ParseError_InvalidContinuation; + const factory Bolt12ParseError.invalidBech32Hrp() = + Bolt12ParseError_InvalidBech32Hrp; + const factory Bolt12ParseError.bech32( + String field0, + ) = Bolt12ParseError_Bech32; + const factory Bolt12ParseError.decode( + DecodeError field0, + ) = Bolt12ParseError_Decode; + const factory Bolt12ParseError.invalidSemantics( + String field0, + ) = Bolt12ParseError_InvalidSemantics; + const factory Bolt12ParseError.invalidSignature( + String field0, + ) = Bolt12ParseError_InvalidSignature; +} + +@freezed +sealed class DecodeError with _$DecodeError { + const DecodeError._(); + + const factory DecodeError.unknownVersion() = DecodeError_UnknownVersion; + const factory DecodeError.unknownRequiredFeature() = + DecodeError_UnknownRequiredFeature; + const factory DecodeError.invalidValue() = DecodeError_InvalidValue; + const factory DecodeError.shortRead() = DecodeError_ShortRead; + const factory DecodeError.badLengthDescriptor() = + DecodeError_BadLengthDescriptor; + const factory DecodeError.io( + String field0, + ) = DecodeError_Io; + const factory DecodeError.unsupportedCompression() = + DecodeError_UnsupportedCompression; + const factory DecodeError.dangerousValue() = DecodeError_DangerousValue; +} + +enum LdkBuilderError { + socketAddressParseError, + + /// The given seed bytes are invalid, e.g., have invalid length. + invalidSeedBytes, + + /// The given seed file is invalid, e.g., has invalid length, or could not be read. + invalidSeedFile, + + /// The current system time is invalid, clocks might have gone backwards. + invalidSystemTime, + + /// The a read channel monitor is invalid. + invalidChannelMonitor, + + /// The given listening addresses are invalid, e.g. too many were passed. + invalidListeningAddress, + + /// We failed to read data from the [`KVStore`]. + readFailed, + + /// We failed to write data to the [`KVStore`]. + writeFailed, + + /// We failed to access the given `storage_dir_path`. + storagePathAccessFailed, + + /// We failed to setup our [`KVStore`]. + kvStoreSetupFailed, + + /// We failed to setup the onchain wallet. + walletSetupFailed, + + /// We failed to setup the logger. + loggerSetupFailed, + invalidPublicKey, + ; +} + +@freezed +sealed class LdkNodeError with _$LdkNodeError implements FrbException { + const LdkNodeError._(); + + const factory LdkNodeError.invalidTxid() = LdkNodeError_InvalidTxid; + + /// Returned when trying to start [Node] while it is already running. + const factory LdkNodeError.alreadyRunning() = LdkNodeError_AlreadyRunning; + + /// Returned when trying to stop [Node] while it is not running. + const factory LdkNodeError.notRunning() = LdkNodeError_NotRunning; + + /// An on-chain transaction could not be created. + const factory LdkNodeError.onchainTxCreationFailed() = + LdkNodeError_OnchainTxCreationFailed; + + /// A network connection has been closed. + const factory LdkNodeError.connectionFailed() = LdkNodeError_ConnectionFailed; + + /// Invoice creation failed. + const factory LdkNodeError.invoiceCreationFailed() = + LdkNodeError_InvoiceCreationFailed; + + /// Sending a payment has failed. + const factory LdkNodeError.paymentSendingFailed() = + LdkNodeError_PaymentSendingFailed; + + /// Sending a payment probe has failed. + const factory LdkNodeError.probeSendingFailed() = + LdkNodeError_ProbeSendingFailed; + + /// A channel could not be opened. + const factory LdkNodeError.channelCreationFailed() = + LdkNodeError_ChannelCreationFailed; + + /// A channel could not be closed. + const factory LdkNodeError.channelClosingFailed() = + LdkNodeError_ChannelClosingFailed; + + /// A channel config could not be updated. + const factory LdkNodeError.channelConfigUpdateFailed() = + LdkNodeError_ChannelConfigUpdateFailed; + + /// Persistence failed. + const factory LdkNodeError.persistenceFailed() = + LdkNodeError_PersistenceFailed; + + /// A wallet operation failed. + const factory LdkNodeError.walletOperationFailed() = + LdkNodeError_WalletOperationFailed; + + /// A signing operation for transaction failed. + const factory LdkNodeError.onchainTxSigningFailed() = + LdkNodeError_OnchainTxSigningFailed; + + /// A signing operation for message failed. + const factory LdkNodeError.messageSigningFailed() = + LdkNodeError_MessageSigningFailed; + + /// A transaction sync operation failed. + const factory LdkNodeError.txSyncFailed() = LdkNodeError_TxSyncFailed; + + /// A gossip updating operation failed. + const factory LdkNodeError.gossipUpdateFailed() = + LdkNodeError_GossipUpdateFailed; + + /// The given address is invalid. + const factory LdkNodeError.invalidAddress() = LdkNodeError_InvalidAddress; + + /// The given network address is invalid. + const factory LdkNodeError.invalidSocketAddress() = + LdkNodeError_InvalidSocketAddress; + + /// The given public key is invalid. + const factory LdkNodeError.invalidPublicKey() = LdkNodeError_InvalidPublicKey; + + /// The given secret key is invalid. + const factory LdkNodeError.invalidSecretKey() = LdkNodeError_InvalidSecretKey; + + /// The given payment hash is invalid. + const factory LdkNodeError.invalidPaymentHash() = + LdkNodeError_InvalidPaymentHash; + + /// The given payment preimage is invalid. + const factory LdkNodeError.invalidPaymentPreimage() = + LdkNodeError_InvalidPaymentPreimage; + + /// The given payment secret is invalid. + const factory LdkNodeError.invalidPaymentSecret() = + LdkNodeError_InvalidPaymentSecret; + + /// The given amount is invalid. + const factory LdkNodeError.invalidAmount() = LdkNodeError_InvalidAmount; + + /// The given invoice is invalid. + const factory LdkNodeError.invalidInvoice() = LdkNodeError_InvalidInvoice; + + /// The given channel ID is invalid. + const factory LdkNodeError.invalidChannelId() = LdkNodeError_InvalidChannelId; + + /// The given network is invalid. + const factory LdkNodeError.invalidNetwork() = LdkNodeError_InvalidNetwork; + + /// A payment with the given hash has already been initiated. + const factory LdkNodeError.duplicatePayment() = LdkNodeError_DuplicatePayment; + + /// There are insufficient funds to complete the given operation. + const factory LdkNodeError.insufficientFunds() = + LdkNodeError_InsufficientFunds; + + ///A fee rate estimation update failed. + const factory LdkNodeError.feerateEstimationUpdateFailed() = + LdkNodeError_FeerateEstimationUpdateFailed; + + ///A liquidity request operation failed. + const factory LdkNodeError.liquidityRequestFailed() = + LdkNodeError_LiquidityRequestFailed; + + ///The given operation failed due to the required liquidity source being unavailable. + const factory LdkNodeError.liquiditySourceUnavailable() = + LdkNodeError_LiquiditySourceUnavailable; + + ///The given operation failed due to the LSP's required opening fee being too high. + const factory LdkNodeError.liquidityFeeTooHigh() = + LdkNodeError_LiquidityFeeTooHigh; + + ///The given payment id is invalid. + const factory LdkNodeError.invalidPaymentId() = LdkNodeError_InvalidPaymentId; + + ///An error in decoding a message or struct. + const factory LdkNodeError.decode( + DecodeError field0, + ) = LdkNodeError_Decode; + + ///An error in decoding the Bolt12 offer. + const factory LdkNodeError.bolt12Parse( + Bolt12ParseError field0, + ) = LdkNodeError_Bolt12Parse; + + ///Invoice request creation failed. + const factory LdkNodeError.invoiceRequestCreationFailed() = + LdkNodeError_InvoiceRequestCreationFailed; + + ///Offer creation failed. + const factory LdkNodeError.offerCreationFailed() = + LdkNodeError_OfferCreationFailed; + + ///Refund creation failed. + const factory LdkNodeError.refundCreationFailed() = + LdkNodeError_RefundCreationFailed; + + ///A fee rate estimation update timed out. + const factory LdkNodeError.feerateEstimationUpdateTimeout() = + LdkNodeError_FeerateEstimationUpdateTimeout; + + ///A wallet operation timed out. + const factory LdkNodeError.walletOperationTimeout() = + LdkNodeError_WalletOperationTimeout; + + ///A transaction sync operation timed out. + const factory LdkNodeError.txSyncTimeout() = LdkNodeError_TxSyncTimeout; + + ///A gossip updating operation timed out. + const factory LdkNodeError.gossipUpdateTimeout() = + LdkNodeError_GossipUpdateTimeout; + + ///The given offer id is invalid. + const factory LdkNodeError.invalidOfferId() = LdkNodeError_InvalidOfferId; + + ///The given node id is invalid. + const factory LdkNodeError.invalidNodeId() = LdkNodeError_InvalidNodeId; + + ///The given offer is invalid. + const factory LdkNodeError.invalidOffer() = LdkNodeError_InvalidOffer; + + ///The given refund is invalid. + const factory LdkNodeError.invalidRefund() = LdkNodeError_InvalidRefund; + + ///The provided offer was denominated in an unsupported currency. + const factory LdkNodeError.unsupportedCurrency() = + LdkNodeError_UnsupportedCurrency; +} diff --git a/lib/src/generated/utils/error.freezed.dart b/lib/src/generated/utils/error.freezed.dart new file mode 100644 index 0000000..2f4dd6b --- /dev/null +++ b/lib/src/generated/utils/error.freezed.dart @@ -0,0 +1,26142 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'error.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + +/// @nodoc +mixin _$Bolt12ParseError { + @optionalTypeArgs + TResult when({ + required TResult Function() invalidContinuation, + required TResult Function() invalidBech32Hrp, + required TResult Function(String field0) bech32, + required TResult Function(DecodeError field0) decode, + required TResult Function(String field0) invalidSemantics, + required TResult Function(String field0) invalidSignature, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidContinuation, + TResult? Function()? invalidBech32Hrp, + TResult? Function(String field0)? bech32, + TResult? Function(DecodeError field0)? decode, + TResult? Function(String field0)? invalidSemantics, + TResult? Function(String field0)? invalidSignature, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidContinuation, + TResult Function()? invalidBech32Hrp, + TResult Function(String field0)? bech32, + TResult Function(DecodeError field0)? decode, + TResult Function(String field0)? invalidSemantics, + TResult Function(String field0)? invalidSignature, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map({ + required TResult Function(Bolt12ParseError_InvalidContinuation value) + invalidContinuation, + required TResult Function(Bolt12ParseError_InvalidBech32Hrp value) + invalidBech32Hrp, + required TResult Function(Bolt12ParseError_Bech32 value) bech32, + required TResult Function(Bolt12ParseError_Decode value) decode, + required TResult Function(Bolt12ParseError_InvalidSemantics value) + invalidSemantics, + required TResult Function(Bolt12ParseError_InvalidSignature value) + invalidSignature, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult? Function(Bolt12ParseError_InvalidBech32Hrp value)? + invalidBech32Hrp, + TResult? Function(Bolt12ParseError_Bech32 value)? bech32, + TResult? Function(Bolt12ParseError_Decode value)? decode, + TResult? Function(Bolt12ParseError_InvalidSemantics value)? + invalidSemantics, + TResult? Function(Bolt12ParseError_InvalidSignature value)? + invalidSignature, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult Function(Bolt12ParseError_InvalidBech32Hrp value)? invalidBech32Hrp, + TResult Function(Bolt12ParseError_Bech32 value)? bech32, + TResult Function(Bolt12ParseError_Decode value)? decode, + TResult Function(Bolt12ParseError_InvalidSemantics value)? invalidSemantics, + TResult Function(Bolt12ParseError_InvalidSignature value)? invalidSignature, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $Bolt12ParseErrorCopyWith<$Res> { + factory $Bolt12ParseErrorCopyWith( + Bolt12ParseError value, $Res Function(Bolt12ParseError) then) = + _$Bolt12ParseErrorCopyWithImpl<$Res, Bolt12ParseError>; +} + +/// @nodoc +class _$Bolt12ParseErrorCopyWithImpl<$Res, $Val extends Bolt12ParseError> + implements $Bolt12ParseErrorCopyWith<$Res> { + _$Bolt12ParseErrorCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; +} + +/// @nodoc +abstract class _$$Bolt12ParseError_InvalidContinuationImplCopyWith<$Res> { + factory _$$Bolt12ParseError_InvalidContinuationImplCopyWith( + _$Bolt12ParseError_InvalidContinuationImpl value, + $Res Function(_$Bolt12ParseError_InvalidContinuationImpl) then) = + __$$Bolt12ParseError_InvalidContinuationImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$Bolt12ParseError_InvalidContinuationImplCopyWithImpl<$Res> + extends _$Bolt12ParseErrorCopyWithImpl<$Res, + _$Bolt12ParseError_InvalidContinuationImpl> + implements _$$Bolt12ParseError_InvalidContinuationImplCopyWith<$Res> { + __$$Bolt12ParseError_InvalidContinuationImplCopyWithImpl( + _$Bolt12ParseError_InvalidContinuationImpl _value, + $Res Function(_$Bolt12ParseError_InvalidContinuationImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$Bolt12ParseError_InvalidContinuationImpl + extends Bolt12ParseError_InvalidContinuation { + const _$Bolt12ParseError_InvalidContinuationImpl() : super._(); + + @override + String toString() { + return 'Bolt12ParseError.invalidContinuation()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Bolt12ParseError_InvalidContinuationImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidContinuation, + required TResult Function() invalidBech32Hrp, + required TResult Function(String field0) bech32, + required TResult Function(DecodeError field0) decode, + required TResult Function(String field0) invalidSemantics, + required TResult Function(String field0) invalidSignature, + }) { + return invalidContinuation(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidContinuation, + TResult? Function()? invalidBech32Hrp, + TResult? Function(String field0)? bech32, + TResult? Function(DecodeError field0)? decode, + TResult? Function(String field0)? invalidSemantics, + TResult? Function(String field0)? invalidSignature, + }) { + return invalidContinuation?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidContinuation, + TResult Function()? invalidBech32Hrp, + TResult Function(String field0)? bech32, + TResult Function(DecodeError field0)? decode, + TResult Function(String field0)? invalidSemantics, + TResult Function(String field0)? invalidSignature, + required TResult orElse(), + }) { + if (invalidContinuation != null) { + return invalidContinuation(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Bolt12ParseError_InvalidContinuation value) + invalidContinuation, + required TResult Function(Bolt12ParseError_InvalidBech32Hrp value) + invalidBech32Hrp, + required TResult Function(Bolt12ParseError_Bech32 value) bech32, + required TResult Function(Bolt12ParseError_Decode value) decode, + required TResult Function(Bolt12ParseError_InvalidSemantics value) + invalidSemantics, + required TResult Function(Bolt12ParseError_InvalidSignature value) + invalidSignature, + }) { + return invalidContinuation(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult? Function(Bolt12ParseError_InvalidBech32Hrp value)? + invalidBech32Hrp, + TResult? Function(Bolt12ParseError_Bech32 value)? bech32, + TResult? Function(Bolt12ParseError_Decode value)? decode, + TResult? Function(Bolt12ParseError_InvalidSemantics value)? + invalidSemantics, + TResult? Function(Bolt12ParseError_InvalidSignature value)? + invalidSignature, + }) { + return invalidContinuation?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult Function(Bolt12ParseError_InvalidBech32Hrp value)? invalidBech32Hrp, + TResult Function(Bolt12ParseError_Bech32 value)? bech32, + TResult Function(Bolt12ParseError_Decode value)? decode, + TResult Function(Bolt12ParseError_InvalidSemantics value)? invalidSemantics, + TResult Function(Bolt12ParseError_InvalidSignature value)? invalidSignature, + required TResult orElse(), + }) { + if (invalidContinuation != null) { + return invalidContinuation(this); + } + return orElse(); + } +} + +abstract class Bolt12ParseError_InvalidContinuation extends Bolt12ParseError { + const factory Bolt12ParseError_InvalidContinuation() = + _$Bolt12ParseError_InvalidContinuationImpl; + const Bolt12ParseError_InvalidContinuation._() : super._(); +} + +/// @nodoc +abstract class _$$Bolt12ParseError_InvalidBech32HrpImplCopyWith<$Res> { + factory _$$Bolt12ParseError_InvalidBech32HrpImplCopyWith( + _$Bolt12ParseError_InvalidBech32HrpImpl value, + $Res Function(_$Bolt12ParseError_InvalidBech32HrpImpl) then) = + __$$Bolt12ParseError_InvalidBech32HrpImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$Bolt12ParseError_InvalidBech32HrpImplCopyWithImpl<$Res> + extends _$Bolt12ParseErrorCopyWithImpl<$Res, + _$Bolt12ParseError_InvalidBech32HrpImpl> + implements _$$Bolt12ParseError_InvalidBech32HrpImplCopyWith<$Res> { + __$$Bolt12ParseError_InvalidBech32HrpImplCopyWithImpl( + _$Bolt12ParseError_InvalidBech32HrpImpl _value, + $Res Function(_$Bolt12ParseError_InvalidBech32HrpImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$Bolt12ParseError_InvalidBech32HrpImpl + extends Bolt12ParseError_InvalidBech32Hrp { + const _$Bolt12ParseError_InvalidBech32HrpImpl() : super._(); + + @override + String toString() { + return 'Bolt12ParseError.invalidBech32Hrp()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Bolt12ParseError_InvalidBech32HrpImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidContinuation, + required TResult Function() invalidBech32Hrp, + required TResult Function(String field0) bech32, + required TResult Function(DecodeError field0) decode, + required TResult Function(String field0) invalidSemantics, + required TResult Function(String field0) invalidSignature, + }) { + return invalidBech32Hrp(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidContinuation, + TResult? Function()? invalidBech32Hrp, + TResult? Function(String field0)? bech32, + TResult? Function(DecodeError field0)? decode, + TResult? Function(String field0)? invalidSemantics, + TResult? Function(String field0)? invalidSignature, + }) { + return invalidBech32Hrp?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidContinuation, + TResult Function()? invalidBech32Hrp, + TResult Function(String field0)? bech32, + TResult Function(DecodeError field0)? decode, + TResult Function(String field0)? invalidSemantics, + TResult Function(String field0)? invalidSignature, + required TResult orElse(), + }) { + if (invalidBech32Hrp != null) { + return invalidBech32Hrp(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Bolt12ParseError_InvalidContinuation value) + invalidContinuation, + required TResult Function(Bolt12ParseError_InvalidBech32Hrp value) + invalidBech32Hrp, + required TResult Function(Bolt12ParseError_Bech32 value) bech32, + required TResult Function(Bolt12ParseError_Decode value) decode, + required TResult Function(Bolt12ParseError_InvalidSemantics value) + invalidSemantics, + required TResult Function(Bolt12ParseError_InvalidSignature value) + invalidSignature, + }) { + return invalidBech32Hrp(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult? Function(Bolt12ParseError_InvalidBech32Hrp value)? + invalidBech32Hrp, + TResult? Function(Bolt12ParseError_Bech32 value)? bech32, + TResult? Function(Bolt12ParseError_Decode value)? decode, + TResult? Function(Bolt12ParseError_InvalidSemantics value)? + invalidSemantics, + TResult? Function(Bolt12ParseError_InvalidSignature value)? + invalidSignature, + }) { + return invalidBech32Hrp?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult Function(Bolt12ParseError_InvalidBech32Hrp value)? invalidBech32Hrp, + TResult Function(Bolt12ParseError_Bech32 value)? bech32, + TResult Function(Bolt12ParseError_Decode value)? decode, + TResult Function(Bolt12ParseError_InvalidSemantics value)? invalidSemantics, + TResult Function(Bolt12ParseError_InvalidSignature value)? invalidSignature, + required TResult orElse(), + }) { + if (invalidBech32Hrp != null) { + return invalidBech32Hrp(this); + } + return orElse(); + } +} + +abstract class Bolt12ParseError_InvalidBech32Hrp extends Bolt12ParseError { + const factory Bolt12ParseError_InvalidBech32Hrp() = + _$Bolt12ParseError_InvalidBech32HrpImpl; + const Bolt12ParseError_InvalidBech32Hrp._() : super._(); +} + +/// @nodoc +abstract class _$$Bolt12ParseError_Bech32ImplCopyWith<$Res> { + factory _$$Bolt12ParseError_Bech32ImplCopyWith( + _$Bolt12ParseError_Bech32Impl value, + $Res Function(_$Bolt12ParseError_Bech32Impl) then) = + __$$Bolt12ParseError_Bech32ImplCopyWithImpl<$Res>; + @useResult + $Res call({String field0}); +} + +/// @nodoc +class __$$Bolt12ParseError_Bech32ImplCopyWithImpl<$Res> + extends _$Bolt12ParseErrorCopyWithImpl<$Res, _$Bolt12ParseError_Bech32Impl> + implements _$$Bolt12ParseError_Bech32ImplCopyWith<$Res> { + __$$Bolt12ParseError_Bech32ImplCopyWithImpl( + _$Bolt12ParseError_Bech32Impl _value, + $Res Function(_$Bolt12ParseError_Bech32Impl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? field0 = null, + }) { + return _then(_$Bolt12ParseError_Bech32Impl( + null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc + +class _$Bolt12ParseError_Bech32Impl extends Bolt12ParseError_Bech32 { + const _$Bolt12ParseError_Bech32Impl(this.field0) : super._(); + + @override + final String field0; + + @override + String toString() { + return 'Bolt12ParseError.bech32(field0: $field0)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Bolt12ParseError_Bech32Impl && + (identical(other.field0, field0) || other.field0 == field0)); + } + + @override + int get hashCode => Object.hash(runtimeType, field0); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$Bolt12ParseError_Bech32ImplCopyWith<_$Bolt12ParseError_Bech32Impl> + get copyWith => __$$Bolt12ParseError_Bech32ImplCopyWithImpl< + _$Bolt12ParseError_Bech32Impl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidContinuation, + required TResult Function() invalidBech32Hrp, + required TResult Function(String field0) bech32, + required TResult Function(DecodeError field0) decode, + required TResult Function(String field0) invalidSemantics, + required TResult Function(String field0) invalidSignature, + }) { + return bech32(field0); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidContinuation, + TResult? Function()? invalidBech32Hrp, + TResult? Function(String field0)? bech32, + TResult? Function(DecodeError field0)? decode, + TResult? Function(String field0)? invalidSemantics, + TResult? Function(String field0)? invalidSignature, + }) { + return bech32?.call(field0); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidContinuation, + TResult Function()? invalidBech32Hrp, + TResult Function(String field0)? bech32, + TResult Function(DecodeError field0)? decode, + TResult Function(String field0)? invalidSemantics, + TResult Function(String field0)? invalidSignature, + required TResult orElse(), + }) { + if (bech32 != null) { + return bech32(field0); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Bolt12ParseError_InvalidContinuation value) + invalidContinuation, + required TResult Function(Bolt12ParseError_InvalidBech32Hrp value) + invalidBech32Hrp, + required TResult Function(Bolt12ParseError_Bech32 value) bech32, + required TResult Function(Bolt12ParseError_Decode value) decode, + required TResult Function(Bolt12ParseError_InvalidSemantics value) + invalidSemantics, + required TResult Function(Bolt12ParseError_InvalidSignature value) + invalidSignature, + }) { + return bech32(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult? Function(Bolt12ParseError_InvalidBech32Hrp value)? + invalidBech32Hrp, + TResult? Function(Bolt12ParseError_Bech32 value)? bech32, + TResult? Function(Bolt12ParseError_Decode value)? decode, + TResult? Function(Bolt12ParseError_InvalidSemantics value)? + invalidSemantics, + TResult? Function(Bolt12ParseError_InvalidSignature value)? + invalidSignature, + }) { + return bech32?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult Function(Bolt12ParseError_InvalidBech32Hrp value)? invalidBech32Hrp, + TResult Function(Bolt12ParseError_Bech32 value)? bech32, + TResult Function(Bolt12ParseError_Decode value)? decode, + TResult Function(Bolt12ParseError_InvalidSemantics value)? invalidSemantics, + TResult Function(Bolt12ParseError_InvalidSignature value)? invalidSignature, + required TResult orElse(), + }) { + if (bech32 != null) { + return bech32(this); + } + return orElse(); + } +} + +abstract class Bolt12ParseError_Bech32 extends Bolt12ParseError { + const factory Bolt12ParseError_Bech32(final String field0) = + _$Bolt12ParseError_Bech32Impl; + const Bolt12ParseError_Bech32._() : super._(); + + String get field0; + @JsonKey(ignore: true) + _$$Bolt12ParseError_Bech32ImplCopyWith<_$Bolt12ParseError_Bech32Impl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$Bolt12ParseError_DecodeImplCopyWith<$Res> { + factory _$$Bolt12ParseError_DecodeImplCopyWith( + _$Bolt12ParseError_DecodeImpl value, + $Res Function(_$Bolt12ParseError_DecodeImpl) then) = + __$$Bolt12ParseError_DecodeImplCopyWithImpl<$Res>; + @useResult + $Res call({DecodeError field0}); + + $DecodeErrorCopyWith<$Res> get field0; +} + +/// @nodoc +class __$$Bolt12ParseError_DecodeImplCopyWithImpl<$Res> + extends _$Bolt12ParseErrorCopyWithImpl<$Res, _$Bolt12ParseError_DecodeImpl> + implements _$$Bolt12ParseError_DecodeImplCopyWith<$Res> { + __$$Bolt12ParseError_DecodeImplCopyWithImpl( + _$Bolt12ParseError_DecodeImpl _value, + $Res Function(_$Bolt12ParseError_DecodeImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? field0 = null, + }) { + return _then(_$Bolt12ParseError_DecodeImpl( + null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as DecodeError, + )); + } + + @override + @pragma('vm:prefer-inline') + $DecodeErrorCopyWith<$Res> get field0 { + return $DecodeErrorCopyWith<$Res>(_value.field0, (value) { + return _then(_value.copyWith(field0: value)); + }); + } +} + +/// @nodoc + +class _$Bolt12ParseError_DecodeImpl extends Bolt12ParseError_Decode { + const _$Bolt12ParseError_DecodeImpl(this.field0) : super._(); + + @override + final DecodeError field0; + + @override + String toString() { + return 'Bolt12ParseError.decode(field0: $field0)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Bolt12ParseError_DecodeImpl && + (identical(other.field0, field0) || other.field0 == field0)); + } + + @override + int get hashCode => Object.hash(runtimeType, field0); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$Bolt12ParseError_DecodeImplCopyWith<_$Bolt12ParseError_DecodeImpl> + get copyWith => __$$Bolt12ParseError_DecodeImplCopyWithImpl< + _$Bolt12ParseError_DecodeImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidContinuation, + required TResult Function() invalidBech32Hrp, + required TResult Function(String field0) bech32, + required TResult Function(DecodeError field0) decode, + required TResult Function(String field0) invalidSemantics, + required TResult Function(String field0) invalidSignature, + }) { + return decode(field0); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidContinuation, + TResult? Function()? invalidBech32Hrp, + TResult? Function(String field0)? bech32, + TResult? Function(DecodeError field0)? decode, + TResult? Function(String field0)? invalidSemantics, + TResult? Function(String field0)? invalidSignature, + }) { + return decode?.call(field0); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidContinuation, + TResult Function()? invalidBech32Hrp, + TResult Function(String field0)? bech32, + TResult Function(DecodeError field0)? decode, + TResult Function(String field0)? invalidSemantics, + TResult Function(String field0)? invalidSignature, + required TResult orElse(), + }) { + if (decode != null) { + return decode(field0); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Bolt12ParseError_InvalidContinuation value) + invalidContinuation, + required TResult Function(Bolt12ParseError_InvalidBech32Hrp value) + invalidBech32Hrp, + required TResult Function(Bolt12ParseError_Bech32 value) bech32, + required TResult Function(Bolt12ParseError_Decode value) decode, + required TResult Function(Bolt12ParseError_InvalidSemantics value) + invalidSemantics, + required TResult Function(Bolt12ParseError_InvalidSignature value) + invalidSignature, + }) { + return decode(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult? Function(Bolt12ParseError_InvalidBech32Hrp value)? + invalidBech32Hrp, + TResult? Function(Bolt12ParseError_Bech32 value)? bech32, + TResult? Function(Bolt12ParseError_Decode value)? decode, + TResult? Function(Bolt12ParseError_InvalidSemantics value)? + invalidSemantics, + TResult? Function(Bolt12ParseError_InvalidSignature value)? + invalidSignature, + }) { + return decode?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult Function(Bolt12ParseError_InvalidBech32Hrp value)? invalidBech32Hrp, + TResult Function(Bolt12ParseError_Bech32 value)? bech32, + TResult Function(Bolt12ParseError_Decode value)? decode, + TResult Function(Bolt12ParseError_InvalidSemantics value)? invalidSemantics, + TResult Function(Bolt12ParseError_InvalidSignature value)? invalidSignature, + required TResult orElse(), + }) { + if (decode != null) { + return decode(this); + } + return orElse(); + } +} + +abstract class Bolt12ParseError_Decode extends Bolt12ParseError { + const factory Bolt12ParseError_Decode(final DecodeError field0) = + _$Bolt12ParseError_DecodeImpl; + const Bolt12ParseError_Decode._() : super._(); + + DecodeError get field0; + @JsonKey(ignore: true) + _$$Bolt12ParseError_DecodeImplCopyWith<_$Bolt12ParseError_DecodeImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$Bolt12ParseError_InvalidSemanticsImplCopyWith<$Res> { + factory _$$Bolt12ParseError_InvalidSemanticsImplCopyWith( + _$Bolt12ParseError_InvalidSemanticsImpl value, + $Res Function(_$Bolt12ParseError_InvalidSemanticsImpl) then) = + __$$Bolt12ParseError_InvalidSemanticsImplCopyWithImpl<$Res>; + @useResult + $Res call({String field0}); +} + +/// @nodoc +class __$$Bolt12ParseError_InvalidSemanticsImplCopyWithImpl<$Res> + extends _$Bolt12ParseErrorCopyWithImpl<$Res, + _$Bolt12ParseError_InvalidSemanticsImpl> + implements _$$Bolt12ParseError_InvalidSemanticsImplCopyWith<$Res> { + __$$Bolt12ParseError_InvalidSemanticsImplCopyWithImpl( + _$Bolt12ParseError_InvalidSemanticsImpl _value, + $Res Function(_$Bolt12ParseError_InvalidSemanticsImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? field0 = null, + }) { + return _then(_$Bolt12ParseError_InvalidSemanticsImpl( + null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc + +class _$Bolt12ParseError_InvalidSemanticsImpl + extends Bolt12ParseError_InvalidSemantics { + const _$Bolt12ParseError_InvalidSemanticsImpl(this.field0) : super._(); + + @override + final String field0; + + @override + String toString() { + return 'Bolt12ParseError.invalidSemantics(field0: $field0)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Bolt12ParseError_InvalidSemanticsImpl && + (identical(other.field0, field0) || other.field0 == field0)); + } + + @override + int get hashCode => Object.hash(runtimeType, field0); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$Bolt12ParseError_InvalidSemanticsImplCopyWith< + _$Bolt12ParseError_InvalidSemanticsImpl> + get copyWith => __$$Bolt12ParseError_InvalidSemanticsImplCopyWithImpl< + _$Bolt12ParseError_InvalidSemanticsImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidContinuation, + required TResult Function() invalidBech32Hrp, + required TResult Function(String field0) bech32, + required TResult Function(DecodeError field0) decode, + required TResult Function(String field0) invalidSemantics, + required TResult Function(String field0) invalidSignature, + }) { + return invalidSemantics(field0); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidContinuation, + TResult? Function()? invalidBech32Hrp, + TResult? Function(String field0)? bech32, + TResult? Function(DecodeError field0)? decode, + TResult? Function(String field0)? invalidSemantics, + TResult? Function(String field0)? invalidSignature, + }) { + return invalidSemantics?.call(field0); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidContinuation, + TResult Function()? invalidBech32Hrp, + TResult Function(String field0)? bech32, + TResult Function(DecodeError field0)? decode, + TResult Function(String field0)? invalidSemantics, + TResult Function(String field0)? invalidSignature, + required TResult orElse(), + }) { + if (invalidSemantics != null) { + return invalidSemantics(field0); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Bolt12ParseError_InvalidContinuation value) + invalidContinuation, + required TResult Function(Bolt12ParseError_InvalidBech32Hrp value) + invalidBech32Hrp, + required TResult Function(Bolt12ParseError_Bech32 value) bech32, + required TResult Function(Bolt12ParseError_Decode value) decode, + required TResult Function(Bolt12ParseError_InvalidSemantics value) + invalidSemantics, + required TResult Function(Bolt12ParseError_InvalidSignature value) + invalidSignature, + }) { + return invalidSemantics(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult? Function(Bolt12ParseError_InvalidBech32Hrp value)? + invalidBech32Hrp, + TResult? Function(Bolt12ParseError_Bech32 value)? bech32, + TResult? Function(Bolt12ParseError_Decode value)? decode, + TResult? Function(Bolt12ParseError_InvalidSemantics value)? + invalidSemantics, + TResult? Function(Bolt12ParseError_InvalidSignature value)? + invalidSignature, + }) { + return invalidSemantics?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult Function(Bolt12ParseError_InvalidBech32Hrp value)? invalidBech32Hrp, + TResult Function(Bolt12ParseError_Bech32 value)? bech32, + TResult Function(Bolt12ParseError_Decode value)? decode, + TResult Function(Bolt12ParseError_InvalidSemantics value)? invalidSemantics, + TResult Function(Bolt12ParseError_InvalidSignature value)? invalidSignature, + required TResult orElse(), + }) { + if (invalidSemantics != null) { + return invalidSemantics(this); + } + return orElse(); + } +} + +abstract class Bolt12ParseError_InvalidSemantics extends Bolt12ParseError { + const factory Bolt12ParseError_InvalidSemantics(final String field0) = + _$Bolt12ParseError_InvalidSemanticsImpl; + const Bolt12ParseError_InvalidSemantics._() : super._(); + + String get field0; + @JsonKey(ignore: true) + _$$Bolt12ParseError_InvalidSemanticsImplCopyWith< + _$Bolt12ParseError_InvalidSemanticsImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$Bolt12ParseError_InvalidSignatureImplCopyWith<$Res> { + factory _$$Bolt12ParseError_InvalidSignatureImplCopyWith( + _$Bolt12ParseError_InvalidSignatureImpl value, + $Res Function(_$Bolt12ParseError_InvalidSignatureImpl) then) = + __$$Bolt12ParseError_InvalidSignatureImplCopyWithImpl<$Res>; + @useResult + $Res call({String field0}); +} + +/// @nodoc +class __$$Bolt12ParseError_InvalidSignatureImplCopyWithImpl<$Res> + extends _$Bolt12ParseErrorCopyWithImpl<$Res, + _$Bolt12ParseError_InvalidSignatureImpl> + implements _$$Bolt12ParseError_InvalidSignatureImplCopyWith<$Res> { + __$$Bolt12ParseError_InvalidSignatureImplCopyWithImpl( + _$Bolt12ParseError_InvalidSignatureImpl _value, + $Res Function(_$Bolt12ParseError_InvalidSignatureImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? field0 = null, + }) { + return _then(_$Bolt12ParseError_InvalidSignatureImpl( + null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc + +class _$Bolt12ParseError_InvalidSignatureImpl + extends Bolt12ParseError_InvalidSignature { + const _$Bolt12ParseError_InvalidSignatureImpl(this.field0) : super._(); + + @override + final String field0; + + @override + String toString() { + return 'Bolt12ParseError.invalidSignature(field0: $field0)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$Bolt12ParseError_InvalidSignatureImpl && + (identical(other.field0, field0) || other.field0 == field0)); + } + + @override + int get hashCode => Object.hash(runtimeType, field0); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$Bolt12ParseError_InvalidSignatureImplCopyWith< + _$Bolt12ParseError_InvalidSignatureImpl> + get copyWith => __$$Bolt12ParseError_InvalidSignatureImplCopyWithImpl< + _$Bolt12ParseError_InvalidSignatureImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidContinuation, + required TResult Function() invalidBech32Hrp, + required TResult Function(String field0) bech32, + required TResult Function(DecodeError field0) decode, + required TResult Function(String field0) invalidSemantics, + required TResult Function(String field0) invalidSignature, + }) { + return invalidSignature(field0); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidContinuation, + TResult? Function()? invalidBech32Hrp, + TResult? Function(String field0)? bech32, + TResult? Function(DecodeError field0)? decode, + TResult? Function(String field0)? invalidSemantics, + TResult? Function(String field0)? invalidSignature, + }) { + return invalidSignature?.call(field0); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidContinuation, + TResult Function()? invalidBech32Hrp, + TResult Function(String field0)? bech32, + TResult Function(DecodeError field0)? decode, + TResult Function(String field0)? invalidSemantics, + TResult Function(String field0)? invalidSignature, + required TResult orElse(), + }) { + if (invalidSignature != null) { + return invalidSignature(field0); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Bolt12ParseError_InvalidContinuation value) + invalidContinuation, + required TResult Function(Bolt12ParseError_InvalidBech32Hrp value) + invalidBech32Hrp, + required TResult Function(Bolt12ParseError_Bech32 value) bech32, + required TResult Function(Bolt12ParseError_Decode value) decode, + required TResult Function(Bolt12ParseError_InvalidSemantics value) + invalidSemantics, + required TResult Function(Bolt12ParseError_InvalidSignature value) + invalidSignature, + }) { + return invalidSignature(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult? Function(Bolt12ParseError_InvalidBech32Hrp value)? + invalidBech32Hrp, + TResult? Function(Bolt12ParseError_Bech32 value)? bech32, + TResult? Function(Bolt12ParseError_Decode value)? decode, + TResult? Function(Bolt12ParseError_InvalidSemantics value)? + invalidSemantics, + TResult? Function(Bolt12ParseError_InvalidSignature value)? + invalidSignature, + }) { + return invalidSignature?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Bolt12ParseError_InvalidContinuation value)? + invalidContinuation, + TResult Function(Bolt12ParseError_InvalidBech32Hrp value)? invalidBech32Hrp, + TResult Function(Bolt12ParseError_Bech32 value)? bech32, + TResult Function(Bolt12ParseError_Decode value)? decode, + TResult Function(Bolt12ParseError_InvalidSemantics value)? invalidSemantics, + TResult Function(Bolt12ParseError_InvalidSignature value)? invalidSignature, + required TResult orElse(), + }) { + if (invalidSignature != null) { + return invalidSignature(this); + } + return orElse(); + } +} + +abstract class Bolt12ParseError_InvalidSignature extends Bolt12ParseError { + const factory Bolt12ParseError_InvalidSignature(final String field0) = + _$Bolt12ParseError_InvalidSignatureImpl; + const Bolt12ParseError_InvalidSignature._() : super._(); + + String get field0; + @JsonKey(ignore: true) + _$$Bolt12ParseError_InvalidSignatureImplCopyWith< + _$Bolt12ParseError_InvalidSignatureImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +mixin _$DecodeError { + @optionalTypeArgs + TResult when({ + required TResult Function() unknownVersion, + required TResult Function() unknownRequiredFeature, + required TResult Function() invalidValue, + required TResult Function() shortRead, + required TResult Function() badLengthDescriptor, + required TResult Function(String field0) io, + required TResult Function() unsupportedCompression, + required TResult Function() dangerousValue, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? unknownVersion, + TResult? Function()? unknownRequiredFeature, + TResult? Function()? invalidValue, + TResult? Function()? shortRead, + TResult? Function()? badLengthDescriptor, + TResult? Function(String field0)? io, + TResult? Function()? unsupportedCompression, + TResult? Function()? dangerousValue, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? unknownVersion, + TResult Function()? unknownRequiredFeature, + TResult Function()? invalidValue, + TResult Function()? shortRead, + TResult Function()? badLengthDescriptor, + TResult Function(String field0)? io, + TResult Function()? unsupportedCompression, + TResult Function()? dangerousValue, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map({ + required TResult Function(DecodeError_UnknownVersion value) unknownVersion, + required TResult Function(DecodeError_UnknownRequiredFeature value) + unknownRequiredFeature, + required TResult Function(DecodeError_InvalidValue value) invalidValue, + required TResult Function(DecodeError_ShortRead value) shortRead, + required TResult Function(DecodeError_BadLengthDescriptor value) + badLengthDescriptor, + required TResult Function(DecodeError_Io value) io, + required TResult Function(DecodeError_UnsupportedCompression value) + unsupportedCompression, + required TResult Function(DecodeError_DangerousValue value) dangerousValue, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult? Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult? Function(DecodeError_InvalidValue value)? invalidValue, + TResult? Function(DecodeError_ShortRead value)? shortRead, + TResult? Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult? Function(DecodeError_Io value)? io, + TResult? Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult? Function(DecodeError_DangerousValue value)? dangerousValue, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap({ + TResult Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult Function(DecodeError_InvalidValue value)? invalidValue, + TResult Function(DecodeError_ShortRead value)? shortRead, + TResult Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult Function(DecodeError_Io value)? io, + TResult Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult Function(DecodeError_DangerousValue value)? dangerousValue, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $DecodeErrorCopyWith<$Res> { + factory $DecodeErrorCopyWith( + DecodeError value, $Res Function(DecodeError) then) = + _$DecodeErrorCopyWithImpl<$Res, DecodeError>; +} + +/// @nodoc +class _$DecodeErrorCopyWithImpl<$Res, $Val extends DecodeError> + implements $DecodeErrorCopyWith<$Res> { + _$DecodeErrorCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; +} + +/// @nodoc +abstract class _$$DecodeError_UnknownVersionImplCopyWith<$Res> { + factory _$$DecodeError_UnknownVersionImplCopyWith( + _$DecodeError_UnknownVersionImpl value, + $Res Function(_$DecodeError_UnknownVersionImpl) then) = + __$$DecodeError_UnknownVersionImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$DecodeError_UnknownVersionImplCopyWithImpl<$Res> + extends _$DecodeErrorCopyWithImpl<$Res, _$DecodeError_UnknownVersionImpl> + implements _$$DecodeError_UnknownVersionImplCopyWith<$Res> { + __$$DecodeError_UnknownVersionImplCopyWithImpl( + _$DecodeError_UnknownVersionImpl _value, + $Res Function(_$DecodeError_UnknownVersionImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$DecodeError_UnknownVersionImpl extends DecodeError_UnknownVersion { + const _$DecodeError_UnknownVersionImpl() : super._(); + + @override + String toString() { + return 'DecodeError.unknownVersion()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$DecodeError_UnknownVersionImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() unknownVersion, + required TResult Function() unknownRequiredFeature, + required TResult Function() invalidValue, + required TResult Function() shortRead, + required TResult Function() badLengthDescriptor, + required TResult Function(String field0) io, + required TResult Function() unsupportedCompression, + required TResult Function() dangerousValue, + }) { + return unknownVersion(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? unknownVersion, + TResult? Function()? unknownRequiredFeature, + TResult? Function()? invalidValue, + TResult? Function()? shortRead, + TResult? Function()? badLengthDescriptor, + TResult? Function(String field0)? io, + TResult? Function()? unsupportedCompression, + TResult? Function()? dangerousValue, + }) { + return unknownVersion?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? unknownVersion, + TResult Function()? unknownRequiredFeature, + TResult Function()? invalidValue, + TResult Function()? shortRead, + TResult Function()? badLengthDescriptor, + TResult Function(String field0)? io, + TResult Function()? unsupportedCompression, + TResult Function()? dangerousValue, + required TResult orElse(), + }) { + if (unknownVersion != null) { + return unknownVersion(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(DecodeError_UnknownVersion value) unknownVersion, + required TResult Function(DecodeError_UnknownRequiredFeature value) + unknownRequiredFeature, + required TResult Function(DecodeError_InvalidValue value) invalidValue, + required TResult Function(DecodeError_ShortRead value) shortRead, + required TResult Function(DecodeError_BadLengthDescriptor value) + badLengthDescriptor, + required TResult Function(DecodeError_Io value) io, + required TResult Function(DecodeError_UnsupportedCompression value) + unsupportedCompression, + required TResult Function(DecodeError_DangerousValue value) dangerousValue, + }) { + return unknownVersion(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult? Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult? Function(DecodeError_InvalidValue value)? invalidValue, + TResult? Function(DecodeError_ShortRead value)? shortRead, + TResult? Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult? Function(DecodeError_Io value)? io, + TResult? Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult? Function(DecodeError_DangerousValue value)? dangerousValue, + }) { + return unknownVersion?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult Function(DecodeError_InvalidValue value)? invalidValue, + TResult Function(DecodeError_ShortRead value)? shortRead, + TResult Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult Function(DecodeError_Io value)? io, + TResult Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult Function(DecodeError_DangerousValue value)? dangerousValue, + required TResult orElse(), + }) { + if (unknownVersion != null) { + return unknownVersion(this); + } + return orElse(); + } +} + +abstract class DecodeError_UnknownVersion extends DecodeError { + const factory DecodeError_UnknownVersion() = _$DecodeError_UnknownVersionImpl; + const DecodeError_UnknownVersion._() : super._(); +} + +/// @nodoc +abstract class _$$DecodeError_UnknownRequiredFeatureImplCopyWith<$Res> { + factory _$$DecodeError_UnknownRequiredFeatureImplCopyWith( + _$DecodeError_UnknownRequiredFeatureImpl value, + $Res Function(_$DecodeError_UnknownRequiredFeatureImpl) then) = + __$$DecodeError_UnknownRequiredFeatureImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$DecodeError_UnknownRequiredFeatureImplCopyWithImpl<$Res> + extends _$DecodeErrorCopyWithImpl<$Res, + _$DecodeError_UnknownRequiredFeatureImpl> + implements _$$DecodeError_UnknownRequiredFeatureImplCopyWith<$Res> { + __$$DecodeError_UnknownRequiredFeatureImplCopyWithImpl( + _$DecodeError_UnknownRequiredFeatureImpl _value, + $Res Function(_$DecodeError_UnknownRequiredFeatureImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$DecodeError_UnknownRequiredFeatureImpl + extends DecodeError_UnknownRequiredFeature { + const _$DecodeError_UnknownRequiredFeatureImpl() : super._(); + + @override + String toString() { + return 'DecodeError.unknownRequiredFeature()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$DecodeError_UnknownRequiredFeatureImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() unknownVersion, + required TResult Function() unknownRequiredFeature, + required TResult Function() invalidValue, + required TResult Function() shortRead, + required TResult Function() badLengthDescriptor, + required TResult Function(String field0) io, + required TResult Function() unsupportedCompression, + required TResult Function() dangerousValue, + }) { + return unknownRequiredFeature(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? unknownVersion, + TResult? Function()? unknownRequiredFeature, + TResult? Function()? invalidValue, + TResult? Function()? shortRead, + TResult? Function()? badLengthDescriptor, + TResult? Function(String field0)? io, + TResult? Function()? unsupportedCompression, + TResult? Function()? dangerousValue, + }) { + return unknownRequiredFeature?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? unknownVersion, + TResult Function()? unknownRequiredFeature, + TResult Function()? invalidValue, + TResult Function()? shortRead, + TResult Function()? badLengthDescriptor, + TResult Function(String field0)? io, + TResult Function()? unsupportedCompression, + TResult Function()? dangerousValue, + required TResult orElse(), + }) { + if (unknownRequiredFeature != null) { + return unknownRequiredFeature(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(DecodeError_UnknownVersion value) unknownVersion, + required TResult Function(DecodeError_UnknownRequiredFeature value) + unknownRequiredFeature, + required TResult Function(DecodeError_InvalidValue value) invalidValue, + required TResult Function(DecodeError_ShortRead value) shortRead, + required TResult Function(DecodeError_BadLengthDescriptor value) + badLengthDescriptor, + required TResult Function(DecodeError_Io value) io, + required TResult Function(DecodeError_UnsupportedCompression value) + unsupportedCompression, + required TResult Function(DecodeError_DangerousValue value) dangerousValue, + }) { + return unknownRequiredFeature(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult? Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult? Function(DecodeError_InvalidValue value)? invalidValue, + TResult? Function(DecodeError_ShortRead value)? shortRead, + TResult? Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult? Function(DecodeError_Io value)? io, + TResult? Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult? Function(DecodeError_DangerousValue value)? dangerousValue, + }) { + return unknownRequiredFeature?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult Function(DecodeError_InvalidValue value)? invalidValue, + TResult Function(DecodeError_ShortRead value)? shortRead, + TResult Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult Function(DecodeError_Io value)? io, + TResult Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult Function(DecodeError_DangerousValue value)? dangerousValue, + required TResult orElse(), + }) { + if (unknownRequiredFeature != null) { + return unknownRequiredFeature(this); + } + return orElse(); + } +} + +abstract class DecodeError_UnknownRequiredFeature extends DecodeError { + const factory DecodeError_UnknownRequiredFeature() = + _$DecodeError_UnknownRequiredFeatureImpl; + const DecodeError_UnknownRequiredFeature._() : super._(); +} + +/// @nodoc +abstract class _$$DecodeError_InvalidValueImplCopyWith<$Res> { + factory _$$DecodeError_InvalidValueImplCopyWith( + _$DecodeError_InvalidValueImpl value, + $Res Function(_$DecodeError_InvalidValueImpl) then) = + __$$DecodeError_InvalidValueImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$DecodeError_InvalidValueImplCopyWithImpl<$Res> + extends _$DecodeErrorCopyWithImpl<$Res, _$DecodeError_InvalidValueImpl> + implements _$$DecodeError_InvalidValueImplCopyWith<$Res> { + __$$DecodeError_InvalidValueImplCopyWithImpl( + _$DecodeError_InvalidValueImpl _value, + $Res Function(_$DecodeError_InvalidValueImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$DecodeError_InvalidValueImpl extends DecodeError_InvalidValue { + const _$DecodeError_InvalidValueImpl() : super._(); + + @override + String toString() { + return 'DecodeError.invalidValue()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$DecodeError_InvalidValueImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() unknownVersion, + required TResult Function() unknownRequiredFeature, + required TResult Function() invalidValue, + required TResult Function() shortRead, + required TResult Function() badLengthDescriptor, + required TResult Function(String field0) io, + required TResult Function() unsupportedCompression, + required TResult Function() dangerousValue, + }) { + return invalidValue(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? unknownVersion, + TResult? Function()? unknownRequiredFeature, + TResult? Function()? invalidValue, + TResult? Function()? shortRead, + TResult? Function()? badLengthDescriptor, + TResult? Function(String field0)? io, + TResult? Function()? unsupportedCompression, + TResult? Function()? dangerousValue, + }) { + return invalidValue?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? unknownVersion, + TResult Function()? unknownRequiredFeature, + TResult Function()? invalidValue, + TResult Function()? shortRead, + TResult Function()? badLengthDescriptor, + TResult Function(String field0)? io, + TResult Function()? unsupportedCompression, + TResult Function()? dangerousValue, + required TResult orElse(), + }) { + if (invalidValue != null) { + return invalidValue(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(DecodeError_UnknownVersion value) unknownVersion, + required TResult Function(DecodeError_UnknownRequiredFeature value) + unknownRequiredFeature, + required TResult Function(DecodeError_InvalidValue value) invalidValue, + required TResult Function(DecodeError_ShortRead value) shortRead, + required TResult Function(DecodeError_BadLengthDescriptor value) + badLengthDescriptor, + required TResult Function(DecodeError_Io value) io, + required TResult Function(DecodeError_UnsupportedCompression value) + unsupportedCompression, + required TResult Function(DecodeError_DangerousValue value) dangerousValue, + }) { + return invalidValue(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult? Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult? Function(DecodeError_InvalidValue value)? invalidValue, + TResult? Function(DecodeError_ShortRead value)? shortRead, + TResult? Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult? Function(DecodeError_Io value)? io, + TResult? Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult? Function(DecodeError_DangerousValue value)? dangerousValue, + }) { + return invalidValue?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult Function(DecodeError_InvalidValue value)? invalidValue, + TResult Function(DecodeError_ShortRead value)? shortRead, + TResult Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult Function(DecodeError_Io value)? io, + TResult Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult Function(DecodeError_DangerousValue value)? dangerousValue, + required TResult orElse(), + }) { + if (invalidValue != null) { + return invalidValue(this); + } + return orElse(); + } +} + +abstract class DecodeError_InvalidValue extends DecodeError { + const factory DecodeError_InvalidValue() = _$DecodeError_InvalidValueImpl; + const DecodeError_InvalidValue._() : super._(); +} + +/// @nodoc +abstract class _$$DecodeError_ShortReadImplCopyWith<$Res> { + factory _$$DecodeError_ShortReadImplCopyWith( + _$DecodeError_ShortReadImpl value, + $Res Function(_$DecodeError_ShortReadImpl) then) = + __$$DecodeError_ShortReadImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$DecodeError_ShortReadImplCopyWithImpl<$Res> + extends _$DecodeErrorCopyWithImpl<$Res, _$DecodeError_ShortReadImpl> + implements _$$DecodeError_ShortReadImplCopyWith<$Res> { + __$$DecodeError_ShortReadImplCopyWithImpl(_$DecodeError_ShortReadImpl _value, + $Res Function(_$DecodeError_ShortReadImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$DecodeError_ShortReadImpl extends DecodeError_ShortRead { + const _$DecodeError_ShortReadImpl() : super._(); + + @override + String toString() { + return 'DecodeError.shortRead()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$DecodeError_ShortReadImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() unknownVersion, + required TResult Function() unknownRequiredFeature, + required TResult Function() invalidValue, + required TResult Function() shortRead, + required TResult Function() badLengthDescriptor, + required TResult Function(String field0) io, + required TResult Function() unsupportedCompression, + required TResult Function() dangerousValue, + }) { + return shortRead(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? unknownVersion, + TResult? Function()? unknownRequiredFeature, + TResult? Function()? invalidValue, + TResult? Function()? shortRead, + TResult? Function()? badLengthDescriptor, + TResult? Function(String field0)? io, + TResult? Function()? unsupportedCompression, + TResult? Function()? dangerousValue, + }) { + return shortRead?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? unknownVersion, + TResult Function()? unknownRequiredFeature, + TResult Function()? invalidValue, + TResult Function()? shortRead, + TResult Function()? badLengthDescriptor, + TResult Function(String field0)? io, + TResult Function()? unsupportedCompression, + TResult Function()? dangerousValue, + required TResult orElse(), + }) { + if (shortRead != null) { + return shortRead(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(DecodeError_UnknownVersion value) unknownVersion, + required TResult Function(DecodeError_UnknownRequiredFeature value) + unknownRequiredFeature, + required TResult Function(DecodeError_InvalidValue value) invalidValue, + required TResult Function(DecodeError_ShortRead value) shortRead, + required TResult Function(DecodeError_BadLengthDescriptor value) + badLengthDescriptor, + required TResult Function(DecodeError_Io value) io, + required TResult Function(DecodeError_UnsupportedCompression value) + unsupportedCompression, + required TResult Function(DecodeError_DangerousValue value) dangerousValue, + }) { + return shortRead(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult? Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult? Function(DecodeError_InvalidValue value)? invalidValue, + TResult? Function(DecodeError_ShortRead value)? shortRead, + TResult? Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult? Function(DecodeError_Io value)? io, + TResult? Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult? Function(DecodeError_DangerousValue value)? dangerousValue, + }) { + return shortRead?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult Function(DecodeError_InvalidValue value)? invalidValue, + TResult Function(DecodeError_ShortRead value)? shortRead, + TResult Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult Function(DecodeError_Io value)? io, + TResult Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult Function(DecodeError_DangerousValue value)? dangerousValue, + required TResult orElse(), + }) { + if (shortRead != null) { + return shortRead(this); + } + return orElse(); + } +} + +abstract class DecodeError_ShortRead extends DecodeError { + const factory DecodeError_ShortRead() = _$DecodeError_ShortReadImpl; + const DecodeError_ShortRead._() : super._(); +} + +/// @nodoc +abstract class _$$DecodeError_BadLengthDescriptorImplCopyWith<$Res> { + factory _$$DecodeError_BadLengthDescriptorImplCopyWith( + _$DecodeError_BadLengthDescriptorImpl value, + $Res Function(_$DecodeError_BadLengthDescriptorImpl) then) = + __$$DecodeError_BadLengthDescriptorImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$DecodeError_BadLengthDescriptorImplCopyWithImpl<$Res> + extends _$DecodeErrorCopyWithImpl<$Res, + _$DecodeError_BadLengthDescriptorImpl> + implements _$$DecodeError_BadLengthDescriptorImplCopyWith<$Res> { + __$$DecodeError_BadLengthDescriptorImplCopyWithImpl( + _$DecodeError_BadLengthDescriptorImpl _value, + $Res Function(_$DecodeError_BadLengthDescriptorImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$DecodeError_BadLengthDescriptorImpl + extends DecodeError_BadLengthDescriptor { + const _$DecodeError_BadLengthDescriptorImpl() : super._(); + + @override + String toString() { + return 'DecodeError.badLengthDescriptor()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$DecodeError_BadLengthDescriptorImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() unknownVersion, + required TResult Function() unknownRequiredFeature, + required TResult Function() invalidValue, + required TResult Function() shortRead, + required TResult Function() badLengthDescriptor, + required TResult Function(String field0) io, + required TResult Function() unsupportedCompression, + required TResult Function() dangerousValue, + }) { + return badLengthDescriptor(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? unknownVersion, + TResult? Function()? unknownRequiredFeature, + TResult? Function()? invalidValue, + TResult? Function()? shortRead, + TResult? Function()? badLengthDescriptor, + TResult? Function(String field0)? io, + TResult? Function()? unsupportedCompression, + TResult? Function()? dangerousValue, + }) { + return badLengthDescriptor?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? unknownVersion, + TResult Function()? unknownRequiredFeature, + TResult Function()? invalidValue, + TResult Function()? shortRead, + TResult Function()? badLengthDescriptor, + TResult Function(String field0)? io, + TResult Function()? unsupportedCompression, + TResult Function()? dangerousValue, + required TResult orElse(), + }) { + if (badLengthDescriptor != null) { + return badLengthDescriptor(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(DecodeError_UnknownVersion value) unknownVersion, + required TResult Function(DecodeError_UnknownRequiredFeature value) + unknownRequiredFeature, + required TResult Function(DecodeError_InvalidValue value) invalidValue, + required TResult Function(DecodeError_ShortRead value) shortRead, + required TResult Function(DecodeError_BadLengthDescriptor value) + badLengthDescriptor, + required TResult Function(DecodeError_Io value) io, + required TResult Function(DecodeError_UnsupportedCompression value) + unsupportedCompression, + required TResult Function(DecodeError_DangerousValue value) dangerousValue, + }) { + return badLengthDescriptor(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult? Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult? Function(DecodeError_InvalidValue value)? invalidValue, + TResult? Function(DecodeError_ShortRead value)? shortRead, + TResult? Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult? Function(DecodeError_Io value)? io, + TResult? Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult? Function(DecodeError_DangerousValue value)? dangerousValue, + }) { + return badLengthDescriptor?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult Function(DecodeError_InvalidValue value)? invalidValue, + TResult Function(DecodeError_ShortRead value)? shortRead, + TResult Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult Function(DecodeError_Io value)? io, + TResult Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult Function(DecodeError_DangerousValue value)? dangerousValue, + required TResult orElse(), + }) { + if (badLengthDescriptor != null) { + return badLengthDescriptor(this); + } + return orElse(); + } +} + +abstract class DecodeError_BadLengthDescriptor extends DecodeError { + const factory DecodeError_BadLengthDescriptor() = + _$DecodeError_BadLengthDescriptorImpl; + const DecodeError_BadLengthDescriptor._() : super._(); +} + +/// @nodoc +abstract class _$$DecodeError_IoImplCopyWith<$Res> { + factory _$$DecodeError_IoImplCopyWith(_$DecodeError_IoImpl value, + $Res Function(_$DecodeError_IoImpl) then) = + __$$DecodeError_IoImplCopyWithImpl<$Res>; + @useResult + $Res call({String field0}); +} + +/// @nodoc +class __$$DecodeError_IoImplCopyWithImpl<$Res> + extends _$DecodeErrorCopyWithImpl<$Res, _$DecodeError_IoImpl> + implements _$$DecodeError_IoImplCopyWith<$Res> { + __$$DecodeError_IoImplCopyWithImpl( + _$DecodeError_IoImpl _value, $Res Function(_$DecodeError_IoImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? field0 = null, + }) { + return _then(_$DecodeError_IoImpl( + null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc + +class _$DecodeError_IoImpl extends DecodeError_Io { + const _$DecodeError_IoImpl(this.field0) : super._(); + + @override + final String field0; + + @override + String toString() { + return 'DecodeError.io(field0: $field0)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$DecodeError_IoImpl && + (identical(other.field0, field0) || other.field0 == field0)); + } + + @override + int get hashCode => Object.hash(runtimeType, field0); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$DecodeError_IoImplCopyWith<_$DecodeError_IoImpl> get copyWith => + __$$DecodeError_IoImplCopyWithImpl<_$DecodeError_IoImpl>( + this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() unknownVersion, + required TResult Function() unknownRequiredFeature, + required TResult Function() invalidValue, + required TResult Function() shortRead, + required TResult Function() badLengthDescriptor, + required TResult Function(String field0) io, + required TResult Function() unsupportedCompression, + required TResult Function() dangerousValue, + }) { + return io(field0); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? unknownVersion, + TResult? Function()? unknownRequiredFeature, + TResult? Function()? invalidValue, + TResult? Function()? shortRead, + TResult? Function()? badLengthDescriptor, + TResult? Function(String field0)? io, + TResult? Function()? unsupportedCompression, + TResult? Function()? dangerousValue, + }) { + return io?.call(field0); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? unknownVersion, + TResult Function()? unknownRequiredFeature, + TResult Function()? invalidValue, + TResult Function()? shortRead, + TResult Function()? badLengthDescriptor, + TResult Function(String field0)? io, + TResult Function()? unsupportedCompression, + TResult Function()? dangerousValue, + required TResult orElse(), + }) { + if (io != null) { + return io(field0); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(DecodeError_UnknownVersion value) unknownVersion, + required TResult Function(DecodeError_UnknownRequiredFeature value) + unknownRequiredFeature, + required TResult Function(DecodeError_InvalidValue value) invalidValue, + required TResult Function(DecodeError_ShortRead value) shortRead, + required TResult Function(DecodeError_BadLengthDescriptor value) + badLengthDescriptor, + required TResult Function(DecodeError_Io value) io, + required TResult Function(DecodeError_UnsupportedCompression value) + unsupportedCompression, + required TResult Function(DecodeError_DangerousValue value) dangerousValue, + }) { + return io(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult? Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult? Function(DecodeError_InvalidValue value)? invalidValue, + TResult? Function(DecodeError_ShortRead value)? shortRead, + TResult? Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult? Function(DecodeError_Io value)? io, + TResult? Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult? Function(DecodeError_DangerousValue value)? dangerousValue, + }) { + return io?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult Function(DecodeError_InvalidValue value)? invalidValue, + TResult Function(DecodeError_ShortRead value)? shortRead, + TResult Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult Function(DecodeError_Io value)? io, + TResult Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult Function(DecodeError_DangerousValue value)? dangerousValue, + required TResult orElse(), + }) { + if (io != null) { + return io(this); + } + return orElse(); + } +} + +abstract class DecodeError_Io extends DecodeError { + const factory DecodeError_Io(final String field0) = _$DecodeError_IoImpl; + const DecodeError_Io._() : super._(); + + String get field0; + @JsonKey(ignore: true) + _$$DecodeError_IoImplCopyWith<_$DecodeError_IoImpl> get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$DecodeError_UnsupportedCompressionImplCopyWith<$Res> { + factory _$$DecodeError_UnsupportedCompressionImplCopyWith( + _$DecodeError_UnsupportedCompressionImpl value, + $Res Function(_$DecodeError_UnsupportedCompressionImpl) then) = + __$$DecodeError_UnsupportedCompressionImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$DecodeError_UnsupportedCompressionImplCopyWithImpl<$Res> + extends _$DecodeErrorCopyWithImpl<$Res, + _$DecodeError_UnsupportedCompressionImpl> + implements _$$DecodeError_UnsupportedCompressionImplCopyWith<$Res> { + __$$DecodeError_UnsupportedCompressionImplCopyWithImpl( + _$DecodeError_UnsupportedCompressionImpl _value, + $Res Function(_$DecodeError_UnsupportedCompressionImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$DecodeError_UnsupportedCompressionImpl + extends DecodeError_UnsupportedCompression { + const _$DecodeError_UnsupportedCompressionImpl() : super._(); + + @override + String toString() { + return 'DecodeError.unsupportedCompression()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$DecodeError_UnsupportedCompressionImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() unknownVersion, + required TResult Function() unknownRequiredFeature, + required TResult Function() invalidValue, + required TResult Function() shortRead, + required TResult Function() badLengthDescriptor, + required TResult Function(String field0) io, + required TResult Function() unsupportedCompression, + required TResult Function() dangerousValue, + }) { + return unsupportedCompression(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? unknownVersion, + TResult? Function()? unknownRequiredFeature, + TResult? Function()? invalidValue, + TResult? Function()? shortRead, + TResult? Function()? badLengthDescriptor, + TResult? Function(String field0)? io, + TResult? Function()? unsupportedCompression, + TResult? Function()? dangerousValue, + }) { + return unsupportedCompression?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? unknownVersion, + TResult Function()? unknownRequiredFeature, + TResult Function()? invalidValue, + TResult Function()? shortRead, + TResult Function()? badLengthDescriptor, + TResult Function(String field0)? io, + TResult Function()? unsupportedCompression, + TResult Function()? dangerousValue, + required TResult orElse(), + }) { + if (unsupportedCompression != null) { + return unsupportedCompression(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(DecodeError_UnknownVersion value) unknownVersion, + required TResult Function(DecodeError_UnknownRequiredFeature value) + unknownRequiredFeature, + required TResult Function(DecodeError_InvalidValue value) invalidValue, + required TResult Function(DecodeError_ShortRead value) shortRead, + required TResult Function(DecodeError_BadLengthDescriptor value) + badLengthDescriptor, + required TResult Function(DecodeError_Io value) io, + required TResult Function(DecodeError_UnsupportedCompression value) + unsupportedCompression, + required TResult Function(DecodeError_DangerousValue value) dangerousValue, + }) { + return unsupportedCompression(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult? Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult? Function(DecodeError_InvalidValue value)? invalidValue, + TResult? Function(DecodeError_ShortRead value)? shortRead, + TResult? Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult? Function(DecodeError_Io value)? io, + TResult? Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult? Function(DecodeError_DangerousValue value)? dangerousValue, + }) { + return unsupportedCompression?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult Function(DecodeError_InvalidValue value)? invalidValue, + TResult Function(DecodeError_ShortRead value)? shortRead, + TResult Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult Function(DecodeError_Io value)? io, + TResult Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult Function(DecodeError_DangerousValue value)? dangerousValue, + required TResult orElse(), + }) { + if (unsupportedCompression != null) { + return unsupportedCompression(this); + } + return orElse(); + } +} + +abstract class DecodeError_UnsupportedCompression extends DecodeError { + const factory DecodeError_UnsupportedCompression() = + _$DecodeError_UnsupportedCompressionImpl; + const DecodeError_UnsupportedCompression._() : super._(); +} + +/// @nodoc +abstract class _$$DecodeError_DangerousValueImplCopyWith<$Res> { + factory _$$DecodeError_DangerousValueImplCopyWith( + _$DecodeError_DangerousValueImpl value, + $Res Function(_$DecodeError_DangerousValueImpl) then) = + __$$DecodeError_DangerousValueImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$DecodeError_DangerousValueImplCopyWithImpl<$Res> + extends _$DecodeErrorCopyWithImpl<$Res, _$DecodeError_DangerousValueImpl> + implements _$$DecodeError_DangerousValueImplCopyWith<$Res> { + __$$DecodeError_DangerousValueImplCopyWithImpl( + _$DecodeError_DangerousValueImpl _value, + $Res Function(_$DecodeError_DangerousValueImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$DecodeError_DangerousValueImpl extends DecodeError_DangerousValue { + const _$DecodeError_DangerousValueImpl() : super._(); + + @override + String toString() { + return 'DecodeError.dangerousValue()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$DecodeError_DangerousValueImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() unknownVersion, + required TResult Function() unknownRequiredFeature, + required TResult Function() invalidValue, + required TResult Function() shortRead, + required TResult Function() badLengthDescriptor, + required TResult Function(String field0) io, + required TResult Function() unsupportedCompression, + required TResult Function() dangerousValue, + }) { + return dangerousValue(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? unknownVersion, + TResult? Function()? unknownRequiredFeature, + TResult? Function()? invalidValue, + TResult? Function()? shortRead, + TResult? Function()? badLengthDescriptor, + TResult? Function(String field0)? io, + TResult? Function()? unsupportedCompression, + TResult? Function()? dangerousValue, + }) { + return dangerousValue?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? unknownVersion, + TResult Function()? unknownRequiredFeature, + TResult Function()? invalidValue, + TResult Function()? shortRead, + TResult Function()? badLengthDescriptor, + TResult Function(String field0)? io, + TResult Function()? unsupportedCompression, + TResult Function()? dangerousValue, + required TResult orElse(), + }) { + if (dangerousValue != null) { + return dangerousValue(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(DecodeError_UnknownVersion value) unknownVersion, + required TResult Function(DecodeError_UnknownRequiredFeature value) + unknownRequiredFeature, + required TResult Function(DecodeError_InvalidValue value) invalidValue, + required TResult Function(DecodeError_ShortRead value) shortRead, + required TResult Function(DecodeError_BadLengthDescriptor value) + badLengthDescriptor, + required TResult Function(DecodeError_Io value) io, + required TResult Function(DecodeError_UnsupportedCompression value) + unsupportedCompression, + required TResult Function(DecodeError_DangerousValue value) dangerousValue, + }) { + return dangerousValue(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult? Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult? Function(DecodeError_InvalidValue value)? invalidValue, + TResult? Function(DecodeError_ShortRead value)? shortRead, + TResult? Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult? Function(DecodeError_Io value)? io, + TResult? Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult? Function(DecodeError_DangerousValue value)? dangerousValue, + }) { + return dangerousValue?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(DecodeError_UnknownVersion value)? unknownVersion, + TResult Function(DecodeError_UnknownRequiredFeature value)? + unknownRequiredFeature, + TResult Function(DecodeError_InvalidValue value)? invalidValue, + TResult Function(DecodeError_ShortRead value)? shortRead, + TResult Function(DecodeError_BadLengthDescriptor value)? + badLengthDescriptor, + TResult Function(DecodeError_Io value)? io, + TResult Function(DecodeError_UnsupportedCompression value)? + unsupportedCompression, + TResult Function(DecodeError_DangerousValue value)? dangerousValue, + required TResult orElse(), + }) { + if (dangerousValue != null) { + return dangerousValue(this); + } + return orElse(); + } +} + +abstract class DecodeError_DangerousValue extends DecodeError { + const factory DecodeError_DangerousValue() = _$DecodeError_DangerousValueImpl; + const DecodeError_DangerousValue._() : super._(); +} + +/// @nodoc +mixin _$LdkNodeError { + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $LdkNodeErrorCopyWith<$Res> { + factory $LdkNodeErrorCopyWith( + LdkNodeError value, $Res Function(LdkNodeError) then) = + _$LdkNodeErrorCopyWithImpl<$Res, LdkNodeError>; +} + +/// @nodoc +class _$LdkNodeErrorCopyWithImpl<$Res, $Val extends LdkNodeError> + implements $LdkNodeErrorCopyWith<$Res> { + _$LdkNodeErrorCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidTxidImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidTxidImplCopyWith( + _$LdkNodeError_InvalidTxidImpl value, + $Res Function(_$LdkNodeError_InvalidTxidImpl) then) = + __$$LdkNodeError_InvalidTxidImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidTxidImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_InvalidTxidImpl> + implements _$$LdkNodeError_InvalidTxidImplCopyWith<$Res> { + __$$LdkNodeError_InvalidTxidImplCopyWithImpl( + _$LdkNodeError_InvalidTxidImpl _value, + $Res Function(_$LdkNodeError_InvalidTxidImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidTxidImpl extends LdkNodeError_InvalidTxid { + const _$LdkNodeError_InvalidTxidImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidTxid()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidTxidImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidTxid(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidTxid?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidTxid != null) { + return invalidTxid(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidTxid(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidTxid?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidTxid != null) { + return invalidTxid(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidTxid extends LdkNodeError { + const factory LdkNodeError_InvalidTxid() = _$LdkNodeError_InvalidTxidImpl; + const LdkNodeError_InvalidTxid._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_AlreadyRunningImplCopyWith<$Res> { + factory _$$LdkNodeError_AlreadyRunningImplCopyWith( + _$LdkNodeError_AlreadyRunningImpl value, + $Res Function(_$LdkNodeError_AlreadyRunningImpl) then) = + __$$LdkNodeError_AlreadyRunningImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_AlreadyRunningImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_AlreadyRunningImpl> + implements _$$LdkNodeError_AlreadyRunningImplCopyWith<$Res> { + __$$LdkNodeError_AlreadyRunningImplCopyWithImpl( + _$LdkNodeError_AlreadyRunningImpl _value, + $Res Function(_$LdkNodeError_AlreadyRunningImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_AlreadyRunningImpl extends LdkNodeError_AlreadyRunning { + const _$LdkNodeError_AlreadyRunningImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.alreadyRunning()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_AlreadyRunningImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return alreadyRunning(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return alreadyRunning?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (alreadyRunning != null) { + return alreadyRunning(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return alreadyRunning(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return alreadyRunning?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (alreadyRunning != null) { + return alreadyRunning(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_AlreadyRunning extends LdkNodeError { + const factory LdkNodeError_AlreadyRunning() = + _$LdkNodeError_AlreadyRunningImpl; + const LdkNodeError_AlreadyRunning._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_NotRunningImplCopyWith<$Res> { + factory _$$LdkNodeError_NotRunningImplCopyWith( + _$LdkNodeError_NotRunningImpl value, + $Res Function(_$LdkNodeError_NotRunningImpl) then) = + __$$LdkNodeError_NotRunningImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_NotRunningImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_NotRunningImpl> + implements _$$LdkNodeError_NotRunningImplCopyWith<$Res> { + __$$LdkNodeError_NotRunningImplCopyWithImpl( + _$LdkNodeError_NotRunningImpl _value, + $Res Function(_$LdkNodeError_NotRunningImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_NotRunningImpl extends LdkNodeError_NotRunning { + const _$LdkNodeError_NotRunningImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.notRunning()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_NotRunningImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return notRunning(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return notRunning?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (notRunning != null) { + return notRunning(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return notRunning(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return notRunning?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (notRunning != null) { + return notRunning(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_NotRunning extends LdkNodeError { + const factory LdkNodeError_NotRunning() = _$LdkNodeError_NotRunningImpl; + const LdkNodeError_NotRunning._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_OnchainTxCreationFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_OnchainTxCreationFailedImplCopyWith( + _$LdkNodeError_OnchainTxCreationFailedImpl value, + $Res Function(_$LdkNodeError_OnchainTxCreationFailedImpl) then) = + __$$LdkNodeError_OnchainTxCreationFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_OnchainTxCreationFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_OnchainTxCreationFailedImpl> + implements _$$LdkNodeError_OnchainTxCreationFailedImplCopyWith<$Res> { + __$$LdkNodeError_OnchainTxCreationFailedImplCopyWithImpl( + _$LdkNodeError_OnchainTxCreationFailedImpl _value, + $Res Function(_$LdkNodeError_OnchainTxCreationFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_OnchainTxCreationFailedImpl + extends LdkNodeError_OnchainTxCreationFailed { + const _$LdkNodeError_OnchainTxCreationFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.onchainTxCreationFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_OnchainTxCreationFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return onchainTxCreationFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return onchainTxCreationFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (onchainTxCreationFailed != null) { + return onchainTxCreationFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return onchainTxCreationFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return onchainTxCreationFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (onchainTxCreationFailed != null) { + return onchainTxCreationFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_OnchainTxCreationFailed extends LdkNodeError { + const factory LdkNodeError_OnchainTxCreationFailed() = + _$LdkNodeError_OnchainTxCreationFailedImpl; + const LdkNodeError_OnchainTxCreationFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_ConnectionFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_ConnectionFailedImplCopyWith( + _$LdkNodeError_ConnectionFailedImpl value, + $Res Function(_$LdkNodeError_ConnectionFailedImpl) then) = + __$$LdkNodeError_ConnectionFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_ConnectionFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_ConnectionFailedImpl> + implements _$$LdkNodeError_ConnectionFailedImplCopyWith<$Res> { + __$$LdkNodeError_ConnectionFailedImplCopyWithImpl( + _$LdkNodeError_ConnectionFailedImpl _value, + $Res Function(_$LdkNodeError_ConnectionFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_ConnectionFailedImpl + extends LdkNodeError_ConnectionFailed { + const _$LdkNodeError_ConnectionFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.connectionFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_ConnectionFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return connectionFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return connectionFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (connectionFailed != null) { + return connectionFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return connectionFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return connectionFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (connectionFailed != null) { + return connectionFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_ConnectionFailed extends LdkNodeError { + const factory LdkNodeError_ConnectionFailed() = + _$LdkNodeError_ConnectionFailedImpl; + const LdkNodeError_ConnectionFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvoiceCreationFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_InvoiceCreationFailedImplCopyWith( + _$LdkNodeError_InvoiceCreationFailedImpl value, + $Res Function(_$LdkNodeError_InvoiceCreationFailedImpl) then) = + __$$LdkNodeError_InvoiceCreationFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvoiceCreationFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InvoiceCreationFailedImpl> + implements _$$LdkNodeError_InvoiceCreationFailedImplCopyWith<$Res> { + __$$LdkNodeError_InvoiceCreationFailedImplCopyWithImpl( + _$LdkNodeError_InvoiceCreationFailedImpl _value, + $Res Function(_$LdkNodeError_InvoiceCreationFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvoiceCreationFailedImpl + extends LdkNodeError_InvoiceCreationFailed { + const _$LdkNodeError_InvoiceCreationFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invoiceCreationFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvoiceCreationFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invoiceCreationFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invoiceCreationFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invoiceCreationFailed != null) { + return invoiceCreationFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invoiceCreationFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invoiceCreationFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invoiceCreationFailed != null) { + return invoiceCreationFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvoiceCreationFailed extends LdkNodeError { + const factory LdkNodeError_InvoiceCreationFailed() = + _$LdkNodeError_InvoiceCreationFailedImpl; + const LdkNodeError_InvoiceCreationFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_PaymentSendingFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_PaymentSendingFailedImplCopyWith( + _$LdkNodeError_PaymentSendingFailedImpl value, + $Res Function(_$LdkNodeError_PaymentSendingFailedImpl) then) = + __$$LdkNodeError_PaymentSendingFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_PaymentSendingFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_PaymentSendingFailedImpl> + implements _$$LdkNodeError_PaymentSendingFailedImplCopyWith<$Res> { + __$$LdkNodeError_PaymentSendingFailedImplCopyWithImpl( + _$LdkNodeError_PaymentSendingFailedImpl _value, + $Res Function(_$LdkNodeError_PaymentSendingFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_PaymentSendingFailedImpl + extends LdkNodeError_PaymentSendingFailed { + const _$LdkNodeError_PaymentSendingFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.paymentSendingFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_PaymentSendingFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return paymentSendingFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return paymentSendingFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (paymentSendingFailed != null) { + return paymentSendingFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return paymentSendingFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return paymentSendingFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (paymentSendingFailed != null) { + return paymentSendingFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_PaymentSendingFailed extends LdkNodeError { + const factory LdkNodeError_PaymentSendingFailed() = + _$LdkNodeError_PaymentSendingFailedImpl; + const LdkNodeError_PaymentSendingFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_ProbeSendingFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_ProbeSendingFailedImplCopyWith( + _$LdkNodeError_ProbeSendingFailedImpl value, + $Res Function(_$LdkNodeError_ProbeSendingFailedImpl) then) = + __$$LdkNodeError_ProbeSendingFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_ProbeSendingFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_ProbeSendingFailedImpl> + implements _$$LdkNodeError_ProbeSendingFailedImplCopyWith<$Res> { + __$$LdkNodeError_ProbeSendingFailedImplCopyWithImpl( + _$LdkNodeError_ProbeSendingFailedImpl _value, + $Res Function(_$LdkNodeError_ProbeSendingFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_ProbeSendingFailedImpl + extends LdkNodeError_ProbeSendingFailed { + const _$LdkNodeError_ProbeSendingFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.probeSendingFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_ProbeSendingFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return probeSendingFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return probeSendingFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (probeSendingFailed != null) { + return probeSendingFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return probeSendingFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return probeSendingFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (probeSendingFailed != null) { + return probeSendingFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_ProbeSendingFailed extends LdkNodeError { + const factory LdkNodeError_ProbeSendingFailed() = + _$LdkNodeError_ProbeSendingFailedImpl; + const LdkNodeError_ProbeSendingFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_ChannelCreationFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_ChannelCreationFailedImplCopyWith( + _$LdkNodeError_ChannelCreationFailedImpl value, + $Res Function(_$LdkNodeError_ChannelCreationFailedImpl) then) = + __$$LdkNodeError_ChannelCreationFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_ChannelCreationFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_ChannelCreationFailedImpl> + implements _$$LdkNodeError_ChannelCreationFailedImplCopyWith<$Res> { + __$$LdkNodeError_ChannelCreationFailedImplCopyWithImpl( + _$LdkNodeError_ChannelCreationFailedImpl _value, + $Res Function(_$LdkNodeError_ChannelCreationFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_ChannelCreationFailedImpl + extends LdkNodeError_ChannelCreationFailed { + const _$LdkNodeError_ChannelCreationFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.channelCreationFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_ChannelCreationFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return channelCreationFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return channelCreationFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (channelCreationFailed != null) { + return channelCreationFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return channelCreationFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return channelCreationFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (channelCreationFailed != null) { + return channelCreationFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_ChannelCreationFailed extends LdkNodeError { + const factory LdkNodeError_ChannelCreationFailed() = + _$LdkNodeError_ChannelCreationFailedImpl; + const LdkNodeError_ChannelCreationFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_ChannelClosingFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_ChannelClosingFailedImplCopyWith( + _$LdkNodeError_ChannelClosingFailedImpl value, + $Res Function(_$LdkNodeError_ChannelClosingFailedImpl) then) = + __$$LdkNodeError_ChannelClosingFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_ChannelClosingFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_ChannelClosingFailedImpl> + implements _$$LdkNodeError_ChannelClosingFailedImplCopyWith<$Res> { + __$$LdkNodeError_ChannelClosingFailedImplCopyWithImpl( + _$LdkNodeError_ChannelClosingFailedImpl _value, + $Res Function(_$LdkNodeError_ChannelClosingFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_ChannelClosingFailedImpl + extends LdkNodeError_ChannelClosingFailed { + const _$LdkNodeError_ChannelClosingFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.channelClosingFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_ChannelClosingFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return channelClosingFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return channelClosingFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (channelClosingFailed != null) { + return channelClosingFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return channelClosingFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return channelClosingFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (channelClosingFailed != null) { + return channelClosingFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_ChannelClosingFailed extends LdkNodeError { + const factory LdkNodeError_ChannelClosingFailed() = + _$LdkNodeError_ChannelClosingFailedImpl; + const LdkNodeError_ChannelClosingFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_ChannelConfigUpdateFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_ChannelConfigUpdateFailedImplCopyWith( + _$LdkNodeError_ChannelConfigUpdateFailedImpl value, + $Res Function(_$LdkNodeError_ChannelConfigUpdateFailedImpl) then) = + __$$LdkNodeError_ChannelConfigUpdateFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_ChannelConfigUpdateFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_ChannelConfigUpdateFailedImpl> + implements _$$LdkNodeError_ChannelConfigUpdateFailedImplCopyWith<$Res> { + __$$LdkNodeError_ChannelConfigUpdateFailedImplCopyWithImpl( + _$LdkNodeError_ChannelConfigUpdateFailedImpl _value, + $Res Function(_$LdkNodeError_ChannelConfigUpdateFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_ChannelConfigUpdateFailedImpl + extends LdkNodeError_ChannelConfigUpdateFailed { + const _$LdkNodeError_ChannelConfigUpdateFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.channelConfigUpdateFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_ChannelConfigUpdateFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return channelConfigUpdateFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return channelConfigUpdateFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (channelConfigUpdateFailed != null) { + return channelConfigUpdateFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return channelConfigUpdateFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return channelConfigUpdateFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (channelConfigUpdateFailed != null) { + return channelConfigUpdateFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_ChannelConfigUpdateFailed extends LdkNodeError { + const factory LdkNodeError_ChannelConfigUpdateFailed() = + _$LdkNodeError_ChannelConfigUpdateFailedImpl; + const LdkNodeError_ChannelConfigUpdateFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_PersistenceFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_PersistenceFailedImplCopyWith( + _$LdkNodeError_PersistenceFailedImpl value, + $Res Function(_$LdkNodeError_PersistenceFailedImpl) then) = + __$$LdkNodeError_PersistenceFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_PersistenceFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_PersistenceFailedImpl> + implements _$$LdkNodeError_PersistenceFailedImplCopyWith<$Res> { + __$$LdkNodeError_PersistenceFailedImplCopyWithImpl( + _$LdkNodeError_PersistenceFailedImpl _value, + $Res Function(_$LdkNodeError_PersistenceFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_PersistenceFailedImpl + extends LdkNodeError_PersistenceFailed { + const _$LdkNodeError_PersistenceFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.persistenceFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_PersistenceFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return persistenceFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return persistenceFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (persistenceFailed != null) { + return persistenceFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return persistenceFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return persistenceFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (persistenceFailed != null) { + return persistenceFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_PersistenceFailed extends LdkNodeError { + const factory LdkNodeError_PersistenceFailed() = + _$LdkNodeError_PersistenceFailedImpl; + const LdkNodeError_PersistenceFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_WalletOperationFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_WalletOperationFailedImplCopyWith( + _$LdkNodeError_WalletOperationFailedImpl value, + $Res Function(_$LdkNodeError_WalletOperationFailedImpl) then) = + __$$LdkNodeError_WalletOperationFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_WalletOperationFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_WalletOperationFailedImpl> + implements _$$LdkNodeError_WalletOperationFailedImplCopyWith<$Res> { + __$$LdkNodeError_WalletOperationFailedImplCopyWithImpl( + _$LdkNodeError_WalletOperationFailedImpl _value, + $Res Function(_$LdkNodeError_WalletOperationFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_WalletOperationFailedImpl + extends LdkNodeError_WalletOperationFailed { + const _$LdkNodeError_WalletOperationFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.walletOperationFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_WalletOperationFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return walletOperationFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return walletOperationFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (walletOperationFailed != null) { + return walletOperationFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return walletOperationFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return walletOperationFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (walletOperationFailed != null) { + return walletOperationFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_WalletOperationFailed extends LdkNodeError { + const factory LdkNodeError_WalletOperationFailed() = + _$LdkNodeError_WalletOperationFailedImpl; + const LdkNodeError_WalletOperationFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_OnchainTxSigningFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_OnchainTxSigningFailedImplCopyWith( + _$LdkNodeError_OnchainTxSigningFailedImpl value, + $Res Function(_$LdkNodeError_OnchainTxSigningFailedImpl) then) = + __$$LdkNodeError_OnchainTxSigningFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_OnchainTxSigningFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_OnchainTxSigningFailedImpl> + implements _$$LdkNodeError_OnchainTxSigningFailedImplCopyWith<$Res> { + __$$LdkNodeError_OnchainTxSigningFailedImplCopyWithImpl( + _$LdkNodeError_OnchainTxSigningFailedImpl _value, + $Res Function(_$LdkNodeError_OnchainTxSigningFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_OnchainTxSigningFailedImpl + extends LdkNodeError_OnchainTxSigningFailed { + const _$LdkNodeError_OnchainTxSigningFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.onchainTxSigningFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_OnchainTxSigningFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return onchainTxSigningFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return onchainTxSigningFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (onchainTxSigningFailed != null) { + return onchainTxSigningFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return onchainTxSigningFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return onchainTxSigningFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (onchainTxSigningFailed != null) { + return onchainTxSigningFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_OnchainTxSigningFailed extends LdkNodeError { + const factory LdkNodeError_OnchainTxSigningFailed() = + _$LdkNodeError_OnchainTxSigningFailedImpl; + const LdkNodeError_OnchainTxSigningFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_MessageSigningFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_MessageSigningFailedImplCopyWith( + _$LdkNodeError_MessageSigningFailedImpl value, + $Res Function(_$LdkNodeError_MessageSigningFailedImpl) then) = + __$$LdkNodeError_MessageSigningFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_MessageSigningFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_MessageSigningFailedImpl> + implements _$$LdkNodeError_MessageSigningFailedImplCopyWith<$Res> { + __$$LdkNodeError_MessageSigningFailedImplCopyWithImpl( + _$LdkNodeError_MessageSigningFailedImpl _value, + $Res Function(_$LdkNodeError_MessageSigningFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_MessageSigningFailedImpl + extends LdkNodeError_MessageSigningFailed { + const _$LdkNodeError_MessageSigningFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.messageSigningFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_MessageSigningFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return messageSigningFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return messageSigningFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (messageSigningFailed != null) { + return messageSigningFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return messageSigningFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return messageSigningFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (messageSigningFailed != null) { + return messageSigningFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_MessageSigningFailed extends LdkNodeError { + const factory LdkNodeError_MessageSigningFailed() = + _$LdkNodeError_MessageSigningFailedImpl; + const LdkNodeError_MessageSigningFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_TxSyncFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_TxSyncFailedImplCopyWith( + _$LdkNodeError_TxSyncFailedImpl value, + $Res Function(_$LdkNodeError_TxSyncFailedImpl) then) = + __$$LdkNodeError_TxSyncFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_TxSyncFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_TxSyncFailedImpl> + implements _$$LdkNodeError_TxSyncFailedImplCopyWith<$Res> { + __$$LdkNodeError_TxSyncFailedImplCopyWithImpl( + _$LdkNodeError_TxSyncFailedImpl _value, + $Res Function(_$LdkNodeError_TxSyncFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_TxSyncFailedImpl extends LdkNodeError_TxSyncFailed { + const _$LdkNodeError_TxSyncFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.txSyncFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_TxSyncFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return txSyncFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return txSyncFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (txSyncFailed != null) { + return txSyncFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return txSyncFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return txSyncFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (txSyncFailed != null) { + return txSyncFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_TxSyncFailed extends LdkNodeError { + const factory LdkNodeError_TxSyncFailed() = _$LdkNodeError_TxSyncFailedImpl; + const LdkNodeError_TxSyncFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_GossipUpdateFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_GossipUpdateFailedImplCopyWith( + _$LdkNodeError_GossipUpdateFailedImpl value, + $Res Function(_$LdkNodeError_GossipUpdateFailedImpl) then) = + __$$LdkNodeError_GossipUpdateFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_GossipUpdateFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_GossipUpdateFailedImpl> + implements _$$LdkNodeError_GossipUpdateFailedImplCopyWith<$Res> { + __$$LdkNodeError_GossipUpdateFailedImplCopyWithImpl( + _$LdkNodeError_GossipUpdateFailedImpl _value, + $Res Function(_$LdkNodeError_GossipUpdateFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_GossipUpdateFailedImpl + extends LdkNodeError_GossipUpdateFailed { + const _$LdkNodeError_GossipUpdateFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.gossipUpdateFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_GossipUpdateFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return gossipUpdateFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return gossipUpdateFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (gossipUpdateFailed != null) { + return gossipUpdateFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return gossipUpdateFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return gossipUpdateFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (gossipUpdateFailed != null) { + return gossipUpdateFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_GossipUpdateFailed extends LdkNodeError { + const factory LdkNodeError_GossipUpdateFailed() = + _$LdkNodeError_GossipUpdateFailedImpl; + const LdkNodeError_GossipUpdateFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidAddressImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidAddressImplCopyWith( + _$LdkNodeError_InvalidAddressImpl value, + $Res Function(_$LdkNodeError_InvalidAddressImpl) then) = + __$$LdkNodeError_InvalidAddressImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidAddressImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_InvalidAddressImpl> + implements _$$LdkNodeError_InvalidAddressImplCopyWith<$Res> { + __$$LdkNodeError_InvalidAddressImplCopyWithImpl( + _$LdkNodeError_InvalidAddressImpl _value, + $Res Function(_$LdkNodeError_InvalidAddressImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidAddressImpl extends LdkNodeError_InvalidAddress { + const _$LdkNodeError_InvalidAddressImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidAddress()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidAddressImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidAddress(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidAddress?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidAddress != null) { + return invalidAddress(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidAddress(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidAddress?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidAddress != null) { + return invalidAddress(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidAddress extends LdkNodeError { + const factory LdkNodeError_InvalidAddress() = + _$LdkNodeError_InvalidAddressImpl; + const LdkNodeError_InvalidAddress._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidSocketAddressImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidSocketAddressImplCopyWith( + _$LdkNodeError_InvalidSocketAddressImpl value, + $Res Function(_$LdkNodeError_InvalidSocketAddressImpl) then) = + __$$LdkNodeError_InvalidSocketAddressImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidSocketAddressImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InvalidSocketAddressImpl> + implements _$$LdkNodeError_InvalidSocketAddressImplCopyWith<$Res> { + __$$LdkNodeError_InvalidSocketAddressImplCopyWithImpl( + _$LdkNodeError_InvalidSocketAddressImpl _value, + $Res Function(_$LdkNodeError_InvalidSocketAddressImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidSocketAddressImpl + extends LdkNodeError_InvalidSocketAddress { + const _$LdkNodeError_InvalidSocketAddressImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidSocketAddress()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidSocketAddressImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidSocketAddress(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidSocketAddress?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidSocketAddress != null) { + return invalidSocketAddress(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidSocketAddress(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidSocketAddress?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidSocketAddress != null) { + return invalidSocketAddress(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidSocketAddress extends LdkNodeError { + const factory LdkNodeError_InvalidSocketAddress() = + _$LdkNodeError_InvalidSocketAddressImpl; + const LdkNodeError_InvalidSocketAddress._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidPublicKeyImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidPublicKeyImplCopyWith( + _$LdkNodeError_InvalidPublicKeyImpl value, + $Res Function(_$LdkNodeError_InvalidPublicKeyImpl) then) = + __$$LdkNodeError_InvalidPublicKeyImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidPublicKeyImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InvalidPublicKeyImpl> + implements _$$LdkNodeError_InvalidPublicKeyImplCopyWith<$Res> { + __$$LdkNodeError_InvalidPublicKeyImplCopyWithImpl( + _$LdkNodeError_InvalidPublicKeyImpl _value, + $Res Function(_$LdkNodeError_InvalidPublicKeyImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidPublicKeyImpl + extends LdkNodeError_InvalidPublicKey { + const _$LdkNodeError_InvalidPublicKeyImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidPublicKey()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidPublicKeyImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidPublicKey(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidPublicKey?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidPublicKey != null) { + return invalidPublicKey(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidPublicKey(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidPublicKey?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidPublicKey != null) { + return invalidPublicKey(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidPublicKey extends LdkNodeError { + const factory LdkNodeError_InvalidPublicKey() = + _$LdkNodeError_InvalidPublicKeyImpl; + const LdkNodeError_InvalidPublicKey._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidSecretKeyImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidSecretKeyImplCopyWith( + _$LdkNodeError_InvalidSecretKeyImpl value, + $Res Function(_$LdkNodeError_InvalidSecretKeyImpl) then) = + __$$LdkNodeError_InvalidSecretKeyImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidSecretKeyImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InvalidSecretKeyImpl> + implements _$$LdkNodeError_InvalidSecretKeyImplCopyWith<$Res> { + __$$LdkNodeError_InvalidSecretKeyImplCopyWithImpl( + _$LdkNodeError_InvalidSecretKeyImpl _value, + $Res Function(_$LdkNodeError_InvalidSecretKeyImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidSecretKeyImpl + extends LdkNodeError_InvalidSecretKey { + const _$LdkNodeError_InvalidSecretKeyImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidSecretKey()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidSecretKeyImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidSecretKey(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidSecretKey?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidSecretKey != null) { + return invalidSecretKey(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidSecretKey(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidSecretKey?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidSecretKey != null) { + return invalidSecretKey(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidSecretKey extends LdkNodeError { + const factory LdkNodeError_InvalidSecretKey() = + _$LdkNodeError_InvalidSecretKeyImpl; + const LdkNodeError_InvalidSecretKey._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidPaymentHashImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidPaymentHashImplCopyWith( + _$LdkNodeError_InvalidPaymentHashImpl value, + $Res Function(_$LdkNodeError_InvalidPaymentHashImpl) then) = + __$$LdkNodeError_InvalidPaymentHashImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidPaymentHashImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InvalidPaymentHashImpl> + implements _$$LdkNodeError_InvalidPaymentHashImplCopyWith<$Res> { + __$$LdkNodeError_InvalidPaymentHashImplCopyWithImpl( + _$LdkNodeError_InvalidPaymentHashImpl _value, + $Res Function(_$LdkNodeError_InvalidPaymentHashImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidPaymentHashImpl + extends LdkNodeError_InvalidPaymentHash { + const _$LdkNodeError_InvalidPaymentHashImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidPaymentHash()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidPaymentHashImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidPaymentHash(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidPaymentHash?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidPaymentHash != null) { + return invalidPaymentHash(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidPaymentHash(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidPaymentHash?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidPaymentHash != null) { + return invalidPaymentHash(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidPaymentHash extends LdkNodeError { + const factory LdkNodeError_InvalidPaymentHash() = + _$LdkNodeError_InvalidPaymentHashImpl; + const LdkNodeError_InvalidPaymentHash._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidPaymentPreimageImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidPaymentPreimageImplCopyWith( + _$LdkNodeError_InvalidPaymentPreimageImpl value, + $Res Function(_$LdkNodeError_InvalidPaymentPreimageImpl) then) = + __$$LdkNodeError_InvalidPaymentPreimageImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidPaymentPreimageImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InvalidPaymentPreimageImpl> + implements _$$LdkNodeError_InvalidPaymentPreimageImplCopyWith<$Res> { + __$$LdkNodeError_InvalidPaymentPreimageImplCopyWithImpl( + _$LdkNodeError_InvalidPaymentPreimageImpl _value, + $Res Function(_$LdkNodeError_InvalidPaymentPreimageImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidPaymentPreimageImpl + extends LdkNodeError_InvalidPaymentPreimage { + const _$LdkNodeError_InvalidPaymentPreimageImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidPaymentPreimage()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidPaymentPreimageImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidPaymentPreimage(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidPaymentPreimage?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidPaymentPreimage != null) { + return invalidPaymentPreimage(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidPaymentPreimage(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidPaymentPreimage?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidPaymentPreimage != null) { + return invalidPaymentPreimage(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidPaymentPreimage extends LdkNodeError { + const factory LdkNodeError_InvalidPaymentPreimage() = + _$LdkNodeError_InvalidPaymentPreimageImpl; + const LdkNodeError_InvalidPaymentPreimage._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidPaymentSecretImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidPaymentSecretImplCopyWith( + _$LdkNodeError_InvalidPaymentSecretImpl value, + $Res Function(_$LdkNodeError_InvalidPaymentSecretImpl) then) = + __$$LdkNodeError_InvalidPaymentSecretImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidPaymentSecretImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InvalidPaymentSecretImpl> + implements _$$LdkNodeError_InvalidPaymentSecretImplCopyWith<$Res> { + __$$LdkNodeError_InvalidPaymentSecretImplCopyWithImpl( + _$LdkNodeError_InvalidPaymentSecretImpl _value, + $Res Function(_$LdkNodeError_InvalidPaymentSecretImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidPaymentSecretImpl + extends LdkNodeError_InvalidPaymentSecret { + const _$LdkNodeError_InvalidPaymentSecretImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidPaymentSecret()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidPaymentSecretImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidPaymentSecret(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidPaymentSecret?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidPaymentSecret != null) { + return invalidPaymentSecret(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidPaymentSecret(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidPaymentSecret?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidPaymentSecret != null) { + return invalidPaymentSecret(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidPaymentSecret extends LdkNodeError { + const factory LdkNodeError_InvalidPaymentSecret() = + _$LdkNodeError_InvalidPaymentSecretImpl; + const LdkNodeError_InvalidPaymentSecret._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidAmountImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidAmountImplCopyWith( + _$LdkNodeError_InvalidAmountImpl value, + $Res Function(_$LdkNodeError_InvalidAmountImpl) then) = + __$$LdkNodeError_InvalidAmountImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidAmountImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_InvalidAmountImpl> + implements _$$LdkNodeError_InvalidAmountImplCopyWith<$Res> { + __$$LdkNodeError_InvalidAmountImplCopyWithImpl( + _$LdkNodeError_InvalidAmountImpl _value, + $Res Function(_$LdkNodeError_InvalidAmountImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidAmountImpl extends LdkNodeError_InvalidAmount { + const _$LdkNodeError_InvalidAmountImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidAmount()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidAmountImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidAmount(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidAmount?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidAmount != null) { + return invalidAmount(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidAmount(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidAmount?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidAmount != null) { + return invalidAmount(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidAmount extends LdkNodeError { + const factory LdkNodeError_InvalidAmount() = _$LdkNodeError_InvalidAmountImpl; + const LdkNodeError_InvalidAmount._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidInvoiceImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidInvoiceImplCopyWith( + _$LdkNodeError_InvalidInvoiceImpl value, + $Res Function(_$LdkNodeError_InvalidInvoiceImpl) then) = + __$$LdkNodeError_InvalidInvoiceImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidInvoiceImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_InvalidInvoiceImpl> + implements _$$LdkNodeError_InvalidInvoiceImplCopyWith<$Res> { + __$$LdkNodeError_InvalidInvoiceImplCopyWithImpl( + _$LdkNodeError_InvalidInvoiceImpl _value, + $Res Function(_$LdkNodeError_InvalidInvoiceImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidInvoiceImpl extends LdkNodeError_InvalidInvoice { + const _$LdkNodeError_InvalidInvoiceImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidInvoice()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidInvoiceImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidInvoice(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidInvoice?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidInvoice != null) { + return invalidInvoice(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidInvoice(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidInvoice?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidInvoice != null) { + return invalidInvoice(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidInvoice extends LdkNodeError { + const factory LdkNodeError_InvalidInvoice() = + _$LdkNodeError_InvalidInvoiceImpl; + const LdkNodeError_InvalidInvoice._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidChannelIdImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidChannelIdImplCopyWith( + _$LdkNodeError_InvalidChannelIdImpl value, + $Res Function(_$LdkNodeError_InvalidChannelIdImpl) then) = + __$$LdkNodeError_InvalidChannelIdImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidChannelIdImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InvalidChannelIdImpl> + implements _$$LdkNodeError_InvalidChannelIdImplCopyWith<$Res> { + __$$LdkNodeError_InvalidChannelIdImplCopyWithImpl( + _$LdkNodeError_InvalidChannelIdImpl _value, + $Res Function(_$LdkNodeError_InvalidChannelIdImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidChannelIdImpl + extends LdkNodeError_InvalidChannelId { + const _$LdkNodeError_InvalidChannelIdImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidChannelId()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidChannelIdImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidChannelId(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidChannelId?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidChannelId != null) { + return invalidChannelId(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidChannelId(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidChannelId?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidChannelId != null) { + return invalidChannelId(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidChannelId extends LdkNodeError { + const factory LdkNodeError_InvalidChannelId() = + _$LdkNodeError_InvalidChannelIdImpl; + const LdkNodeError_InvalidChannelId._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidNetworkImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidNetworkImplCopyWith( + _$LdkNodeError_InvalidNetworkImpl value, + $Res Function(_$LdkNodeError_InvalidNetworkImpl) then) = + __$$LdkNodeError_InvalidNetworkImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidNetworkImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_InvalidNetworkImpl> + implements _$$LdkNodeError_InvalidNetworkImplCopyWith<$Res> { + __$$LdkNodeError_InvalidNetworkImplCopyWithImpl( + _$LdkNodeError_InvalidNetworkImpl _value, + $Res Function(_$LdkNodeError_InvalidNetworkImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidNetworkImpl extends LdkNodeError_InvalidNetwork { + const _$LdkNodeError_InvalidNetworkImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidNetwork()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidNetworkImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidNetwork(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidNetwork?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidNetwork != null) { + return invalidNetwork(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidNetwork(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidNetwork?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidNetwork != null) { + return invalidNetwork(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidNetwork extends LdkNodeError { + const factory LdkNodeError_InvalidNetwork() = + _$LdkNodeError_InvalidNetworkImpl; + const LdkNodeError_InvalidNetwork._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_DuplicatePaymentImplCopyWith<$Res> { + factory _$$LdkNodeError_DuplicatePaymentImplCopyWith( + _$LdkNodeError_DuplicatePaymentImpl value, + $Res Function(_$LdkNodeError_DuplicatePaymentImpl) then) = + __$$LdkNodeError_DuplicatePaymentImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_DuplicatePaymentImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_DuplicatePaymentImpl> + implements _$$LdkNodeError_DuplicatePaymentImplCopyWith<$Res> { + __$$LdkNodeError_DuplicatePaymentImplCopyWithImpl( + _$LdkNodeError_DuplicatePaymentImpl _value, + $Res Function(_$LdkNodeError_DuplicatePaymentImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_DuplicatePaymentImpl + extends LdkNodeError_DuplicatePayment { + const _$LdkNodeError_DuplicatePaymentImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.duplicatePayment()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_DuplicatePaymentImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return duplicatePayment(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return duplicatePayment?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (duplicatePayment != null) { + return duplicatePayment(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return duplicatePayment(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return duplicatePayment?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (duplicatePayment != null) { + return duplicatePayment(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_DuplicatePayment extends LdkNodeError { + const factory LdkNodeError_DuplicatePayment() = + _$LdkNodeError_DuplicatePaymentImpl; + const LdkNodeError_DuplicatePayment._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InsufficientFundsImplCopyWith<$Res> { + factory _$$LdkNodeError_InsufficientFundsImplCopyWith( + _$LdkNodeError_InsufficientFundsImpl value, + $Res Function(_$LdkNodeError_InsufficientFundsImpl) then) = + __$$LdkNodeError_InsufficientFundsImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InsufficientFundsImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InsufficientFundsImpl> + implements _$$LdkNodeError_InsufficientFundsImplCopyWith<$Res> { + __$$LdkNodeError_InsufficientFundsImplCopyWithImpl( + _$LdkNodeError_InsufficientFundsImpl _value, + $Res Function(_$LdkNodeError_InsufficientFundsImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InsufficientFundsImpl + extends LdkNodeError_InsufficientFunds { + const _$LdkNodeError_InsufficientFundsImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.insufficientFunds()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InsufficientFundsImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return insufficientFunds(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return insufficientFunds?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (insufficientFunds != null) { + return insufficientFunds(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return insufficientFunds(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return insufficientFunds?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (insufficientFunds != null) { + return insufficientFunds(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InsufficientFunds extends LdkNodeError { + const factory LdkNodeError_InsufficientFunds() = + _$LdkNodeError_InsufficientFundsImpl; + const LdkNodeError_InsufficientFunds._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_FeerateEstimationUpdateFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_FeerateEstimationUpdateFailedImplCopyWith( + _$LdkNodeError_FeerateEstimationUpdateFailedImpl value, + $Res Function(_$LdkNodeError_FeerateEstimationUpdateFailedImpl) + then) = + __$$LdkNodeError_FeerateEstimationUpdateFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_FeerateEstimationUpdateFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_FeerateEstimationUpdateFailedImpl> + implements _$$LdkNodeError_FeerateEstimationUpdateFailedImplCopyWith<$Res> { + __$$LdkNodeError_FeerateEstimationUpdateFailedImplCopyWithImpl( + _$LdkNodeError_FeerateEstimationUpdateFailedImpl _value, + $Res Function(_$LdkNodeError_FeerateEstimationUpdateFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_FeerateEstimationUpdateFailedImpl + extends LdkNodeError_FeerateEstimationUpdateFailed { + const _$LdkNodeError_FeerateEstimationUpdateFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.feerateEstimationUpdateFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_FeerateEstimationUpdateFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return feerateEstimationUpdateFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return feerateEstimationUpdateFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (feerateEstimationUpdateFailed != null) { + return feerateEstimationUpdateFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return feerateEstimationUpdateFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return feerateEstimationUpdateFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (feerateEstimationUpdateFailed != null) { + return feerateEstimationUpdateFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_FeerateEstimationUpdateFailed extends LdkNodeError { + const factory LdkNodeError_FeerateEstimationUpdateFailed() = + _$LdkNodeError_FeerateEstimationUpdateFailedImpl; + const LdkNodeError_FeerateEstimationUpdateFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_LiquidityRequestFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_LiquidityRequestFailedImplCopyWith( + _$LdkNodeError_LiquidityRequestFailedImpl value, + $Res Function(_$LdkNodeError_LiquidityRequestFailedImpl) then) = + __$$LdkNodeError_LiquidityRequestFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_LiquidityRequestFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_LiquidityRequestFailedImpl> + implements _$$LdkNodeError_LiquidityRequestFailedImplCopyWith<$Res> { + __$$LdkNodeError_LiquidityRequestFailedImplCopyWithImpl( + _$LdkNodeError_LiquidityRequestFailedImpl _value, + $Res Function(_$LdkNodeError_LiquidityRequestFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_LiquidityRequestFailedImpl + extends LdkNodeError_LiquidityRequestFailed { + const _$LdkNodeError_LiquidityRequestFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.liquidityRequestFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_LiquidityRequestFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return liquidityRequestFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return liquidityRequestFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (liquidityRequestFailed != null) { + return liquidityRequestFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return liquidityRequestFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return liquidityRequestFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (liquidityRequestFailed != null) { + return liquidityRequestFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_LiquidityRequestFailed extends LdkNodeError { + const factory LdkNodeError_LiquidityRequestFailed() = + _$LdkNodeError_LiquidityRequestFailedImpl; + const LdkNodeError_LiquidityRequestFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_LiquiditySourceUnavailableImplCopyWith<$Res> { + factory _$$LdkNodeError_LiquiditySourceUnavailableImplCopyWith( + _$LdkNodeError_LiquiditySourceUnavailableImpl value, + $Res Function(_$LdkNodeError_LiquiditySourceUnavailableImpl) then) = + __$$LdkNodeError_LiquiditySourceUnavailableImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_LiquiditySourceUnavailableImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_LiquiditySourceUnavailableImpl> + implements _$$LdkNodeError_LiquiditySourceUnavailableImplCopyWith<$Res> { + __$$LdkNodeError_LiquiditySourceUnavailableImplCopyWithImpl( + _$LdkNodeError_LiquiditySourceUnavailableImpl _value, + $Res Function(_$LdkNodeError_LiquiditySourceUnavailableImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_LiquiditySourceUnavailableImpl + extends LdkNodeError_LiquiditySourceUnavailable { + const _$LdkNodeError_LiquiditySourceUnavailableImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.liquiditySourceUnavailable()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_LiquiditySourceUnavailableImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return liquiditySourceUnavailable(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return liquiditySourceUnavailable?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (liquiditySourceUnavailable != null) { + return liquiditySourceUnavailable(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return liquiditySourceUnavailable(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return liquiditySourceUnavailable?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (liquiditySourceUnavailable != null) { + return liquiditySourceUnavailable(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_LiquiditySourceUnavailable extends LdkNodeError { + const factory LdkNodeError_LiquiditySourceUnavailable() = + _$LdkNodeError_LiquiditySourceUnavailableImpl; + const LdkNodeError_LiquiditySourceUnavailable._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_LiquidityFeeTooHighImplCopyWith<$Res> { + factory _$$LdkNodeError_LiquidityFeeTooHighImplCopyWith( + _$LdkNodeError_LiquidityFeeTooHighImpl value, + $Res Function(_$LdkNodeError_LiquidityFeeTooHighImpl) then) = + __$$LdkNodeError_LiquidityFeeTooHighImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_LiquidityFeeTooHighImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_LiquidityFeeTooHighImpl> + implements _$$LdkNodeError_LiquidityFeeTooHighImplCopyWith<$Res> { + __$$LdkNodeError_LiquidityFeeTooHighImplCopyWithImpl( + _$LdkNodeError_LiquidityFeeTooHighImpl _value, + $Res Function(_$LdkNodeError_LiquidityFeeTooHighImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_LiquidityFeeTooHighImpl + extends LdkNodeError_LiquidityFeeTooHigh { + const _$LdkNodeError_LiquidityFeeTooHighImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.liquidityFeeTooHigh()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_LiquidityFeeTooHighImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return liquidityFeeTooHigh(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return liquidityFeeTooHigh?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (liquidityFeeTooHigh != null) { + return liquidityFeeTooHigh(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return liquidityFeeTooHigh(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return liquidityFeeTooHigh?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (liquidityFeeTooHigh != null) { + return liquidityFeeTooHigh(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_LiquidityFeeTooHigh extends LdkNodeError { + const factory LdkNodeError_LiquidityFeeTooHigh() = + _$LdkNodeError_LiquidityFeeTooHighImpl; + const LdkNodeError_LiquidityFeeTooHigh._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidPaymentIdImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidPaymentIdImplCopyWith( + _$LdkNodeError_InvalidPaymentIdImpl value, + $Res Function(_$LdkNodeError_InvalidPaymentIdImpl) then) = + __$$LdkNodeError_InvalidPaymentIdImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidPaymentIdImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InvalidPaymentIdImpl> + implements _$$LdkNodeError_InvalidPaymentIdImplCopyWith<$Res> { + __$$LdkNodeError_InvalidPaymentIdImplCopyWithImpl( + _$LdkNodeError_InvalidPaymentIdImpl _value, + $Res Function(_$LdkNodeError_InvalidPaymentIdImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidPaymentIdImpl + extends LdkNodeError_InvalidPaymentId { + const _$LdkNodeError_InvalidPaymentIdImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidPaymentId()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidPaymentIdImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidPaymentId(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidPaymentId?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidPaymentId != null) { + return invalidPaymentId(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidPaymentId(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidPaymentId?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidPaymentId != null) { + return invalidPaymentId(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidPaymentId extends LdkNodeError { + const factory LdkNodeError_InvalidPaymentId() = + _$LdkNodeError_InvalidPaymentIdImpl; + const LdkNodeError_InvalidPaymentId._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_DecodeImplCopyWith<$Res> { + factory _$$LdkNodeError_DecodeImplCopyWith(_$LdkNodeError_DecodeImpl value, + $Res Function(_$LdkNodeError_DecodeImpl) then) = + __$$LdkNodeError_DecodeImplCopyWithImpl<$Res>; + @useResult + $Res call({DecodeError field0}); + + $DecodeErrorCopyWith<$Res> get field0; +} + +/// @nodoc +class __$$LdkNodeError_DecodeImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_DecodeImpl> + implements _$$LdkNodeError_DecodeImplCopyWith<$Res> { + __$$LdkNodeError_DecodeImplCopyWithImpl(_$LdkNodeError_DecodeImpl _value, + $Res Function(_$LdkNodeError_DecodeImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? field0 = null, + }) { + return _then(_$LdkNodeError_DecodeImpl( + null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as DecodeError, + )); + } + + @override + @pragma('vm:prefer-inline') + $DecodeErrorCopyWith<$Res> get field0 { + return $DecodeErrorCopyWith<$Res>(_value.field0, (value) { + return _then(_value.copyWith(field0: value)); + }); + } +} + +/// @nodoc + +class _$LdkNodeError_DecodeImpl extends LdkNodeError_Decode { + const _$LdkNodeError_DecodeImpl(this.field0) : super._(); + + @override + final DecodeError field0; + + @override + String toString() { + return 'LdkNodeError.decode(field0: $field0)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_DecodeImpl && + (identical(other.field0, field0) || other.field0 == field0)); + } + + @override + int get hashCode => Object.hash(runtimeType, field0); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$LdkNodeError_DecodeImplCopyWith<_$LdkNodeError_DecodeImpl> get copyWith => + __$$LdkNodeError_DecodeImplCopyWithImpl<_$LdkNodeError_DecodeImpl>( + this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return decode(field0); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return decode?.call(field0); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (decode != null) { + return decode(field0); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return decode(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return decode?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (decode != null) { + return decode(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_Decode extends LdkNodeError { + const factory LdkNodeError_Decode(final DecodeError field0) = + _$LdkNodeError_DecodeImpl; + const LdkNodeError_Decode._() : super._(); + + DecodeError get field0; + @JsonKey(ignore: true) + _$$LdkNodeError_DecodeImplCopyWith<_$LdkNodeError_DecodeImpl> get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$LdkNodeError_Bolt12ParseImplCopyWith<$Res> { + factory _$$LdkNodeError_Bolt12ParseImplCopyWith( + _$LdkNodeError_Bolt12ParseImpl value, + $Res Function(_$LdkNodeError_Bolt12ParseImpl) then) = + __$$LdkNodeError_Bolt12ParseImplCopyWithImpl<$Res>; + @useResult + $Res call({Bolt12ParseError field0}); + + $Bolt12ParseErrorCopyWith<$Res> get field0; +} + +/// @nodoc +class __$$LdkNodeError_Bolt12ParseImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_Bolt12ParseImpl> + implements _$$LdkNodeError_Bolt12ParseImplCopyWith<$Res> { + __$$LdkNodeError_Bolt12ParseImplCopyWithImpl( + _$LdkNodeError_Bolt12ParseImpl _value, + $Res Function(_$LdkNodeError_Bolt12ParseImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? field0 = null, + }) { + return _then(_$LdkNodeError_Bolt12ParseImpl( + null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as Bolt12ParseError, + )); + } + + @override + @pragma('vm:prefer-inline') + $Bolt12ParseErrorCopyWith<$Res> get field0 { + return $Bolt12ParseErrorCopyWith<$Res>(_value.field0, (value) { + return _then(_value.copyWith(field0: value)); + }); + } +} + +/// @nodoc + +class _$LdkNodeError_Bolt12ParseImpl extends LdkNodeError_Bolt12Parse { + const _$LdkNodeError_Bolt12ParseImpl(this.field0) : super._(); + + @override + final Bolt12ParseError field0; + + @override + String toString() { + return 'LdkNodeError.bolt12Parse(field0: $field0)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_Bolt12ParseImpl && + (identical(other.field0, field0) || other.field0 == field0)); + } + + @override + int get hashCode => Object.hash(runtimeType, field0); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$LdkNodeError_Bolt12ParseImplCopyWith<_$LdkNodeError_Bolt12ParseImpl> + get copyWith => __$$LdkNodeError_Bolt12ParseImplCopyWithImpl< + _$LdkNodeError_Bolt12ParseImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return bolt12Parse(field0); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return bolt12Parse?.call(field0); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (bolt12Parse != null) { + return bolt12Parse(field0); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return bolt12Parse(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return bolt12Parse?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (bolt12Parse != null) { + return bolt12Parse(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_Bolt12Parse extends LdkNodeError { + const factory LdkNodeError_Bolt12Parse(final Bolt12ParseError field0) = + _$LdkNodeError_Bolt12ParseImpl; + const LdkNodeError_Bolt12Parse._() : super._(); + + Bolt12ParseError get field0; + @JsonKey(ignore: true) + _$$LdkNodeError_Bolt12ParseImplCopyWith<_$LdkNodeError_Bolt12ParseImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$LdkNodeError_InvoiceRequestCreationFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_InvoiceRequestCreationFailedImplCopyWith( + _$LdkNodeError_InvoiceRequestCreationFailedImpl value, + $Res Function(_$LdkNodeError_InvoiceRequestCreationFailedImpl) then) = + __$$LdkNodeError_InvoiceRequestCreationFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvoiceRequestCreationFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_InvoiceRequestCreationFailedImpl> + implements _$$LdkNodeError_InvoiceRequestCreationFailedImplCopyWith<$Res> { + __$$LdkNodeError_InvoiceRequestCreationFailedImplCopyWithImpl( + _$LdkNodeError_InvoiceRequestCreationFailedImpl _value, + $Res Function(_$LdkNodeError_InvoiceRequestCreationFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvoiceRequestCreationFailedImpl + extends LdkNodeError_InvoiceRequestCreationFailed { + const _$LdkNodeError_InvoiceRequestCreationFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invoiceRequestCreationFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvoiceRequestCreationFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invoiceRequestCreationFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invoiceRequestCreationFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invoiceRequestCreationFailed != null) { + return invoiceRequestCreationFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invoiceRequestCreationFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invoiceRequestCreationFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invoiceRequestCreationFailed != null) { + return invoiceRequestCreationFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvoiceRequestCreationFailed extends LdkNodeError { + const factory LdkNodeError_InvoiceRequestCreationFailed() = + _$LdkNodeError_InvoiceRequestCreationFailedImpl; + const LdkNodeError_InvoiceRequestCreationFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_OfferCreationFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_OfferCreationFailedImplCopyWith( + _$LdkNodeError_OfferCreationFailedImpl value, + $Res Function(_$LdkNodeError_OfferCreationFailedImpl) then) = + __$$LdkNodeError_OfferCreationFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_OfferCreationFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_OfferCreationFailedImpl> + implements _$$LdkNodeError_OfferCreationFailedImplCopyWith<$Res> { + __$$LdkNodeError_OfferCreationFailedImplCopyWithImpl( + _$LdkNodeError_OfferCreationFailedImpl _value, + $Res Function(_$LdkNodeError_OfferCreationFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_OfferCreationFailedImpl + extends LdkNodeError_OfferCreationFailed { + const _$LdkNodeError_OfferCreationFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.offerCreationFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_OfferCreationFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return offerCreationFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return offerCreationFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (offerCreationFailed != null) { + return offerCreationFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return offerCreationFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return offerCreationFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (offerCreationFailed != null) { + return offerCreationFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_OfferCreationFailed extends LdkNodeError { + const factory LdkNodeError_OfferCreationFailed() = + _$LdkNodeError_OfferCreationFailedImpl; + const LdkNodeError_OfferCreationFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_RefundCreationFailedImplCopyWith<$Res> { + factory _$$LdkNodeError_RefundCreationFailedImplCopyWith( + _$LdkNodeError_RefundCreationFailedImpl value, + $Res Function(_$LdkNodeError_RefundCreationFailedImpl) then) = + __$$LdkNodeError_RefundCreationFailedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_RefundCreationFailedImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_RefundCreationFailedImpl> + implements _$$LdkNodeError_RefundCreationFailedImplCopyWith<$Res> { + __$$LdkNodeError_RefundCreationFailedImplCopyWithImpl( + _$LdkNodeError_RefundCreationFailedImpl _value, + $Res Function(_$LdkNodeError_RefundCreationFailedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_RefundCreationFailedImpl + extends LdkNodeError_RefundCreationFailed { + const _$LdkNodeError_RefundCreationFailedImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.refundCreationFailed()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_RefundCreationFailedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return refundCreationFailed(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return refundCreationFailed?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (refundCreationFailed != null) { + return refundCreationFailed(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return refundCreationFailed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return refundCreationFailed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (refundCreationFailed != null) { + return refundCreationFailed(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_RefundCreationFailed extends LdkNodeError { + const factory LdkNodeError_RefundCreationFailed() = + _$LdkNodeError_RefundCreationFailedImpl; + const LdkNodeError_RefundCreationFailed._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_FeerateEstimationUpdateTimeoutImplCopyWith< + $Res> { + factory _$$LdkNodeError_FeerateEstimationUpdateTimeoutImplCopyWith( + _$LdkNodeError_FeerateEstimationUpdateTimeoutImpl value, + $Res Function(_$LdkNodeError_FeerateEstimationUpdateTimeoutImpl) + then) = + __$$LdkNodeError_FeerateEstimationUpdateTimeoutImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_FeerateEstimationUpdateTimeoutImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_FeerateEstimationUpdateTimeoutImpl> + implements + _$$LdkNodeError_FeerateEstimationUpdateTimeoutImplCopyWith<$Res> { + __$$LdkNodeError_FeerateEstimationUpdateTimeoutImplCopyWithImpl( + _$LdkNodeError_FeerateEstimationUpdateTimeoutImpl _value, + $Res Function(_$LdkNodeError_FeerateEstimationUpdateTimeoutImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_FeerateEstimationUpdateTimeoutImpl + extends LdkNodeError_FeerateEstimationUpdateTimeout { + const _$LdkNodeError_FeerateEstimationUpdateTimeoutImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.feerateEstimationUpdateTimeout()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_FeerateEstimationUpdateTimeoutImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return feerateEstimationUpdateTimeout(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return feerateEstimationUpdateTimeout?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (feerateEstimationUpdateTimeout != null) { + return feerateEstimationUpdateTimeout(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return feerateEstimationUpdateTimeout(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return feerateEstimationUpdateTimeout?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (feerateEstimationUpdateTimeout != null) { + return feerateEstimationUpdateTimeout(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_FeerateEstimationUpdateTimeout + extends LdkNodeError { + const factory LdkNodeError_FeerateEstimationUpdateTimeout() = + _$LdkNodeError_FeerateEstimationUpdateTimeoutImpl; + const LdkNodeError_FeerateEstimationUpdateTimeout._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_WalletOperationTimeoutImplCopyWith<$Res> { + factory _$$LdkNodeError_WalletOperationTimeoutImplCopyWith( + _$LdkNodeError_WalletOperationTimeoutImpl value, + $Res Function(_$LdkNodeError_WalletOperationTimeoutImpl) then) = + __$$LdkNodeError_WalletOperationTimeoutImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_WalletOperationTimeoutImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_WalletOperationTimeoutImpl> + implements _$$LdkNodeError_WalletOperationTimeoutImplCopyWith<$Res> { + __$$LdkNodeError_WalletOperationTimeoutImplCopyWithImpl( + _$LdkNodeError_WalletOperationTimeoutImpl _value, + $Res Function(_$LdkNodeError_WalletOperationTimeoutImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_WalletOperationTimeoutImpl + extends LdkNodeError_WalletOperationTimeout { + const _$LdkNodeError_WalletOperationTimeoutImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.walletOperationTimeout()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_WalletOperationTimeoutImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return walletOperationTimeout(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return walletOperationTimeout?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (walletOperationTimeout != null) { + return walletOperationTimeout(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return walletOperationTimeout(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return walletOperationTimeout?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (walletOperationTimeout != null) { + return walletOperationTimeout(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_WalletOperationTimeout extends LdkNodeError { + const factory LdkNodeError_WalletOperationTimeout() = + _$LdkNodeError_WalletOperationTimeoutImpl; + const LdkNodeError_WalletOperationTimeout._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_TxSyncTimeoutImplCopyWith<$Res> { + factory _$$LdkNodeError_TxSyncTimeoutImplCopyWith( + _$LdkNodeError_TxSyncTimeoutImpl value, + $Res Function(_$LdkNodeError_TxSyncTimeoutImpl) then) = + __$$LdkNodeError_TxSyncTimeoutImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_TxSyncTimeoutImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_TxSyncTimeoutImpl> + implements _$$LdkNodeError_TxSyncTimeoutImplCopyWith<$Res> { + __$$LdkNodeError_TxSyncTimeoutImplCopyWithImpl( + _$LdkNodeError_TxSyncTimeoutImpl _value, + $Res Function(_$LdkNodeError_TxSyncTimeoutImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_TxSyncTimeoutImpl extends LdkNodeError_TxSyncTimeout { + const _$LdkNodeError_TxSyncTimeoutImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.txSyncTimeout()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_TxSyncTimeoutImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return txSyncTimeout(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return txSyncTimeout?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (txSyncTimeout != null) { + return txSyncTimeout(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return txSyncTimeout(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return txSyncTimeout?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (txSyncTimeout != null) { + return txSyncTimeout(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_TxSyncTimeout extends LdkNodeError { + const factory LdkNodeError_TxSyncTimeout() = _$LdkNodeError_TxSyncTimeoutImpl; + const LdkNodeError_TxSyncTimeout._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_GossipUpdateTimeoutImplCopyWith<$Res> { + factory _$$LdkNodeError_GossipUpdateTimeoutImplCopyWith( + _$LdkNodeError_GossipUpdateTimeoutImpl value, + $Res Function(_$LdkNodeError_GossipUpdateTimeoutImpl) then) = + __$$LdkNodeError_GossipUpdateTimeoutImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_GossipUpdateTimeoutImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_GossipUpdateTimeoutImpl> + implements _$$LdkNodeError_GossipUpdateTimeoutImplCopyWith<$Res> { + __$$LdkNodeError_GossipUpdateTimeoutImplCopyWithImpl( + _$LdkNodeError_GossipUpdateTimeoutImpl _value, + $Res Function(_$LdkNodeError_GossipUpdateTimeoutImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_GossipUpdateTimeoutImpl + extends LdkNodeError_GossipUpdateTimeout { + const _$LdkNodeError_GossipUpdateTimeoutImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.gossipUpdateTimeout()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_GossipUpdateTimeoutImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return gossipUpdateTimeout(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return gossipUpdateTimeout?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (gossipUpdateTimeout != null) { + return gossipUpdateTimeout(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return gossipUpdateTimeout(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return gossipUpdateTimeout?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (gossipUpdateTimeout != null) { + return gossipUpdateTimeout(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_GossipUpdateTimeout extends LdkNodeError { + const factory LdkNodeError_GossipUpdateTimeout() = + _$LdkNodeError_GossipUpdateTimeoutImpl; + const LdkNodeError_GossipUpdateTimeout._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidOfferIdImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidOfferIdImplCopyWith( + _$LdkNodeError_InvalidOfferIdImpl value, + $Res Function(_$LdkNodeError_InvalidOfferIdImpl) then) = + __$$LdkNodeError_InvalidOfferIdImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidOfferIdImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_InvalidOfferIdImpl> + implements _$$LdkNodeError_InvalidOfferIdImplCopyWith<$Res> { + __$$LdkNodeError_InvalidOfferIdImplCopyWithImpl( + _$LdkNodeError_InvalidOfferIdImpl _value, + $Res Function(_$LdkNodeError_InvalidOfferIdImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidOfferIdImpl extends LdkNodeError_InvalidOfferId { + const _$LdkNodeError_InvalidOfferIdImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidOfferId()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidOfferIdImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidOfferId(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidOfferId?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidOfferId != null) { + return invalidOfferId(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidOfferId(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidOfferId?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidOfferId != null) { + return invalidOfferId(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidOfferId extends LdkNodeError { + const factory LdkNodeError_InvalidOfferId() = + _$LdkNodeError_InvalidOfferIdImpl; + const LdkNodeError_InvalidOfferId._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidNodeIdImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidNodeIdImplCopyWith( + _$LdkNodeError_InvalidNodeIdImpl value, + $Res Function(_$LdkNodeError_InvalidNodeIdImpl) then) = + __$$LdkNodeError_InvalidNodeIdImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidNodeIdImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_InvalidNodeIdImpl> + implements _$$LdkNodeError_InvalidNodeIdImplCopyWith<$Res> { + __$$LdkNodeError_InvalidNodeIdImplCopyWithImpl( + _$LdkNodeError_InvalidNodeIdImpl _value, + $Res Function(_$LdkNodeError_InvalidNodeIdImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidNodeIdImpl extends LdkNodeError_InvalidNodeId { + const _$LdkNodeError_InvalidNodeIdImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidNodeId()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidNodeIdImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidNodeId(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidNodeId?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidNodeId != null) { + return invalidNodeId(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidNodeId(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidNodeId?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidNodeId != null) { + return invalidNodeId(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidNodeId extends LdkNodeError { + const factory LdkNodeError_InvalidNodeId() = _$LdkNodeError_InvalidNodeIdImpl; + const LdkNodeError_InvalidNodeId._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidOfferImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidOfferImplCopyWith( + _$LdkNodeError_InvalidOfferImpl value, + $Res Function(_$LdkNodeError_InvalidOfferImpl) then) = + __$$LdkNodeError_InvalidOfferImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidOfferImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_InvalidOfferImpl> + implements _$$LdkNodeError_InvalidOfferImplCopyWith<$Res> { + __$$LdkNodeError_InvalidOfferImplCopyWithImpl( + _$LdkNodeError_InvalidOfferImpl _value, + $Res Function(_$LdkNodeError_InvalidOfferImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidOfferImpl extends LdkNodeError_InvalidOffer { + const _$LdkNodeError_InvalidOfferImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidOffer()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidOfferImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidOffer(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidOffer?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidOffer != null) { + return invalidOffer(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidOffer(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidOffer?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidOffer != null) { + return invalidOffer(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidOffer extends LdkNodeError { + const factory LdkNodeError_InvalidOffer() = _$LdkNodeError_InvalidOfferImpl; + const LdkNodeError_InvalidOffer._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_InvalidRefundImplCopyWith<$Res> { + factory _$$LdkNodeError_InvalidRefundImplCopyWith( + _$LdkNodeError_InvalidRefundImpl value, + $Res Function(_$LdkNodeError_InvalidRefundImpl) then) = + __$$LdkNodeError_InvalidRefundImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_InvalidRefundImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, _$LdkNodeError_InvalidRefundImpl> + implements _$$LdkNodeError_InvalidRefundImplCopyWith<$Res> { + __$$LdkNodeError_InvalidRefundImplCopyWithImpl( + _$LdkNodeError_InvalidRefundImpl _value, + $Res Function(_$LdkNodeError_InvalidRefundImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_InvalidRefundImpl extends LdkNodeError_InvalidRefund { + const _$LdkNodeError_InvalidRefundImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.invalidRefund()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_InvalidRefundImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return invalidRefund(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return invalidRefund?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidRefund != null) { + return invalidRefund(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return invalidRefund(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return invalidRefund?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (invalidRefund != null) { + return invalidRefund(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_InvalidRefund extends LdkNodeError { + const factory LdkNodeError_InvalidRefund() = _$LdkNodeError_InvalidRefundImpl; + const LdkNodeError_InvalidRefund._() : super._(); +} + +/// @nodoc +abstract class _$$LdkNodeError_UnsupportedCurrencyImplCopyWith<$Res> { + factory _$$LdkNodeError_UnsupportedCurrencyImplCopyWith( + _$LdkNodeError_UnsupportedCurrencyImpl value, + $Res Function(_$LdkNodeError_UnsupportedCurrencyImpl) then) = + __$$LdkNodeError_UnsupportedCurrencyImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LdkNodeError_UnsupportedCurrencyImplCopyWithImpl<$Res> + extends _$LdkNodeErrorCopyWithImpl<$Res, + _$LdkNodeError_UnsupportedCurrencyImpl> + implements _$$LdkNodeError_UnsupportedCurrencyImplCopyWith<$Res> { + __$$LdkNodeError_UnsupportedCurrencyImplCopyWithImpl( + _$LdkNodeError_UnsupportedCurrencyImpl _value, + $Res Function(_$LdkNodeError_UnsupportedCurrencyImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LdkNodeError_UnsupportedCurrencyImpl + extends LdkNodeError_UnsupportedCurrency { + const _$LdkNodeError_UnsupportedCurrencyImpl() : super._(); + + @override + String toString() { + return 'LdkNodeError.unsupportedCurrency()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LdkNodeError_UnsupportedCurrencyImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() invalidTxid, + required TResult Function() alreadyRunning, + required TResult Function() notRunning, + required TResult Function() onchainTxCreationFailed, + required TResult Function() connectionFailed, + required TResult Function() invoiceCreationFailed, + required TResult Function() paymentSendingFailed, + required TResult Function() probeSendingFailed, + required TResult Function() channelCreationFailed, + required TResult Function() channelClosingFailed, + required TResult Function() channelConfigUpdateFailed, + required TResult Function() persistenceFailed, + required TResult Function() walletOperationFailed, + required TResult Function() onchainTxSigningFailed, + required TResult Function() messageSigningFailed, + required TResult Function() txSyncFailed, + required TResult Function() gossipUpdateFailed, + required TResult Function() invalidAddress, + required TResult Function() invalidSocketAddress, + required TResult Function() invalidPublicKey, + required TResult Function() invalidSecretKey, + required TResult Function() invalidPaymentHash, + required TResult Function() invalidPaymentPreimage, + required TResult Function() invalidPaymentSecret, + required TResult Function() invalidAmount, + required TResult Function() invalidInvoice, + required TResult Function() invalidChannelId, + required TResult Function() invalidNetwork, + required TResult Function() duplicatePayment, + required TResult Function() insufficientFunds, + required TResult Function() feerateEstimationUpdateFailed, + required TResult Function() liquidityRequestFailed, + required TResult Function() liquiditySourceUnavailable, + required TResult Function() liquidityFeeTooHigh, + required TResult Function() invalidPaymentId, + required TResult Function(DecodeError field0) decode, + required TResult Function(Bolt12ParseError field0) bolt12Parse, + required TResult Function() invoiceRequestCreationFailed, + required TResult Function() offerCreationFailed, + required TResult Function() refundCreationFailed, + required TResult Function() feerateEstimationUpdateTimeout, + required TResult Function() walletOperationTimeout, + required TResult Function() txSyncTimeout, + required TResult Function() gossipUpdateTimeout, + required TResult Function() invalidOfferId, + required TResult Function() invalidNodeId, + required TResult Function() invalidOffer, + required TResult Function() invalidRefund, + required TResult Function() unsupportedCurrency, + }) { + return unsupportedCurrency(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? invalidTxid, + TResult? Function()? alreadyRunning, + TResult? Function()? notRunning, + TResult? Function()? onchainTxCreationFailed, + TResult? Function()? connectionFailed, + TResult? Function()? invoiceCreationFailed, + TResult? Function()? paymentSendingFailed, + TResult? Function()? probeSendingFailed, + TResult? Function()? channelCreationFailed, + TResult? Function()? channelClosingFailed, + TResult? Function()? channelConfigUpdateFailed, + TResult? Function()? persistenceFailed, + TResult? Function()? walletOperationFailed, + TResult? Function()? onchainTxSigningFailed, + TResult? Function()? messageSigningFailed, + TResult? Function()? txSyncFailed, + TResult? Function()? gossipUpdateFailed, + TResult? Function()? invalidAddress, + TResult? Function()? invalidSocketAddress, + TResult? Function()? invalidPublicKey, + TResult? Function()? invalidSecretKey, + TResult? Function()? invalidPaymentHash, + TResult? Function()? invalidPaymentPreimage, + TResult? Function()? invalidPaymentSecret, + TResult? Function()? invalidAmount, + TResult? Function()? invalidInvoice, + TResult? Function()? invalidChannelId, + TResult? Function()? invalidNetwork, + TResult? Function()? duplicatePayment, + TResult? Function()? insufficientFunds, + TResult? Function()? feerateEstimationUpdateFailed, + TResult? Function()? liquidityRequestFailed, + TResult? Function()? liquiditySourceUnavailable, + TResult? Function()? liquidityFeeTooHigh, + TResult? Function()? invalidPaymentId, + TResult? Function(DecodeError field0)? decode, + TResult? Function(Bolt12ParseError field0)? bolt12Parse, + TResult? Function()? invoiceRequestCreationFailed, + TResult? Function()? offerCreationFailed, + TResult? Function()? refundCreationFailed, + TResult? Function()? feerateEstimationUpdateTimeout, + TResult? Function()? walletOperationTimeout, + TResult? Function()? txSyncTimeout, + TResult? Function()? gossipUpdateTimeout, + TResult? Function()? invalidOfferId, + TResult? Function()? invalidNodeId, + TResult? Function()? invalidOffer, + TResult? Function()? invalidRefund, + TResult? Function()? unsupportedCurrency, + }) { + return unsupportedCurrency?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? invalidTxid, + TResult Function()? alreadyRunning, + TResult Function()? notRunning, + TResult Function()? onchainTxCreationFailed, + TResult Function()? connectionFailed, + TResult Function()? invoiceCreationFailed, + TResult Function()? paymentSendingFailed, + TResult Function()? probeSendingFailed, + TResult Function()? channelCreationFailed, + TResult Function()? channelClosingFailed, + TResult Function()? channelConfigUpdateFailed, + TResult Function()? persistenceFailed, + TResult Function()? walletOperationFailed, + TResult Function()? onchainTxSigningFailed, + TResult Function()? messageSigningFailed, + TResult Function()? txSyncFailed, + TResult Function()? gossipUpdateFailed, + TResult Function()? invalidAddress, + TResult Function()? invalidSocketAddress, + TResult Function()? invalidPublicKey, + TResult Function()? invalidSecretKey, + TResult Function()? invalidPaymentHash, + TResult Function()? invalidPaymentPreimage, + TResult Function()? invalidPaymentSecret, + TResult Function()? invalidAmount, + TResult Function()? invalidInvoice, + TResult Function()? invalidChannelId, + TResult Function()? invalidNetwork, + TResult Function()? duplicatePayment, + TResult Function()? insufficientFunds, + TResult Function()? feerateEstimationUpdateFailed, + TResult Function()? liquidityRequestFailed, + TResult Function()? liquiditySourceUnavailable, + TResult Function()? liquidityFeeTooHigh, + TResult Function()? invalidPaymentId, + TResult Function(DecodeError field0)? decode, + TResult Function(Bolt12ParseError field0)? bolt12Parse, + TResult Function()? invoiceRequestCreationFailed, + TResult Function()? offerCreationFailed, + TResult Function()? refundCreationFailed, + TResult Function()? feerateEstimationUpdateTimeout, + TResult Function()? walletOperationTimeout, + TResult Function()? txSyncTimeout, + TResult Function()? gossipUpdateTimeout, + TResult Function()? invalidOfferId, + TResult Function()? invalidNodeId, + TResult Function()? invalidOffer, + TResult Function()? invalidRefund, + TResult Function()? unsupportedCurrency, + required TResult orElse(), + }) { + if (unsupportedCurrency != null) { + return unsupportedCurrency(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(LdkNodeError_InvalidTxid value) invalidTxid, + required TResult Function(LdkNodeError_AlreadyRunning value) alreadyRunning, + required TResult Function(LdkNodeError_NotRunning value) notRunning, + required TResult Function(LdkNodeError_OnchainTxCreationFailed value) + onchainTxCreationFailed, + required TResult Function(LdkNodeError_ConnectionFailed value) + connectionFailed, + required TResult Function(LdkNodeError_InvoiceCreationFailed value) + invoiceCreationFailed, + required TResult Function(LdkNodeError_PaymentSendingFailed value) + paymentSendingFailed, + required TResult Function(LdkNodeError_ProbeSendingFailed value) + probeSendingFailed, + required TResult Function(LdkNodeError_ChannelCreationFailed value) + channelCreationFailed, + required TResult Function(LdkNodeError_ChannelClosingFailed value) + channelClosingFailed, + required TResult Function(LdkNodeError_ChannelConfigUpdateFailed value) + channelConfigUpdateFailed, + required TResult Function(LdkNodeError_PersistenceFailed value) + persistenceFailed, + required TResult Function(LdkNodeError_WalletOperationFailed value) + walletOperationFailed, + required TResult Function(LdkNodeError_OnchainTxSigningFailed value) + onchainTxSigningFailed, + required TResult Function(LdkNodeError_MessageSigningFailed value) + messageSigningFailed, + required TResult Function(LdkNodeError_TxSyncFailed value) txSyncFailed, + required TResult Function(LdkNodeError_GossipUpdateFailed value) + gossipUpdateFailed, + required TResult Function(LdkNodeError_InvalidAddress value) invalidAddress, + required TResult Function(LdkNodeError_InvalidSocketAddress value) + invalidSocketAddress, + required TResult Function(LdkNodeError_InvalidPublicKey value) + invalidPublicKey, + required TResult Function(LdkNodeError_InvalidSecretKey value) + invalidSecretKey, + required TResult Function(LdkNodeError_InvalidPaymentHash value) + invalidPaymentHash, + required TResult Function(LdkNodeError_InvalidPaymentPreimage value) + invalidPaymentPreimage, + required TResult Function(LdkNodeError_InvalidPaymentSecret value) + invalidPaymentSecret, + required TResult Function(LdkNodeError_InvalidAmount value) invalidAmount, + required TResult Function(LdkNodeError_InvalidInvoice value) invalidInvoice, + required TResult Function(LdkNodeError_InvalidChannelId value) + invalidChannelId, + required TResult Function(LdkNodeError_InvalidNetwork value) invalidNetwork, + required TResult Function(LdkNodeError_DuplicatePayment value) + duplicatePayment, + required TResult Function(LdkNodeError_InsufficientFunds value) + insufficientFunds, + required TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value) + feerateEstimationUpdateFailed, + required TResult Function(LdkNodeError_LiquidityRequestFailed value) + liquidityRequestFailed, + required TResult Function(LdkNodeError_LiquiditySourceUnavailable value) + liquiditySourceUnavailable, + required TResult Function(LdkNodeError_LiquidityFeeTooHigh value) + liquidityFeeTooHigh, + required TResult Function(LdkNodeError_InvalidPaymentId value) + invalidPaymentId, + required TResult Function(LdkNodeError_Decode value) decode, + required TResult Function(LdkNodeError_Bolt12Parse value) bolt12Parse, + required TResult Function(LdkNodeError_InvoiceRequestCreationFailed value) + invoiceRequestCreationFailed, + required TResult Function(LdkNodeError_OfferCreationFailed value) + offerCreationFailed, + required TResult Function(LdkNodeError_RefundCreationFailed value) + refundCreationFailed, + required TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value) + feerateEstimationUpdateTimeout, + required TResult Function(LdkNodeError_WalletOperationTimeout value) + walletOperationTimeout, + required TResult Function(LdkNodeError_TxSyncTimeout value) txSyncTimeout, + required TResult Function(LdkNodeError_GossipUpdateTimeout value) + gossipUpdateTimeout, + required TResult Function(LdkNodeError_InvalidOfferId value) invalidOfferId, + required TResult Function(LdkNodeError_InvalidNodeId value) invalidNodeId, + required TResult Function(LdkNodeError_InvalidOffer value) invalidOffer, + required TResult Function(LdkNodeError_InvalidRefund value) invalidRefund, + required TResult Function(LdkNodeError_UnsupportedCurrency value) + unsupportedCurrency, + }) { + return unsupportedCurrency(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult? Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult? Function(LdkNodeError_NotRunning value)? notRunning, + TResult? Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult? Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult? Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult? Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult? Function(LdkNodeError_ProbeSendingFailed value)? + probeSendingFailed, + TResult? Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult? Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult? Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult? Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult? Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult? Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult? Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult? Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult? Function(LdkNodeError_GossipUpdateFailed value)? + gossipUpdateFailed, + TResult? Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult? Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult? Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult? Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult? Function(LdkNodeError_InvalidPaymentHash value)? + invalidPaymentHash, + TResult? Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult? Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult? Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult? Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult? Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult? Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult? Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult? Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult? Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult? Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult? Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult? Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult? Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult? Function(LdkNodeError_Decode value)? decode, + TResult? Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult? Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult? Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult? Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult? Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult? Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult? Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult? Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult? Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult? Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult? Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult? Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult? Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + }) { + return unsupportedCurrency?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(LdkNodeError_InvalidTxid value)? invalidTxid, + TResult Function(LdkNodeError_AlreadyRunning value)? alreadyRunning, + TResult Function(LdkNodeError_NotRunning value)? notRunning, + TResult Function(LdkNodeError_OnchainTxCreationFailed value)? + onchainTxCreationFailed, + TResult Function(LdkNodeError_ConnectionFailed value)? connectionFailed, + TResult Function(LdkNodeError_InvoiceCreationFailed value)? + invoiceCreationFailed, + TResult Function(LdkNodeError_PaymentSendingFailed value)? + paymentSendingFailed, + TResult Function(LdkNodeError_ProbeSendingFailed value)? probeSendingFailed, + TResult Function(LdkNodeError_ChannelCreationFailed value)? + channelCreationFailed, + TResult Function(LdkNodeError_ChannelClosingFailed value)? + channelClosingFailed, + TResult Function(LdkNodeError_ChannelConfigUpdateFailed value)? + channelConfigUpdateFailed, + TResult Function(LdkNodeError_PersistenceFailed value)? persistenceFailed, + TResult Function(LdkNodeError_WalletOperationFailed value)? + walletOperationFailed, + TResult Function(LdkNodeError_OnchainTxSigningFailed value)? + onchainTxSigningFailed, + TResult Function(LdkNodeError_MessageSigningFailed value)? + messageSigningFailed, + TResult Function(LdkNodeError_TxSyncFailed value)? txSyncFailed, + TResult Function(LdkNodeError_GossipUpdateFailed value)? gossipUpdateFailed, + TResult Function(LdkNodeError_InvalidAddress value)? invalidAddress, + TResult Function(LdkNodeError_InvalidSocketAddress value)? + invalidSocketAddress, + TResult Function(LdkNodeError_InvalidPublicKey value)? invalidPublicKey, + TResult Function(LdkNodeError_InvalidSecretKey value)? invalidSecretKey, + TResult Function(LdkNodeError_InvalidPaymentHash value)? invalidPaymentHash, + TResult Function(LdkNodeError_InvalidPaymentPreimage value)? + invalidPaymentPreimage, + TResult Function(LdkNodeError_InvalidPaymentSecret value)? + invalidPaymentSecret, + TResult Function(LdkNodeError_InvalidAmount value)? invalidAmount, + TResult Function(LdkNodeError_InvalidInvoice value)? invalidInvoice, + TResult Function(LdkNodeError_InvalidChannelId value)? invalidChannelId, + TResult Function(LdkNodeError_InvalidNetwork value)? invalidNetwork, + TResult Function(LdkNodeError_DuplicatePayment value)? duplicatePayment, + TResult Function(LdkNodeError_InsufficientFunds value)? insufficientFunds, + TResult Function(LdkNodeError_FeerateEstimationUpdateFailed value)? + feerateEstimationUpdateFailed, + TResult Function(LdkNodeError_LiquidityRequestFailed value)? + liquidityRequestFailed, + TResult Function(LdkNodeError_LiquiditySourceUnavailable value)? + liquiditySourceUnavailable, + TResult Function(LdkNodeError_LiquidityFeeTooHigh value)? + liquidityFeeTooHigh, + TResult Function(LdkNodeError_InvalidPaymentId value)? invalidPaymentId, + TResult Function(LdkNodeError_Decode value)? decode, + TResult Function(LdkNodeError_Bolt12Parse value)? bolt12Parse, + TResult Function(LdkNodeError_InvoiceRequestCreationFailed value)? + invoiceRequestCreationFailed, + TResult Function(LdkNodeError_OfferCreationFailed value)? + offerCreationFailed, + TResult Function(LdkNodeError_RefundCreationFailed value)? + refundCreationFailed, + TResult Function(LdkNodeError_FeerateEstimationUpdateTimeout value)? + feerateEstimationUpdateTimeout, + TResult Function(LdkNodeError_WalletOperationTimeout value)? + walletOperationTimeout, + TResult Function(LdkNodeError_TxSyncTimeout value)? txSyncTimeout, + TResult Function(LdkNodeError_GossipUpdateTimeout value)? + gossipUpdateTimeout, + TResult Function(LdkNodeError_InvalidOfferId value)? invalidOfferId, + TResult Function(LdkNodeError_InvalidNodeId value)? invalidNodeId, + TResult Function(LdkNodeError_InvalidOffer value)? invalidOffer, + TResult Function(LdkNodeError_InvalidRefund value)? invalidRefund, + TResult Function(LdkNodeError_UnsupportedCurrency value)? + unsupportedCurrency, + required TResult orElse(), + }) { + if (unsupportedCurrency != null) { + return unsupportedCurrency(this); + } + return orElse(); + } +} + +abstract class LdkNodeError_UnsupportedCurrency extends LdkNodeError { + const factory LdkNodeError_UnsupportedCurrency() = + _$LdkNodeError_UnsupportedCurrencyImpl; + const LdkNodeError_UnsupportedCurrency._() : super._(); +} diff --git a/lib/src/root.dart b/lib/src/root.dart index fa2461a..9607cfe 100644 --- a/lib/src/root.dart +++ b/lib/src/root.dart @@ -1,23 +1,31 @@ -import 'package:ldk_node/src/generated/api/error.dart' as error; +import 'package:flutter_rust_bridge/flutter_rust_bridge.dart'; +import 'package:ldk_node/src/generated/api/bolt11.dart' as bolt11; +import 'package:ldk_node/src/generated/api/bolt12.dart' as bolt12; +import 'package:ldk_node/src/generated/api/graph.dart' as graph; import 'package:ldk_node/src/generated/api/types.dart' as types; +import 'package:ldk_node/src/generated/utils/error.dart' as error; import 'package:ldk_node/src/utils/default_services.dart'; import 'package:ldk_node/src/utils/utils.dart'; import 'package:path_provider/path_provider.dart'; +import 'generated/api/builder.dart' as builder; import 'generated/api/node.dart'; +import 'generated/api/on_chain.dart' as on_chain; +import 'generated/api/spontaneous.dart' as spontaneous; +import 'generated/lib.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 LdkMnemonic { +class Mnemonic extends builder.LdkMnemonic { Mnemonic({required super.seedPhrase}); static Future generate() async { try { await Frb.verifyInit(); - final res = await LdkMnemonic.generate(); + final res = await builder.LdkMnemonic.generate(); return Mnemonic(seedPhrase: res.seedPhrase); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } } @@ -38,8 +46,8 @@ class Node extends LdkNode { Future start({hint}) async { try { return super.start(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -51,32 +59,42 @@ class Node extends LdkNode { Future stop({hint}) async { try { await super.stop(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - // Confirm the last retrieved event handled. + ///Returns the status of the Node. + @override + Future status({hint}) async { + try { + return await super.status(); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + /// Blocks until the next event is available. /// - /// **Note:** This **MUST** be called after each event has been handled. + /// **Note:** this will always return the same event until handling is confirmed via `node.eventHandled()`. @override Future eventHandled({hint}) async { try { await super.eventHandled(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - /// Blocks until the next event is available. + // Confirm the last retrieved event handled. /// - /// **Note:** this will always return the same event until handling is confirmed via `node.eventHandled()`. + /// **Note:** This **MUST** be called after each event has been handled. @override Future nextEvent({hint}) async { try { return await super.nextEvent(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -89,8 +107,20 @@ class Node extends LdkNode { Future waitNextHandled({hint}) async { try { return await super.waitNextEvent(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///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()`. + @override + Future nextEventAsync({hint}) async { + try { + return await super.nextEventAsync(); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -99,8 +129,8 @@ class Node extends LdkNode { Future nodeId({hint}) async { try { return await super.nodeId(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -109,61 +139,28 @@ class Node extends LdkNode { Future?> listeningAddresses({hint}) async { try { return await super.listeningAddresses(); - } on error.NodeException catch (e) { - throw mapNodeException(e); - } - } - - /// Retrieve a new on-chain/funding address. - @override - Future newOnchainAddress({hint}) async { - try { - return await super.newOnchainAddress(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } /// Retrieve the currently spendable on-chain balance in satoshis. @override - Future spendableOnchainBalanceSats({hint}) async { + Future listBalances({hint}) { try { - return await super.spendableOnchainBalanceSats(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + return super.listBalances(); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - /// Retrieve the current total on-chain balance in satoshis. + ///Returns the config with which the Node was initialized. @override - Future totalOnchainBalanceSats({hint}) async { + Future config({hint}) { try { - return await super.totalOnchainBalanceSats(); - } on error.NodeException catch (e) { - throw mapNodeException(e); - } - } - - /// Send an on-chain payment to the given address. - @override - Future sendToOnchainAddress( - {required types.Address address, required int amountSats, hint}) async { - try { - return await super - .sendToOnchainAddress(address: address, amountSats: amountSats); - } on error.NodeException catch (e) { - throw mapNodeException(e); - } - } - - /// Send an on-chain payment to the given address, draining all the available funds. - @override - Future sendAllToOnchainAddress( - {required types.Address address, hint}) async { - try { - return await super.sendAllToOnchainAddress(address: address); - } on error.NodeException catch (e) { - throw mapNodeException(e); + return super.config(); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -172,8 +169,8 @@ class Node extends LdkNode { Future> listChannels({hint}) async { try { return await super.listChannels(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -189,8 +186,8 @@ class Node extends LdkNode { try { return await super .connect(address: address, nodeId: nodeId, persist: persist); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -205,8 +202,8 @@ class Node extends LdkNode { await super.disconnect( counterpartyNodeId: counterpartyNodeId, ); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -220,24 +217,24 @@ class Node extends LdkNode { /// /// Returns a temporary channel id. @override - Future connectOpenChannel( + Future connectOpenChannel( {required types.SocketAddress socketAddress, required types.PublicKey nodeId, - required int channelAmountSats, + required BigInt channelAmountSats, required bool announceChannel, types.ChannelConfig? channelConfig, - int? pushToCounterpartyMsat, + BigInt? pushToCounterpartyMsat, hint}) async { try { - await super.connectOpenChannel( + return await super.connectOpenChannel( socketAddress: socketAddress, nodeId: nodeId, pushToCounterpartyMsat: pushToCounterpartyMsat, channelAmountSats: channelAmountSats, channelConfig: channelConfig, announceChannel: announceChannel); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -247,8 +244,18 @@ class Node extends LdkNode { Future syncWallets({hint}) async { try { await super.syncWallets(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Returns a handler allowing to query the network graph. + Future networkGraph() async { + try { + final res = await LdkNode.networkGraph(ptr: this); + return NetworkGraph._(ptr: res.ptr); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -256,15 +263,34 @@ class Node extends LdkNode { @override Future closeChannel( {required types.PublicKey counterpartyNodeId, - required types.ChannelId channelId, + required types.UserChannelId userChannelId, hint}) async { try { await super.closeChannel( - channelId: channelId, + userChannelId: userChannelId, counterpartyNodeId: counterpartyNodeId, ); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Force-close a previously opened channel. + /// Will force-close the channel, potentially broadcasting our latest state. Note that in contrast to cooperative closure, force-closing will have the channel funds time-locked, i. e., they will only be available after the counterparty had time to contest our claim. + /// Force-closing channels also more costly in terms of on-chain fees. So cooperative closure should always be preferred (and tried first). + /// Broadcasting the closing transactions will be omitted for Anchor channels if we trust the counterparty to broadcast for us. + @override + Future forceCloseChannel( + {required types.PublicKey counterpartyNodeId, + required types.UserChannelId userChannelId, + hint}) async { + try { + await super.forceCloseChannel( + userChannelId: userChannelId, + counterpartyNodeId: counterpartyNodeId, + ); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } @@ -273,225 +299,531 @@ class Node extends LdkNode { @override Future updateChannelConfig( {required types.PublicKey counterpartyNodeId, - required types.ChannelId channelId, + required types.UserChannelId userChannelId, required types.ChannelConfig channelConfig, hint}) async { try { await super.updateChannelConfig( - channelId: channelId, + userChannelId: userChannelId, counterpartyNodeId: counterpartyNodeId, channelConfig: channelConfig, ); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - /// Send a payement given an invoice. + /// Retrieve the details of a specific payment with the given hash. + /// + /// Returns `PaymentDetails` if the payment was known and `null` otherwise. @override - Future sendPayment( - {required types.Bolt11Invoice invoice, hint}) async { + Future payment( + {required types.PaymentId paymentId, hint}) async { try { - return await super.sendPayment(invoice: invoice); - } on error.NodeException catch (e) { - throw mapNodeException(e); + return await super.payment(paymentId: paymentId); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - /// Send a payment given an invoice and an amount in millisatoshi. - /// - /// This will fail if the amount given is less than the value required by the given invoice. - /// - /// This can be used to pay a so-called "zero-amount" invoice, i.e., an invoice that leaves the - /// amount paid to be determined by the user. + ///Remove the payment with the given hash from the store. @override - Future sendPaymentUsingAmount( - {required types.Bolt11Invoice invoice, - required int amountMsat, - hint}) async { + Future removePayment({required types.PaymentId paymentId, hint}) async { try { - return await super - .sendPaymentUsingAmount(invoice: invoice, amountMsat: amountMsat); - } on error.NodeException catch (e) { - throw mapNodeException(e); + return await super.removePayment(paymentId: paymentId); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - /// Send a spontaneous, aka. "keysend", payment + ///Retrieves all payments that match the given predicate. @override - Future sendSpontaneousPayment( - {required types.PublicKey nodeId, required int amountMsat, hint}) async { + Future> listPaymentsWithFilter( + {required types.PaymentDirection paymentDirection, hint}) async { try { return await super - .sendSpontaneousPayment(amountMsat: amountMsat, nodeId: nodeId); - } on error.NodeException catch (e) { - throw mapNodeException(e); + .listPaymentsWithFilter(paymentDirection: paymentDirection); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - ///Sends payment probes over all paths of a route that would be used to pay the given amount to the given node_id. + ///Retrieves all payments. @override - Future sendSpontaneousPaymentProbes( - {required types.PublicKey nodeId, required int amountMsat, hint}) async { + Future> listPayments({hint}) async { try { - return await super - .sendSpontaneousPaymentProbes(amountMsat: amountMsat, nodeId: nodeId); - } on error.NodeException catch (e) { - throw mapNodeException(e); + return super.listPayments(); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - // Sends payment probes over all paths of a route that would be used to pay the given invoice. - /// - /// This may be used to send "pre-flight" probes, i.e., to train our scorer before conducting - /// the actual payment. Note this is only useful if there likely is sufficient time for the - /// probe to settle before sending out the actual payment, e.g., when waiting for user - /// confirmation in a wallet UI. - /// - /// Otherwise, there is a chance the probe could take up some liquidity needed to complete the - /// actual payment. Users should therefore be cautious and might avoid sending probes if - /// liquidity is scarce and/or they don't expect the probe to return before they send the - /// payment. To mitigate this issue, channels with available liquidity less than the required - /// amount times "config.probingLiquidityLimitMultiplier" won't be used to send - /// pre-flight probes. + ///Retrieves a list of known peers. + @override + Future> listPeers({hint}) async { + try { + return await super.listPeers(); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + /// Creates a digital ECDSA signature of a message with the node's secret key. /// + /// A receiver knowing the corresponding [types.PublicKey] (e.g. the node’s id) and the message + /// can be sure that the signature was generated by the caller. + /// Signatures are EC recoverable, meaning that given the message and the + /// signature the PublicKey of the signer can be extracted. @override - Future sendPaymentProbes( - {required types.Bolt11Invoice invoice, hint}) async { + Future signMessage({required List msg, hint}) async { try { - return await super.sendPaymentProbes(invoice: invoice); - } on error.NodeException catch (e) { - throw mapNodeException(e); + return await super.signMessage(msg: msg); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } + /// Verifies that the given ECDSA signature was created for the given message with the + /// secret key corresponding to the given public key. @override - Future sendPaymentProbesUsingAmount( - {required types.Bolt11Invoice invoice, - required int amountMsat, + Future verifySignature( + {required List msg, + required String sig, + required types.PublicKey publicKey, hint}) async { try { - return await super.sendPaymentProbesUsingAmount( - invoice: invoice, amountMsat: amountMsat); - } on error.NodeException catch (e) { - throw mapNodeException(e); + return await super + .verifySignature(msg: msg, sig: sig, publicKey: publicKey); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Returns a payment handler allowing to create and pay BOLT 11 invoices. + Future bolt11Payment() async { + try { + final res = await LdkNode.bolt11Payment(ptr: this); + return Bolt11Payment._(ptr: res.ptr); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Returns a payment handler allowing to create and pay BOLT 12 invoices. + Future bolt12Payment() async { + try { + final res = await LdkNode.bolt12Payment(ptr: this); + return Bolt12Payment._(ptr: res.ptr); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Returns a payment handler allowing to send and receive on-chain payments. + Future onChainPayment() async { + try { + final res = await LdkNode.onChainPayment(ptr: this); + return OnChainPayment._(ptr: res.ptr); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Returns a payment handler allowing to send spontaneous ("keysend") payments. + Future spontaneousPayment() async { + try { + final res = await LdkNode.spontaneousPayment(ptr: this); + return SpontaneousPayment._(ptr: res.ptr); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } +} + +///A payment handler allowing to send spontaneous ("keysend") payments. +class SpontaneousPayment extends spontaneous.LdkSpontaneousPayment { + SpontaneousPayment._({required super.ptr}); + + ///Sends payment probes over all paths of a route that would be used to pay the given amount to the given node_id. + @override + Future sendProbes( + {required BigInt amountMsat, required types.PublicKey nodeId, hint}) { + try { + return super.sendProbes(amountMsat: amountMsat, nodeId: nodeId); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Send a spontaneous, aka. "keysend", payment + @override + Future send( + {required BigInt amountMsat, + required types.PublicKey nodeId, + dynamic hint}) { + try { + return super.send(amountMsat: amountMsat, nodeId: nodeId); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } +} + +///A payment handler allowing to send and receive on-chain payments. +class OnChainPayment extends on_chain.LdkOnChainPayment { + OnChainPayment._({required super.ptr}); + @override + Future newAddress({hint}) { + try { + return super.newAddress(); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + @override + Future sendAllToAddress({required types.Address address, hint}) { + try { + return super.sendAllToAddress(address: address); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + @override + Future sendToAddress( + {required types.Address address, required BigInt amountSats, hint}) { + try { + return super.sendToAddress(address: address, amountSats: amountSats); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } +} + +///Represents the network as nodes and channels between them. +class NetworkGraph extends graph.LdkNetworkGraph { + NetworkGraph._({required super.ptr}); + + ///Returns information on a channel with the given id. + @override + Future channel({required BigInt shortChannelId}) { + try { + return super.channel(shortChannelId: shortChannelId); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Returns the list of channels in the graph + @override + Future listChannels() { + try { + return super.listChannels(); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Returns the list of nodes in the graph + @override + Future> listNodes() { + try { + return super.listNodes(); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - /// Returns a payable invoice that can be used to request and receive a payment of the amount - /// given. + ///Returns information on a node with the given id. + @override + Future node({required graph.NodeId nodeId}) { + try { + return super.node(nodeId: nodeId); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } +} + +///Represents a syntactically and semantically correct lightning BOLT11 invoice. +class Bolt11Payment extends bolt11.LdkBolt11Payment { + Bolt11Payment._({required super.ptr}); + + ///Allows to attempt manually claiming payments with the given preimage that have previously been registered via + ///`receiveForHash` or `receiveVariableAmountForHash`. + /// This should be called in response to a PaymentClaimable event as soon as the preimage is available. + /// Will check that the payment is known, and that the given preimage and claimable amount match our expectations before attempting to claim the payment, and will return an error otherwise. + /// When claiming the payment has succeeded, a PaymentReceived event will be emitted. @override - Future receivePayment( - {required int amountMsat, + Future claimForHash( + {required types.PaymentHash paymentHash, + required BigInt claimableAmountMsat, + required types.PaymentPreimage preimage}) { + try { + return super.claimForHash( + paymentHash: paymentHash, + claimableAmountMsat: claimableAmountMsat, + preimage: preimage); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Allows to manually fail payments with the given hash that have previously been registered via + ///`receiveForHash` or `receiveVariableAmountForHash`. + /// This should be called in response to a PaymentClaimable event if the payment needs to be failed back, e. g., if the correct preimage can't be retrieved in time before the claim deadline has been reached. + /// Will check that the payment is known before failing the payment, and will return an error otherwise. + @override + Future failForHash({required types.PaymentHash paymentHash}) { + try { + return super.failForHash(paymentHash: paymentHash); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Returns a payable invoice that can be used to request a payment of the amount given for the given payment hash. + /// We will register the given payment hash and emit a PaymentClaimable event once the inbound payment arrives. + /// Note: users MUST handle this event and claim the payment manually via claimForHash as soon as they have obtained access to the preimage of the given payment hash. + /// If they're unable to obtain the preimage, they MUST immediately fail the payment via failForHash. + @override + Future receiveForHash( + {required types.PaymentHash paymentHash, + required BigInt amountMsat, + required String description, + required int expirySecs}) { + try { + return super.receiveForHash( + paymentHash: paymentHash, + amountMsat: amountMsat, + description: description, + expirySecs: expirySecs); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Returns a payable invoice that can be used to request a payment for the given payment hash and the amount to be determined by the user, also known as a "zero-amount" invoice. + /// We will register the given payment hash and emit a PaymentClaimable event once the inbound payment arrives. + /// Note: users MUST handle this event and claim the payment manually via `claimForHash` as soon as they have obtained access to the preimage + /// of the given payment hash. If they're unable to obtain the preimage, they MUST immediately fail the payment via `failForHash`. + @override + Future receiveVariableAmountForHash( + {required String description, required int expirySecs, + required types.PaymentHash paymentHash}) { + try { + return super.receiveVariableAmountForHash( + description: description, + expirySecs: expirySecs, + paymentHash: paymentHash); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Returns a payable invoice that can be used to request and receive a payment of the amount given. + /// The inbound payment will be automatically claimed upon arrival. + @override + Future receive( + {required BigInt amountMsat, required String description, - hint}) async { + required int expirySecs, + hint}) { try { - return await super.receivePayment( + return super.receive( amountMsat: amountMsat, description: description, expirySecs: expirySecs); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - /// Returns a payable invoice that can be used to request and receive a payment for which the - /// amount is to be determined by the user, also known as a "zero-amount" invoice. + ///Returns a payable invoice that can be used to request and receive a payment for which the amount is to be determined by the user, also known as a "zero-amount" invoice. + /// The inbound payment will be automatically claimed upon arrival. @override - Future receiveVariableAmountPayment( - {required int expirySecs, required String description, hint}) async { + Future receiveVariableAmount( + {required String description, required int expirySecs, hint}) { try { - return await super.receiveVariableAmountPayment( + return super.receiveVariableAmount( description: description, expirySecs: expirySecs); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - /// Retrieve the details of a specific payment with the given hash. - /// - /// Returns `PaymentDetails` if the payment was known and `null` otherwise. + ///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 payment( - {required types.PaymentHash paymentHash, hint}) async { + Future receiveVariableAmountViaJitChannel( + {required String description, + required int expirySecs, + BigInt? maxProportionalLspFeeLimitPpmMsat, + hint}) { try { - return await super.payment(paymentHash: paymentHash); - } on error.NodeException catch (e) { - throw mapNodeException(e); + return super.receiveVariableAmountViaJitChannel( + description: description, + expirySecs: expirySecs, + maxProportionalLspFeeLimitPpmMsat: maxProportionalLspFeeLimitPpmMsat); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - ///Remove the payment with the given hash from the store. + ///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, `maxTotalLspFeeLimitMsat` 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 removePayment( - {required types.PaymentHash paymentHash, hint}) async { + Future receiveViaJitChannel( + {required BigInt amountMsat, + required String description, + required int expirySecs, + BigInt? maxTotalLspFeeLimitMsat, + hint}) { try { - return await super.removePayment(paymentHash: paymentHash); - } on error.NodeException catch (e) { - throw mapNodeException(e); + return super.receiveViaJitChannel( + description: description, + expirySecs: expirySecs, + maxTotalLspFeeLimitMsat: maxTotalLspFeeLimitMsat, + amountMsat: amountMsat); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - ///Retrieves all payments that match the given predicate. + ///Send a payment given an invoice. @override - Future> listPaymentsWithFilter( - {required types.PaymentDirection paymentDirection, hint}) async { + Future send({required bolt11.Bolt11Invoice invoice, hint}) { try { - return await super - .listPaymentsWithFilter(paymentDirection: paymentDirection); - } on error.NodeException catch (e) { - throw mapNodeException(e); + return super.send(invoice: invoice); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - ///Retrieves all payments. + ///Sends payment probes over all paths of a route that would be used to pay the given invoice. + /// This may be used to send "pre-flight" probes, i. e., to train our scorer before conducting the actual payment. Note this is only useful if there likely is sufficient time for the probe to settle before sending out the actual payment, e. g., when waiting for user confirmation in a wallet UI. + /// Otherwise, there is a chance the probe could take up some liquidity needed to complete the actual payment. + /// Users should therefore be cautious and might avoid sending probes if liquidity is scarce and/ or they don't expect the probe to return before they send the payment. + /// To mitigate this issue, channels with available liquidity less than the required amount times @override - Future> listPayments({hint}) async { + Future sendProbes({required bolt11.Bolt11Invoice invoice, hint}) { try { - return super.listPayments(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + return super.sendProbes(invoice: invoice); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - ///Retrieves a list of known peers. + ///Sends payment probes over all paths of a route that would be used to pay the given zero-value invoice using the given amount. + /// This can be used to send pre-flight probes for a so-called "zero-amount" invoice, i. e., an invoice that leaves the amount paid to be determined by the user. @override - Future> listPeers({hint}) async { + Future sendProbesUsingAmount( + {required bolt11.Bolt11Invoice invoice, + required BigInt amountMsat, + hint}) { try { - return await super.listPeers(); - } on error.NodeException catch (e) { - throw mapNodeException(e); + return super + .sendProbesUsingAmount(invoice: invoice, amountMsat: amountMsat); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - /// Creates a digital ECDSA signature of a message with the node's secret key. - /// - /// A receiver knowing the corresponding [types.PublicKey] (e.g. the node’s id) and the message - /// can be sure that the signature was generated by the caller. - /// Signatures are EC recoverable, meaning that given the message and the - /// signature the PublicKey of the signer can be extracted. + ///Send a payment given an invoice and an amount in millisatoshi. + /// This will fail if the amount given is less than the value required by the given invoice. + /// This can be used to pay a so-called "zero-amount" invoice, i. e., an invoice that leaves the amount paid to be determined by the user. @override - Future signMessage({required List msg, hint}) async { + Future sendUsingAmount( + {required bolt11.Bolt11Invoice invoice, + required BigInt amountMsat, + hint}) { try { - return await super.signMessage(msg: msg); - } on error.NodeException catch (e) { - throw mapNodeException(e); + return super.sendUsingAmount(invoice: invoice, amountMsat: amountMsat); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } +} + +///A payment handler allowing to create and pay BOLT 12 offers and refunds. +class Bolt12Payment extends bolt12.LdkBolt12Payment { + Bolt12Payment._({required super.ptr}); + + ///Returns a Refund object that can be used to offer a refund payment of the amount given. + @override + Future initiateRefund( + {required BigInt amountMsat, required int expirySecs}) { + try { + return super + .initiateRefund(amountMsat: amountMsat, expirySecs: expirySecs); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } - /// Verifies that the given ECDSA signature was created for the given message with the - /// secret key corresponding to the given public key. + ///Returns a payable offer that can be used to request and receive a payment of the amount given. @override - Future verifySignature( - {required List msg, - required String sig, - required types.PublicKey pkey, - hint}) async { + Future receive( + {required BigInt amountMsat, required String description}) { + try { + return super.receive(amountMsat: amountMsat, description: description); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Returns a payable offer that can be used to request and receive a payment for which the amount is to be determined by the user, also known as a "zero-amount" offer. + @override + Future receiveVariableAmount({required String description}) { try { - return await super.verifySignature(msg: msg, sig: sig, pkey: pkey); - } on error.NodeException catch (e) { - throw mapNodeException(e); + return super.receiveVariableAmount(description: description); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Requests a refund payment for the given Refund. + /// The returned `Bolt12Invoice` is for informational purposes only (i. e., isn't needed to retrieve the refund). + @override + Future requestRefundPayment( + {required bolt12.Refund refund}) { + try { + return super.requestRefundPayment(refund: refund); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Send a payment given an offer and an amount in millisatoshi. + /// This will fail if the amount given is less than the value required by the given offer. + /// This can be used to pay a so-called "zero-amount" offers, i. e., an offer that leaves the amount paid to be determined by the user. + /// If payer_note is Some it will be seen by the recipient and reflected back in the invoice response. + @override + Future sendUsingAmount( + {required bolt12.Offer offer, + String? payerNote, + required BigInt amountMsat}) { + try { + return super.sendUsingAmount( + offer: offer, payerNote: payerNote, amountMsat: amountMsat); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); + } + } + + ///Send a payment given an offer. + /// If payer_note is Some it will be seen by the recipient and reflected back in the invoice response. + @override + Future send( + {required bolt12.Offer offer, String? payerNote}) { + try { + return super.send(offer: offer, payerNote: payerNote); + } on error.LdkNodeError catch (e) { + throw mapLdkNodeError(e); } } } @@ -509,6 +841,7 @@ class Builder { types.EntropySourceConfig? _entropySource; types.ChainDataSourceConfig? _chainDataSourceConfig; types.GossipSourceConfig? _gossipSourceConfig; + types.LiquiditySourceConfig? _liquiditySourceConfig; /// Creates a new builder instance from an [Config]. /// @@ -521,18 +854,19 @@ class Builder { /// factory Builder() { return Builder._(types.Config( - storageDirPath: '', - network: types.Network.bitcoin, - listeningAddresses: [ - types.SocketAddress.hostname(addr: "0.0.0.0", port: 9735) - ], - onchainWalletSyncIntervalSecs: 60, - walletSyncIntervalSecs: 20, - feeRateCacheUpdateIntervalSecs: 600, - logLevel: types.LogLevel.debug, - defaultCltvExpiryDelta: 144, - trustedPeers0Conf: [], - probingLiquidityLimitMultiplier: 3)); + storageDirPath: '', + network: types.Network.bitcoin, + listeningAddresses: [ + types.SocketAddress.hostname(addr: "0.0.0.0", port: 9735) + ], + onchainWalletSyncIntervalSecs: BigInt.from(60), + walletSyncIntervalSecs: BigInt.from(20), + feeRateCacheUpdateIntervalSecs: BigInt.from(200), + logLevel: types.LogLevel.debug, + defaultCltvExpiryDelta: 144, + trustedPeers0Conf: [], + probingLiquidityLimitMultiplier: BigInt.from(3), + )); } /// Creates a new builder instance with default services configured for testnet. @@ -556,7 +890,17 @@ class Builder { return builder .setNetwork(types.Network.signet) .setEsploraServer(DefaultServicesMutinynet.esploraServerUrl) - .setGossipSourceRgs(DefaultServicesMutinynet.rgsServerUrl); + .setGossipSourceRgs(DefaultServicesMutinynet.rgsServerUrl) + .setLiquiditySourceLsps2( + address: types.SocketAddress.hostname( + addr: DefaultServicesMutinynet.lsps2SourceAddress, + port: DefaultServicesMutinynet.lsps2SourcePort, + ), + publicKey: types.PublicKey( + hex: DefaultServicesMutinynet.lsps2SourcePublicKey, + ), + token: DefaultServicesMutinynet.lsps2SourceToken, + ); } /// Configures the [Node] instance to source its wallet entropy from a seed file on disk. @@ -635,6 +979,22 @@ 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. /// @@ -647,17 +1007,38 @@ class Builder { final nodePath = "${directory.path}/ldk_cache/"; _config!.storageDirPath = nodePath; } - final res = await buildWithSqliteStore( - config: _config!, - entropySourceConfig: _entropySource, - chainDataSourceConfig: _chainDataSourceConfig, - gossipSourceConfig: _gossipSourceConfig, - ); + final res = await (await builder.NodeBuilder.createBuilder( + config: _config ?? Builder()._config!, + chainDataSourceConfig: _chainDataSourceConfig, + entropySourceConfig: _entropySource, + liquiditySourceConfig: _liquiditySourceConfig, + gossipSourceConfig: _gossipSourceConfig)) + .build(); + return Node._(ptr: res.ptr); + } on error.LdkBuilderError catch (e) { + throw mapLdkBuilderError(e); + } + } + + ///Builds a Node instance with a FilesystemStore backend and according to the options previously configured. + Future buildWithFsStore() async { + try { + await Frb.verifyInit(); + if (_config!.storageDirPath == '') { + final directory = await getApplicationDocumentsDirectory(); + final nodePath = "${directory.path}/ldk_cache/"; + _config!.storageDirPath = nodePath; + } + final res = await (await builder.NodeBuilder.createBuilder( + config: _config ?? Builder()._config!, + chainDataSourceConfig: _chainDataSourceConfig, + entropySourceConfig: _entropySource, + liquiditySourceConfig: _liquiditySourceConfig, + gossipSourceConfig: _gossipSourceConfig)) + .buildWithFsStore(); return Node._(ptr: res.ptr); - } on error.BuilderException catch (e) { - throw mapBuilderException(e); - } on error.NodeException catch (e) { - throw mapNodeException(e); + } on error.LdkBuilderError catch (e) { + throw mapLdkBuilderError(e); } } } diff --git a/lib/src/utils/default_services.dart b/lib/src/utils/default_services.dart index 21ac712..e1b5637 100644 --- a/lib/src/utils/default_services.dart +++ b/lib/src/utils/default_services.dart @@ -6,4 +6,9 @@ class DefaultServicesTestnet { class DefaultServicesMutinynet { static const String esploraServerUrl = 'https://mutinynet.ltbl.io/api'; static const String rgsServerUrl = 'https://mutinynet.ltbl.io/snapshot'; + static const String lsps2SourceAddress = '44.219.111.31'; + static const int lsps2SourcePort = 39735; + static const String lsps2SourcePublicKey = + '0371d6fd7d75de2d0372d03ea00e8bacdacb50c27d0eaea0a76a0622eff1f5ef2b'; + static const String lsps2SourceToken = 'JZWN9YLW'; } diff --git a/lib/src/utils/exceptions.dart b/lib/src/utils/exceptions.dart index 7e681b9..0af8206 100644 --- a/lib/src/utils/exceptions.dart +++ b/lib/src/utils/exceptions.dart @@ -1,127 +1,164 @@ -import '../generated/api/error.dart' as bridge; +import '../generated/utils/error.dart' as error; -abstract class LdkException implements Exception { +abstract class ExceptionBase implements Exception { String? message; - LdkException({this.message}); + ExceptionBase({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 LdkException { +class NodeException extends ExceptionBase { NodeException({super.message}); } -class BuilderException extends LdkException { +class BuilderException extends ExceptionBase { BuilderException({super.message}); } -BuilderException mapBuilderException(bridge.BuilderException e) { +BuilderException mapLdkBuilderError(error.LdkBuilderError e) { switch (e) { - case bridge.BuilderException.invalidSeedBytes: + case error.LdkBuilderError.invalidSeedBytes: return BuilderException(message: "Given seed bytes are invalid."); - case bridge.BuilderException.invalidSeedFile: + case error.LdkBuilderError.invalidSeedFile: return BuilderException( message: "Given seed file is invalid or could not be read."); - case bridge.BuilderException.invalidSystemTime: + case error.LdkBuilderError.invalidSystemTime: return BuilderException( message: "System time is invalid. Clocks might have gone back in time."); - case bridge.BuilderException.readFailed: + case error.LdkBuilderError.readFailed: return BuilderException(message: "Failed to read from store."); - case bridge.BuilderException.writeFailed: + case error.LdkBuilderError.writeFailed: return BuilderException(message: "Failed to write to store."); - case bridge.BuilderException.storagePathAccessFailed: + case error.LdkBuilderError.storagePathAccessFailed: return BuilderException( message: "Failed to access the given storage path."); - case bridge.BuilderException.walletSetupFailed: + case error.LdkBuilderError.walletSetupFailed: return BuilderException(message: "Failed to setup onchain wallet."); - case bridge.BuilderException.loggerSetupFailed: + case error.LdkBuilderError.loggerSetupFailed: return BuilderException(message: "Failed to setup the logger."); - case bridge.BuilderException.invalidChannelMonitor: + + case error.LdkBuilderError.invalidChannelMonitor: return BuilderException( message: "Failed to watch a deserialized ChannelMonitor."); - case bridge.BuilderException.invalidListeningAddress: + case error.LdkBuilderError.invalidListeningAddress: return BuilderException( message: "Given listening addresses are invalid."); - case bridge.BuilderException.kvStoreSetupFailed: + case error.LdkBuilderError.kvStoreSetupFailed: return BuilderException(message: "Failed to setup KVStore."); - case bridge.BuilderException.socketAddressParseError: - return BuilderException(message: "Failed to parse socket address"); - case bridge.BuilderException.invalidTrustedPeer: - return BuilderException(message: "Invalid trusted peer"); + case error.LdkBuilderError.socketAddressParseError: + return BuilderException(message: "Invalid SocketAddress."); + + case error.LdkBuilderError.invalidPublicKey: + return BuilderException(message: "Invalid PublicKey."); } } -NodeException mapNodeException(bridge.NodeException e) { - switch (e) { - case bridge.NodeException.alreadyRunning: - return NodeException(message: "Node is already running."); - case bridge.NodeException.notRunning: - return NodeException(message: "Node is not running."); - case bridge.NodeException.onchainTxCreationFailed: - return NodeException( - message: "On-chain transaction could not be created."); - case bridge.NodeException.connectionFailed: - return NodeException(message: "Network connection closed."); - case bridge.NodeException.paymentSendingFailed: - return NodeException(message: "Failed to send the given payment."); - case bridge.NodeException.probeSendingFailed: - return NodeException(message: "Failed to send the given payment probe."); - case bridge.NodeException.channelCreationFailed: - return NodeException(message: "Failed to create channel."); - case bridge.NodeException.channelClosingFailed: - return NodeException(message: "Failed to close channel."); - case bridge.NodeException.channelConfigUpdateFailed: - return NodeException(message: "Failed to update channel config."); - case bridge.NodeException.persistenceFailed: - return NodeException(message: "Failed to persist data."); - case bridge.NodeException.walletOperationFailed: - return NodeException(message: "Failed to conduct wallet operation."); - case bridge.NodeException.onchainTxSigningFailed: - return NodeException(message: "Failed to sign given transaction."); - case bridge.NodeException.messageSigningFailed: - return NodeException(message: "Failed to sign given message."); - case bridge.NodeException.txSyncFailed: - return NodeException(message: "Failed to sync transactions."); - case bridge.NodeException.gossipUpdateFailed: - return NodeException(message: "Failed to update gossip data."); - case bridge.NodeException.invalidAddress: - return NodeException(message: "The given address is invalid."); - case bridge.NodeException.invalidSocketAddress: - return NodeException(message: "The given network address is invalid."); - case bridge.NodeException.invalidPublicKey: - return NodeException(message: "The given public key is invalid."); - case bridge.NodeException.invalidSecretKey: - return NodeException(message: "The given secret key is invalid."); - case bridge.NodeException.invalidPaymentHash: - return NodeException(message: "The given payment hash is invalid."); - case bridge.NodeException.invalidPaymentPreimage: - return NodeException(message: "The given payment preimage is invalid."); - case bridge.NodeException.invalidPaymentSecret: - return NodeException(message: "The given payment secret is invalid."); - case bridge.NodeException.invalidAmount: - return NodeException(message: "The given amount is invalid."); - case bridge.NodeException.invalidInvoice: - return NodeException(message: "The given invoice is invalid."); - case bridge.NodeException.invalidChannelId: - return NodeException(message: "The given channel ID is invalid."); - case bridge.NodeException.invoiceCreationFailed: - return NodeException(message: "Failed to create invoice."); - case bridge.NodeException.invalidNetwork: - return NodeException(message: "The given network is invalid."); - case bridge.NodeException.duplicatePayment: - return NodeException( - message: "A payment with the given hash has already been initiated."); +NodeException mapLdkNodeError(error.LdkNodeError e) { + return e.map( + alreadyRunning: (_) => NodeException(message: "Node is already running."), + notRunning: (_) => NodeException(message: "Node is not running."), + onchainTxCreationFailed: (_) => + NodeException(message: "On-chain transaction could not be created."), + connectionFailed: (_) => + NodeException(message: "Network connection closed."), + paymentSendingFailed: (_) => + NodeException(message: "Failed to send the given payment."), + probeSendingFailed: (_) => + NodeException(message: "Failed to send the given payment probe."), + channelCreationFailed: (_) => + NodeException(message: "Failed to create channel."), + channelClosingFailed: (_) => + NodeException(message: "Failed to close channel."), + channelConfigUpdateFailed: (_) => + NodeException(message: "Failed to update channel config."), + persistenceFailed: (_) => + NodeException(message: "Failed to persist data."), + walletOperationFailed: (_) => + NodeException(message: "Failed to conduct wallet operation."), + onchainTxSigningFailed: (_) => + NodeException(message: "Failed to sign given transaction."), + messageSigningFailed: (_) => + NodeException(message: "Failed to sign given message."), + txSyncFailed: (_) => + NodeException(message: "Failed to sync transactions."), + gossipUpdateFailed: (_) => + NodeException(message: "Failed to update gossip data."), + invalidAddress: (_) => + NodeException(message: "The given address is invalid."), + invalidSocketAddress: (_) => + NodeException(message: "The given network address is invalid."), + invalidPublicKey: (_) => + NodeException(message: "The given public key is invalid."), + invalidSecretKey: (_) => + NodeException(message: "The given secret key is invalid."), + invalidPaymentHash: (_) => + NodeException(message: "The given payment hash is invalid."), + invalidPaymentPreimage: (_) => + NodeException(message: "The given payment preimage is invalid."), + invalidPaymentSecret: (_) => + NodeException(message: "The given payment secret is invalid."), + invalidAmount: (_) => + NodeException(message: "The given amount is invalid."), + invalidInvoice: (_) => + NodeException(message: "The given invoice is invalid."), + invalidChannelId: (_) => + NodeException(message: "The given channel ID is invalid."), + invoiceCreationFailed: (_) => + NodeException(message: "Failed to create invoice."), + invalidNetwork: (_) => + NodeException(message: "The given network is invalid."), + duplicatePayment: (_) => NodeException( + message: "A payment with the given hash has already been initiated."), + insufficientFunds: (_) => NodeException( + message: + "There are insufficient funds to complete the given operation."), + feerateEstimationUpdateFailed: (_) => + NodeException(message: "Failed to update fee rate estimation."), + liquidityRequestFailed: (_) => + NodeException(message: "Liquidity request operation failed."), + liquiditySourceUnavailable: (_) => NodeException(message: "Liquidity operation failed due to the required liquidity source being unavailable."), + liquidityFeeTooHigh: (_) => NodeException(message: "Liquidity operation failed due to the LSP's required opening fee being too high."), + invalidTxid: (_) => NodeException(message: "The given transaction id is Invalid."), + invalidPaymentId: (_) => NodeException(message: "The given paymentId is invalid."), + decode: (e) => mapLdkDecodeError(e.field0), + bolt12Parse: (e) => NodeException(message: e.toString()), + walletOperationTimeout: (e) => NodeException(message: "A wallet operation timed out."), + invoiceRequestCreationFailed: (e) => NodeException(message: "Invoice request creation failed."), + offerCreationFailed: (e) => NodeException(message: "Offer creation failed."), + refundCreationFailed: (e) => NodeException(message: "Refund creation failed."), + feerateEstimationUpdateTimeout: (e) => NodeException(message: "A fee rate estimation update timed out."), + txSyncTimeout: (e) => NodeException(message: "A transaction sync operation timed out."), + gossipUpdateTimeout: (e) => NodeException(message: "A gossip updating operation timed out."), + invalidOfferId: (e) => NodeException(message: "The given offer id is invalid."), + invalidNodeId: (e) => NodeException(message: "The given node id is invalid."), + invalidOffer: (e) => NodeException(message: "The given offer is invalid."), + invalidRefund: (e) => NodeException(message: "The given refund is invalid."), + unsupportedCurrency: (e) => NodeException(message: "The provided offer was denominated in an unsupported currency.")); +} - case bridge.NodeException.insufficientFunds: - return NodeException( +NodeException mapLdkDecodeError(error.DecodeError e) { + return e.map( + unknownVersion: (e) => NodeException( message: - "There are insufficient funds to complete the given operation."); - case bridge.NodeException.feerateEstimationUpdateFailed: - return NodeException(message: "Failed to update fee rate estimation. "); - case bridge.NodeException.invalidTxid: - return NodeException(message: "Invalid transaction id"); - } + "A version byte specified something we don’t know how to handle. Includes unknown realm byte in an onion hop data packet."), + unknownRequiredFeature: (e) => NodeException( + message: + "Unknown feature mandating we fail to parse message (e.g., TLV with an even, unknown type)."), + invalidValue: (e) => NodeException( + message: + "Invalid value, a byte which was supposed to be a bool was something other than a 0 or 1, a public key/private key/signature was invalid, text wasn’t UTF-8, TLV was syntactically incorrect, etc."), + shortRead: (e) => + NodeException(message: "The buffer to be read was too short."), + badLengthDescriptor: (e) => NodeException( + message: + "A length descriptor in the packet didn’t describe the later data correctly. "), + io: (e) => NodeException(message: "Io: ${e.toString()}"), + unsupportedCompression: (e) => NodeException( + message: + "The message included zlib-compressed values, which we don’t support. "), + dangerousValue: (e) => NodeException( + message: "Value is validly encoded but is dangerous to use. ")); } diff --git a/lib/src/utils/utils.dart b/lib/src/utils/utils.dart index 0f77fa2..2f58dbf 100644 --- a/lib/src/utils/utils.dart +++ b/lib/src/utils/utils.dart @@ -7,8 +7,8 @@ export 'exceptions.dart'; class Frb { static Future verifyInit() async { try { - if (!LdkCore.instance.initialized) { - await LdkCore.init(); + if (!core.instance.initialized) { + await core.init(); } } catch (e) { debugPrint(e.toString()); diff --git a/makefile b/makefile index 5a42da9..a003e3c 100644 --- a/makefile +++ b/makefile @@ -11,7 +11,7 @@ help: makefile ## init: Install missing dependencies. init: - cargo install flutter_rust_bridge_codegen --version 2.0.0-dev.31 + cargo install flutter_rust_bridge_codegen --version 2.0.0 ## : all: init generate-bindings diff --git a/pubspec.yaml b/pubspec.yaml index 0195250..fa3e563 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: ldk_node description: A ready-to-go Lightning node library built using LDK and BDK. -version: 0.2.2-dev +version: 0.3.0 homepage: https://github.com/LtbLightning/ldk-node-flutter environment: @@ -8,23 +8,22 @@ environment: flutter: ">=2.5.0" dependencies: - collection: ^1.17.1 + collection: ^1.18.0 ffi: ^2.1.0 flutter: sdk: flutter - flutter_rust_bridge: ">2.0.0-dev.30 <= 2.0.0-dev.31" + flutter_rust_bridge: "2.0.0" freezed_annotation: ^2.2.0 - meta: ^1.10.0 + meta: ^1.12.0 uuid: ^4.3.3 path_provider: ^2.1.2 dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^3.0.1 - ffigen: ^9.0.1 - freezed: ^2.4.7 + ffigen: ^12.0.0 + freezed: ^2.5.2 build_runner: ^2.4.8 - lints: ^3.0.0 + lints: ^4.0.0 flutter: plugin: diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 3d2870b..a74fed9 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ "getrandom", "once_cell", @@ -30,9 +30,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.7" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "once_cell", @@ -42,18 +42,18 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "allo-isolate" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f5a5fd28223e6f3cafb7d9cd685f51eafdd71d33ca1229f8316925d5957240" +checksum = "97b6d794345b06592d0ebeed8e477e41b71e5a0a49df4fc0e4184d5938b99509" dependencies = [ "anyhow", "atomic", @@ -62,9 +62,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "android-tzdata" @@ -101,19 +101,19 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.79" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "async-trait" -version = "0.1.77" +version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -124,15 +124,15 @@ checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba" [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ "addr2line", "cc", @@ -161,7 +161,7 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fc1fc1a92e0943bfbcd6eb7d32c1b2a79f2f1357eb1e2eee9d7f36d6d7ca44a" dependencies = [ - "ahash 0.7.7", + "ahash 0.7.8", "async-trait", "bdk-macros", "bip39", @@ -258,9 +258,18 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] [[package]] name = "build-target" @@ -270,15 +279,15 @@ checksum = "832133bbabbbaa9fbdba793456a2827627a7d2b8fb96032fa1e7666d7895832b" [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytemuck" -version = "1.14.1" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed2490600f404f2b94c167e31d3ed1d5f3c225a0f3b80230053b3e0b7b962bd9" +checksum = "78834c15cb5d5efe3452d58b1e8ba890dd62d21907f867f383358198e56ebca5" [[package]] name = "byteorder" @@ -288,18 +297,15 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "cc" -version = "1.0.83" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] +checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" [[package]] name = "cfg-if" @@ -309,14 +315,15 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.33" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", - "windows-targets 0.52.0", + "serde", + "windows-targets 0.52.5", ] [[package]] @@ -345,6 +352,16 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + [[package]] name = "dart-sys-fork" version = "4.1.1" @@ -372,29 +389,30 @@ checksum = "51aac4c99b2e6775164b412ea33ae8441b2fde2dbf05a20bc0052a63d08c475b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] -name = "deranged" -version = "0.3.11" +name = "digest" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "powerfmt", + "block-buffer", + "crypto-common", ] [[package]] name = "either" -version = "1.9.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] @@ -417,9 +435,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -452,9 +470,9 @@ checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" [[package]] name = "fastrand" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "fixedbitset" @@ -464,9 +482,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flutter_rust_bridge" -version = "2.0.0-dev.31" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d9ceb6f8db0bf711a55e20151c6699132bb5975f846ecac2c3bc7d23cc0845d" +checksum = "033e831e28f1077ceae3490fb6d093dfdefefd09c5c6e8544c6579effe7e814f" dependencies = [ "allo-isolate", "android_logger", @@ -491,13 +509,15 @@ dependencies = [ [[package]] name = "flutter_rust_bridge_macros" -version = "2.0.0-dev.31" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e02edfe56f04af804d3145b17dfe7820d46a6753b214160f227dbdfa1073f7cb" +checksum = "0217fc4b7131b52578be60bbe38c76b3edfc2f9fecab46d9f930510f40ef9023" dependencies = [ "hex", + "md-5", + "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -506,21 +526,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -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" @@ -586,7 +591,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -619,11 +624,21 @@ dependencies = [ "slab", ] +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -638,9 +653,9 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "h2" -version = "0.3.24" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", @@ -657,11 +672,11 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ - "ahash 0.8.7", + "ahash 0.8.11", "allocator-api2", ] @@ -682,9 +697,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.4" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hex" @@ -694,9 +709,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-conservative" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ed443af458ccb6d81c1e7e661545f94d3176752fb1df2f543b902a1e0f51e2" +checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" [[package]] name = "hex_lit" @@ -715,9 +730,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", @@ -785,24 +800,11 @@ 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.59" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -833,9 +835,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.1" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "433de089bd45971eecf4668ee0ee8f4cec17db4f8bd8f7bc3197a6ce37aa7d9b" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", "hashbrown", @@ -858,9 +860,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" @@ -879,20 +881,20 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "ldk-node" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "923588872d472775345535cdb87a123730c077b4acbb49f081bb4a91442b4a20" +checksum = "c4a5400043598f1da534abf81bb937739a680663d57a451bf8363d6113211424" dependencies = [ "bdk", "bip39", "bitcoin", "chrono", "esplora-client", - "futures", "libc", "lightning", "lightning-background-processor", "lightning-invoice", + "lightning-liquidity", "lightning-net-tokio", "lightning-persister", "lightning-rapid-gossip-sync", @@ -908,20 +910,18 @@ dependencies = [ [[package]] name = "ldk_node" -version = "0.2.2-dev" +version = "0.3.0" dependencies = [ "anyhow", "flutter_rust_bridge", "ldk-node", - "log", - "simplelog", ] [[package]] name = "libc" -version = "0.2.152" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libsqlite3-sys" @@ -936,9 +936,9 @@ dependencies = [ [[package]] name = "lightning" -version = "0.0.121" +version = "0.0.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0c1f811ae288f86c6767055c55b5f7a721ca1e61bf1897a9ae2ec663e8aba1" +checksum = "5fd92d4aa159374be430c7590e169b4a6c0fb79018f5bc4ea1bffde536384db3" dependencies = [ "bitcoin", "hex-conservative", @@ -946,9 +946,9 @@ dependencies = [ [[package]] name = "lightning-background-processor" -version = "0.0.121" +version = "0.0.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d4711ad9cc33f30c2e8e876fcfd6255523fc250440abb8c374cd98e6c40e79" +checksum = "fb1c2c64050e37cee7c3b6b022106523784055ac3ee572d360780a1d6fe8062c" dependencies = [ "bitcoin", "lightning", @@ -957,22 +957,36 @@ dependencies = [ [[package]] name = "lightning-invoice" -version = "0.29.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b186aca4a605d4db3b85979922be287b9ebd5dedd8132963bb9dbeb8f7d2a04" +checksum = "26d07d01cf197bf2184b929b7dc94aa70d935aac6df896c256a3a9475b7e9d40" dependencies = [ "bech32", "bitcoin", "lightning", - "num-traits", "secp256k1", + "serde", +] + +[[package]] +name = "lightning-liquidity" +version = "0.1.0-alpha.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fa6284740f64672f42145de7b0a242beea3821dae1f0eac7949a8f48799c828" +dependencies = [ + "bitcoin", + "chrono", + "lightning", + "lightning-invoice", + "serde", + "serde_json", ] [[package]] name = "lightning-net-tokio" -version = "0.0.121" +version = "0.0.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4813cca14ed984924a6975895e80cde8673a0a105a1c7ddf3b0fb3d1ce59e6bf" +checksum = "f9e6a4d49c50a1344916d080dc8c012ce3a778cdd45de8def75350b2b40fe018" dependencies = [ "bitcoin", "lightning", @@ -981,9 +995,9 @@ dependencies = [ [[package]] name = "lightning-persister" -version = "0.0.121" +version = "0.0.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82a633e4d08b75e16dc131af2961254b7005c30ab29577e215080d2943c0511" +checksum = "8a8dd33971815fa074b05678e09a6d4b15c78225ea34d66ed4f17c35a53467a9" dependencies = [ "bitcoin", "lightning", @@ -992,9 +1006,9 @@ dependencies = [ [[package]] name = "lightning-rapid-gossip-sync" -version = "0.0.121" +version = "0.0.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "128d6c450cb698b46ecacc6645ebeb2b57d6f9458482635ab523863fa8378314" +checksum = "9d861b0f0cd5f8fe8c63760023c4fd4fd32c384881b41780b62ced2a8a619f91" dependencies = [ "bitcoin", "lightning", @@ -1002,9 +1016,9 @@ dependencies = [ [[package]] name = "lightning-transaction-sync" -version = "0.0.121" +version = "0.0.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0721b05c0230f11e1c96af68304103ad07e146b13b47f7fd9a12e69cacb610d" +checksum = "04c1e88eece28f19b5834fb5aefceabc5d143cfda2dfa9a32f73e66f4d0c84ed" dependencies = [ "bdk-macros", "bitcoin", @@ -1015,21 +1029,31 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "md-5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest", +] [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "mime" @@ -1050,18 +1074,18 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "wasi", @@ -1074,29 +1098,11 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" -[[package]] -name = "native-tls" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" -dependencies = [ - "lazy_static", - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] @@ -1111,15 +1117,6 @@ dependencies = [ "libc", ] -[[package]] -name = "num_threads" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" -dependencies = [ - "libc", -] - [[package]] name = "object" version = "0.32.2" @@ -1135,50 +1132,6 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "openssl" -version = "0.10.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" -dependencies = [ - "bitflags 2.4.2", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.99" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "oslog" version = "0.1.0" @@ -1198,9 +1151,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "petgraph" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", "indexmap", @@ -1208,9 +1161,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -1220,15 +1173,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" - -[[package]] -name = "powerfmt" -version = "0.2.0" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "ppv-lite86" @@ -1248,9 +1195,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6" dependencies = [ "unicode-ident", ] @@ -1311,9 +1258,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -1348,20 +1295,11 @@ dependencies = [ "getrandom", ] -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "regex" -version = "1.10.3" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", @@ -1371,9 +1309,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", @@ -1382,15 +1320,15 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "reqwest" -version = "0.11.23" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ "base64 0.21.7", "bytes", @@ -1402,12 +1340,10 @@ dependencies = [ "http-body", "hyper", "hyper-rustls", - "hyper-tls", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", @@ -1416,9 +1352,9 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", "system-configuration", "tokio", - "tokio-native-tls", "tokio-rustls", "tokio-socks", "tower-service", @@ -1432,16 +1368,17 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.7" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", + "cfg-if", "getrandom", "libc", "spin", "untrusted", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1460,17 +1397,17 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustix" -version = "0.38.30" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "errno", "libc", "linux-raw-sys", @@ -1479,9 +1416,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.10" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", "ring", @@ -1510,18 +1447,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" - -[[package]] -name = "schannel" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" -dependencies = [ - "windows-sys 0.52.0", -] +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "sct" @@ -1554,54 +1482,31 @@ dependencies = [ "cc", ] -[[package]] -name = "security-framework" -version = "2.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" -dependencies = [ - "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.196" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.196" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "serde_json" -version = "1.0.113" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", "ryu", @@ -1620,17 +1525,6 @@ dependencies = [ "serde", ] -[[package]] -name = "simplelog" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acee08041c5de3d5048c8b3f6f13fafb3026b24ba43c6a695a0c76179b844369" -dependencies = [ - "log", - "termcolor", - "time", -] - [[package]] name = "slab" version = "0.4.9" @@ -1642,18 +1536,18 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1675,15 +1569,21 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" 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" @@ -1707,44 +1607,34 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.9.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", "fastrand", - "redox_syscall", "rustix", "windows-sys 0.52.0", ] -[[package]] -name = "termcolor" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" -dependencies = [ - "winapi-util", -] - [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -1756,37 +1646,6 @@ dependencies = [ "num_cpus", ] -[[package]] -name = "time" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" -dependencies = [ - "deranged", - "itoa", - "libc", - "num_threads", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" -dependencies = [ - "time-core", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -1804,9 +1663,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.35.1" +version = "1.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" dependencies = [ "backtrace", "bytes", @@ -1827,17 +1686,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "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", + "syn 2.0.66", ] [[package]] @@ -1864,16 +1713,15 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] @@ -1907,6 +1755,12 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + [[package]] name = "unicode-bidi" version = "0.3.15" @@ -1959,9 +1813,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "vss-client" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3d56cb3a4c815901ee46fcaac027ab1674232eb4f136a17e3b0576a4c77ded7" +checksum = "a62cbd331368125aeb93b67dd4a80826a4ee29a810d4c76d2c9d265c1522a3f2" dependencies = [ "prost", "prost-build", @@ -2006,7 +1860,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", "wasm-bindgen-shared", ] @@ -2040,7 +1894,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2053,9 +1907,9 @@ checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "web-sys" -version = "0.3.67" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -2063,9 +1917,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.3" +version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "which" @@ -2095,15 +1949,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" -dependencies = [ - "winapi", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -2116,7 +1961,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -2134,7 +1979,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -2154,17 +1999,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "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", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -2175,9 +2021,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -2187,9 +2033,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -2199,9 +2045,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -2211,9 +2063,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -2223,9 +2075,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -2235,9 +2087,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -2247,9 +2099,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winreg" @@ -2263,20 +2115,20 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 8c5bd1a..e81455f 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ldk_node" -version = "0.2.2-dev" +version = "0.3.0" edition = "2021" [lib] @@ -10,16 +10,14 @@ crate-type = ["staticlib", "cdylib"] [build-dependencies] anyhow = "1.0.68" [dependencies] -flutter_rust_bridge = "=2.0.0-dev.31" - -log = "0.4.19" -simplelog = "0.12.1" +flutter_rust_bridge = "=2.0.0" anyhow = { version = "1.0.71"} -ldk-node = { version = "= 0.2.2" } +ldk-node = { version = "= 0.3.0" } +# ldk-node = {git = 'https://github.com/lightningdevkit/ldk-node.git', rev = "246775d04dbb2e99528a6a1aa0bc04ad7378e900"} [profile.release] -opt-level = 'z' # Optimize for size. +opt-level = 3 # Optimize for size. lto = true # Enable Link Time Optimization codegen-units = 1 # Reduce number of codegen units to increase optimizations. panic = 'abort' diff --git a/rust/cargokit.yaml b/rust/cargokit.yaml index de2761f..c57f2dd 100644 --- a/rust/cargokit.yaml +++ b/rust/cargokit.yaml @@ -4,4 +4,4 @@ cargo: precompiled_binaries: url_prefix: https://github.com/LtbLightning/ldk-node-flutter/releases/download/precompiled_ - public_key: 9ac2de724ed22cc1e1400b7630331f82b99cfc11e76f8d4b04c0cd1f0c9dcfd1 + public_key: 0e43d5e8452d00db7f3000c18fb1ba796babfcb5dc6306bb0629eff24f8be85b diff --git a/rust/src/api/bolt11.rs b/rust/src/api/bolt11.rs new file mode 100644 index 0000000..42ad08a --- /dev/null +++ b/rust/src/api/bolt11.rs @@ -0,0 +1,175 @@ +use crate::api::types::{PaymentHash, PaymentId, PaymentPreimage}; +use crate::frb_generated::RustOpaque; +use crate::utils::error::LdkNodeError; +use std::str::FromStr; + +pub struct LdkBolt11Payment { + pub ptr: RustOpaque, +} +impl From for LdkBolt11Payment { + fn from(value: ldk_node::payment::Bolt11Payment) -> Self { + LdkBolt11Payment { + ptr: RustOpaque::new(value), + } + } +} +#[derive(Debug, Clone, PartialEq, Eq)] +///Represents a syntactically and semantically correct lightning BOLT11 invoice. +/// +pub struct Bolt11Invoice { + pub signed_raw_invoice: String, +} + +impl TryFrom for ldk_node::lightning_invoice::Bolt11Invoice { + type Error = LdkNodeError; + + fn try_from(value: Bolt11Invoice) -> Result { + ldk_node::lightning_invoice::Bolt11Invoice::from_str(value.signed_raw_invoice.as_str()) + .map_err(|_| LdkNodeError::InvalidInvoice) + } +} +impl From for Bolt11Invoice { + fn from(value: ldk_node::lightning_invoice::Bolt11Invoice) -> Self { + Bolt11Invoice { + signed_raw_invoice: value.to_string(), + } + } +} + +impl LdkBolt11Payment { + pub fn send(&self, invoice: Bolt11Invoice) -> Result { + self.ptr + .send(&(invoice.try_into()?)) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + pub fn send_using_amount( + &self, + invoice: Bolt11Invoice, + amount_msat: u64, + ) -> anyhow::Result { + self.ptr + .send_using_amount(&(invoice.try_into()?), amount_msat) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + + pub fn send_probes(&self, invoice: Bolt11Invoice) -> anyhow::Result<(), LdkNodeError> { + self.ptr + .send_probes(&(invoice.try_into()?)) + .map_err(|e| e.into()) + } + + pub fn send_probes_using_amount( + &self, + invoice: Bolt11Invoice, + amount_msat: u64, + ) -> Result<(), LdkNodeError> { + self.ptr + .send_probes_using_amount(&(invoice.try_into()?), amount_msat) + .map_err(|e| e.into()) + } + pub fn claim_for_hash( + &self, + payment_hash: PaymentHash, + claimable_amount_msat: u64, + preimage: PaymentPreimage, + ) -> anyhow::Result<(), LdkNodeError> { + self.ptr + .claim_for_hash(payment_hash.into(), claimable_amount_msat, preimage.into()) + .map_err(|e| e.into()) + } + pub fn fail_for_hash(&self, payment_hash: PaymentHash) -> anyhow::Result<(), LdkNodeError> { + self.ptr + .fail_for_hash(payment_hash.into()) + .map_err(|e| e.into()) + } + pub fn receive( + &self, + amount_msat: u64, + description: String, + expiry_secs: u32, + ) -> anyhow::Result { + self.ptr + .receive(amount_msat, description.as_str(), expiry_secs) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + + pub fn receive_for_hash( + &self, + payment_hash: PaymentHash, + amount_msat: u64, + description: String, + expiry_secs: u32, + ) -> anyhow::Result { + self.ptr + .receive_for_hash( + amount_msat, + description.as_str(), + expiry_secs, + payment_hash.into(), + ) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + pub fn receive_variable_amount( + &self, + description: String, + expiry_secs: u32, + ) -> anyhow::Result { + self.ptr + .receive_variable_amount(description.as_str(), expiry_secs) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + pub fn receive_variable_amount_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_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_variable_amount_for_hash( + &self, + description: String, + expiry_secs: u32, + payment_hash: PaymentHash + ) -> anyhow::Result { + match self.ptr.receive_variable_amount_for_hash( + description.as_str(), + expiry_secs, + payment_hash.into() + ) { + Ok(e) => Ok(e.into()), + Err(e) => Err(e.into()), + } + } + + pub fn receive_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_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()), + } + } +} diff --git a/rust/src/api/bolt12.rs b/rust/src/api/bolt12.rs new file mode 100644 index 0000000..553bb2f --- /dev/null +++ b/rust/src/api/bolt12.rs @@ -0,0 +1,147 @@ +use crate::api::types::PaymentId; +use ldk_node::lightning::util::ser::Writeable; +use std::str::FromStr; +use std::sync::Arc; + +use crate::frb_generated::RustOpaque; +use crate::utils::error::LdkNodeError; +/// An `Offer` is a potentially long-lived proposal for payment of a good or service. +/// +/// An offer is a precursor to an [InvoiceRequest]. A merchant publishes an offer from which a +/// customer may request an [Bolt12Invoice] for a specific quantity and using an amount sufficient +/// to cover that quantity (i.e., at least `quantity * amount`). +/// +/// Offers may be denominated in currency other than bitcoin but are ultimately paid using the +/// latter. +/// + +pub struct Offer { + pub s: String, +} +impl TryFrom for ldk_node::lightning::offers::offer::Offer { + type Error = LdkNodeError; + + fn try_from(value: Offer) -> Result { + ldk_node::lightning::offers::offer::Offer::from_str(value.s.as_str()).map_err(|e| e.into()) + } +} +impl From for Offer { + fn from(value: ldk_node::lightning::offers::offer::Offer) -> Self { + Offer { + s: value.to_string(), + } + } +} +///A Refund is a request to send an `Bolt12Invoice` without a preceding `Offer`. +// +// Typically, after an invoice is paid, the recipient may publish a refund allowing the sender to recoup their funds. +// A refund may be used more generally as an “offer for money”, such as with a bitcoin ATM. + +pub struct Refund { + pub s: String, +} + +impl TryFrom for ldk_node::lightning::offers::refund::Refund { + type Error = LdkNodeError; + + fn try_from(value: Refund) -> Result { + ldk_node::lightning::offers::refund::Refund::from_str(value.s.as_str()) + .map_err(|e| e.into()) + } +} +impl From for Refund { + fn from(value: ldk_node::lightning::offers::refund::Refund) -> Self { + Refund { + s: value.to_string(), + } + } +} + +#[derive(Debug, Clone, PartialEq, Eq)] +///A Bolt12Invoice is a payment request, typically corresponding to an Offer or a Refund. +// An invoice may be sent in response to an InvoiceRequest in the case of an offer or sent directly after scanning a refund. It includes all the information needed to pay a recipient. +pub struct Bolt12Invoice { + pub data: Vec, +} + +impl TryFrom for ldk_node::lightning::offers::invoice::Bolt12Invoice { + type Error = LdkNodeError; + + fn try_from(value: Bolt12Invoice) -> Result { + ldk_node::lightning::offers::invoice::Bolt12Invoice::try_from(value.data) + .map_err(|_| LdkNodeError::InvalidInvoice) + } +} +impl From for Bolt12Invoice { + fn from(value: ldk_node::lightning::offers::invoice::Bolt12Invoice) -> Self { + Bolt12Invoice { + data: value.encode(), + } + } +} +pub struct LdkBolt12Payment { + pub ptr: RustOpaque>, +} +impl LdkBolt12Payment { + pub fn send( + &self, + offer: Offer, + payer_note: Option, + ) -> Result { + self.ptr + .send(&(offer.try_into()?), payer_note) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + pub fn send_using_amount( + &self, + offer: Offer, + payer_note: Option, + amount_msat: u64, + ) -> anyhow::Result { + self.ptr + .send_using_amount(&(offer.try_into()?), payer_note, amount_msat) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + pub fn receive( + &self, + amount_msat: u64, + description: String, + ) -> anyhow::Result { + self.ptr + .receive(amount_msat, description.as_str()) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + pub fn receive_variable_amount( + &self, + description: String, + ) -> anyhow::Result { + self.ptr + .receive_variable_amount(description.as_str()) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + + pub fn request_refund_payment( + &self, + refund: Refund, + ) -> anyhow::Result { + self.ptr + .request_refund_payment(&(refund.try_into()?)) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + + pub fn initiate_refund( + &self, + amount_msat: u64, + expiry_secs: u32, + ) -> anyhow::Result { + self.ptr + .initiate_refund(amount_msat, expiry_secs) + .map_err(|e| e.into()) + .map(|e| e.into()) + } +} diff --git a/rust/src/api/builder.rs b/rust/src/api/builder.rs new file mode 100644 index 0000000..0411f2d --- /dev/null +++ b/rust/src/api/builder.rs @@ -0,0 +1,126 @@ +use crate::api::node::LdkNode; +use crate::api::types::{ + ChainDataSourceConfig, Config, EntropySourceConfig, GossipSourceConfig, LiquiditySourceConfig, +}; +use crate::frb_generated::RustOpaque; +use crate::utils::error::LdkBuilderError; +use flutter_rust_bridge::frb; +use ldk_node::lightning::util::ser::Writeable; +use std::str::FromStr; + +#[derive(Debug, Clone)] +pub struct LdkMnemonic { + pub seed_phrase: String, +} + +impl TryFrom for ldk_node::bip39::Mnemonic { + type Error = LdkBuilderError; + + fn try_from(value: LdkMnemonic) -> Result { + ldk_node::bip39::Mnemonic::from_str(&value.seed_phrase).map_err(|e| e.into()) + } +} +impl From for LdkMnemonic { + fn from(value: ldk_node::bip39::Mnemonic) -> Self { + LdkMnemonic { + seed_phrase: value.to_string(), + } + } +} +impl LdkMnemonic { + pub fn generate() -> LdkMnemonic { + ldk_node::generate_entropy_mnemonic().into() + } +} + +#[frb(opaque)] +pub struct NodeBuilder { + pub builder: RustOpaque, +} + +impl NodeBuilder { + pub fn create_builder( + config: Config, + 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.try_into()?); + if let Some(source) = entropy_source_config { + match source { + EntropySourceConfig::SeedFile(e) => builder.set_entropy_seed_path(e), + EntropySourceConfig::SeedBytes(e) => builder.set_entropy_seed_bytes(e.encode())?, + EntropySourceConfig::Bip39Mnemonic { + mnemonic, + passphrase, + } => builder.set_entropy_bip39_mnemonic( + >::try_into(mnemonic)?, + passphrase, + ), + }; + } + if let Some(source) = chain_data_source_config { + match source { + ChainDataSourceConfig::Esplora(e) => builder.set_esplora_server(e), + }; + } + if let Some(source) = gossip_source_config { + match source { + GossipSourceConfig::P2PNetwork => builder.set_gossip_source_p2p(), + 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.try_into()?, + liquidity + .lsps2_service + .1 + .try_into() + .map_err(|_| LdkBuilderError::InvalidPublicKey)?, + liquidity.lsps2_service.2, + ); + } + Ok(NodeBuilder { + builder: RustOpaque::new(builder), + }) + } + pub fn build(self) -> anyhow::Result { + match self.builder.build() { + Ok(e) => Ok(LdkNode { + ptr: RustOpaque::new(e), + }), + Err(e) => Err(e.into()), + } + } + pub fn build_with_fs_store(self) -> anyhow::Result { + match self.builder.build_with_fs_store() { + Ok(e) => Ok(LdkNode { + ptr: RustOpaque::new(e), + }), + Err(e) => Err(e.into()), + } + } + // fn build_with_store( + // self + // ) -> anyhow::Result { + // match self.builder.build_with_store(Arc::new(())) { + // Ok(e) => Ok(LdkNode { + // ptr: RustOpaque::new(e), + // }), + // Err(e) => Err(e.into()), + // } + // } +} + +// pub fn build_with_vss_store( +// self, url: String, store_id: String +// ) -> anyhow::Result { +// match self.builder.build_with_vss_store(url, store_id) { +// Ok(e) => Ok(LdkNode { +// ptr: RustOpaque::new(e), +// }), +// Err(e) => Err(e.into()), +// } +// } diff --git a/rust/src/api/error.rs b/rust/src/api/error.rs deleted file mode 100644 index 95359e4..0000000 --- a/rust/src/api/error.rs +++ /dev/null @@ -1,162 +0,0 @@ -use ldk_node::{BuildError, NodeError}; - -#[derive(Debug, PartialEq)] -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. - NotRunning, - /// An on-chain transaction could not be created. - OnchainTxCreationFailed, - /// A network connection has been closed. - ConnectionFailed, - /// Invoice creation failed. - InvoiceCreationFailed, - /// Sending a payment has failed. - PaymentSendingFailed, - /// Sending a payment probe has failed. - ProbeSendingFailed, - /// A channel could not be opened. - ChannelCreationFailed, - /// A channel could not be closed. - ChannelClosingFailed, - /// A channel config could not be updated. - ChannelConfigUpdateFailed, - /// Persistence failed. - PersistenceFailed, - /// A wallet operation failed. - WalletOperationFailed, - /// A signing operation for transaction failed. - OnchainTxSigningFailed, - /// A signing operation for message failed. - MessageSigningFailed, - /// A transaction sync operation failed. - TxSyncFailed, - /// A gossip updating operation failed. - GossipUpdateFailed, - /// The given address is invalid. - InvalidAddress, - /// The given network address is invalid. - InvalidSocketAddress, - /// The given public key is invalid. - InvalidPublicKey, - /// The given secret key is invalid. - InvalidSecretKey, - /// The given payment hash is invalid. - InvalidPaymentHash, - /// The given payment preimage is invalid. - InvalidPaymentPreimage, - /// The given payment secret is invalid. - InvalidPaymentSecret, - /// The given amount is invalid. - InvalidAmount, - /// The given invoice is invalid. - InvalidInvoice, - /// The given channel ID is invalid. - InvalidChannelId, - /// The given network is invalid. - InvalidNetwork, - /// A payment with the given hash has already been initiated. - DuplicatePayment, - /// There are insufficient funds to complete the given operation. - InsufficientFunds, - - FeerateEstimationUpdateFailed, -} -#[allow(dead_code)] -#[derive(Debug)] -pub enum BuilderException { - SocketAddressParseError, - /// The given seed bytes are invalid, e.g., have invalid length. - InvalidSeedBytes, - /// The given seed file is invalid, e.g., has invalid length, or could not be read. - InvalidSeedFile, - /// The current system time is invalid, clocks might have gone backwards. - InvalidSystemTime, - /// The a read channel monitor is invalid. - InvalidChannelMonitor, - /// The given listening addresses are invalid, e.g. too many were passed. - InvalidListeningAddress, - /// We failed to read data from the [`KVStore`]. - ReadFailed, - /// We failed to write data to the [`KVStore`]. - WriteFailed, - /// We failed to access the given `storage_dir_path`. - StoragePathAccessFailed, - /// We failed to setup our [`KVStore`]. - KVStoreSetupFailed, - /// We failed to setup the onchain wallet. - WalletSetupFailed, - /// We failed to setup the logger. - LoggerSetupFailed, - InvalidTrustedPeer, -} - -impl From for NodeException { - fn from(value: NodeError) -> Self { - match value { - 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 => { - NodeException::FeerateEstimationUpdateFailed - } - } - } -} -impl From for BuilderException { - fn from(value: BuildError) -> Self { - match value { - 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/graph.rs b/rust/src/api/graph.rs new file mode 100644 index 0000000..f745e4c --- /dev/null +++ b/rust/src/api/graph.rs @@ -0,0 +1,167 @@ +use crate::api::types::SocketAddress; +use crate::frb_generated::RustOpaque; +use crate::utils::error::LdkNodeError; +use ldk_node::lightning::util::ser::Writeable; + +///Represents the compressed public key of a node +pub struct NodeId { + pub compressed: Vec, +} + +impl From for NodeId { + fn from(value: ldk_node::lightning::routing::gossip::NodeId) -> Self { + Self { + compressed: value.encode(), + } + } +} +impl TryFrom for ldk_node::lightning::routing::gossip::NodeId { + type Error = LdkNodeError; + + fn try_from(value: NodeId) -> Result { + ldk_node::lightning::routing::gossip::NodeId::from_slice(value.compressed.as_slice()) + .map_err(|e| e.into()) + } +} +///Fees for routing via a given channel or a node +pub struct RoutingFees { + ///Flat routing fee in millisatoshis. + pub base_msat: u32, + ///Liquidity-based routing fee in millionths of a routed amount. In other words, 10000 is 1%. + pub proportional_millionths: u32, +} +impl From for RoutingFees { + fn from(value: ldk_node::lightning_invoice::RoutingFees) -> Self { + Self { + base_msat: value.base_msat, + proportional_millionths: value.proportional_millionths, + } + } +} +pub struct ChannelUpdateInfo { + ///When the last update to the channel direction was issued. Value is opaque, as set in the announcement. + pub last_update: u32, + ///Whether the channel can be currently used for payments (in this one direction). + pub enabled: bool, + ///The difference in CLTV values that you must have when routing through this channel. + pub cltv_expiry_delta: u16, + ///The minimum value, which must be relayed to the next hop via the channel + pub htlc_minimum_msat: u64, + ///The maximum value which may be relayed to the next hop via the channel. + pub htlc_maximum_msat: u64, + ////Fees charged when the channel is used for routing + pub fees: RoutingFees, +} + +///Details about a channel (both directions). Received within a channel announcement. +pub struct ChannelInfo { + ///Source node of the first direction of a channel + pub node_one: NodeId, + ///Details about the first direction of a channel + pub one_to_two: Option, + ///Source node of the second direction of a channel + pub node_two: NodeId, + ///Details about the second direction of a channel + pub two_to_one: Option, + ///The channel capacity as seen on-chain, if chain lookup is available. + pub capacity_sats: Option, +} +impl From for ChannelInfo { + fn from(value: ldk_node::lightning::routing::gossip::ChannelInfo) -> Self { + Self { + node_one: value.node_one.into(), + one_to_two: value.one_to_two.map(|e| e.into()), + node_two: value.node_two.into(), + two_to_one: value.two_to_one.map(|e| e.into()), + capacity_sats: value.capacity_sats, + } + } +} + +impl From for ChannelUpdateInfo { + fn from(value: ldk_node::lightning::routing::gossip::ChannelUpdateInfo) -> Self { + ChannelUpdateInfo { + last_update: value.last_update, + enabled: value.enabled, + cltv_expiry_delta: value.cltv_expiry_delta, + htlc_minimum_msat: value.htlc_minimum_msat, + htlc_maximum_msat: value.htlc_maximum_msat, + fees: value.fees.into(), + } + } +} +///Details about a node in the network, known from the network announcement. +pub struct NodeInfo { + pub channels: Vec, + ///More information about a node from node_announcement. Optional because we store a Node entry after learning about it from a channel announcement, but before receiving a node announcement. + pub announcement_info: Option, +} + +impl From for NodeInfo { + fn from(value: ldk_node::lightning::routing::gossip::NodeInfo) -> Self { + NodeInfo { + channels: value.channels, + announcement_info: value.announcement_info.map(|e| e.into()), + } + } +} +pub struct NodeAnnouncementInfo { + /// When the last known update to the node state was issued. + /// Value is opaque, as set in the announcement. + pub last_update: u32, + /// Moniker assigned to the node. + /// May be invalid or malicious (eg control chars), + /// should not be exposed to the user. + pub alias: String, + /// List of addresses on which this node is reachable + pub addresses: Vec, +} + +impl From for NodeAnnouncementInfo { + fn from(value: ldk_node::lightning::routing::gossip::NodeAnnouncementInfo) -> Self { + Self { + last_update: value.last_update, + alias: value.alias.to_string(), + addresses: value + .addresses() + .iter() + .map(|e| e.to_owned().into()) + .collect(), + } + } +} +pub struct LdkNetworkGraph { + pub ptr: RustOpaque, +} +impl From for LdkNetworkGraph { + fn from(value: ldk_node::graph::NetworkGraph) -> Self { + LdkNetworkGraph { + ptr: RustOpaque::new(value), + } + } +} + +impl LdkNetworkGraph { + /// Returns the list of channels in the graph + pub fn list_channels(&self) -> Vec { + self.ptr.list_channels() + } + + /// Returns information on a channel with the given id. + pub fn channel(&self, short_channel_id: u64) -> Option { + self.ptr.channel(short_channel_id).map(|e| e.into()) + } + + /// Returns the list of nodes in the graph + pub fn list_nodes(&self) -> Vec { + self.ptr + .list_nodes() + .iter() + .map(|e| e.to_owned().into()) + .collect() + } + + pub fn node(&self, node_id: NodeId) -> Result, LdkNodeError> { + Ok(self.ptr.node(&(node_id.try_into()?)).map(|e| e.into())) + } +} diff --git a/rust/src/api/mod.rs b/rust/src/api/mod.rs index 6f054f8..045ddfe 100644 --- a/rust/src/api/mod.rs +++ b/rust/src/api/mod.rs @@ -1,3 +1,8 @@ -pub mod error; -pub mod types; +pub mod bolt11; +pub mod bolt12; +pub mod builder; +pub mod graph; pub mod node; +pub mod on_chain; +pub mod spontaneous; +pub mod types; diff --git a/rust/src/api/node.rs b/rust/src/api/node.rs index fa291de..e320984 100644 --- a/rust/src/api/node.rs +++ b/rust/src/api/node.rs @@ -1,103 +1,32 @@ -use crate::api::error::{BuilderException, NodeException}; +use crate::api::bolt11::LdkBolt11Payment; +use crate::api::bolt12::LdkBolt12Payment; +use crate::api::graph::LdkNetworkGraph; +use crate::api::on_chain::LdkOnChainPayment; +use crate::api::spontaneous::LdkSpontaneousPayment; use crate::api::types::*; use crate::frb_generated::RustOpaque; +use crate::utils::error::LdkNodeError; pub use ldk_node::io::sqlite_store::SqliteStore; -use ldk_node::lightning::util::ser::Writeable; pub use ldk_node::Node; -use std::str::FromStr; pub use std::sync::{Arc, Mutex}; -#[derive(Debug, Clone)] -pub struct LdkMnemonic { - pub seed_phrase: String, -} - -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 LdkMnemonic { - fn from(value: ldk_node::bip39::Mnemonic) -> Self { - LdkMnemonic { - seed_phrase: value.to_string(), - } - } -} -impl LdkMnemonic { - pub fn generate() -> LdkMnemonic { - ldk_node::generate_entropy_mnemonic().into() - } -} - -pub fn build_with_sqlite_store( - config: Config, - chain_data_source_config: Option, - entropy_source_config: Option, - gossip_source_config: Option, -) -> anyhow::Result { - let builder = create_builder( - config, - chain_data_source_config, - entropy_source_config, - gossip_source_config, - ); - match builder?.build() { - Ok(e) => Ok(LdkNode { - ptr: RustOpaque::new(e), - }), - Err(e) => Err(e.into()), - } -} - -fn create_builder( - config: Config, - chain_data_source_config: Option, - entropy_source_config: Option, - gossip_source_config: Option, -) -> 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), - EntropySourceConfig::SeedBytes(e) => builder.set_entropy_seed_bytes(e.encode())?, - EntropySourceConfig::Bip39Mnemonic { - mnemonic, - passphrase, - } => builder.set_entropy_bip39_mnemonic(mnemonic.try_into()?, passphrase), - }; - } - if let Some(source) = chain_data_source_config { - match source { - ChainDataSourceConfig::Esplora(e) => builder.set_esplora_server(e), - }; - } - if let Some(source) = gossip_source_config { - match source { - GossipSourceConfig::P2PNetwork => builder.set_gossip_source_p2p(), - GossipSourceConfig::RapidGossipSync(e) => builder.set_gossip_source_rgs(e), - }; - } - Ok(builder) -} - pub struct LdkNode { - pub ptr: RustOpaque>, + pub ptr: RustOpaque, } impl LdkNode { - pub fn start(&self) -> anyhow::Result<(), NodeException> { + pub fn start(&self) -> anyhow::Result<(), LdkNodeError> { self.ptr.start().map_err(|e| e.into()) } - pub fn stop(&self) -> anyhow::Result<(), NodeException> { + pub fn stop(&self) -> anyhow::Result<(), LdkNodeError> { self.ptr.stop().map_err(|e| e.into()) } - pub fn is_running(&self) -> bool { - self.ptr.is_running() + pub fn status(&self) -> NodeStatus { + self.ptr.status().into() + } + pub fn config(&self) -> Config { + self.ptr.config().into() } - pub fn event_handled(&self) { self.ptr.event_handled() } @@ -112,7 +41,9 @@ impl LdkNode { pub fn wait_next_event(&self) -> Event { self.ptr.wait_next_event().into() } - + pub async fn next_event_async(&self) -> Event { + self.ptr.next_event_async().await.into() + } pub fn node_id(&self) -> PublicKey { self.ptr.node_id().into() } @@ -126,44 +57,8 @@ impl LdkNode { }) } - pub fn new_onchain_address(&self) -> anyhow::Result { - self.ptr - .new_onchain_address() - .map_err(|e| e.into()) - .map(|e| e.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 { - self.ptr - .send_to_onchain_address(&(address.try_into()?), amount_sats) - .map_err(|e| e.into()) - .map(|e| Txid { - hash: e.to_string(), - }) - } - - pub fn send_all_to_onchain_address( - &self, - address: Address, - ) -> anyhow::Result { - self.ptr - .send_all_to_onchain_address(&(address.try_into()?)) - .map_err(|e| e.into()) - .map(|e| e.into()) + pub fn list_balances(&self) -> anyhow::Result { + Ok(self.ptr.list_balances().into()) } pub fn list_channels(&self) -> Vec { @@ -175,19 +70,19 @@ impl LdkNode { node_id: PublicKey, address: SocketAddress, persist: bool, - ) -> anyhow::Result<(), NodeException> { + ) -> anyhow::Result<(), LdkNodeError> { self.ptr .connect( node_id.try_into()?, address .try_into() - .map_err(|_| NodeException::InvalidAddress)?, + .map_err(|_| LdkNodeError::InvalidAddress)?, persist, ) .map_err(|e| e.into()) } - pub fn disconnect(&self, counterparty_node_id: PublicKey) -> anyhow::Result<(), NodeException> { + pub fn disconnect(&self, counterparty_node_id: PublicKey) -> anyhow::Result<(), LdkNodeError> { self.ptr .disconnect(counterparty_node_id.try_into()?) .map_err(|e| e.into()) @@ -201,144 +96,77 @@ impl LdkNode { push_to_counterparty_msat: Option, announce_channel: bool, channel_config: Option, - ) -> anyhow::Result<(), NodeException> { + ) -> Result { self.ptr .connect_open_channel( node_id.try_into()?, socket_address .try_into() - .map_err(|_| NodeException::InvalidAddress)?, + .map_err(|_| LdkNodeError::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<(), NodeException> { + pub fn sync_wallets(&self) -> anyhow::Result<(), LdkNodeError> { self.ptr.sync_wallets().map_err(|e| e.into()) } pub fn close_channel( &self, - channel_id: ChannelId, + user_channel_id: UserChannelId, counterparty_node_id: PublicKey, - ) -> anyhow::Result<(), NodeException> { + ) -> anyhow::Result<(), LdkNodeError> { self.ptr - .close_channel(&(channel_id.into()), counterparty_node_id.try_into()?) + .close_channel( + &(user_channel_id.try_into()?), + counterparty_node_id.try_into()?, + ) .map_err(|e| e.into()) } - pub fn update_channel_config( + pub fn force_close_channel( &self, - channel_id: ChannelId, + user_channel_id: UserChannelId, counterparty_node_id: PublicKey, - channel_config: ChannelConfig, - ) -> anyhow::Result<(), NodeException> { + ) -> anyhow::Result<(), LdkNodeError> { self.ptr - .update_channel_config( - &channel_id.into(), + .force_close_channel( + &(user_channel_id.try_into()?), counterparty_node_id.try_into()?, - Arc::new(channel_config.into()), ) .map_err(|e| e.into()) } - pub fn send_payment( - &self, - invoice: Bolt11Invoice, - ) -> anyhow::Result { - self.ptr - .send_payment(&(invoice.try_into()?)) - .map_err(|e| e.into()) - .map(|e| e.into()) - } - - pub fn send_payment_using_amount( - &self, - invoice: Bolt11Invoice, - amount_msat: u64, - ) -> anyhow::Result { - self.ptr - .send_payment_using_amount(&(invoice.try_into()?), amount_msat) - .map_err(|e| e.into()) - .map(|e| e.into()) - } - - pub fn send_spontaneous_payment( - &self, - amount_msat: u64, - node_id: PublicKey, - ) -> anyhow::Result { - self.ptr - .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<(), NodeException> { - self.ptr - .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<(), NodeException> { - self.ptr - .send_spontaneous_payment_probes(amount_msat, node_id.try_into()?) - .map_err(|e| e.into()) - } - - pub fn send_payment_probes_using_amount( - &self, - invoice: Bolt11Invoice, - amount_msat: u64, - ) -> Result<(), NodeException> { - self.ptr - .send_payment_probes_using_amount(&(invoice.try_into()?), amount_msat) - .map_err(|e| e.into()) - } - - pub fn receive_payment( - &self, - amount_msat: u64, - description: String, - expiry_secs: u32, - ) -> anyhow::Result { - self.ptr - .receive_payment(amount_msat, description.as_str(), expiry_secs) - .map_err(|e| e.into()) - .map(|e| e.into()) - } - - pub fn receive_variable_amount_payment( + pub fn update_channel_config( &self, - description: String, - expiry_secs: u32, - ) -> anyhow::Result { + user_channel_id: UserChannelId, + counterparty_node_id: PublicKey, + channel_config: ChannelConfig, + ) -> anyhow::Result<(), LdkNodeError> { self.ptr - .receive_variable_amount_payment(description.as_str(), expiry_secs) + .update_channel_config( + &(user_channel_id.try_into()?), + counterparty_node_id.try_into()?, + Arc::new(channel_config.into()), + ) .map_err(|e| e.into()) - .map(|e| Bolt11Invoice { - signed_raw_invoice: e.to_string(), - }) } - pub fn payment(&self, payment_hash: PaymentHash) -> Option { - match self.ptr.payment(&(payment_hash.into())) { + pub fn payment(&self, payment_id: PaymentId) -> Option { + match self.ptr.payment(&(payment_id.into())) { None => None, Some(e) => Some(e.into()), } } - pub fn remove_payment(&self, payment_hash: PaymentHash) -> Result<(), NodeException> { + pub fn remove_payment(&self, payment_id: PaymentId) -> Result<(), LdkNodeError> { self.ptr - .remove_payment(&(payment_hash.into())) + .remove_payment(&(payment_id.into())) .map_err(|e| e.into()) } @@ -369,18 +197,35 @@ impl LdkNode { .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()) } + pub fn network_graph(ptr: Self) -> LdkNetworkGraph { + ptr.ptr.network_graph().into() + } + pub fn bolt11_payment(ptr: Self) -> LdkBolt11Payment { + ptr.ptr.bolt11_payment().into() + } + pub fn on_chain_payment(ptr: Self) -> LdkOnChainPayment { + ptr.ptr.onchain_payment().into() + } + pub fn spontaneous_payment(ptr: Self) -> LdkSpontaneousPayment { + ptr.ptr.spontaneous_payment().into() + } + pub fn bolt12_payment(ptr: Self) -> LdkBolt12Payment { + LdkBolt12Payment { + ptr: RustOpaque::new(ptr.ptr.bolt12_payment()), + } + } pub fn verify_signature( &self, msg: Vec, sig: String, - pkey: PublicKey, - ) -> anyhow::Result { + public_key: PublicKey, + ) -> anyhow::Result { Ok(self .ptr - .verify_signature(msg.as_slice(), sig.as_str(), &pkey.try_into()?)) + .verify_signature(msg.as_slice(), sig.as_str(), &public_key.try_into()?)) } } diff --git a/rust/src/api/on_chain.rs b/rust/src/api/on_chain.rs new file mode 100644 index 0000000..14e5fea --- /dev/null +++ b/rust/src/api/on_chain.rs @@ -0,0 +1,39 @@ +use crate::api::types::{Address, Txid}; +use crate::frb_generated::RustOpaque; +use crate::utils::error::LdkNodeError; + +pub struct LdkOnChainPayment { + pub ptr: RustOpaque, +} +impl From for LdkOnChainPayment { + fn from(value: ldk_node::payment::OnchainPayment) -> Self { + LdkOnChainPayment { + ptr: RustOpaque::new(value), + } + } +} + +impl LdkOnChainPayment { + pub fn new_address(&self) -> Result { + self.ptr + .new_address() + .map_err(|e| e.into()) + .map(|e| e.into()) + } + pub fn send_to_address( + &self, + address: Address, + amount_sats: u64, + ) -> Result { + self.ptr + .send_to_address(&(address.try_into()?), amount_sats) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + pub fn send_all_to_address(&self, address: Address) -> Result { + self.ptr + .send_all_to_address(&(address.try_into()?)) + .map_err(|e| e.into()) + .map(|e| e.into()) + } +} diff --git a/rust/src/api/spontaneous.rs b/rust/src/api/spontaneous.rs new file mode 100644 index 0000000..c46f61b --- /dev/null +++ b/rust/src/api/spontaneous.rs @@ -0,0 +1,28 @@ +use crate::api::types::{PaymentId, PublicKey}; +use crate::frb_generated::RustOpaque; +use crate::utils::error::LdkNodeError; + +pub struct LdkSpontaneousPayment { + pub ptr: RustOpaque, +} +impl From for LdkSpontaneousPayment { + fn from(value: ldk_node::payment::SpontaneousPayment) -> Self { + Self { + ptr: RustOpaque::new(value), + } + } +} +impl LdkSpontaneousPayment { + pub fn send(&self, amount_msat: u64, node_id: PublicKey) -> Result { + self.ptr + .send(amount_msat, node_id.try_into()?) + .map_err(|e| e.into()) + .map(|e| e.into()) + } + pub fn send_probes(&self, amount_msat: u64, node_id: PublicKey) -> Result<(), LdkNodeError> { + self.ptr + .send_probes(amount_msat, node_id.try_into()?) + .map_err(|e| e.into()) + .map(|e| e.into()) + } +} diff --git a/rust/src/api/types.rs b/rust/src/api/types.rs index 35504d3..a9fbf8e 100644 --- a/rust/src/api/types.rs +++ b/rust/src/api/types.rs @@ -1,10 +1,12 @@ -use crate::api::error::{BuilderException, NodeException}; -use crate::api::node::LdkMnemonic; -use flutter_rust_bridge::frb; +use crate::api::builder::LdkMnemonic; +use crate::utils::error::{LdkBuilderError, LdkNodeError}; +use flutter_rust_bridge::*; +use ldk_node::lightning::util::ser::{Readable, Writeable}; +use std::default::Default; use std::str::FromStr; use std::string::ToString; -///An address which can be used to connect to a remote peer. +///The addresses on which the node will listen for incoming connections. #[derive(Debug, Clone, PartialEq, Eq)] pub enum SocketAddress { TcpIpV4 { @@ -27,17 +29,6 @@ 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 { @@ -68,9 +59,8 @@ impl From for SocketAddress { } } } - impl TryFrom for ldk_node::lightning::ln::msgs::SocketAddress { - type Error = BuilderException; + type Error = LdkBuilderError; fn try_from(value: SocketAddress) -> Result { match value { @@ -97,13 +87,14 @@ impl TryFrom for ldk_node::lightning::ln::msgs::SocketAddress { SocketAddress::Hostname { addr, port } => { Ok(ldk_node::lightning::ln::msgs::SocketAddress::Hostname { hostname: ldk_node::lightning::util::ser::Hostname::try_from(addr) - .map_err(|_| BuilderException::SocketAddressParseError)?, + .map_err(|_| LdkBuilderError::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. @@ -123,7 +114,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: MaxDustHTLCExposure, + pub max_dust_htlc_exposure: Option, ///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. @@ -135,10 +126,25 @@ 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. + // 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. 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. // @@ -155,29 +161,27 @@ 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::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(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::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 } } @@ -208,87 +212,334 @@ impl From for ldk_node::lightning::ln::ChannelId { /// #[derive(Debug, Clone, PartialEq, Eq)] pub struct UserChannelId { - pub data: u64, + pub data: Vec, } /// 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.0 as u64, + data: value.encode(), } } } -#[derive(Debug, Clone, PartialEq, Eq)] -/// An event emitted by [Node], which should be handled by the user. +impl TryFrom for ldk_node::UserChannelId { + type Error = LdkNodeError; + + fn try_from(value: UserChannelId) -> Result { + let mut encoded = value.data.as_slice(); + ldk_node::UserChannelId::read(&mut encoded).map_err(|e| e.into()) + } +} +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::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 + } + ldk_node::lightning::events::ClosureReason::LegacyCooperativeClosure => { + ClosureReason::LegacyCooperativeClosure + } + ldk_node::lightning::events::ClosureReason::CounterpartyInitiatedCooperativeClosure => { + ClosureReason::CounterpartyInitiatedCooperativeClosure + } + ldk_node::lightning::events::ClosureReason::LocallyInitiatedCooperativeClosure => { + ClosureReason::LocallyInitiatedCooperativeClosure + } + ldk_node::lightning::events::ClosureReason::HTLCsTimedOut => { + ClosureReason::HTLCsTimedOut + } + } + } +} +/// 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 + } + } + } +} +#[derive(Clone, Debug, PartialEq, Eq)] +/// The reason the channel was closed. See individual variants for more details. +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. + /// + /// [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel. + 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. + /// + /// This was only set in versions of LDK prior to 0.0.122. + // Can be removed once we disallow downgrading to 0.0.121 + LegacyCooperativeClosure, + /// The channel was closed after negotiating a cooperative close and we've now broadcasted + /// the cooperative close transaction. This indicates that the shutdown was initiated by our + /// counterparty. + /// + /// In rare cases where we initiated closure immediately prior to shutting down without + /// persisting, this value may be provided for channels we initiated closure for. + CounterpartyInitiatedCooperativeClosure, + /// The channel was closed after negotiating a cooperative close and we've now broadcasted + /// the cooperative close transaction. This indicates that the shutdown was initiated by us. + LocallyInitiatedCooperativeClosure, + /// 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. + /// + /// [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor + DisconnectedPeer, + /// Closure generated from `ChannelManager::read` if the [`ChannelMonitor`] is newer than + /// the [`ChannelManager`] deserialized. + /// + /// [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor + /// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager + 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, + /// One of our HTLCs timed out in a channel, causing us to force close the channel. + HTLCsTimedOut, +} +///A user-provided identifier in channelManager.sendPayment used to uniquely identify a payment and ensure idempotency in LDK. +#[derive(Eq, PartialEq, Debug, Clone)] +pub struct PaymentId(pub [u8; 32]); + +impl From for PaymentId { + fn from(value: ldk_node::lightning::ln::channelmanager::PaymentId) -> Self { + PaymentId(value.0) + } +} +impl From for ldk_node::lightning::ln::channelmanager::PaymentId { + fn from(value: PaymentId) -> Self { + ldk_node::lightning::ln::channelmanager::PaymentId(value.0) + } +} +/// An event emitted by [`Node`], which should be handled by the user. /// + +#[derive(Debug, Clone, PartialEq, Eq)] pub enum Event { + /// A payment for a previously-registered payment hash has been received. + /// + /// This needs to be manually claimed by supplying the correct preimage to `claimForHash`. + /// + /// If the the provided parameters don't match the expectations or the preimage can't be + /// retrieved in time, should be failed-back via [`failForHash`]. + PaymentClaimable { + /// A local identifier used to track the payment. + payment_id: PaymentId, + /// The hash of the payment. + payment_hash: PaymentHash, + /// The value, in thousandths of a satoshi, that is claimable. + claimable_amount_msat: u64, + /// The block height at which this payment will be failed back and will no longer be + /// eligible for claiming. + claim_deadline: Option, + }, /// A sent payment was successful. PaymentSuccessful { + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + payment_id: Option, /// 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 { + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + payment_id: Option, /// 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 { + /// A local identifier used to track the payment. + /// + /// Will only be `None` for events serialized with LDK Node v0.2.1 or prior. + payment_id: Option, /// The hash of the payment. payment_hash: PaymentHash, /// 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 `channelId` of the channel. + channel_id: ChannelId, + /// The `userChannelId` of the channel. + user_channel_id: UserChannelId, + /// The `temporaryChannelId` this channel used to be known by during channel establishment. + former_temporary_channel_id: ChannelId, + /// The `nodeId` 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 `channelId` of the channel. channel_id: ChannelId, - /// The user_channel_id of the channel. + /// The `userChannelId` of the channel. user_channel_id: UserChannelId, - + /// The `nodeId` 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 `channelId` of the channel. channel_id: ChannelId, - /// The user_channel_id of the channel. + /// The `userChannelId` of the channel. user_channel_id: UserChannelId, + /// The `nodeId` 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 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, + /// This will be `None` for events serialized by LDK Node v0.2.1 and prior. + reason: Option, }, } impl From for Event { fn from(value: ldk_node::Event) -> Self { match value { - ldk_node::Event::PaymentSuccessful { payment_hash } => Event::PaymentSuccessful { + ldk_node::Event::PaymentSuccessful { + payment_id, + payment_hash, + fee_paid_msat, + } => Event::PaymentSuccessful { + payment_id: payment_id.map(|e| e.into()), payment_hash: PaymentHash { data: payment_hash.0, }, + fee_paid_msat, }, - ldk_node::Event::PaymentFailed { payment_hash } => Event::PaymentFailed { + ldk_node::Event::PaymentFailed { + payment_id, + payment_hash, + reason, + } => Event::PaymentFailed { + payment_id: payment_id.map(|e| e.into()), payment_hash: PaymentHash { data: payment_hash.0, }, + reason: reason.map(|e| e.into()), }, ldk_node::Event::PaymentReceived { + payment_id, payment_hash, amount_msat, } => Event::PaymentReceived { + payment_id: payment_id.map(|e| e.into()), payment_hash: PaymentHash { data: payment_hash.0, }, @@ -307,10 +558,12 @@ 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, @@ -327,6 +580,17 @@ impl From for Event { }, funding_txo: funding_txo.into(), }, + ldk_node::Event::PaymentClaimable { + payment_id, + payment_hash, + claimable_amount_msat, + claim_deadline, + } => Event::PaymentClaimable { + payment_id: payment_id.into(), + payment_hash: payment_hash.into(), + claimable_amount_msat: claimable_amount_msat, + claim_deadline: claim_deadline, + }, } } } @@ -339,11 +603,11 @@ pub struct Txid { } impl TryFrom for ldk_node::bitcoin::Txid { - type Error = NodeException; + type Error = LdkNodeError; fn try_from(value: Txid) -> Result { ldk_node::bitcoin::Txid::from_str(value.hash.as_str()) - .map_err(|_| NodeException::InvalidTxid) + .map_err(|_| LdkNodeError::InvalidTxid) } } @@ -385,12 +649,12 @@ pub enum PaymentStatus { Failed, } -impl From for PaymentStatus { - fn from(value: ldk_node::PaymentStatus) -> Self { +impl From for PaymentStatus { + fn from(value: ldk_node::payment::PaymentStatus) -> Self { match value { - ldk_node::PaymentStatus::Pending => PaymentStatus::Pending, - ldk_node::PaymentStatus::Succeeded => PaymentStatus::Succeeded, - ldk_node::PaymentStatus::Failed => PaymentStatus::Failed, + ldk_node::payment::PaymentStatus::Pending => PaymentStatus::Pending, + ldk_node::payment::PaymentStatus::Succeeded => PaymentStatus::Succeeded, + ldk_node::payment::PaymentStatus::Failed => PaymentStatus::Failed, } } } @@ -405,20 +669,20 @@ pub enum PaymentDirection { Outbound, } -impl From for PaymentDirection { - fn from(value: ldk_node::PaymentDirection) -> Self { +impl From for PaymentDirection { + fn from(value: ldk_node::payment::PaymentDirection) -> Self { match value { - ldk_node::PaymentDirection::Inbound => PaymentDirection::Inbound, - ldk_node::PaymentDirection::Outbound => PaymentDirection::Outbound, + ldk_node::payment::PaymentDirection::Inbound => PaymentDirection::Inbound, + ldk_node::payment::PaymentDirection::Outbound => PaymentDirection::Outbound, } } } -impl From for ldk_node::PaymentDirection { +impl From for ldk_node::payment::PaymentDirection { fn from(value: PaymentDirection) -> Self { match value { - PaymentDirection::Inbound => ldk_node::PaymentDirection::Inbound, - PaymentDirection::Outbound => ldk_node::PaymentDirection::Outbound, + PaymentDirection::Inbound => ldk_node::payment::PaymentDirection::Inbound, + PaymentDirection::Outbound => ldk_node::payment::PaymentDirection::Outbound, } } } @@ -449,6 +713,17 @@ pub struct PaymentPreimage { pub data: [u8; 32], } +impl From for PaymentPreimage { + fn from(value: ldk_node::lightning::ln::PaymentPreimage) -> Self { + Self { data: value.0 } + } +} + +impl From for ldk_node::lightning::ln::PaymentPreimage { + fn from(value: PaymentPreimage) -> Self { + ldk_node::lightning::ln::PaymentPreimage(value.data) + } +} /// payment_secret type, use to authenticate sender to the receiver and tie MPP HTLCs together /// #[derive(Hash, Copy, Clone, PartialEq, Eq, Debug)] @@ -456,19 +731,18 @@ pub struct PaymentSecret { pub data: [u8; 32], } -// Structs wrapping the particular information which should easily be -// understandable, parseable, and transformable, i.e., we'll try to avoid -// exposing too many technical detail here. +impl From for PaymentSecret { + fn from(value: ldk_node::lightning_invoice::PaymentSecret) -> Self { + PaymentSecret { data: value.0 } + } +} /// Represents a payment. -/// #[derive(Clone, Debug, PartialEq, Eq)] pub struct PaymentDetails { - /// The payment hash, i.e., the hash of the `preimage`. - pub hash: PaymentHash, - /// The pre-image used by the payment. - pub preimage: Option, - /// The secret used by the payment. - pub secret: Option, + /// The identifier of this payment. + pub id: PaymentId, + /// The kind of the payment. + pub kind: PaymentKind, /// The amount transferred. pub amount_msat: Option, /// The direction of the payment. @@ -477,41 +751,171 @@ pub struct PaymentDetails { pub status: PaymentStatus, } -impl From for PaymentDetails { - fn from(value: ldk_node::PaymentDetails) -> Self { +impl From for PaymentDetails { + fn from(value: ldk_node::payment::PaymentDetails) -> Self { PaymentDetails { - hash: PaymentHash { data: value.hash.0 }, - preimage: value.preimage.map(|x| PaymentPreimage { data: x.0 }), - secret: value.secret.map(|x| PaymentSecret { data: x.0 }), + id: value.id.into(), status: value.status.into(), amount_msat: value.amount_msat, direction: value.direction.into(), + kind: value.kind.into(), } } } - -#[derive(Debug, Clone, PartialEq, Eq)] -///Represents a syntactically and semantically correct lightning BOLT11 invoice. -/// -pub struct Bolt11Invoice { - pub signed_raw_invoice: String, +/// Limits applying to how much fee we allow an LSP to deduct from the payment amount. +#[derive(Copy, Clone, Debug, PartialEq, Eq)] +pub struct LSPFeeLimits { + /// The maximal total amount we allow any configured LSP withhold from us when forwarding the + /// payment. + pub max_total_opening_fee_msat: Option, + /// The maximal proportional fee, in parts-per-million millisatoshi, we allow any configured + /// LSP withhold from us when forwarding the payment. + pub max_proportional_opening_fee_ppm_msat: Option, +} +impl From for LSPFeeLimits { + fn from(value: ldk_node::payment::LSPFeeLimits) -> Self { + LSPFeeLimits { + max_total_opening_fee_msat: value.max_total_opening_fee_msat, + max_proportional_opening_fee_ppm_msat: value.max_proportional_opening_fee_ppm_msat, + } + } } -impl TryFrom for ldk_node::lightning_invoice::Bolt11Invoice { - type Error = NodeException; +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub struct OfferId(pub [u8; 32]); - fn try_from(value: Bolt11Invoice) -> Result { - ldk_node::lightning_invoice::Bolt11Invoice::from_str(value.signed_raw_invoice.as_str()) - .map_err(|_| NodeException::InvalidInvoice) +impl From for OfferId { + fn from(value: ldk_node::lightning::offers::offer::OfferId) -> Self { + Self(value.0) + } +} +impl From for ldk_node::lightning::offers::offer::OfferId { + fn from(value: OfferId) -> Self { + Self(value.0) } } -impl From for Bolt11Invoice { - fn from(value: ldk_node::lightning_invoice::Bolt11Invoice) -> Self { - Bolt11Invoice { - signed_raw_invoice: value.to_string(), +/// Represents the kind of a payment. +#[derive(Clone, Debug, PartialEq, Eq)] +pub enum PaymentKind { + /// An on-chain payment. + Onchain, + /// A [BOLT 11] payment. + /// + /// [BOLT 11]: https://github.com/lightning/bolts/blob/master/11-payment-encoding.md + // TODO: Bolt11 { invoice: Option }, + Bolt11 { + /// The payment hash, i.e., the hash of the `preimage`. + hash: PaymentHash, + /// The pre-image used by the payment. + preimage: Option, + /// The secret used by the payment. + secret: Option, + }, + /// A [BOLT 11] payment intended to open an [LSPS 2] just-in-time channel. + /// + /// [BOLT 11]: https://github.com/lightning/bolts/blob/master/11-payment-encoding.md + /// [LSPS 2]: https://github.com/BitcoinAndLightningLayerSpecs/lsp/blob/main/LSPS2/README.md + Bolt11Jit { + /// The payment hash, i.e., the hash of the `preimage`. + hash: PaymentHash, + /// The pre-image used by the payment. + preimage: Option, + /// The secret used by the payment. + secret: Option, + /// Limits applying to how much fee we allow an LSP to deduct from the payment amount. + /// + /// Allowing them to deduct this fee from the first inbound payment will pay for the LSP's + /// channel opening fees. + /// + lsp_fee_limits: LSPFeeLimits, + }, + /// A spontaneous ("keysend") payment. + Spontaneous { + /// The payment hash, i.e., the hash of the `preimage`. + hash: PaymentHash, + /// The pre-image used by the payment. + preimage: Option, + }, + + /// A [BOLT 12] offer payment, i.e., a payment for an `Offer`. + /// + /// [BOLT 12]: https://github.com/lightning/bolts/blob/master/12-offer-encoding.md + Bolt12Offer { + /// The payment hash, i.e., the hash of the `preimage`. + hash: Option, + /// The pre-image used by the payment. + preimage: Option, + /// The secret used by the payment. + secret: Option, + /// The ID of the offer this payment is for. + offer_id: OfferId, + }, + /// A [BOLT 12] 'refund' payment, i.e., a payment for a `Refund`. + /// + /// [BOLT 12]: https://github.com/lightning/bolts/blob/master/12-offer-encoding.md + Bolt12Refund { + /// The payment hash, i.e., the hash of the `preimage`. + hash: Option, + /// The pre-image used by the payment. + preimage: Option, + /// The secret used by the payment. + secret: Option, + }, +} +impl From for PaymentKind { + fn from(value: ldk_node::payment::PaymentKind) -> Self { + match value { + ldk_node::payment::PaymentKind::Onchain => PaymentKind::Onchain, + ldk_node::payment::PaymentKind::Bolt11 { + hash, + preimage, + secret, + } => PaymentKind::Bolt11 { + hash: hash.into(), + preimage: preimage.map(|e| e.into()), + secret: secret.map(|e| e.into()), + }, + ldk_node::payment::PaymentKind::Bolt11Jit { + hash, + preimage, + secret, + lsp_fee_limits, + } => PaymentKind::Bolt11Jit { + hash: hash.into(), + preimage: preimage.map(|e| e.into()), + secret: secret.map(|e| e.into()), + lsp_fee_limits: lsp_fee_limits.into(), + }, + ldk_node::payment::PaymentKind::Spontaneous { hash, preimage } => { + PaymentKind::Spontaneous { + hash: hash.into(), + preimage: preimage.map(|e| e.into()), + } + } + ldk_node::payment::PaymentKind::Bolt12Offer { + hash, + preimage, + secret, + offer_id, + } => PaymentKind::Bolt12Offer { + hash: hash.map(|e| e.into()), + preimage: preimage.map(|e| e.into()), + secret: secret.map(|e| e.into()), + offer_id: offer_id.into(), + }, + ldk_node::payment::PaymentKind::Bolt12Refund { + hash, + preimage, + secret, + } => PaymentKind::Bolt12Refund { + hash: hash.map(|e| e.into()), + preimage: preimage.map(|e| e.into()), + secret: secret.map(|e| e.into()), + }, } } } + ///A Secp256k1 public key, used for verification of signatures. /// #[derive(Debug, Clone, PartialEq, Eq)] @@ -520,11 +924,11 @@ pub struct PublicKey { } impl TryFrom for ldk_node::bitcoin::secp256k1::PublicKey { - type Error = NodeException; + type Error = LdkNodeError; fn try_from(value: PublicKey) -> Result { ldk_node::bitcoin::secp256k1::PublicKey::from_str(value.hex.as_str()) - .map_err(|_| NodeException::InvalidPublicKey) + .map_err(|_| LdkNodeError::InvalidPublicKey) } } impl From for PublicKey { @@ -541,12 +945,12 @@ pub struct Address { } impl TryFrom
for ldk_node::bitcoin::Address { - type Error = NodeException; + type Error = LdkNodeError; fn try_from(value: Address) -> Result { ldk_node::bitcoin::Address::from_str(value.s.as_str()) .map(|e| e.assume_checked()) - .map_err(|_| NodeException::InvalidAddress) + .map_err(|_| LdkNodeError::InvalidAddress) } } impl From for Address { @@ -557,116 +961,130 @@ impl From for Address { } } -/// Details of a channel, as returned by node.listChannels() -/// -#[derive(Clone, Debug, PartialEq, Eq)] +#[derive(Debug, Clone)] pub struct ChannelDetails { - /// 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). + /// 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). + /// /// 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 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 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. /// - /// This value is not included in `outbound_capacity_msat` as it can never be spent. + /// This value is not included in `outboundCapacityMsat` as it can never be spent. /// - /// This value will be null for outbound channels until the counterparty accepts the channel. + /// This value will be `None` for outbound channels until the counterparty accepts the channel. /// pub unspendable_punishment_reserve: Option, - /// 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. - /// + /// The local `user_channel_id` of this channel. 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, - /// 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 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 + /// The amount does not include any pending HTLCs which are not yet 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 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 available outbound capacity for sending HTLCs to the remote peer. /// + /// 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 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 number of required confirmations on the funding transactions before the funding is + /// considered "locked". The amount is selected by the channel fundee. /// + /// 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, - - /// True if the channel was initiated (and thus funded) by us. - /// + /// Returns `true` if the channel was initiated (and therefore funded) by us. 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 - /// + /// 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, - /// 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 is a strict superset of `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. /// + /// This is a strict superset of `is_channel_ready`. pub is_usable: bool, - /// True if this channel is (or will be) publicly-announced. - /// + /// 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. + /// + /// This value is not included in [`inbound_capacity_msat`] as it can never be spent. + /// + /// [`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 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. + /// + /// 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, } 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.txid.to_string()), + funding_txo: value.clone().funding_txo.map(|x| x.into()), 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, @@ -675,6 +1093,29 @@ 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(), } } } @@ -697,13 +1138,24 @@ pub enum Network { Regtest, } -impl From for ldk_node::Network { +impl From for ldk_node::bitcoin::Network { fn from(value: Network) -> Self { match value { - Network::Bitcoin => ldk_node::Network::Bitcoin, - Network::Testnet => ldk_node::Network::Testnet, - Network::Signet => ldk_node::Network::Signet, - Network::Regtest => ldk_node::Network::Regtest, + 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, } } } @@ -770,9 +1222,192 @@ 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, + } + } +} + +/// Configuration options pertaining to 'Anchor' channels, i.e., channels for which the +/// `optionAnchorsZeroFeeHtlcTx` channel type is negotiated. +/// +/// Prior to the introduction of Anchor channels, the on-chain fees paying for the transactions +/// issued on channel closure were pre-determined and locked-in at the time of the channel +/// opening. This required to estimate what fee rate would be sufficient to still have the +/// closing transactions be spendable on-chain (i.e., not be considered dust). This legacy +/// design of pre-anchor channels proved inadequate in the unpredictable, often turbulent, fee +/// markets we experience today. +/// +/// In contrast, Anchor channels allow to determine an adequate fee rate *at the time of channel +/// closure*, making them much more robust in the face of fee spikes. In turn, they require to +/// maintain a reserve of on-chain funds to have the channel closure transactions confirmed +/// on-chain, at least if the channel counterparty can't be trusted to do this for us. +/// +/// See [BOLT 3] for more technical details on Anchor channels. +/// +/// +/// ### Defaults +/// +/// | Parameter | Value | +/// |----------------------------|--------| +/// | `trustedPeersNoReserve` | [] | +/// | `perChannelReserveSats` | 25000 | +/// +/// +/// [BOLT 3]: https://github.com/lightning/bolts/blob/master/03-transactions.md#htlc-timeout-and-htlc-success-transactions +#[derive(Debug, Clone)] +pub struct AnchorChannelsConfig { + /// A list of peers that we trust to get the required channel closing transactions confirmed + /// on-chain. + /// + /// Channels with these peers won't count towards the retained on-chain reserve and we won't + /// take any action to get the required transactions confirmed ourselves. + /// + /// **Note:** Trusting the channel counterparty to take the necessary actions to get the + /// required Anchor spending and HTLC transactions confirmed on-chain is potentially insecure + /// as the channel may not be closed if they refuse to do so, potentially leaving the user + /// funds stuck *or* even allow the counterparty to steal any in-flight funds after the + /// corresponding HTLCs time out. + pub trusted_peers_no_reserve: Vec, + /// The amount of satoshis per anchors-negotiated channel with an untrusted peer that we keep + /// as an emergency reserve in our on-chain wallet. + /// + /// This allows for having the required Anchor output spending and HTLC transactions confirmed + /// when the channel is closed. + /// + /// If the channel peer is not marked as trusted via trustedPeersNoReserve, + /// we will always try to spend the Anchor + /// outputs with *any* on-chain funds available, i.e., the total reserve value as well as any + /// spendable funds available in the on-chain wallet. Therefore, this per-channel multiplier is + /// really an emergency reserve that we maintain at all time to reduce reduce the risk of + /// insufficient funds at time of a channel closure. To this end, we will refuse to open + /// outbound or accept inbound channels if we don't have sufficient on-chain funds available to + /// cover the additional reserve requirement. + /// + /// **Note:** Depending on the fee market at the time of closure, this reserve amount might or + /// might not suffice to successfully spend the Anchor output and have the HTLC transactions + /// confirmed on-chain, i.e., you may want to adjust this value accordingly. + pub per_channel_reserve_sats: u64, +} + +impl TryFrom for ldk_node::AnchorChannelsConfig { + type Error = LdkBuilderError; + + fn try_from(value: AnchorChannelsConfig) -> Result { + let trusted_peers_no_reserve: Result< + Vec, + LdkBuilderError, + > = value + .trusted_peers_no_reserve + .into_iter() + .map(|x| x.try_into().map_err(|_| LdkBuilderError::InvalidPublicKey)) + .collect(); + Ok(Self { + trusted_peers_no_reserve: trusted_peers_no_reserve?, + per_channel_reserve_sats: value.per_channel_reserve_sats, + }) + } +} + +impl From for AnchorChannelsConfig { + fn from(value: ldk_node::AnchorChannelsConfig) -> Self { + Self { + trusted_peers_no_reserve: value + .trusted_peers_no_reserve + .into_iter() + .map(|e| e.into()) + .collect(), + per_channel_reserve_sats: value.per_channel_reserve_sats, + } + } +} + +impl TryFrom for ldk_node::Config { + type Error = LdkBuilderError; + + fn try_from(value: Config) -> Result { + let addresses = if let Some(addresses) = value.listening_addresses { + let addr_vec: Result< + Vec, + LdkBuilderError, + > = addresses + .into_iter() + .map(|socket_addr| socket_addr.try_into()) + .collect(); + Some(addr_vec?) + } else { + None + }; + let anchor_channels_config = + if let Some(anchor_channels_config) = value.anchor_channels_config { + let anchr_channels_config: Result = + anchor_channels_config.try_into(); + Some(anchr_channels_config?) + } else { + None + }; + let trusted_peers_0conf: Result< + Vec, + LdkBuilderError, + > = value + .trusted_peers_0conf + .into_iter() + .map(|x| x.try_into().map_err(|_| LdkBuilderError::InvalidPublicKey)) + .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, + anchor_channels_config, + }) + } +} +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, + anchor_channels_config: value.anchor_channels_config.map(|e| e.into()), + } + } +} /// Represents the configuration of an [Node] instance. /// -#[frb] +#[frb(serialize)] #[derive(Debug, Clone)] pub struct Config { #[frb(non_final)] @@ -819,50 +1454,18 @@ pub struct Config { /// #[frb(non_final)] pub log_level: LogLevel, + #[frb(non_final)] + pub anchor_channels_config: Option, } -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 AnchorChannelsConfig { + fn default() -> Self { + AnchorChannelsConfig { + trusted_peers_no_reserve: vec![], + per_channel_reserve_sats: 25000, + } } } + impl Default for Config { fn default() -> Self { Self { @@ -877,6 +1480,7 @@ impl Default for Config { trusted_peers_0conf: vec![], probing_liquidity_limit_multiplier: 3, log_level: DEFAULT_LOG_LEVEL, + anchor_channels_config: Some(Default::default()), } } } @@ -902,6 +1506,384 @@ 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.listBalances`. +/// +#[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::lightning::chain::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 22a3cb7..bdef0c3 100644 --- a/rust/src/frb_generated.io.rs +++ b/rust/src/frb_generated.io.rs @@ -1,12 +1,15 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. +// Generated by `flutter_rust_bridge`@ 2.0.0. // Section: imports use super::*; +use crate::api::bolt12::*; +use crate::api::builder::*; use crate::api::node::*; +use crate::*; use flutter_rust_bridge::for_generated::byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt}; -use flutter_rust_bridge::for_generated::transform_result_dco; +use flutter_rust_bridge::for_generated::{transform_result_dco, Lifetimeable, Lockable}; use flutter_rust_bridge::{Handler, IntoIntoDart}; // Section: boilerplate @@ -15,9 +18,65 @@ flutter_rust_bridge::frb_generated_boilerplate_io!(); // Section: dart2rust -impl CstDecode>> for usize { +impl CstDecode for usize { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> RustOpaqueNom> { + fn cst_decode(self) -> NodeBuilder { + flutter_rust_bridge::for_generated::rust_auto_opaque_decode_owned(CstDecode::< + RustOpaqueNom>, + >::cst_decode( + self + )) + } +} +impl CstDecode>> for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> RustOpaqueNom> { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode> for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> RustOpaqueNom { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode>> + for usize +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode( + self, + ) -> RustOpaqueNom> { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode> for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> RustOpaqueNom { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode> for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> RustOpaqueNom { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode> for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> RustOpaqueNom { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode> for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> RustOpaqueNom { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode> for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> RustOpaqueNom { unsafe { decode_rust_opaque_nom(self as _) } } } @@ -36,14 +95,80 @@ impl CstDecode for wire_cst_address { } } } -impl CstDecode for wire_cst_bolt_11_invoice { +impl CstDecode for wire_cst_anchor_channels_config { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::Bolt11Invoice { - crate::api::types::Bolt11Invoice { + fn cst_decode(self) -> crate::api::types::AnchorChannelsConfig { + crate::api::types::AnchorChannelsConfig { + trusted_peers_no_reserve: self.trusted_peers_no_reserve.cst_decode(), + per_channel_reserve_sats: self.per_channel_reserve_sats.cst_decode(), + } + } +} +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::bolt11::Bolt11Invoice { + crate::api::bolt11::Bolt11Invoice { signed_raw_invoice: self.signed_raw_invoice.cst_decode(), } } } +impl CstDecode for wire_cst_bolt_12_invoice { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::bolt12::Bolt12Invoice { + crate::api::bolt12::Bolt12Invoice { + data: self.data.cst_decode(), + } + } +} +impl CstDecode for wire_cst_bolt_12_parse_error { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::utils::error::Bolt12ParseError { + match self.tag { + 0 => crate::utils::error::Bolt12ParseError::InvalidContinuation, + 1 => crate::utils::error::Bolt12ParseError::InvalidBech32Hrp, + 2 => { + let ans = unsafe { self.kind.Bech32 }; + crate::utils::error::Bolt12ParseError::Bech32(ans.field0.cst_decode()) + } + 3 => { + let ans = unsafe { self.kind.Decode }; + crate::utils::error::Bolt12ParseError::Decode(ans.field0.cst_decode()) + } + 4 => { + let ans = unsafe { self.kind.InvalidSemantics }; + crate::utils::error::Bolt12ParseError::InvalidSemantics(ans.field0.cst_decode()) + } + 5 => { + let ans = unsafe { self.kind.InvalidSignature }; + crate::utils::error::Bolt12ParseError::InvalidSignature(ans.field0.cst_decode()) + } + _ => unreachable!(), + } + } +} impl CstDecode for *mut wire_cst_address { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::Address { @@ -51,11 +176,25 @@ impl CstDecode for *mut wire_cst_address { CstDecode::::cst_decode(*wrap).into() } } -impl CstDecode for *mut wire_cst_bolt_11_invoice { +impl CstDecode for *mut wire_cst_anchor_channels_config { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::Bolt11Invoice { + fn cst_decode(self) -> crate::api::types::AnchorChannelsConfig { 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_bolt_11_invoice { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::bolt11::Bolt11Invoice { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} +impl CstDecode for *mut wire_cst_bolt_12_parse_error { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::utils::error::Bolt12ParseError { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() } } impl CstDecode @@ -81,6 +220,27 @@ impl CstDecode for *mut wire_cst_channel_id { CstDecode::::cst_decode(*wrap).into() } } +impl CstDecode for *mut wire_cst_channel_info { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::ChannelInfo { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} +impl CstDecode for *mut wire_cst_channel_update_info { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::ChannelUpdateInfo { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + 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 { @@ -88,6 +248,13 @@ impl CstDecode for *mut wire_cst_config { CstDecode::::cst_decode(*wrap).into() } } +impl CstDecode for *mut wire_cst_decode_error { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::utils::error::DecodeError { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} impl CstDecode for *mut wire_cst_entropy_source_config { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::EntropySourceConfig { @@ -109,11 +276,32 @@ impl CstDecode for *mut wire_cst_gossip_s CstDecode::::cst_decode(*wrap).into() } } -impl CstDecode for *mut wire_cst_ldk_mnemonic { +impl CstDecode for *mut wire_cst_ldk_bolt_11_payment { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::bolt11::LdkBolt11Payment { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} +impl CstDecode for *mut wire_cst_ldk_bolt_12_payment { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::bolt12::LdkBolt12Payment { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} +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::LdkMnemonic { + fn cst_decode(self) -> crate::api::builder::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_ldk_network_graph { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::LdkNetworkGraph { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() } } impl CstDecode for *mut wire_cst_ldk_node { @@ -123,6 +311,78 @@ impl CstDecode for *mut wire_cst_ldk_node { CstDecode::::cst_decode(*wrap).into() } } +impl CstDecode for *mut wire_cst_ldk_on_chain_payment { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::on_chain::LdkOnChainPayment { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} +impl CstDecode + for *mut wire_cst_ldk_spontaneous_payment +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::spontaneous::LdkSpontaneousPayment { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + 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_lsp_fee_limits { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::LSPFeeLimits { + 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_node_announcement_info { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::NodeAnnouncementInfo { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} +impl CstDecode for *mut wire_cst_node_id { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::NodeId { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} +impl CstDecode for *mut wire_cst_node_info { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::NodeInfo { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} +impl CstDecode for *mut wire_cst_offer { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::bolt12::Offer { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} +impl CstDecode for *mut wire_cst_offer_id { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::OfferId { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} impl CstDecode for *mut wire_cst_out_point { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::OutPoint { @@ -137,6 +397,13 @@ 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 { @@ -144,6 +411,13 @@ impl CstDecode for *mut wire_cst_payment_hash { CstDecode::::cst_decode(*wrap).into() } } +impl CstDecode for *mut wire_cst_payment_id { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::PaymentId { + 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_preimage { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::PaymentPreimage { @@ -165,6 +439,13 @@ impl CstDecode for *mut wire_cst_public_key { CstDecode::::cst_decode(*wrap).into() } } +impl CstDecode for *mut wire_cst_refund { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::bolt12::Refund { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} impl CstDecode for *mut wire_cst_socket_address { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::SocketAddress { @@ -172,6 +453,19 @@ 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 { @@ -231,7 +525,6 @@ 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(), @@ -240,6 +533,31 @@ 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(), } } } @@ -251,6 +569,62 @@ impl CstDecode for wire_cst_channel_id { } } } +impl CstDecode for wire_cst_channel_info { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::ChannelInfo { + crate::api::graph::ChannelInfo { + node_one: self.node_one.cst_decode(), + one_to_two: self.one_to_two.cst_decode(), + node_two: self.node_two.cst_decode(), + two_to_one: self.two_to_one.cst_decode(), + capacity_sats: self.capacity_sats.cst_decode(), + } + } +} +impl CstDecode for wire_cst_channel_update_info { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::ChannelUpdateInfo { + crate::api::graph::ChannelUpdateInfo { + last_update: self.last_update.cst_decode(), + enabled: self.enabled.cst_decode(), + cltv_expiry_delta: self.cltv_expiry_delta.cst_decode(), + htlc_minimum_msat: self.htlc_minimum_msat.cst_decode(), + htlc_maximum_msat: self.htlc_maximum_msat.cst_decode(), + fees: self.fees.cst_decode(), + } + } +} +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::LegacyCooperativeClosure, + 3 => crate::api::types::ClosureReason::CounterpartyInitiatedCooperativeClosure, + 4 => crate::api::types::ClosureReason::LocallyInitiatedCooperativeClosure, + 5 => crate::api::types::ClosureReason::CommitmentTxConfirmed, + 6 => crate::api::types::ClosureReason::FundingTimedOut, + 7 => { + let ans = unsafe { self.kind.ProcessingError }; + crate::api::types::ClosureReason::ProcessingError { + err: ans.err.cst_decode(), + } + } + 8 => crate::api::types::ClosureReason::DisconnectedPeer, + 9 => crate::api::types::ClosureReason::OutdatedChannelManager, + 10 => crate::api::types::ClosureReason::CounterpartyCoopClosedUnfundedChannel, + 11 => crate::api::types::ClosureReason::FundingBatchClosure, + 12 => crate::api::types::ClosureReason::HTLCsTimedOut, + _ => 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 { @@ -270,6 +644,26 @@ impl CstDecode for wire_cst_config { .probing_liquidity_limit_multiplier .cst_decode(), log_level: self.log_level.cst_decode(), + anchor_channels_config: self.anchor_channels_config.cst_decode(), + } + } +} +impl CstDecode for wire_cst_decode_error { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::utils::error::DecodeError { + match self.tag { + 0 => crate::utils::error::DecodeError::UnknownVersion, + 1 => crate::utils::error::DecodeError::UnknownRequiredFeature, + 2 => crate::utils::error::DecodeError::InvalidValue, + 3 => crate::utils::error::DecodeError::ShortRead, + 4 => crate::utils::error::DecodeError::BadLengthDescriptor, + 5 => { + let ans = unsafe { self.kind.Io }; + crate::utils::error::DecodeError::Io(ans.field0.cst_decode()) + } + 6 => crate::utils::error::DecodeError::UnsupportedCompression, + 7 => crate::utils::error::DecodeError::DangerousValue, + _ => unreachable!(), } } } @@ -301,48 +695,63 @@ impl CstDecode for wire_cst_event { fn cst_decode(self) -> crate::api::types::Event { match self.tag { 0 => { + let ans = unsafe { self.kind.PaymentClaimable }; + crate::api::types::Event::PaymentClaimable { + payment_id: ans.payment_id.cst_decode(), + payment_hash: ans.payment_hash.cst_decode(), + claimable_amount_msat: ans.claimable_amount_msat.cst_decode(), + claim_deadline: ans.claim_deadline.cst_decode(), + } + } + 1 => { let ans = unsafe { self.kind.PaymentSuccessful }; crate::api::types::Event::PaymentSuccessful { + payment_id: ans.payment_id.cst_decode(), payment_hash: ans.payment_hash.cst_decode(), + fee_paid_msat: ans.fee_paid_msat.cst_decode(), } } - 1 => { + 2 => { let ans = unsafe { self.kind.PaymentFailed }; crate::api::types::Event::PaymentFailed { + payment_id: ans.payment_id.cst_decode(), payment_hash: ans.payment_hash.cst_decode(), + reason: ans.reason.cst_decode(), } } - 2 => { + 3 => { let ans = unsafe { self.kind.PaymentReceived }; crate::api::types::Event::PaymentReceived { + payment_id: ans.payment_id.cst_decode(), payment_hash: ans.payment_hash.cst_decode(), amount_msat: ans.amount_msat.cst_decode(), } } - 3 => { - let ans = unsafe { self.kind.ChannelReady }; - crate::api::types::Event::ChannelReady { + 4 => { + 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(), + funding_txo: ans.funding_txo.cst_decode(), } } - 4 => { - let ans = unsafe { self.kind.ChannelClosed }; - crate::api::types::Event::ChannelClosed { + 5 => { + 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(), counterparty_node_id: ans.counterparty_node_id.cst_decode(), } } - 5 => { - let ans = unsafe { self.kind.ChannelPending }; - crate::api::types::Event::ChannelPending { + 6 => { + 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(), - 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(), + reason: ans.reason.cst_decode(), } } _ => unreachable!(), @@ -362,14 +771,38 @@ impl CstDecode for wire_cst_gossip_source } } } -impl CstDecode for wire_cst_ldk_mnemonic { +impl CstDecode for wire_cst_ldk_bolt_11_payment { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::bolt11::LdkBolt11Payment { + crate::api::bolt11::LdkBolt11Payment { + ptr: self.ptr.cst_decode(), + } + } +} +impl CstDecode for wire_cst_ldk_bolt_12_payment { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::node::LdkMnemonic { - crate::api::node::LdkMnemonic { + fn cst_decode(self) -> crate::api::bolt12::LdkBolt12Payment { + crate::api::bolt12::LdkBolt12Payment { + ptr: self.ptr.cst_decode(), + } + } +} +impl CstDecode for wire_cst_ldk_mnemonic { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::builder::LdkMnemonic { + crate::api::builder::LdkMnemonic { seed_phrase: self.seed_phrase.cst_decode(), } } } +impl CstDecode for wire_cst_ldk_network_graph { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::LdkNetworkGraph { + crate::api::graph::LdkNetworkGraph { + ptr: self.ptr.cst_decode(), + } + } +} impl CstDecode for wire_cst_ldk_node { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::node::LdkNode { @@ -378,19 +811,192 @@ impl CstDecode for wire_cst_ldk_node { } } } -impl CstDecode> for *mut wire_cst_list_channel_details { +impl CstDecode for wire_cst_ldk_node_error { // 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() + fn cst_decode(self) -> crate::utils::error::LdkNodeError { + match self.tag { + 0 => crate::utils::error::LdkNodeError::InvalidTxid, + 1 => crate::utils::error::LdkNodeError::AlreadyRunning, + 2 => crate::utils::error::LdkNodeError::NotRunning, + 3 => crate::utils::error::LdkNodeError::OnchainTxCreationFailed, + 4 => crate::utils::error::LdkNodeError::ConnectionFailed, + 5 => crate::utils::error::LdkNodeError::InvoiceCreationFailed, + 6 => crate::utils::error::LdkNodeError::PaymentSendingFailed, + 7 => crate::utils::error::LdkNodeError::ProbeSendingFailed, + 8 => crate::utils::error::LdkNodeError::ChannelCreationFailed, + 9 => crate::utils::error::LdkNodeError::ChannelClosingFailed, + 10 => crate::utils::error::LdkNodeError::ChannelConfigUpdateFailed, + 11 => crate::utils::error::LdkNodeError::PersistenceFailed, + 12 => crate::utils::error::LdkNodeError::WalletOperationFailed, + 13 => crate::utils::error::LdkNodeError::OnchainTxSigningFailed, + 14 => crate::utils::error::LdkNodeError::MessageSigningFailed, + 15 => crate::utils::error::LdkNodeError::TxSyncFailed, + 16 => crate::utils::error::LdkNodeError::GossipUpdateFailed, + 17 => crate::utils::error::LdkNodeError::InvalidAddress, + 18 => crate::utils::error::LdkNodeError::InvalidSocketAddress, + 19 => crate::utils::error::LdkNodeError::InvalidPublicKey, + 20 => crate::utils::error::LdkNodeError::InvalidSecretKey, + 21 => crate::utils::error::LdkNodeError::InvalidPaymentHash, + 22 => crate::utils::error::LdkNodeError::InvalidPaymentPreimage, + 23 => crate::utils::error::LdkNodeError::InvalidPaymentSecret, + 24 => crate::utils::error::LdkNodeError::InvalidAmount, + 25 => crate::utils::error::LdkNodeError::InvalidInvoice, + 26 => crate::utils::error::LdkNodeError::InvalidChannelId, + 27 => crate::utils::error::LdkNodeError::InvalidNetwork, + 28 => crate::utils::error::LdkNodeError::DuplicatePayment, + 29 => crate::utils::error::LdkNodeError::InsufficientFunds, + 30 => crate::utils::error::LdkNodeError::FeerateEstimationUpdateFailed, + 31 => crate::utils::error::LdkNodeError::LiquidityRequestFailed, + 32 => crate::utils::error::LdkNodeError::LiquiditySourceUnavailable, + 33 => crate::utils::error::LdkNodeError::LiquidityFeeTooHigh, + 34 => crate::utils::error::LdkNodeError::InvalidPaymentId, + 35 => { + let ans = unsafe { self.kind.Decode }; + crate::utils::error::LdkNodeError::Decode(ans.field0.cst_decode()) + } + 36 => { + let ans = unsafe { self.kind.Bolt12Parse }; + crate::utils::error::LdkNodeError::Bolt12Parse(ans.field0.cst_decode()) + } + 37 => crate::utils::error::LdkNodeError::InvoiceRequestCreationFailed, + 38 => crate::utils::error::LdkNodeError::OfferCreationFailed, + 39 => crate::utils::error::LdkNodeError::RefundCreationFailed, + 40 => crate::utils::error::LdkNodeError::FeerateEstimationUpdateTimeout, + 41 => crate::utils::error::LdkNodeError::WalletOperationTimeout, + 42 => crate::utils::error::LdkNodeError::TxSyncTimeout, + 43 => crate::utils::error::LdkNodeError::GossipUpdateTimeout, + 44 => crate::utils::error::LdkNodeError::InvalidOfferId, + 45 => crate::utils::error::LdkNodeError::InvalidNodeId, + 46 => crate::utils::error::LdkNodeError::InvalidOffer, + 47 => crate::utils::error::LdkNodeError::InvalidRefund, + 48 => crate::utils::error::LdkNodeError::UnsupportedCurrency, + _ => unreachable!(), + } } } -impl CstDecode> for *mut wire_cst_list_payment_details { +impl CstDecode for wire_cst_ldk_on_chain_payment { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> Vec { + fn cst_decode(self) -> crate::api::on_chain::LdkOnChainPayment { + crate::api::on_chain::LdkOnChainPayment { + ptr: self.ptr.cst_decode(), + } + } +} +impl CstDecode + for wire_cst_ldk_spontaneous_payment +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::spontaneous::LdkSpontaneousPayment { + crate::api::spontaneous::LdkSpontaneousPayment { + ptr: self.ptr.cst_decode(), + } + } +} +impl CstDecode for wire_cst_lightning_balance { + // 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!(), + } + } +} +impl CstDecode for wire_cst_liquidity_source_config { + // 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(), + } + } +} +impl CstDecode> for *mut wire_cst_list_channel_details { + // 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_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_node_id { + // 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 { 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) @@ -408,6 +1014,27 @@ 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_64_strict { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> 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) + } + } +} 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 { @@ -446,6 +1073,17 @@ impl CstDecode> for *mut wire_cst_list_soc vec.into_iter().map(CstDecode::cst_decode).collect() } } +impl CstDecode for wire_cst_lsp_fee_limits { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::LSPFeeLimits { + crate::api::types::LSPFeeLimits { + max_total_opening_fee_msat: self.max_total_opening_fee_msat.cst_decode(), + max_proportional_opening_fee_ppm_msat: self + .max_proportional_opening_fee_ppm_msat + .cst_decode(), + } + } +} impl CstDecode for 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 { @@ -462,6 +1100,68 @@ impl CstDecode for wire_cst_max_dust_htl } } } +impl CstDecode for wire_cst_node_announcement_info { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::NodeAnnouncementInfo { + crate::api::graph::NodeAnnouncementInfo { + last_update: self.last_update.cst_decode(), + alias: self.alias.cst_decode(), + addresses: self.addresses.cst_decode(), + } + } +} +impl CstDecode for wire_cst_node_id { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::NodeId { + crate::api::graph::NodeId { + compressed: self.compressed.cst_decode(), + } + } +} +impl CstDecode for wire_cst_node_info { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::NodeInfo { + crate::api::graph::NodeInfo { + channels: self.channels.cst_decode(), + announcement_info: self.announcement_info.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_offer { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::bolt12::Offer { + crate::api::bolt12::Offer { + s: self.s.cst_decode(), + } + } +} +impl CstDecode for wire_cst_offer_id { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::OfferId { + crate::api::types::OfferId(self.field0.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 { @@ -475,9 +1175,8 @@ impl CstDecode for wire_cst_payment_details { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::PaymentDetails { crate::api::types::PaymentDetails { - hash: self.hash.cst_decode(), - preimage: self.preimage.cst_decode(), - secret: self.secret.cst_decode(), + id: self.id.cst_decode(), + kind: self.kind.cst_decode(), amount_msat: self.amount_msat.cst_decode(), direction: self.direction.cst_decode(), status: self.status.cst_decode(), @@ -492,6 +1191,62 @@ impl CstDecode for wire_cst_payment_hash { } } } +impl CstDecode for wire_cst_payment_id { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::PaymentId { + crate::api::types::PaymentId(self.field0.cst_decode()) + } +} +impl CstDecode for wire_cst_payment_kind { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::PaymentKind { + match self.tag { + 0 => crate::api::types::PaymentKind::Onchain, + 1 => { + let ans = unsafe { self.kind.Bolt11 }; + crate::api::types::PaymentKind::Bolt11 { + hash: ans.hash.cst_decode(), + preimage: ans.preimage.cst_decode(), + secret: ans.secret.cst_decode(), + } + } + 2 => { + let ans = unsafe { self.kind.Bolt11Jit }; + crate::api::types::PaymentKind::Bolt11Jit { + hash: ans.hash.cst_decode(), + preimage: ans.preimage.cst_decode(), + secret: ans.secret.cst_decode(), + lsp_fee_limits: ans.lsp_fee_limits.cst_decode(), + } + } + 3 => { + let ans = unsafe { self.kind.Spontaneous }; + crate::api::types::PaymentKind::Spontaneous { + hash: ans.hash.cst_decode(), + preimage: ans.preimage.cst_decode(), + } + } + 4 => { + let ans = unsafe { self.kind.Bolt12Offer }; + crate::api::types::PaymentKind::Bolt12Offer { + hash: ans.hash.cst_decode(), + preimage: ans.preimage.cst_decode(), + secret: ans.secret.cst_decode(), + offer_id: ans.offer_id.cst_decode(), + } + } + 5 => { + let ans = unsafe { self.kind.Bolt12Refund }; + crate::api::types::PaymentKind::Bolt12Refund { + hash: ans.hash.cst_decode(), + preimage: ans.preimage.cst_decode(), + secret: ans.secret.cst_decode(), + } + } + _ => unreachable!(), + } + } +} impl CstDecode for wire_cst_payment_preimage { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::PaymentPreimage { @@ -518,6 +1273,40 @@ 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 { @@ -526,6 +1315,45 @@ impl CstDecode for wire_cst_public_key { } } } +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_refund { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::bolt12::Refund { + crate::api::bolt12::Refund { + s: self.s.cst_decode(), + } + } +} +impl CstDecode for wire_cst_routing_fees { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::RoutingFees { + crate::api::graph::RoutingFees { + base_msat: self.base_msat.cst_decode(), + proportional_millionths: self.proportional_millionths.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 { @@ -631,6 +1459,48 @@ impl Default for wire_cst_address { Self::new_with_null_ptr() } } +impl NewWithNullPtr for wire_cst_anchor_channels_config { + fn new_with_null_ptr() -> Self { + Self { + trusted_peers_no_reserve: core::ptr::null_mut(), + per_channel_reserve_sats: Default::default(), + } + } +} +impl Default for wire_cst_anchor_channels_config { + fn default() -> Self { + 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 { @@ -643,6 +1513,31 @@ impl Default for wire_cst_bolt_11_invoice { Self::new_with_null_ptr() } } +impl NewWithNullPtr for wire_cst_bolt_12_invoice { + fn new_with_null_ptr() -> Self { + Self { + data: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_bolt_12_invoice { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_bolt_12_parse_error { + fn new_with_null_ptr() -> Self { + Self { + tag: -1, + kind: Bolt12ParseErrorKind { nil__: () }, + } + } +} +impl Default for wire_cst_bolt_12_parse_error { + fn default() -> Self { + Self::new_with_null_ptr() + } +} impl NewWithNullPtr for wire_cst_chain_data_source_config { fn new_with_null_ptr() -> Self { Self { @@ -662,7 +1557,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: Default::default(), + max_dust_htlc_exposure: core::ptr::null_mut(), force_close_avoidance_max_fee_satoshis: Default::default(), accept_underpaying_htlcs: Default::default(), } @@ -683,7 +1578,6 @@ 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(), @@ -692,6 +1586,19 @@ 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(), } } } @@ -712,55 +1619,115 @@ impl Default for wire_cst_channel_id { Self::new_with_null_ptr() } } -impl NewWithNullPtr for wire_cst_config { +impl NewWithNullPtr for wire_cst_channel_info { fn new_with_null_ptr() -> Self { Self { - storage_dir_path: core::ptr::null_mut(), - log_dir_path: core::ptr::null_mut(), - network: Default::default(), - listening_addresses: core::ptr::null_mut(), - default_cltv_expiry_delta: Default::default(), - onchain_wallet_sync_interval_secs: Default::default(), - wallet_sync_interval_secs: Default::default(), - fee_rate_cache_update_interval_secs: Default::default(), - trusted_peers_0conf: core::ptr::null_mut(), - probing_liquidity_limit_multiplier: Default::default(), - log_level: Default::default(), + node_one: Default::default(), + one_to_two: core::ptr::null_mut(), + node_two: Default::default(), + two_to_one: core::ptr::null_mut(), + capacity_sats: core::ptr::null_mut(), } } } -impl Default for wire_cst_config { +impl Default for wire_cst_channel_info { fn default() -> Self { Self::new_with_null_ptr() } } -impl NewWithNullPtr for wire_cst_entropy_source_config { +impl NewWithNullPtr for wire_cst_channel_update_info { fn new_with_null_ptr() -> Self { Self { - tag: -1, - kind: EntropySourceConfigKind { nil__: () }, + last_update: Default::default(), + enabled: Default::default(), + cltv_expiry_delta: Default::default(), + htlc_minimum_msat: Default::default(), + htlc_maximum_msat: Default::default(), + fees: Default::default(), } } } -impl Default for wire_cst_entropy_source_config { +impl Default for wire_cst_channel_update_info { fn default() -> Self { Self::new_with_null_ptr() } } -impl NewWithNullPtr for wire_cst_event { +impl NewWithNullPtr for wire_cst_closure_reason { fn new_with_null_ptr() -> Self { Self { tag: -1, - kind: EventKind { nil__: () }, + kind: ClosureReasonKind { nil__: () }, } } } -impl Default for wire_cst_event { +impl Default for wire_cst_closure_reason { fn default() -> Self { Self::new_with_null_ptr() } } -impl NewWithNullPtr for wire_cst_gossip_source_config { +impl NewWithNullPtr for wire_cst_config { + fn new_with_null_ptr() -> Self { + Self { + storage_dir_path: core::ptr::null_mut(), + log_dir_path: core::ptr::null_mut(), + network: Default::default(), + listening_addresses: core::ptr::null_mut(), + default_cltv_expiry_delta: Default::default(), + onchain_wallet_sync_interval_secs: Default::default(), + wallet_sync_interval_secs: Default::default(), + fee_rate_cache_update_interval_secs: Default::default(), + trusted_peers_0conf: core::ptr::null_mut(), + probing_liquidity_limit_multiplier: Default::default(), + log_level: Default::default(), + anchor_channels_config: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_config { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_decode_error { + fn new_with_null_ptr() -> Self { + Self { + tag: -1, + kind: DecodeErrorKind { nil__: () }, + } + } +} +impl Default for wire_cst_decode_error { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_entropy_source_config { + fn new_with_null_ptr() -> Self { + Self { + tag: -1, + kind: EntropySourceConfigKind { nil__: () }, + } + } +} +impl Default for wire_cst_entropy_source_config { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_event { + fn new_with_null_ptr() -> Self { + Self { + tag: -1, + kind: EventKind { nil__: () }, + } + } +} +impl Default for wire_cst_event { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_gossip_source_config { fn new_with_null_ptr() -> Self { Self { tag: -1, @@ -773,6 +1740,30 @@ impl Default for wire_cst_gossip_source_config { Self::new_with_null_ptr() } } +impl NewWithNullPtr for wire_cst_ldk_bolt_11_payment { + fn new_with_null_ptr() -> Self { + Self { + ptr: Default::default(), + } + } +} +impl Default for wire_cst_ldk_bolt_11_payment { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_ldk_bolt_12_payment { + fn new_with_null_ptr() -> Self { + Self { + ptr: Default::default(), + } + } +} +impl Default for wire_cst_ldk_bolt_12_payment { + fn default() -> Self { + Self::new_with_null_ptr() + } +} impl NewWithNullPtr for wire_cst_ldk_mnemonic { fn new_with_null_ptr() -> Self { Self { @@ -785,6 +1776,18 @@ impl Default for wire_cst_ldk_mnemonic { Self::new_with_null_ptr() } } +impl NewWithNullPtr for wire_cst_ldk_network_graph { + fn new_with_null_ptr() -> Self { + Self { + ptr: Default::default(), + } + } +} +impl Default for wire_cst_ldk_network_graph { + fn default() -> Self { + Self::new_with_null_ptr() + } +} impl NewWithNullPtr for wire_cst_ldk_node { fn new_with_null_ptr() -> Self { Self { @@ -797,6 +1800,81 @@ impl Default for wire_cst_ldk_node { Self::new_with_null_ptr() } } +impl NewWithNullPtr for wire_cst_ldk_node_error { + fn new_with_null_ptr() -> Self { + Self { + tag: -1, + kind: LdkNodeErrorKind { nil__: () }, + } + } +} +impl Default for wire_cst_ldk_node_error { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_ldk_on_chain_payment { + fn new_with_null_ptr() -> Self { + Self { + ptr: Default::default(), + } + } +} +impl Default for wire_cst_ldk_on_chain_payment { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_ldk_spontaneous_payment { + fn new_with_null_ptr() -> Self { + Self { + ptr: Default::default(), + } + } +} +impl Default for wire_cst_ldk_spontaneous_payment { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_lightning_balance { + fn new_with_null_ptr() -> Self { + Self { + tag: -1, + kind: LightningBalanceKind { nil__: () }, + } + } +} +impl Default for wire_cst_lightning_balance { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_liquidity_source_config { + fn new_with_null_ptr() -> Self { + Self { + lsps2_service: Default::default(), + } + } +} +impl Default for wire_cst_liquidity_source_config { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_lsp_fee_limits { + fn new_with_null_ptr() -> Self { + Self { + max_total_opening_fee_msat: core::ptr::null_mut(), + max_proportional_opening_fee_ppm_msat: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_lsp_fee_limits { + fn default() -> Self { + Self::new_with_null_ptr() + } +} impl NewWithNullPtr for wire_cst_max_dust_htlc_exposure { fn new_with_null_ptr() -> Self { Self { @@ -810,6 +1888,88 @@ impl Default for wire_cst_max_dust_htlc_exposure { Self::new_with_null_ptr() } } +impl NewWithNullPtr for wire_cst_node_announcement_info { + fn new_with_null_ptr() -> Self { + Self { + last_update: Default::default(), + alias: core::ptr::null_mut(), + addresses: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_node_announcement_info { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_node_id { + fn new_with_null_ptr() -> Self { + Self { + compressed: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_node_id { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_node_info { + fn new_with_null_ptr() -> Self { + Self { + channels: core::ptr::null_mut(), + announcement_info: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_node_info { + 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_offer { + fn new_with_null_ptr() -> Self { + Self { + s: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_offer { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_offer_id { + fn new_with_null_ptr() -> Self { + Self { + field0: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_offer_id { + fn default() -> Self { + Self::new_with_null_ptr() + } +} impl NewWithNullPtr for wire_cst_out_point { fn new_with_null_ptr() -> Self { Self { @@ -826,9 +1986,8 @@ impl Default for wire_cst_out_point { impl NewWithNullPtr for wire_cst_payment_details { fn new_with_null_ptr() -> Self { Self { - hash: Default::default(), - preimage: core::ptr::null_mut(), - secret: core::ptr::null_mut(), + id: Default::default(), + kind: Default::default(), amount_msat: core::ptr::null_mut(), direction: Default::default(), status: Default::default(), @@ -852,6 +2011,31 @@ impl Default for wire_cst_payment_hash { Self::new_with_null_ptr() } } +impl NewWithNullPtr for wire_cst_payment_id { + fn new_with_null_ptr() -> Self { + Self { + field0: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_payment_id { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_payment_kind { + fn new_with_null_ptr() -> Self { + Self { + tag: -1, + kind: PaymentKindKind { nil__: () }, + } + } +} +impl Default for wire_cst_payment_kind { + fn default() -> Self { + Self::new_with_null_ptr() + } +} impl NewWithNullPtr for wire_cst_payment_preimage { fn new_with_null_ptr() -> Self { Self { @@ -871,120 +2055,525 @@ impl NewWithNullPtr for wire_cst_payment_secret { } } } -impl Default for wire_cst_payment_secret { - fn default() -> Self { - Self::new_with_null_ptr() - } +impl Default for wire_cst_payment_secret { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_peer_details { + fn new_with_null_ptr() -> Self { + Self { + node_id: Default::default(), + address: Default::default(), + is_connected: Default::default(), + } + } +} +impl Default for wire_cst_peer_details { + fn default() -> Self { + 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: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_public_key { + fn default() -> Self { + 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_refund { + fn new_with_null_ptr() -> Self { + Self { + s: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_refund { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_routing_fees { + fn new_with_null_ptr() -> Self { + Self { + base_msat: Default::default(), + proportional_millionths: Default::default(), + } + } +} +impl Default for wire_cst_routing_fees { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_socket_address { + fn new_with_null_ptr() -> Self { + Self { + tag: -1, + kind: SocketAddressKind { nil__: () }, + } + } +} +impl Default for wire_cst_socket_address { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_txid { + fn new_with_null_ptr() -> Self { + Self { + hash: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_txid { + fn default() -> Self { + Self::new_with_null_ptr() + } +} +impl NewWithNullPtr for wire_cst_user_channel_id { + fn new_with_null_ptr() -> Self { + Self { + data: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_user_channel_id { + fn default() -> Self { + Self::new_with_null_ptr() + } +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hash( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + payment_hash: *mut wire_cst_payment_hash, + claimable_amount_msat: u64, + preimage: *mut wire_cst_payment_preimage, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hash_impl( + port_, + that, + payment_hash, + claimable_amount_msat, + preimage, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hash( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + payment_hash: *mut wire_cst_payment_hash, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hash_impl(port_, that, payment_hash) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + amount_msat: u64, + description: *mut wire_cst_list_prim_u_8_strict, + expiry_secs: u32, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_impl( + port_, + that, + amount_msat, + description, + expiry_secs, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hash( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + payment_hash: *mut wire_cst_payment_hash, + amount_msat: u64, + description: *mut wire_cst_list_prim_u_8_strict, + expiry_secs: u32, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hash_impl( + port_, + that, + payment_hash, + amount_msat, + description, + expiry_secs, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + description: *mut wire_cst_list_prim_u_8_strict, + expiry_secs: u32, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_impl( + port_, + that, + description, + expiry_secs, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hash( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + description: *mut wire_cst_list_prim_u_8_strict, + expiry_secs: u32, + payment_hash: *mut wire_cst_payment_hash, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hash_impl( + port_, + that, + description, + expiry_secs, + payment_hash, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + description: *mut wire_cst_list_prim_u_8_strict, + expiry_secs: u32, + max_proportional_lsp_fee_limit_ppm_msat: *mut u64, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel_impl( + port_, + that, + description, + expiry_secs, + max_proportional_lsp_fee_limit_ppm_msat, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + amount_msat: u64, + description: *mut wire_cst_list_prim_u_8_strict, + expiry_secs: u32, + max_total_lsp_fee_limit_msat: *mut u64, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_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__crate__api__bolt11__ldk_bolt_11_payment_send( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + invoice: *mut wire_cst_bolt_11_invoice, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_send_impl(port_, that, invoice) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + invoice: *mut wire_cst_bolt_11_invoice, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_impl(port_, that, invoice) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + invoice: *mut wire_cst_bolt_11_invoice, + amount_msat: u64, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount_impl( + port_, + that, + invoice, + amount_msat, + ) } -impl NewWithNullPtr for wire_cst_peer_details { - fn new_with_null_ptr() -> Self { - Self { - node_id: Default::default(), - address: Default::default(), - is_connected: Default::default(), - } - } + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount( + port_: i64, + that: *mut wire_cst_ldk_bolt_11_payment, + invoice: *mut wire_cst_bolt_11_invoice, + amount_msat: u64, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount_impl( + port_, + that, + invoice, + amount_msat, + ) } -impl Default for wire_cst_peer_details { - fn default() -> Self { - Self::new_with_null_ptr() - } + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refund( + port_: i64, + that: *mut wire_cst_ldk_bolt_12_payment, + amount_msat: u64, + expiry_secs: u32, +) { + wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refund_impl( + port_, + that, + amount_msat, + expiry_secs, + ) } -impl NewWithNullPtr for wire_cst_public_key { - fn new_with_null_ptr() -> Self { - Self { - hex: core::ptr::null_mut(), - } - } + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_receive( + port_: i64, + that: *mut wire_cst_ldk_bolt_12_payment, + amount_msat: u64, + description: *mut wire_cst_list_prim_u_8_strict, +) { + wire__crate__api__bolt12__ldk_bolt_12_payment_receive_impl( + port_, + that, + amount_msat, + description, + ) } -impl Default for wire_cst_public_key { - fn default() -> Self { - Self::new_with_null_ptr() - } + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amount( + port_: i64, + that: *mut wire_cst_ldk_bolt_12_payment, + description: *mut wire_cst_list_prim_u_8_strict, +) { + wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amount_impl( + port_, + that, + description, + ) } -impl NewWithNullPtr for wire_cst_socket_address { - fn new_with_null_ptr() -> Self { - Self { - tag: -1, - kind: SocketAddressKind { nil__: () }, - } - } + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_payment( + port_: i64, + that: *mut wire_cst_ldk_bolt_12_payment, + refund: *mut wire_cst_refund, +) { + wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_payment_impl(port_, that, refund) } -impl Default for wire_cst_socket_address { - fn default() -> Self { - Self::new_with_null_ptr() - } + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_send( + port_: i64, + that: *mut wire_cst_ldk_bolt_12_payment, + offer: *mut wire_cst_offer, + payer_note: *mut wire_cst_list_prim_u_8_strict, +) { + wire__crate__api__bolt12__ldk_bolt_12_payment_send_impl(port_, that, offer, payer_note) } -impl NewWithNullPtr for wire_cst_txid { - fn new_with_null_ptr() -> Self { - Self { - hash: core::ptr::null_mut(), - } - } + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amount( + port_: i64, + that: *mut wire_cst_ldk_bolt_12_payment, + offer: *mut wire_cst_offer, + payer_note: *mut wire_cst_list_prim_u_8_strict, + amount_msat: u64, +) { + wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amount_impl( + port_, + that, + offer, + payer_note, + amount_msat, + ) } -impl Default for wire_cst_txid { - fn default() -> Self { - Self::new_with_null_ptr() - } + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder( + that: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder_impl(that) } -impl NewWithNullPtr for wire_cst_user_channel_id { - fn new_with_null_ptr() -> Self { - Self { - data: Default::default(), - } - } + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder( + that: usize, + builder: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder_impl(that, builder) } -impl Default for wire_cst_user_channel_id { - fn default() -> Self { - Self::new_with_null_ptr() - } + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_build( + port_: i64, + that: usize, +) { + wire__crate__api__builder__NodeBuilder_build_impl(port_, that) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_build_with_fs_store( + port_: i64, + that: usize, +) { + wire__crate__api__builder__NodeBuilder_build_with_fs_store_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_build_with_sqlite_store( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__builder__NodeBuilder_create_builder( 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, ) { - wire_build_with_sqlite_store_impl( + wire__crate__api__builder__NodeBuilder_create_builder_impl( port_, config, chain_data_source_config, entropy_source_config, gossip_source_config, + liquidity_source_config, ) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_mnemonic_generate(port_: i64) { - wire_ldk_mnemonic_generate_impl(port_) +pub extern "C" fn frbgen_ldk_node_wire__crate__api__builder__ldk_mnemonic_generate(port_: i64) { + wire__crate__api__builder__ldk_mnemonic_generate_impl(port_) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_channel( + port_: i64, + that: *mut wire_cst_ldk_network_graph, + short_channel_id: u64, +) { + wire__crate__api__graph__ldk_network_graph_channel_impl(port_, that, short_channel_id) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_list_channels( + port_: i64, + that: *mut wire_cst_ldk_network_graph, +) { + wire__crate__api__graph__ldk_network_graph_list_channels_impl(port_, that) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_list_nodes( + port_: i64, + that: *mut wire_cst_ldk_network_graph, +) { + wire__crate__api__graph__ldk_network_graph_list_nodes_impl(port_, that) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__graph__ldk_network_graph_node( + port_: i64, + that: *mut wire_cst_ldk_network_graph, + node_id: *mut wire_cst_node_id, +) { + wire__crate__api__graph__ldk_network_graph_node_impl(port_, that, node_id) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_bolt11_payment( + port_: i64, + ptr: *mut wire_cst_ldk_node, +) { + wire__crate__api__node__ldk_node_bolt11_payment_impl(port_, ptr) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_bolt12_payment( + port_: i64, + ptr: *mut wire_cst_ldk_node, +) { + wire__crate__api__node__ldk_node_bolt12_payment_impl(port_, ptr) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_close_channel( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_close_channel( port_: i64, that: *mut wire_cst_ldk_node, - channel_id: *mut wire_cst_channel_id, + user_channel_id: *mut wire_cst_user_channel_id, counterparty_node_id: *mut wire_cst_public_key, ) { - wire_ldk_node_close_channel_impl(port_, that, channel_id, counterparty_node_id) + wire__crate__api__node__ldk_node_close_channel_impl( + port_, + that, + user_channel_id, + counterparty_node_id, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_config( + port_: i64, + that: *mut wire_cst_ldk_node, +) { + wire__crate__api__node__ldk_node_config_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_connect( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_connect( port_: i64, that: *mut wire_cst_ldk_node, node_id: *mut wire_cst_public_key, address: *mut wire_cst_socket_address, persist: bool, ) { - wire_ldk_node_connect_impl(port_, that, node_id, address, persist) + wire__crate__api__node__ldk_node_connect_impl(port_, that, node_id, address, persist) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_connect_open_channel( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_connect_open_channel( port_: i64, that: *mut wire_cst_ldk_node, socket_address: *mut wire_cst_socket_address, @@ -994,7 +2583,7 @@ pub extern "C" fn frbgen_ldk_node_wire_ldk_node_connect_open_channel( announce_channel: bool, channel_config: *mut wire_cst_channel_config, ) { - wire_ldk_node_connect_open_channel_impl( + wire__crate__api__node__ldk_node_connect_open_channel_impl( port_, that, socket_address, @@ -1007,318 +2596,432 @@ pub extern "C" fn frbgen_ldk_node_wire_ldk_node_connect_open_channel( } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_disconnect( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_disconnect( port_: i64, that: *mut wire_cst_ldk_node, counterparty_node_id: *mut wire_cst_public_key, ) { - wire_ldk_node_disconnect_impl(port_, that, counterparty_node_id) + wire__crate__api__node__ldk_node_disconnect_impl(port_, that, counterparty_node_id) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_event_handled( + port_: i64, + that: *mut wire_cst_ldk_node, +) { + wire__crate__api__node__ldk_node_event_handled_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_event_handled( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_force_close_channel( port_: i64, that: *mut wire_cst_ldk_node, + user_channel_id: *mut wire_cst_user_channel_id, + counterparty_node_id: *mut wire_cst_public_key, ) { - wire_ldk_node_event_handled_impl(port_, that) + wire__crate__api__node__ldk_node_force_close_channel_impl( + port_, + that, + user_channel_id, + counterparty_node_id, + ) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_is_running( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_list_balances( port_: i64, that: *mut wire_cst_ldk_node, ) { - wire_ldk_node_is_running_impl(port_, that) + wire__crate__api__node__ldk_node_list_balances_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_list_channels( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_list_channels( port_: i64, that: *mut wire_cst_ldk_node, ) { - wire_ldk_node_list_channels_impl(port_, that) + wire__crate__api__node__ldk_node_list_channels_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_list_payments( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_list_payments( port_: i64, that: *mut wire_cst_ldk_node, ) { - wire_ldk_node_list_payments_impl(port_, that) + wire__crate__api__node__ldk_node_list_payments_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_list_payments_with_filter( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_list_payments_with_filter( port_: i64, that: *mut wire_cst_ldk_node, payment_direction: i32, ) { - wire_ldk_node_list_payments_with_filter_impl(port_, that, payment_direction) + wire__crate__api__node__ldk_node_list_payments_with_filter_impl(port_, that, payment_direction) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_list_peers( + port_: i64, + that: *mut wire_cst_ldk_node, +) { + wire__crate__api__node__ldk_node_list_peers_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_list_peers( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_listening_addresses( port_: i64, that: *mut wire_cst_ldk_node, ) { - wire_ldk_node_list_peers_impl(port_, that) + wire__crate__api__node__ldk_node_listening_addresses_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_listening_addresses( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_network_graph( + port_: i64, + ptr: *mut wire_cst_ldk_node, +) { + wire__crate__api__node__ldk_node_network_graph_impl(port_, ptr) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_next_event( port_: i64, that: *mut wire_cst_ldk_node, ) { - wire_ldk_node_listening_addresses_impl(port_, that) + wire__crate__api__node__ldk_node_next_event_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_new_onchain_address( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_next_event_async( port_: i64, that: *mut wire_cst_ldk_node, ) { - wire_ldk_node_new_onchain_address_impl(port_, that) + wire__crate__api__node__ldk_node_next_event_async_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_next_event( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_node_id( port_: i64, that: *mut wire_cst_ldk_node, ) { - wire_ldk_node_next_event_impl(port_, that) + wire__crate__api__node__ldk_node_node_id_impl(port_, that) } #[no_mangle] -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) +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_on_chain_payment( + port_: i64, + ptr: *mut wire_cst_ldk_node, +) { + wire__crate__api__node__ldk_node_on_chain_payment_impl(port_, ptr) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_payment( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_payment( port_: i64, that: *mut wire_cst_ldk_node, - payment_hash: *mut wire_cst_payment_hash, + payment_id: *mut wire_cst_payment_id, ) { - wire_ldk_node_payment_impl(port_, that, payment_hash) + wire__crate__api__node__ldk_node_payment_impl(port_, that, payment_id) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_receive_payment( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_remove_payment( port_: i64, that: *mut wire_cst_ldk_node, - amount_msat: u64, - description: *mut wire_cst_list_prim_u_8_strict, - expiry_secs: u32, + payment_id: *mut wire_cst_payment_id, ) { - wire_ldk_node_receive_payment_impl(port_, that, amount_msat, description, expiry_secs) + wire__crate__api__node__ldk_node_remove_payment_impl(port_, that, payment_id) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_receive_variable_amount_payment( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_sign_message( port_: i64, that: *mut wire_cst_ldk_node, - description: *mut wire_cst_list_prim_u_8_strict, - expiry_secs: u32, + msg: *mut wire_cst_list_prim_u_8_loose, +) { + wire__crate__api__node__ldk_node_sign_message_impl(port_, that, msg) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_spontaneous_payment( + port_: i64, + ptr: *mut wire_cst_ldk_node, ) { - wire_ldk_node_receive_variable_amount_payment_impl(port_, that, description, expiry_secs) + wire__crate__api__node__ldk_node_spontaneous_payment_impl(port_, ptr) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_remove_payment( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_start( port_: i64, that: *mut wire_cst_ldk_node, - payment_hash: *mut wire_cst_payment_hash, ) { - wire_ldk_node_remove_payment_impl(port_, that, payment_hash) + wire__crate__api__node__ldk_node_start_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_send_all_to_onchain_address( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_status( port_: i64, that: *mut wire_cst_ldk_node, - address: *mut wire_cst_address, ) { - wire_ldk_node_send_all_to_onchain_address_impl(port_, that, address) + wire__crate__api__node__ldk_node_status_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_send_payment( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_stop( port_: i64, that: *mut wire_cst_ldk_node, - invoice: *mut wire_cst_bolt_11_invoice, ) { - wire_ldk_node_send_payment_impl(port_, that, invoice) + wire__crate__api__node__ldk_node_stop_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_send_payment_probes( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_sync_wallets( port_: i64, that: *mut wire_cst_ldk_node, - invoice: *mut wire_cst_bolt_11_invoice, ) { - wire_ldk_node_send_payment_probes_impl(port_, that, invoice) + wire__crate__api__node__ldk_node_sync_wallets_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_send_payment_probes_using_amount( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_update_channel_config( port_: i64, that: *mut wire_cst_ldk_node, - invoice: *mut wire_cst_bolt_11_invoice, - amount_msat: u64, + user_channel_id: *mut wire_cst_user_channel_id, + counterparty_node_id: *mut wire_cst_public_key, + channel_config: *mut wire_cst_channel_config, +) { + wire__crate__api__node__ldk_node_update_channel_config_impl( + port_, + that, + user_channel_id, + counterparty_node_id, + channel_config, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_verify_signature( + port_: i64, + that: *mut wire_cst_ldk_node, + msg: *mut wire_cst_list_prim_u_8_loose, + sig: *mut wire_cst_list_prim_u_8_strict, + public_key: *mut wire_cst_public_key, ) { - wire_ldk_node_send_payment_probes_using_amount_impl(port_, that, invoice, amount_msat) + wire__crate__api__node__ldk_node_verify_signature_impl(port_, that, msg, sig, public_key) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_send_payment_using_amount( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__node__ldk_node_wait_next_event( port_: i64, that: *mut wire_cst_ldk_node, - invoice: *mut wire_cst_bolt_11_invoice, - amount_msat: u64, ) { - wire_ldk_node_send_payment_using_amount_impl(port_, that, invoice, amount_msat) + wire__crate__api__node__ldk_node_wait_next_event_impl(port_, that) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_new_address( + port_: i64, + that: *mut wire_cst_ldk_on_chain_payment, +) { + wire__crate__api__on_chain__ldk_on_chain_payment_new_address_impl(port_, that) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address( + port_: i64, + that: *mut wire_cst_ldk_on_chain_payment, + address: *mut wire_cst_address, +) { + wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address_impl(port_, that, address) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address( + port_: i64, + that: *mut wire_cst_ldk_on_chain_payment, + address: *mut wire_cst_address, + amount_sats: u64, +) { + wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address_impl( + port_, + that, + address, + amount_sats, + ) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_send_spontaneous_payment( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__spontaneous__ldk_spontaneous_payment_send( port_: i64, - that: *mut wire_cst_ldk_node, + that: *mut wire_cst_ldk_spontaneous_payment, amount_msat: u64, node_id: *mut wire_cst_public_key, ) { - wire_ldk_node_send_spontaneous_payment_impl(port_, that, amount_msat, node_id) + wire__crate__api__spontaneous__ldk_spontaneous_payment_send_impl( + port_, + that, + amount_msat, + node_id, + ) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_send_spontaneous_payment_probes( +pub extern "C" fn frbgen_ldk_node_wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes( port_: i64, - that: *mut wire_cst_ldk_node, + that: *mut wire_cst_ldk_spontaneous_payment, amount_msat: u64, node_id: *mut wire_cst_public_key, ) { - wire_ldk_node_send_spontaneous_payment_probes_impl(port_, that, amount_msat, node_id) + wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes_impl( + port_, + that, + amount_msat, + node_id, + ) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_send_to_onchain_address( - port_: i64, - that: *mut wire_cst_ldk_node, - address: *mut wire_cst_address, - amount_sats: u64, +pub extern "C" fn frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ptr: *const std::ffi::c_void, ) { - wire_ldk_node_send_to_onchain_address_impl(port_, that, address, amount_sats) + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_sign_message( - port_: i64, - that: *mut wire_cst_ldk_node, - msg: *mut wire_cst_list_prim_u_8_loose, +pub extern "C" fn frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ptr: *const std::ffi::c_void, ) { - wire_ldk_node_sign_message_impl(port_, that, msg) + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_spendable_onchain_balance_sats( - port_: i64, - that: *mut wire_cst_ldk_node, +pub extern "C" fn frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_Node( + ptr: *const std::ffi::c_void, ) { - wire_ldk_node_spendable_onchain_balance_sats_impl(port_, that) + unsafe { + StdArc::::increment_strong_count(ptr as _); + } } #[no_mangle] -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) +pub extern "C" fn frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_Node( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::::decrement_strong_count(ptr as _); + } } #[no_mangle] -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) +pub extern "C" fn frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_sync_wallets( - port_: i64, - that: *mut wire_cst_ldk_node, +pub extern "C" fn frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + ptr: *const std::ffi::c_void, ) { - wire_ldk_node_sync_wallets_impl(port_, that) + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_total_onchain_balance_sats( - port_: i64, - that: *mut wire_cst_ldk_node, +pub extern "C" fn frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilder( + ptr: *const std::ffi::c_void, ) { - wire_ldk_node_total_onchain_balance_sats_impl(port_, that) + unsafe { + StdArc::::increment_strong_count(ptr as _); + } } #[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, +pub extern "C" fn frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilder( + ptr: *const std::ffi::c_void, ) { - wire_ldk_node_update_channel_config_impl( - port_, - that, - channel_id, - counterparty_node_id, - channel_config, - ) + unsafe { + StdArc::::decrement_strong_count(ptr as _); + } } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_verify_signature( - port_: i64, - 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, +pub extern "C" fn frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraph( + ptr: *const std::ffi::c_void, ) { - wire_ldk_node_verify_signature_impl(port_, that, msg, sig, pkey) + unsafe { + StdArc::::increment_strong_count(ptr as _); + } } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_ldk_node_wait_next_event( - port_: i64, - that: *mut wire_cst_ldk_node, +pub extern "C" fn frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraph( + ptr: *const std::ffi::c_void, ) { - wire_ldk_node_wait_next_event_impl(port_, that) + unsafe { + StdArc::::decrement_strong_count(ptr as _); + } } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_socket_address_as_string( - port_: i64, - that: *mut wire_cst_socket_address, +pub extern "C" fn frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( + ptr: *const std::ffi::c_void, ) { - wire_socket_address_as_string_impl(port_, that) + unsafe { + StdArc::::increment_strong_count(ptr as _); + } } #[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, +pub extern "C" fn frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::::decrement_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::::increment_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( + ptr: *const std::ffi::c_void, ) { - wire_socket_address_from_str_impl(port_, address) + unsafe { + StdArc::::decrement_strong_count(ptr as _); + } } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore( +pub extern "C" fn frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( ptr: *const std::ffi::c_void, ) { unsafe { - StdArc::>::increment_strong_count(ptr as _); + StdArc::::increment_strong_count(ptr as _); } } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore( +pub extern "C" fn frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( ptr: *const std::ffi::c_void, ) { unsafe { - StdArc::>::decrement_strong_count(ptr as _); + StdArc::::decrement_strong_count(ptr as _); } } @@ -1327,6 +3030,14 @@ pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_address() -> *mut wire_cst flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_address::new_with_null_ptr()) } +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_anchor_channels_config( +) -> *mut wire_cst_anchor_channels_config { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_anchor_channels_config::new_with_null_ptr(), + ) +} + #[no_mangle] pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_bolt_11_invoice( ) -> *mut wire_cst_bolt_11_invoice { @@ -1335,6 +3046,14 @@ pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_bolt_11_invoice( ) } +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_bolt_12_parse_error( +) -> *mut wire_cst_bolt_12_parse_error { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_bolt_12_parse_error::new_with_null_ptr(), + ) +} + #[no_mangle] pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_chain_data_source_config( ) -> *mut wire_cst_chain_data_source_config { @@ -1356,11 +3075,37 @@ 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_channel_info() -> *mut wire_cst_channel_info { + flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_channel_info::new_with_null_ptr()) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_channel_update_info( +) -> *mut wire_cst_channel_update_info { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_channel_update_info::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()) } +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_decode_error() -> *mut wire_cst_decode_error { + flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_decode_error::new_with_null_ptr()) +} + #[no_mangle] pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_entropy_source_config( ) -> *mut wire_cst_entropy_source_config { @@ -1382,16 +3127,108 @@ 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_ldk_bolt_11_payment( +) -> *mut wire_cst_ldk_bolt_11_payment { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_ldk_bolt_11_payment::new_with_null_ptr(), + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_ldk_bolt_12_payment( +) -> *mut wire_cst_ldk_bolt_12_payment { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_ldk_bolt_12_payment::new_with_null_ptr(), + ) +} + #[no_mangle] 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_ldk_network_graph( +) -> *mut wire_cst_ldk_network_graph { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_ldk_network_graph::new_with_null_ptr(), + ) +} + #[no_mangle] 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] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_ldk_on_chain_payment( +) -> *mut wire_cst_ldk_on_chain_payment { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_ldk_on_chain_payment::new_with_null_ptr(), + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_ldk_spontaneous_payment( +) -> *mut wire_cst_ldk_spontaneous_payment { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_ldk_spontaneous_payment::new_with_null_ptr(), + ) +} + +#[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(), + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_lsp_fee_limits( +) -> *mut wire_cst_lsp_fee_limits { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_lsp_fee_limits::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_node_announcement_info( +) -> *mut wire_cst_node_announcement_info { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_node_announcement_info::new_with_null_ptr(), + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_node_id() -> *mut wire_cst_node_id { + flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_node_id::new_with_null_ptr()) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_node_info() -> *mut wire_cst_node_info { + flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_node_info::new_with_null_ptr()) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_offer() -> *mut wire_cst_offer { + flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_offer::new_with_null_ptr()) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_offer_id() -> *mut wire_cst_offer_id { + flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_offer_id::new_with_null_ptr()) +} + #[no_mangle] pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_out_point() -> *mut wire_cst_out_point { flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_out_point::new_with_null_ptr()) @@ -1405,11 +3242,23 @@ 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()) } +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_payment_id() -> *mut wire_cst_payment_id { + flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_payment_id::new_with_null_ptr()) +} + #[no_mangle] pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_payment_preimage( ) -> *mut wire_cst_payment_preimage { @@ -1431,6 +3280,11 @@ pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_public_key() -> *mut wire_ flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_public_key::new_with_null_ptr()) } +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_refund() -> *mut wire_cst_refund { + flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_refund::new_with_null_ptr()) +} + #[no_mangle] pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_socket_address( ) -> *mut wire_cst_socket_address { @@ -1439,6 +3293,16 @@ 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) @@ -1471,6 +3335,32 @@ 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_node_id(len: i32) -> *mut wire_cst_list_node_id { + let wrap = wire_cst_list_node_id { + 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, @@ -1499,6 +3389,31 @@ 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_64_strict( + len: i32, +) -> *mut wire_cst_list_prim_u_64_strict { + let ans = wire_cst_list_prim_u_64_strict { + ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr(Default::default(), len), + len, + }; + flutter_rust_bridge::for_generated::new_leak_box_ptr(ans) +} + #[no_mangle] pub extern "C" fn frbgen_ldk_node_cst_new_list_prim_u_8_loose( len: i32, @@ -1548,16 +3463,77 @@ pub extern "C" fn frbgen_ldk_node_cst_new_list_socket_address( }; flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) } - + +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_address { + s: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_anchor_channels_config { + trusted_peers_no_reserve: *mut wire_cst_list_public_key, + per_channel_reserve_sats: u64, +} +#[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, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_bolt_12_invoice { + data: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_bolt_12_parse_error { + tag: i32, + kind: Bolt12ParseErrorKind, +} #[repr(C)] #[derive(Clone, Copy)] -pub struct wire_cst_address { - s: *mut wire_cst_list_prim_u_8_strict, +pub union Bolt12ParseErrorKind { + Bech32: wire_cst_Bolt12ParseError_Bech32, + Decode: wire_cst_Bolt12ParseError_Decode, + InvalidSemantics: wire_cst_Bolt12ParseError_InvalidSemantics, + InvalidSignature: wire_cst_Bolt12ParseError_InvalidSignature, + nil__: (), } #[repr(C)] #[derive(Clone, Copy)] -pub struct wire_cst_bolt_11_invoice { - signed_raw_invoice: *mut wire_cst_list_prim_u_8_strict, +pub struct wire_cst_Bolt12ParseError_Bech32 { + field0: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_Bolt12ParseError_Decode { + field0: *mut wire_cst_decode_error, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_Bolt12ParseError_InvalidSemantics { + field0: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_Bolt12ParseError_InvalidSignature { + field0: *mut wire_cst_list_prim_u_8_strict, } #[repr(C)] #[derive(Clone, Copy)] @@ -1582,7 +3558,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: wire_cst_max_dust_htlc_exposure, + max_dust_htlc_exposure: *mut wire_cst_max_dust_htlc_exposure, force_close_avoidance_max_fee_satoshis: u64, accept_underpaying_htlcs: bool, } @@ -1591,12 +3567,11 @@ 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_list_prim_u_8_strict, + funding_txo: *mut wire_cst_out_point, 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, @@ -1605,6 +3580,19 @@ 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)] @@ -1613,6 +3601,48 @@ pub struct wire_cst_channel_id { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_channel_info { + node_one: wire_cst_node_id, + one_to_two: *mut wire_cst_channel_update_info, + node_two: wire_cst_node_id, + two_to_one: *mut wire_cst_channel_update_info, + capacity_sats: *mut u64, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_channel_update_info { + last_update: u32, + enabled: bool, + cltv_expiry_delta: u16, + htlc_minimum_msat: u64, + htlc_maximum_msat: u64, + fees: wire_cst_routing_fees, +} +#[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, @@ -1625,6 +3655,24 @@ pub struct wire_cst_config { trusted_peers_0conf: *mut wire_cst_list_public_key, probing_liquidity_limit_multiplier: u64, log_level: i32, + anchor_channels_config: *mut wire_cst_anchor_channels_config, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_decode_error { + tag: i32, + kind: DecodeErrorKind, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub union DecodeErrorKind { + Io: wire_cst_DecodeError_Io, + nil__: (), +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_DecodeError_Io { + field0: *mut wire_cst_list_prim_u_8_strict, } #[repr(C)] #[derive(Clone, Copy)] @@ -1665,52 +3713,67 @@ pub struct wire_cst_event { #[repr(C)] #[derive(Clone, Copy)] pub union EventKind { + PaymentClaimable: wire_cst_Event_PaymentClaimable, 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_PaymentClaimable { + payment_id: *mut wire_cst_payment_id, + payment_hash: *mut wire_cst_payment_hash, + claimable_amount_msat: u64, + claim_deadline: *mut u32, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_Event_PaymentSuccessful { + payment_id: *mut wire_cst_payment_id, payment_hash: *mut wire_cst_payment_hash, + fee_paid_msat: *mut u64, } #[repr(C)] #[derive(Clone, Copy)] pub struct wire_cst_Event_PaymentFailed { + payment_id: *mut wire_cst_payment_id, payment_hash: *mut wire_cst_payment_hash, + reason: *mut i32, } #[repr(C)] #[derive(Clone, Copy)] pub struct wire_cst_Event_PaymentReceived { + payment_id: *mut wire_cst_payment_id, payment_hash: *mut wire_cst_payment_hash, amount_msat: u64, } #[repr(C)] #[derive(Clone, Copy)] -pub struct wire_cst_Event_ChannelReady { +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, + funding_txo: *mut wire_cst_out_point, } #[repr(C)] #[derive(Clone, Copy)] -pub struct wire_cst_Event_ChannelClosed { +pub struct wire_cst_Event_ChannelReady { 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_ChannelPending { +pub struct wire_cst_Event_ChannelClosed { 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, + reason: *mut wire_cst_closure_reason, } #[repr(C)] #[derive(Clone, Copy)] @@ -1731,22 +3794,155 @@ pub struct wire_cst_GossipSourceConfig_RapidGossipSync { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_ldk_bolt_11_payment { + ptr: usize, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_ldk_bolt_12_payment { + ptr: usize, +} +#[repr(C)] +#[derive(Clone, Copy)] 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_ldk_network_graph { + ptr: usize, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_ldk_node { ptr: usize, } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_ldk_node_error { + tag: i32, + kind: LdkNodeErrorKind, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub union LdkNodeErrorKind { + Decode: wire_cst_LdkNodeError_Decode, + Bolt12Parse: wire_cst_LdkNodeError_Bolt12Parse, + nil__: (), +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_LdkNodeError_Decode { + field0: *mut wire_cst_decode_error, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_LdkNodeError_Bolt12Parse { + field0: *mut wire_cst_bolt_12_parse_error, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_ldk_on_chain_payment { + ptr: usize, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_ldk_spontaneous_payment { + ptr: usize, +} +#[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, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_liquidity_source_config { + lsps2_service: wire_cst_record_socket_address_public_key_opt_string, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_list_channel_details { ptr: *mut wire_cst_channel_details, len: i32, } #[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_node_id { + ptr: *mut wire_cst_node_id, + len: i32, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_list_payment_details { ptr: *mut wire_cst_payment_details, len: i32, @@ -1759,6 +3955,18 @@ 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_64_strict { + ptr: *mut u64, + len: i32, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_list_prim_u_8_loose { ptr: *mut u8, len: i32, @@ -1783,6 +3991,12 @@ pub struct wire_cst_list_socket_address { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_lsp_fee_limits { + max_total_opening_fee_msat: *mut u64, + max_proportional_opening_fee_ppm_msat: *mut u64, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_max_dust_htlc_exposure { tag: i32, kind: MaxDustHTLCExposureKind, @@ -1806,6 +4020,46 @@ pub struct wire_cst_MaxDustHTLCExposure_FeeRateMultiplier { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_node_announcement_info { + last_update: u32, + alias: *mut wire_cst_list_prim_u_8_strict, + addresses: *mut wire_cst_list_socket_address, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_node_id { + compressed: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_node_info { + channels: *mut wire_cst_list_prim_u_64_strict, + announcement_info: *mut wire_cst_node_announcement_info, +} +#[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_offer { + s: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_offer_id { + field0: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_out_point { txid: wire_cst_txid, vout: u32, @@ -1813,9 +4067,8 @@ pub struct wire_cst_out_point { #[repr(C)] #[derive(Clone, Copy)] pub struct wire_cst_payment_details { - hash: wire_cst_payment_hash, - preimage: *mut wire_cst_payment_preimage, - secret: *mut wire_cst_payment_secret, + id: wire_cst_payment_id, + kind: wire_cst_payment_kind, amount_msat: *mut u64, direction: i32, status: i32, @@ -1827,6 +4080,63 @@ pub struct wire_cst_payment_hash { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_payment_id { + field0: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_payment_kind { + tag: i32, + kind: PaymentKindKind, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub union PaymentKindKind { + Bolt11: wire_cst_PaymentKind_Bolt11, + Bolt11Jit: wire_cst_PaymentKind_Bolt11Jit, + Spontaneous: wire_cst_PaymentKind_Spontaneous, + Bolt12Offer: wire_cst_PaymentKind_Bolt12Offer, + Bolt12Refund: wire_cst_PaymentKind_Bolt12Refund, + nil__: (), +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_PaymentKind_Bolt11 { + hash: *mut wire_cst_payment_hash, + preimage: *mut wire_cst_payment_preimage, + secret: *mut wire_cst_payment_secret, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_PaymentKind_Bolt11Jit { + hash: *mut wire_cst_payment_hash, + preimage: *mut wire_cst_payment_preimage, + secret: *mut wire_cst_payment_secret, + lsp_fee_limits: *mut wire_cst_lsp_fee_limits, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_PaymentKind_Spontaneous { + hash: *mut wire_cst_payment_hash, + preimage: *mut wire_cst_payment_preimage, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_PaymentKind_Bolt12Offer { + hash: *mut wire_cst_payment_hash, + preimage: *mut wire_cst_payment_preimage, + secret: *mut wire_cst_payment_secret, + offer_id: *mut wire_cst_offer_id, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_PaymentKind_Bolt12Refund { + hash: *mut wire_cst_payment_hash, + preimage: *mut wire_cst_payment_preimage, + secret: *mut wire_cst_payment_secret, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_payment_preimage { data: *mut wire_cst_list_prim_u_8_strict, } @@ -1844,11 +4154,66 @@ 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: *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, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_refund { + s: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_routing_fees { + base_msat: u32, + proportional_millionths: u32, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_socket_address { tag: i32, kind: SocketAddressKind, @@ -1902,5 +4267,5 @@ pub struct wire_cst_txid { #[repr(C)] #[derive(Clone, Copy)] pub struct wire_cst_user_channel_id { - data: u64, + data: *mut wire_cst_list_prim_u_8_strict, } diff --git a/rust/src/frb_generated.rs b/rust/src/frb_generated.rs index 1478aaa..025f9e4 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.31. +// Generated by `flutter_rust_bridge`@ 2.0.0. #![allow( non_camel_case_types, @@ -14,14 +14,23 @@ clippy::double_parens, clippy::let_and_return, clippy::too_many_arguments, - clippy::match_single_binding + clippy::match_single_binding, + clippy::clone_on_copy, + clippy::let_unit_value, + clippy::deref_addrof, + clippy::explicit_auto_deref, + clippy::borrow_deref_ref, + clippy::needless_borrow )] // Section: imports +use crate::api::bolt12::*; +use crate::api::builder::*; use crate::api::node::*; +use crate::*; use flutter_rust_bridge::for_generated::byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt}; -use flutter_rust_bridge::for_generated::transform_result_dco; +use flutter_rust_bridge::for_generated::{transform_result_dco, Lifetimeable, Lockable}; use flutter_rust_bridge::{Handler, IntoIntoDart}; // Section: boilerplate @@ -31,7 +40,8 @@ flutter_rust_bridge::frb_generated_boilerplate!( default_rust_opaque = RustOpaqueNom, default_rust_auto_opaque = RustAutoOpaqueNom, ); -pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.0.0-dev.31"; +pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.0.0"; +pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = 1761952349; // Section: executor @@ -39,1150 +49,4074 @@ flutter_rust_bridge::frb_generated_default_handler!(); // Section: wire_funcs -fn wire_build_with_sqlite_store_impl( +fn wire__crate__api__bolt11__ldk_bolt_11_payment_claim_for_hash_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>, + that: impl CstDecode, + payment_hash: impl CstDecode, + claimable_amount_msat: impl CstDecode, + preimage: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "build_with_sqlite_store", + debug_name: "ldk_bolt_11_payment_claim_for_hash", 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_that = that.cst_decode(); + let api_payment_hash = payment_hash.cst_decode(); + let api_claimable_amount_msat = claimable_amount_msat.cst_decode(); + let api_preimage = preimage.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::build_with_sqlite_store( - api_config, - api_chain_data_source_config, - api_entropy_source_config, - api_gossip_source_config, - ) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt11::LdkBolt11Payment::claim_for_hash( + &api_that, + api_payment_hash, + api_claimable_amount_msat, + api_preimage, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_mnemonic_generate_impl(port_: flutter_rust_bridge::for_generated::MessagePort) { +fn wire__crate__api__bolt11__ldk_bolt_11_payment_fail_for_hash_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode, + payment_hash: impl CstDecode, +) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_mnemonic_generate", + debug_name: "ldk_bolt_11_payment_fail_for_hash", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { + let api_that = that.cst_decode(); + let api_payment_hash = payment_hash.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkMnemonic::generate()) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt11::LdkBolt11Payment::fail_for_hash( + &api_that, + api_payment_hash, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_close_channel_impl( +fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - channel_id: impl CstDecode, - counterparty_node_id: impl CstDecode, + 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: "ldk_node_close_channel", + debug_name: "ldk_bolt_11_payment_receive", 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(); + 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::LdkNode::close_channel( + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt11::LdkBolt11Payment::receive( &api_that, - api_channel_id, - api_counterparty_node_id, - ) - })()) + api_amount_msat, + api_description, + api_expiry_secs, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_connect_impl( +fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_for_hash_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - node_id: impl CstDecode, - address: impl CstDecode, - persist: impl CstDecode, + that: impl CstDecode, + payment_hash: 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: "ldk_node_connect", + debug_name: "ldk_bolt_11_payment_receive_for_hash", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_node_id = node_id.cst_decode(); - let api_address = address.cst_decode(); - let api_persist = persist.cst_decode(); + let api_payment_hash = payment_hash.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::LdkNode::connect( + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt11::LdkBolt11Payment::receive_for_hash( &api_that, - api_node_id, - api_address, - api_persist, - ) - })()) + api_payment_hash, + api_amount_msat, + api_description, + api_expiry_secs, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_connect_open_channel_impl( +fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - socket_address: impl CstDecode, - node_id: impl CstDecode, - channel_amount_sats: impl CstDecode, - push_to_counterparty_msat: impl CstDecode>, - announce_channel: impl CstDecode, - channel_config: impl CstDecode>, + that: impl CstDecode, + description: impl CstDecode, + expiry_secs: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_connect_open_channel", + debug_name: "ldk_bolt_11_payment_receive_variable_amount", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.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(); - let api_announce_channel = announce_channel.cst_decode(); - let api_channel_config = channel_config.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::LdkNode::connect_open_channel( + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt11::LdkBolt11Payment::receive_variable_amount( &api_that, - api_socket_address, - api_node_id, - api_channel_amount_sats, - api_push_to_counterparty_msat, - api_announce_channel, - api_channel_config, - ) - })()) + api_description, + api_expiry_secs, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_disconnect_impl( +fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_for_hash_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - counterparty_node_id: impl CstDecode, + that: impl CstDecode, + description: impl CstDecode, + expiry_secs: impl CstDecode, + payment_hash: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_disconnect", + debug_name: "ldk_bolt_11_payment_receive_variable_amount_for_hash", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_counterparty_node_id = counterparty_node_id.cst_decode(); + let api_description = description.cst_decode(); + let api_expiry_secs = expiry_secs.cst_decode(); + let api_payment_hash = payment_hash.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::disconnect(&api_that, api_counterparty_node_id) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = + crate::api::bolt11::LdkBolt11Payment::receive_variable_amount_for_hash( + &api_that, + api_description, + api_expiry_secs, + api_payment_hash, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_event_handled_impl( +fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel_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: "ldk_bolt_11_payment_receive_variable_amount_via_jit_channel", 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();let api_max_proportional_lsp_fee_limit_ppm_msat = max_proportional_lsp_fee_limit_ppm_msat.cst_decode(); move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt11::LdkBolt11Payment::receive_variable_amount_via_jit_channel(&api_that, api_description, api_expiry_secs, api_max_proportional_lsp_fee_limit_ppm_msat)?; Ok(output_ok) + })()) + } }) +} +fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + 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: "ldk_node_event_handled", + debug_name: "ldk_bolt_11_payment_receive_via_jit_channel", 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(); + let api_max_total_lsp_fee_limit_msat = max_total_lsp_fee_limit_msat.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::event_handled(&api_that)) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt11::LdkBolt11Payment::receive_via_jit_channel( + &api_that, + api_amount_msat, + api_description, + api_expiry_secs, + api_max_total_lsp_fee_limit_msat, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_is_running_impl( +fn wire__crate__api__bolt11__ldk_bolt_11_payment_send_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: "ldk_node_is_running", + debug_name: "ldk_bolt_11_payment_send", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); + let api_invoice = invoice.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::is_running(&api_that)) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = + crate::api::bolt11::LdkBolt11Payment::send(&api_that, api_invoice)?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_list_channels_impl( +fn wire__crate__api__bolt11__ldk_bolt_11_payment_send_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: "ldk_node_list_channels", + debug_name: "ldk_bolt_11_payment_send_probes", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); + let api_invoice = invoice.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::list_channels(&api_that)) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = + crate::api::bolt11::LdkBolt11Payment::send_probes(&api_that, api_invoice)?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_list_payments_impl( +fn wire__crate__api__bolt11__ldk_bolt_11_payment_send_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: "ldk_node_list_payments", + debug_name: "ldk_bolt_11_payment_send_probes_using_amount", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); + let api_invoice = invoice.cst_decode(); + let api_amount_msat = amount_msat.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::list_payments(&api_that)) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt11::LdkBolt11Payment::send_probes_using_amount( + &api_that, + api_invoice, + api_amount_msat, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_list_payments_with_filter_impl( +fn wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - payment_direction: 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: "ldk_node_list_payments_with_filter", + debug_name: "ldk_bolt_11_payment_send_using_amount", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_payment_direction = payment_direction.cst_decode(); + let api_invoice = invoice.cst_decode(); + let api_amount_msat = amount_msat.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::list_payments_with_filter( + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt11::LdkBolt11Payment::send_using_amount( &api_that, - api_payment_direction, - )) - })()) + api_invoice, + api_amount_msat, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_list_peers_impl( +fn wire__crate__api__bolt12__ldk_bolt_12_payment_initiate_refund_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, + amount_msat: impl CstDecode, + expiry_secs: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_list_peers", + debug_name: "ldk_bolt_12_payment_initiate_refund", 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_expiry_secs = expiry_secs.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::list_peers(&api_that)) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt12::LdkBolt12Payment::initiate_refund( + &api_that, + api_amount_msat, + api_expiry_secs, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_listening_addresses_impl( +fn wire__crate__api__bolt12__ldk_bolt_12_payment_receive_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, + amount_msat: impl CstDecode, + description: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_listening_addresses", + debug_name: "ldk_bolt_12_payment_receive", 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(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::listening_addresses(&api_that)) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt12::LdkBolt12Payment::receive( + &api_that, + api_amount_msat, + api_description, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_new_onchain_address_impl( +fn wire__crate__api__bolt12__ldk_bolt_12_payment_receive_variable_amount_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, + description: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_new_onchain_address", + debug_name: "ldk_bolt_12_payment_receive_variable_amount", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); + let api_description = description.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::new_onchain_address(&api_that) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt12::LdkBolt12Payment::receive_variable_amount( + &api_that, + api_description, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_next_event_impl( +fn wire__crate__api__bolt12__ldk_bolt_12_payment_request_refund_payment_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, + refund: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_next_event", + debug_name: "ldk_bolt_12_payment_request_refund_payment", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); + let api_refund = refund.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::next_event(&api_that)) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt12::LdkBolt12Payment::request_refund_payment( + &api_that, api_refund, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_node_id_impl( +fn wire__crate__api__bolt12__ldk_bolt_12_payment_send_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, + offer: impl CstDecode, + payer_note: impl CstDecode>, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_node_id", + debug_name: "ldk_bolt_12_payment_send", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); + let api_offer = offer.cst_decode(); + let api_payer_note = payer_note.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::node_id(&api_that)) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt12::LdkBolt12Payment::send( + &api_that, + api_offer, + api_payer_note, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_payment_impl( +fn wire__crate__api__bolt12__ldk_bolt_12_payment_send_using_amount_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - payment_hash: impl CstDecode, + that: impl CstDecode, + offer: impl CstDecode, + payer_note: impl CstDecode>, + amount_msat: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_payment", + debug_name: "ldk_bolt_12_payment_send_using_amount", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_payment_hash = payment_hash.cst_decode(); + let api_offer = offer.cst_decode(); + let api_payer_note = payer_note.cst_decode(); + let api_amount_msat = amount_msat.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::LdkNode::payment( + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::bolt12::LdkBolt12Payment::send_using_amount( &api_that, - api_payment_hash, - )) - })()) + api_offer, + api_payer_note, + api_amount_msat, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_receive_payment_impl( +fn wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "NodeBuilder_auto_accessor_get_builder", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + transform_result_dco::<_, _, ()>((move || { + let mut api_that_guard = None; + let decode_indices_ = + flutter_rust_bridge::for_generated::lockable_compute_decode_order(vec![ + flutter_rust_bridge::for_generated::LockableOrderInfo::new( + &api_that, 0, false, + ), + ]); + for i in decode_indices_ { + match i { + 0 => api_that_guard = Some(api_that.lockable_decode_sync_ref()), + _ => unreachable!(), + } + } + let api_that_guard = api_that_guard.unwrap(); + let output_ok = Result::<_, ()>::Ok(api_that_guard.builder.clone())?; + Ok(output_ok) + })()) + }, + ) +} +fn wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, + builder: impl CstDecode>, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "NodeBuilder_auto_accessor_set_builder", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + let api_builder = builder.cst_decode(); + transform_result_dco::<_, _, ()>((move || { + let mut api_that_guard = None; + let decode_indices_ = + flutter_rust_bridge::for_generated::lockable_compute_decode_order(vec![ + flutter_rust_bridge::for_generated::LockableOrderInfo::new( + &api_that, 0, true, + ), + ]); + for i in decode_indices_ { + match i { + 0 => api_that_guard = Some(api_that.lockable_decode_sync_ref_mut()), + _ => unreachable!(), + } + } + let mut api_that_guard = api_that_guard.unwrap(); + let output_ok = Result::<_, ()>::Ok({ + { + api_that_guard.builder = api_builder; + }; + })?; + Ok(output_ok) + })()) + }, + ) +} +fn wire__crate__api__builder__NodeBuilder_build_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - amount_msat: impl CstDecode, - description: impl CstDecode, - expiry_secs: impl CstDecode, + that: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_receive_payment", + debug_name: "NodeBuilder_build", 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::LdkNode::receive_payment( - &api_that, - api_amount_msat, - api_description, - api_expiry_secs, - ) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkBuilderError>((move || { + let output_ok = crate::api::builder::NodeBuilder::build(api_that)?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_receive_variable_amount_payment_impl( +fn wire__crate__api__builder__NodeBuilder_build_with_fs_store_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - description: impl CstDecode, - expiry_secs: impl CstDecode, + that: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_receive_variable_amount_payment", + debug_name: "NodeBuilder_build_with_fs_store", 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::LdkNode::receive_variable_amount_payment( - &api_that, - api_description, - api_expiry_secs, - ) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkBuilderError>((move || { + let output_ok = + crate::api::builder::NodeBuilder::build_with_fs_store(api_that)?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_remove_payment_impl( +fn wire__crate__api__builder__NodeBuilder_create_builder_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - payment_hash: impl CstDecode, + config: impl CstDecode, + chain_data_source_config: impl CstDecode>, + entropy_source_config: impl CstDecode>, + gossip_source_config: impl CstDecode>, + liquidity_source_config: impl CstDecode>, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_remove_payment", + debug_name: "NodeBuilder_create_builder", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { - let api_that = that.cst_decode(); - let api_payment_hash = payment_hash.cst_decode(); + 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(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::remove_payment(&api_that, api_payment_hash) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkBuilderError>((move || { + let output_ok = crate::api::builder::NodeBuilder::create_builder( + api_config, + api_chain_data_source_config, + api_entropy_source_config, + api_gossip_source_config, + api_liquidity_source_config, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_send_all_to_onchain_address_impl( +fn wire__crate__api__builder__ldk_mnemonic_generate_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - address: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_send_all_to_onchain_address", + 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_address = address.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::send_all_to_onchain_address(&api_that, api_address) + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::builder::LdkMnemonic::generate())?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_send_payment_impl( +fn wire__crate__api__graph__ldk_network_graph_channel_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - invoice: impl CstDecode, + that: impl CstDecode, + short_channel_id: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_send_payment", + debug_name: "ldk_network_graph_channel", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_invoice = invoice.cst_decode(); + let api_short_channel_id = short_channel_id.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::send_payment(&api_that, api_invoice) + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::graph::LdkNetworkGraph::channel( + &api_that, + api_short_channel_id, + ))?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_send_payment_probes_impl( +fn wire__crate__api__graph__ldk_network_graph_list_channels_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - invoice: impl CstDecode, + that: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_send_payment_probes", + debug_name: "ldk_network_graph_list_channels", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_invoice = invoice.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::send_payment_probes(&api_that, api_invoice) + transform_result_dco::<_, _, ()>((move || { + let output_ok = Result::<_, ()>::Ok( + crate::api::graph::LdkNetworkGraph::list_channels(&api_that), + )?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_send_payment_probes_using_amount_impl( +fn wire__crate__api__graph__ldk_network_graph_list_nodes_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - invoice: impl CstDecode, - amount_msat: impl CstDecode, + that: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_send_payment_probes_using_amount", + debug_name: "ldk_network_graph_list_nodes", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_invoice = invoice.cst_decode(); - let api_amount_msat = amount_msat.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::send_payment_probes_using_amount( - &api_that, - api_invoice, - api_amount_msat, - ) + transform_result_dco::<_, _, ()>((move || { + let output_ok = Result::<_, ()>::Ok( + crate::api::graph::LdkNetworkGraph::list_nodes(&api_that), + )?; + Ok(output_ok) + })()) + } + }, + ) +} +fn wire__crate__api__graph__ldk_network_graph_node_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode, + node_id: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ldk_network_graph_node", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_node_id = node_id.cst_decode(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = + crate::api::graph::LdkNetworkGraph::node(&api_that, api_node_id)?; + Ok(output_ok) + })( + )) + } + }, + ) +} +fn wire__crate__api__node__ldk_node_bolt11_payment_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + ptr: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ldk_node_bolt11_payment", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_ptr = ptr.cst_decode(); + move |context| { + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::bolt11_payment(api_ptr))?; + Ok(output_ok) + })()) + } + }, + ) +} +fn wire__crate__api__node__ldk_node_bolt12_payment_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + ptr: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ldk_node_bolt12_payment", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_ptr = ptr.cst_decode(); + move |context| { + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::bolt12_payment(api_ptr))?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_send_payment_using_amount_impl( +fn wire__crate__api__node__ldk_node_close_channel_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, - invoice: impl CstDecode, - amount_msat: impl CstDecode, + user_channel_id: impl CstDecode, + counterparty_node_id: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_send_payment_using_amount", + 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_invoice = invoice.cst_decode(); - let api_amount_msat = amount_msat.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::LdkNode::send_payment_using_amount( + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::close_channel( &api_that, - api_invoice, - api_amount_msat, - ) + api_user_channel_id, + api_counterparty_node_id, + )?; + Ok(output_ok) + })( + )) + } + }, + ) +} +fn wire__crate__api__node__ldk_node_config_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_config", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + move |context| { + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::config(&api_that))?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_send_spontaneous_payment_impl( +fn wire__crate__api__node__ldk_node_connect_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, - amount_msat: 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: "ldk_node_send_spontaneous_payment", + debug_name: "ldk_node_connect", 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_node_id = node_id.cst_decode(); + let api_address = address.cst_decode(); + let api_persist = persist.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::send_spontaneous_payment( + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::connect( &api_that, - api_amount_msat, api_node_id, - ) - })()) + api_address, + api_persist, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_send_spontaneous_payment_probes_impl( +fn wire__crate__api__node__ldk_node_connect_open_channel_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, - amount_msat: impl CstDecode, + socket_address: impl CstDecode, node_id: impl CstDecode, + channel_amount_sats: impl CstDecode, + push_to_counterparty_msat: impl CstDecode>, + announce_channel: impl CstDecode, + channel_config: impl CstDecode>, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_send_spontaneous_payment_probes", + 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_amount_msat = amount_msat.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(); + let api_announce_channel = announce_channel.cst_decode(); + let api_channel_config = channel_config.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::send_spontaneous_payment_probes( + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::connect_open_channel( &api_that, - api_amount_msat, + api_socket_address, api_node_id, - ) - })()) + api_channel_amount_sats, + api_push_to_counterparty_msat, + api_announce_channel, + api_channel_config, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_send_to_onchain_address_impl( +fn wire__crate__api__node__ldk_node_disconnect_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, - address: impl CstDecode, - amount_sats: impl CstDecode, + counterparty_node_id: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_send_to_onchain_address", + debug_name: "ldk_node_disconnect", 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_amount_sats = amount_sats.cst_decode(); + let api_counterparty_node_id = counterparty_node_id.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::send_to_onchain_address( - &api_that, - api_address, - api_amount_sats, - ) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = + crate::api::node::LdkNode::disconnect(&api_that, api_counterparty_node_id)?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_sign_message_impl( +fn wire__crate__api__node__ldk_node_event_handled_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, - msg: impl CstDecode>, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_sign_message", + debug_name: "ldk_node_event_handled", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_msg = msg.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::sign_message(&api_that, api_msg) + transform_result_dco::<_, _, ()>((move || { + let output_ok = Result::<_, ()>::Ok({ + crate::api::node::LdkNode::event_handled(&api_that); + })?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_spendable_onchain_balance_sats_impl( +fn wire__crate__api__node__ldk_node_force_close_channel_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, + user_channel_id: impl CstDecode, + counterparty_node_id: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_spendable_onchain_balance_sats", + debug_name: "ldk_node_force_close_channel", 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::LdkNode::spendable_onchain_balance_sats(&api_that) - })()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::force_close_channel( + &api_that, + api_user_channel_id, + api_counterparty_node_id, + )?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_start_impl( +fn wire__crate__api__node__ldk_node_list_balances_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_start", + debug_name: "ldk_node_list_balances", 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::start(&api_that))()) + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::list_balances(&api_that)?; + Ok(output_ok) + })( + )) } }, ) } -fn wire_ldk_node_stop_impl( +fn wire__crate__api__node__ldk_node_list_channels_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_stop", + debug_name: "ldk_node_list_channels", 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::stop(&api_that))()) + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::list_channels(&api_that))?; + Ok(output_ok) + })()) } }, ) } -fn wire_ldk_node_sync_wallets_impl( +fn wire__crate__api__node__ldk_node_list_payments_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_sync_wallets", + debug_name: "ldk_node_list_payments", 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::sync_wallets(&api_that))()) + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::list_payments(&api_that))?; + Ok(output_ok) + })()) } }, ) } -fn wire_ldk_node_total_onchain_balance_sats_impl( +fn wire__crate__api__node__ldk_node_list_payments_with_filter_impl( port_: flutter_rust_bridge::for_generated::MessagePort, that: impl CstDecode, + payment_direction: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "ldk_node_total_onchain_balance_sats", + debug_name: "ldk_node_list_payments_with_filter", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); + let api_payment_direction = payment_direction.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::total_onchain_balance_sats(&api_that) + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::list_payments_with_filter( + &api_that, + api_payment_direction, + ))?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_update_channel_config_impl( +fn wire__crate__api__node__ldk_node_list_peers_impl( port_: flutter_rust_bridge::for_generated::MessagePort, 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: "ldk_node_update_channel_config", + debug_name: "ldk_node_list_peers", 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(); - let api_channel_config = channel_config.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::update_channel_config( - &api_that, - api_channel_id, - api_counterparty_node_id, - api_channel_config, - ) + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::list_peers(&api_that))?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_verify_signature_impl( +fn wire__crate__api__node__ldk_node_listening_addresses_impl( port_: flutter_rust_bridge::for_generated::MessagePort, 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: "ldk_node_verify_signature", + debug_name: "ldk_node_listening_addresses", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_msg = msg.cst_decode(); - let api_sig = sig.cst_decode(); - let api_pkey = pkey.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::node::LdkNode::verify_signature( - &api_that, api_msg, api_sig, api_pkey, - ) + transform_result_dco::<_, _, ()>((move || { + let output_ok = Result::<_, ()>::Ok( + crate::api::node::LdkNode::listening_addresses(&api_that), + )?; + Ok(output_ok) + })()) + } + }, + ) +} +fn wire__crate__api__node__ldk_node_network_graph_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + ptr: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ldk_node_network_graph", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_ptr = ptr.cst_decode(); + move |context| { + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::network_graph(api_ptr))?; + Ok(output_ok) })()) } }, ) } -fn wire_ldk_node_wait_next_event_impl( +fn wire__crate__api__node__ldk_node_next_event_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_wait_next_event", + debug_name: "ldk_node_next_event", 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::LdkNode::wait_next_event(&api_that)) + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::next_event(&api_that))?; + Ok(output_ok) })()) } }, ) } -fn wire_socket_address_as_string_impl( +fn wire__crate__api__node__ldk_node_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: "ldk_node_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 { + let output_ok = Result::<_, ()>::Ok( + crate::api::node::LdkNode::next_event_async(&api_that).await, + )?; + Ok(output_ok) + })() + .await, + ) + } + }, + ) +} +fn wire__crate__api__node__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: "socket_address_as_string", + debug_name: "ldk_node_node_id", 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::types::SocketAddress::as_string(&api_that)) + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::node_id(&api_that))?; + Ok(output_ok) })()) } }, ) } -fn wire_socket_address_from_str_impl( +fn wire__crate__api__node__ldk_node_on_chain_payment_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - address: impl CstDecode, + ptr: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "socket_address_from_str", + debug_name: "ldk_node_on_chain_payment", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { - let api_address = address.cst_decode(); + let api_ptr = ptr.cst_decode(); move |context| { - transform_result_dco((move || { - crate::api::types::SocketAddress::from_str(api_address) + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::on_chain_payment(api_ptr))?; + Ok(output_ok) })()) } }, ) } - -// Section: dart2rust - -impl CstDecode for bool { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> bool { - self - } +fn wire__crate__api__node__ldk_node_payment_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode, + payment_id: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ldk_node_payment", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_payment_id = payment_id.cst_decode(); + move |context| { + transform_result_dco::<_, _, ()>((move || { + let output_ok = Result::<_, ()>::Ok(crate::api::node::LdkNode::payment( + &api_that, + api_payment_id, + ))?; + Ok(output_ok) + })()) + } + }, + ) } -impl CstDecode for i32 { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::error::BuilderException { - match 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), - } - } +fn wire__crate__api__node__ldk_node_remove_payment_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode, + payment_id: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ldk_node_remove_payment", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_payment_id = payment_id.cst_decode(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = + crate::api::node::LdkNode::remove_payment(&api_that, api_payment_id)?; + Ok(output_ok) + })( + )) + } + }, + ) } -impl CstDecode for i32 { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> i32 { - self - } +fn wire__crate__api__node__ldk_node_sign_message_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode, + msg: impl CstDecode>, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ldk_node_sign_message", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_msg = msg.cst_decode(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::sign_message(&api_that, api_msg)?; + Ok(output_ok) + })( + )) + } + }, + ) } -impl CstDecode for i32 { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::LogLevel { - match self { - 0 => crate::api::types::LogLevel::Gossip, - 1 => crate::api::types::LogLevel::Trace, - 2 => crate::api::types::LogLevel::Debug, - 3 => crate::api::types::LogLevel::Info, - 4 => crate::api::types::LogLevel::Warn, - 5 => crate::api::types::LogLevel::Error, - _ => unreachable!("Invalid variant for LogLevel: {}", self), - } +fn wire__crate__api__node__ldk_node_spontaneous_payment_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + ptr: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ldk_node_spontaneous_payment", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_ptr = ptr.cst_decode(); + move |context| { + transform_result_dco::<_, _, ()>((move || { + let output_ok = Result::<_, ()>::Ok( + crate::api::node::LdkNode::spontaneous_payment(api_ptr), + )?; + Ok(output_ok) + })()) + } + }, + ) +} +fn wire__crate__api__node__ldk_node_start_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_start", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::start(&api_that)?; + Ok(output_ok) + })( + )) + } + }, + ) +} +fn wire__crate__api__node__ldk_node_status_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_status", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + move |context| { + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::status(&api_that))?; + Ok(output_ok) + })()) + } + }, + ) +} +fn wire__crate__api__node__ldk_node_stop_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_stop", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::stop(&api_that)?; + Ok(output_ok) + })( + )) + } + }, + ) +} +fn wire__crate__api__node__ldk_node_sync_wallets_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_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::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::sync_wallets(&api_that)?; + Ok(output_ok) + })( + )) + } + }, + ) +} +fn wire__crate__api__node__ldk_node_update_channel_config_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode, + user_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: "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_counterparty_node_id = counterparty_node_id.cst_decode(); + let api_channel_config = channel_config.cst_decode(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::update_channel_config( + &api_that, + api_user_channel_id, + api_counterparty_node_id, + api_channel_config, + )?; + Ok(output_ok) + })( + )) + } + }, + ) +} +fn wire__crate__api__node__ldk_node_verify_signature_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode, + msg: impl CstDecode>, + sig: impl CstDecode, + public_key: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ldk_node_verify_signature", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_msg = msg.cst_decode(); + let api_sig = sig.cst_decode(); + let api_public_key = public_key.cst_decode(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::node::LdkNode::verify_signature( + &api_that, + api_msg, + api_sig, + api_public_key, + )?; + Ok(output_ok) + })( + )) + } + }, + ) +} +fn wire__crate__api__node__ldk_node_wait_next_event_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_wait_next_event", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + move |context| { + transform_result_dco::<_, _, ()>((move || { + let output_ok = + Result::<_, ()>::Ok(crate::api::node::LdkNode::wait_next_event(&api_that))?; + Ok(output_ok) + })()) + } + }, + ) +} +fn wire__crate__api__on_chain__ldk_on_chain_payment_new_address_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_on_chain_payment_new_address", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = + crate::api::on_chain::LdkOnChainPayment::new_address(&api_that)?; + Ok(output_ok) + })( + )) + } + }, + ) +} +fn wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode, + address: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ldk_on_chain_payment_send_all_to_address", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_address = address.cst_decode(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::on_chain::LdkOnChainPayment::send_all_to_address( + &api_that, + api_address, + )?; + Ok(output_ok) + })( + )) + } + }, + ) +} +fn wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode, + address: impl CstDecode, + amount_sats: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ldk_on_chain_payment_send_to_address", + 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_amount_sats = amount_sats.cst_decode(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::on_chain::LdkOnChainPayment::send_to_address( + &api_that, + api_address, + api_amount_sats, + )?; + Ok(output_ok) + })( + )) + } + }, + ) +} +fn wire__crate__api__spontaneous__ldk_spontaneous_payment_send_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + 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: "ldk_spontaneous_payment_send", + 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_node_id = node_id.cst_decode(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::spontaneous::LdkSpontaneousPayment::send( + &api_that, + api_amount_msat, + api_node_id, + )?; + Ok(output_ok) + })( + )) + } + }, + ) +} +fn wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + 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: "ldk_spontaneous_payment_send_probes", + 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_node_id = node_id.cst_decode(); + move |context| { + transform_result_dco::<_, _, crate::utils::error::LdkNodeError>((move || { + let output_ok = crate::api::spontaneous::LdkSpontaneousPayment::send_probes( + &api_that, + api_amount_msat, + api_node_id, + )?; + Ok(output_ok) + })( + )) + } + }, + ) +} + +// Section: dart2rust + +impl CstDecode for bool { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> 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::types::Network { - match self { - 0 => crate::api::types::Network::Bitcoin, - 1 => crate::api::types::Network::Testnet, - 2 => crate::api::types::Network::Signet, - 3 => crate::api::types::Network::Regtest, - _ => unreachable!("Invalid variant for Network: {}", self), - } + fn cst_decode(self) -> i32 { + 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::NodeException { + fn cst_decode(self) -> crate::utils::error::LdkBuilderError { match 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), + 0 => crate::utils::error::LdkBuilderError::SocketAddressParseError, + 1 => crate::utils::error::LdkBuilderError::InvalidSeedBytes, + 2 => crate::utils::error::LdkBuilderError::InvalidSeedFile, + 3 => crate::utils::error::LdkBuilderError::InvalidSystemTime, + 4 => crate::utils::error::LdkBuilderError::InvalidChannelMonitor, + 5 => crate::utils::error::LdkBuilderError::InvalidListeningAddress, + 6 => crate::utils::error::LdkBuilderError::ReadFailed, + 7 => crate::utils::error::LdkBuilderError::WriteFailed, + 8 => crate::utils::error::LdkBuilderError::StoragePathAccessFailed, + 9 => crate::utils::error::LdkBuilderError::KVStoreSetupFailed, + 10 => crate::utils::error::LdkBuilderError::WalletSetupFailed, + 11 => crate::utils::error::LdkBuilderError::LoggerSetupFailed, + 12 => crate::utils::error::LdkBuilderError::InvalidPublicKey, + _ => unreachable!("Invalid variant for LdkBuilderError: {}", self), } } } -impl CstDecode for i32 { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::PaymentDirection { - match self { - 0 => crate::api::types::PaymentDirection::Inbound, - 1 => crate::api::types::PaymentDirection::Outbound, - _ => unreachable!("Invalid variant for PaymentDirection: {}", self), - } +impl CstDecode for i32 { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::LogLevel { + match self { + 0 => crate::api::types::LogLevel::Gossip, + 1 => crate::api::types::LogLevel::Trace, + 2 => crate::api::types::LogLevel::Debug, + 3 => crate::api::types::LogLevel::Info, + 4 => crate::api::types::LogLevel::Warn, + 5 => crate::api::types::LogLevel::Error, + _ => unreachable!("Invalid variant for LogLevel: {}", self), + } + } +} +impl CstDecode for i32 { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::Network { + match self { + 0 => crate::api::types::Network::Bitcoin, + 1 => crate::api::types::Network::Testnet, + 2 => crate::api::types::Network::Signet, + 3 => crate::api::types::Network::Regtest, + _ => unreachable!("Invalid variant for Network: {}", self), + } + } +} +impl CstDecode for i32 { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::PaymentDirection { + match self { + 0 => crate::api::types::PaymentDirection::Inbound, + 1 => crate::api::types::PaymentDirection::Outbound, + _ => unreachable!("Invalid variant for PaymentDirection: {}", self), + } + } +} +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 { + match self { + 0 => crate::api::types::PaymentStatus::Pending, + 1 => crate::api::types::PaymentStatus::Succeeded, + 2 => crate::api::types::PaymentStatus::Failed, + _ => unreachable!("Invalid variant for PaymentStatus: {}", self), + } + } +} +impl CstDecode for u16 { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> u16 { + self + } +} +impl CstDecode for u32 { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> u32 { + self + } +} +impl CstDecode for u64 { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> u64 { + self + } +} +impl CstDecode for u8 { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> u8 { + self + } +} +impl CstDecode for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> usize { + self + } +} +impl SseDecode for NodeBuilder { + // 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 flutter_rust_bridge::for_generated::rust_auto_opaque_decode_owned(inner); + } +} + +impl SseDecode for RustOpaqueNom> { + // 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 unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode for RustOpaqueNom { + // 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 unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode + for RustOpaqueNom> +{ + // 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 unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode for RustOpaqueNom { + // 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 unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode for RustOpaqueNom { + // 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 unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode for RustOpaqueNom { + // 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 unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode for RustOpaqueNom { + // 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 unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode for RustOpaqueNom { + // 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 unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode for String { + // 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 String::from_utf8(inner).unwrap(); + } +} + +impl SseDecode for crate::api::types::Address { + // 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_s = ::sse_decode(deserializer); + return crate::api::types::Address { s: var_s }; + } +} + +impl SseDecode for crate::api::types::AnchorChannelsConfig { + // 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_trustedPeersNoReserve = + >::sse_decode(deserializer); + let mut var_perChannelReserveSats = ::sse_decode(deserializer); + return crate::api::types::AnchorChannelsConfig { + trusted_peers_no_reserve: var_trustedPeersNoReserve, + per_channel_reserve_sats: var_perChannelReserveSats, + }; + } +} + +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::bolt11::Bolt11Invoice { + // 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_signedRawInvoice = ::sse_decode(deserializer); + return crate::api::bolt11::Bolt11Invoice { + signed_raw_invoice: var_signedRawInvoice, + }; + } +} + +impl SseDecode for crate::api::bolt12::Bolt12Invoice { + // 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); + return crate::api::bolt12::Bolt12Invoice { data: var_data }; + } +} + +impl SseDecode for crate::utils::error::Bolt12ParseError { + // 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 => { + return crate::utils::error::Bolt12ParseError::InvalidContinuation; + } + 1 => { + return crate::utils::error::Bolt12ParseError::InvalidBech32Hrp; + } + 2 => { + let mut var_field0 = ::sse_decode(deserializer); + return crate::utils::error::Bolt12ParseError::Bech32(var_field0); + } + 3 => { + let mut var_field0 = ::sse_decode(deserializer); + return crate::utils::error::Bolt12ParseError::Decode(var_field0); + } + 4 => { + let mut var_field0 = ::sse_decode(deserializer); + return crate::utils::error::Bolt12ParseError::InvalidSemantics(var_field0); + } + 5 => { + let mut var_field0 = ::sse_decode(deserializer); + return crate::utils::error::Bolt12ParseError::InvalidSignature(var_field0); + } + _ => { + unimplemented!(""); + } + } + } +} + +impl SseDecode for bool { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + deserializer.cursor.read_u8().unwrap() != 0 + } +} + +impl SseDecode for crate::api::types::ChainDataSourceConfig { + // 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_field0 = ::sse_decode(deserializer); + return crate::api::types::ChainDataSourceConfig::Esplora(var_field0); + } + _ => { + unimplemented!(""); + } + } + } +} + +impl SseDecode for crate::api::types::ChannelConfig { + // 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_forwardingFeeProportionalMillionths = ::sse_decode(deserializer); + let mut var_forwardingFeeBaseMsat = ::sse_decode(deserializer); + let mut var_cltvExpiryDelta = ::sse_decode(deserializer); + let mut var_maxDustHtlcExposure = + >::sse_decode(deserializer); + let mut var_forceCloseAvoidanceMaxFeeSatoshis = ::sse_decode(deserializer); + let mut var_acceptUnderpayingHtlcs = ::sse_decode(deserializer); + return crate::api::types::ChannelConfig { + forwarding_fee_proportional_millionths: var_forwardingFeeProportionalMillionths, + forwarding_fee_base_msat: var_forwardingFeeBaseMsat, + cltv_expiry_delta: var_cltvExpiryDelta, + max_dust_htlc_exposure: var_maxDustHtlcExposure, + force_close_avoidance_max_fee_satoshis: var_forceCloseAvoidanceMaxFeeSatoshis, + accept_underpaying_htlcs: var_acceptUnderpayingHtlcs, + }; + } +} + +impl SseDecode for crate::api::types::ChannelDetails { + // 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_channelId = ::sse_decode(deserializer); + let mut var_counterpartyNodeId = ::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_outboundCapacityMsat = ::sse_decode(deserializer); + let mut var_inboundCapacityMsat = ::sse_decode(deserializer); + let mut var_confirmationsRequired = >::sse_decode(deserializer); + let mut var_confirmations = >::sse_decode(deserializer); + let mut var_isOutbound = ::sse_decode(deserializer); + 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, + funding_txo: var_fundingTxo, + channel_value_sats: var_channelValueSats, + unspendable_punishment_reserve: var_unspendablePunishmentReserve, + user_channel_id: var_userChannelId, + feerate_sat_per_1000_weight: var_feerateSatPer1000Weight, + outbound_capacity_msat: var_outboundCapacityMsat, + inbound_capacity_msat: var_inboundCapacityMsat, + confirmations_required: var_confirmationsRequired, + confirmations: var_confirmations, + is_outbound: var_isOutbound, + 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, + }; + } +} + +impl SseDecode for crate::api::types::ChannelId { + // 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 = <[u8; 32]>::sse_decode(deserializer); + return crate::api::types::ChannelId { data: var_data }; + } +} + +impl SseDecode for crate::api::graph::ChannelInfo { + // 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_nodeOne = ::sse_decode(deserializer); + let mut var_oneToTwo = + >::sse_decode(deserializer); + let mut var_nodeTwo = ::sse_decode(deserializer); + let mut var_twoToOne = + >::sse_decode(deserializer); + let mut var_capacitySats = >::sse_decode(deserializer); + return crate::api::graph::ChannelInfo { + node_one: var_nodeOne, + one_to_two: var_oneToTwo, + node_two: var_nodeTwo, + two_to_one: var_twoToOne, + capacity_sats: var_capacitySats, + }; + } +} + +impl SseDecode for crate::api::graph::ChannelUpdateInfo { + // 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_lastUpdate = ::sse_decode(deserializer); + let mut var_enabled = ::sse_decode(deserializer); + let mut var_cltvExpiryDelta = ::sse_decode(deserializer); + let mut var_htlcMinimumMsat = ::sse_decode(deserializer); + let mut var_htlcMaximumMsat = ::sse_decode(deserializer); + let mut var_fees = ::sse_decode(deserializer); + return crate::api::graph::ChannelUpdateInfo { + last_update: var_lastUpdate, + enabled: var_enabled, + cltv_expiry_delta: var_cltvExpiryDelta, + htlc_minimum_msat: var_htlcMinimumMsat, + htlc_maximum_msat: var_htlcMaximumMsat, + fees: var_fees, + }; + } +} + +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::LegacyCooperativeClosure; + } + 3 => { + return crate::api::types::ClosureReason::CounterpartyInitiatedCooperativeClosure; + } + 4 => { + return crate::api::types::ClosureReason::LocallyInitiatedCooperativeClosure; + } + 5 => { + return crate::api::types::ClosureReason::CommitmentTxConfirmed; + } + 6 => { + return crate::api::types::ClosureReason::FundingTimedOut; + } + 7 => { + let mut var_err = ::sse_decode(deserializer); + return crate::api::types::ClosureReason::ProcessingError { err: var_err }; + } + 8 => { + return crate::api::types::ClosureReason::DisconnectedPeer; + } + 9 => { + return crate::api::types::ClosureReason::OutdatedChannelManager; + } + 10 => { + return crate::api::types::ClosureReason::CounterpartyCoopClosedUnfundedChannel; + } + 11 => { + return crate::api::types::ClosureReason::FundingBatchClosure; + } + 12 => { + return crate::api::types::ClosureReason::HTLCsTimedOut; + } + _ => { + 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 { + let mut var_storageDirPath = ::sse_decode(deserializer); + let mut var_logDirPath = >::sse_decode(deserializer); + let mut var_network = ::sse_decode(deserializer); + let mut var_listeningAddresses = + >>::sse_decode(deserializer); + let mut var_defaultCltvExpiryDelta = ::sse_decode(deserializer); + let mut var_onchainWalletSyncIntervalSecs = ::sse_decode(deserializer); + let mut var_walletSyncIntervalSecs = ::sse_decode(deserializer); + let mut var_feeRateCacheUpdateIntervalSecs = ::sse_decode(deserializer); + let mut var_trustedPeers0Conf = + >::sse_decode(deserializer); + let mut var_probingLiquidityLimitMultiplier = ::sse_decode(deserializer); + let mut var_logLevel = ::sse_decode(deserializer); + let mut var_anchorChannelsConfig = + >::sse_decode(deserializer); + return crate::api::types::Config { + storage_dir_path: var_storageDirPath, + log_dir_path: var_logDirPath, + network: var_network, + listening_addresses: var_listeningAddresses, + default_cltv_expiry_delta: var_defaultCltvExpiryDelta, + onchain_wallet_sync_interval_secs: var_onchainWalletSyncIntervalSecs, + wallet_sync_interval_secs: var_walletSyncIntervalSecs, + fee_rate_cache_update_interval_secs: var_feeRateCacheUpdateIntervalSecs, + trusted_peers_0conf: var_trustedPeers0Conf, + probing_liquidity_limit_multiplier: var_probingLiquidityLimitMultiplier, + log_level: var_logLevel, + anchor_channels_config: var_anchorChannelsConfig, + }; + } +} + +impl SseDecode for crate::utils::error::DecodeError { + // 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 => { + return crate::utils::error::DecodeError::UnknownVersion; + } + 1 => { + return crate::utils::error::DecodeError::UnknownRequiredFeature; + } + 2 => { + return crate::utils::error::DecodeError::InvalidValue; + } + 3 => { + return crate::utils::error::DecodeError::ShortRead; + } + 4 => { + return crate::utils::error::DecodeError::BadLengthDescriptor; + } + 5 => { + let mut var_field0 = ::sse_decode(deserializer); + return crate::utils::error::DecodeError::Io(var_field0); + } + 6 => { + return crate::utils::error::DecodeError::UnsupportedCompression; + } + 7 => { + return crate::utils::error::DecodeError::DangerousValue; + } + _ => { + unimplemented!(""); + } + } + } +} + +impl SseDecode for crate::api::types::EntropySourceConfig { + // 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_field0 = ::sse_decode(deserializer); + return crate::api::types::EntropySourceConfig::SeedFile(var_field0); + } + 1 => { + let mut var_field0 = <[u8; 64]>::sse_decode(deserializer); + return crate::api::types::EntropySourceConfig::SeedBytes(var_field0); + } + 2 => { + let mut var_mnemonic = ::sse_decode(deserializer); + let mut var_passphrase = >::sse_decode(deserializer); + return crate::api::types::EntropySourceConfig::Bip39Mnemonic { + mnemonic: var_mnemonic, + passphrase: var_passphrase, + }; + } + _ => { + unimplemented!(""); + } + } + } +} + +impl SseDecode for crate::api::types::Event { + // 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_paymentId = ::sse_decode(deserializer); + let mut var_paymentHash = + ::sse_decode(deserializer); + let mut var_claimableAmountMsat = ::sse_decode(deserializer); + let mut var_claimDeadline = >::sse_decode(deserializer); + return crate::api::types::Event::PaymentClaimable { + payment_id: var_paymentId, + payment_hash: var_paymentHash, + claimable_amount_msat: var_claimableAmountMsat, + claim_deadline: var_claimDeadline, + }; + } + 1 => { + let mut var_paymentId = + >::sse_decode(deserializer); + let mut var_paymentHash = + ::sse_decode(deserializer); + let mut var_feePaidMsat = >::sse_decode(deserializer); + return crate::api::types::Event::PaymentSuccessful { + payment_id: var_paymentId, + payment_hash: var_paymentHash, + fee_paid_msat: var_feePaidMsat, + }; + } + 2 => { + let mut var_paymentId = + >::sse_decode(deserializer); + let mut var_paymentHash = + ::sse_decode(deserializer); + let mut var_reason = + >::sse_decode(deserializer); + return crate::api::types::Event::PaymentFailed { + payment_id: var_paymentId, + payment_hash: var_paymentHash, + reason: var_reason, + }; + } + 3 => { + let mut var_paymentId = + >::sse_decode(deserializer); + let mut var_paymentHash = + ::sse_decode(deserializer); + let mut var_amountMsat = ::sse_decode(deserializer); + return crate::api::types::Event::PaymentReceived { + payment_id: var_paymentId, + payment_hash: var_paymentHash, + amount_msat: var_amountMsat, + }; + } + 4 => { + 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 { + channel_id: var_channelId, + user_channel_id: var_userChannelId, + former_temporary_channel_id: var_formerTemporaryChannelId, + counterparty_node_id: var_counterpartyNodeId, + funding_txo: var_fundingTxo, + }; + } + 5 => { + let mut var_channelId = ::sse_decode(deserializer); + let mut var_userChannelId = + ::sse_decode(deserializer); + let mut var_counterpartyNodeId = + >::sse_decode(deserializer); + return crate::api::types::Event::ChannelReady { + channel_id: var_channelId, + user_channel_id: var_userChannelId, + counterparty_node_id: var_counterpartyNodeId, + }; + } + 6 => { + let mut var_channelId = ::sse_decode(deserializer); + let mut var_userChannelId = + ::sse_decode(deserializer); + let mut var_counterpartyNodeId = + >::sse_decode(deserializer); + let mut var_reason = + >::sse_decode(deserializer); + return crate::api::types::Event::ChannelClosed { + channel_id: var_channelId, + user_channel_id: var_userChannelId, + counterparty_node_id: var_counterpartyNodeId, + reason: var_reason, + }; + } + _ => { + unimplemented!(""); + } + } + } +} + +impl SseDecode for crate::api::types::GossipSourceConfig { + // 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 => { + return crate::api::types::GossipSourceConfig::P2PNetwork; + } + 1 => { + let mut var_field0 = ::sse_decode(deserializer); + return crate::api::types::GossipSourceConfig::RapidGossipSync(var_field0); + } + _ => { + unimplemented!(""); + } + } + } +} + +impl SseDecode for i32 { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + deserializer.cursor.read_i32::().unwrap() + } +} + +impl SseDecode for crate::api::bolt11::LdkBolt11Payment { + // 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::bolt11::LdkBolt11Payment { ptr: var_ptr }; + } +} + +impl SseDecode for crate::api::bolt12::LdkBolt12Payment { + // 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::bolt12::LdkBolt12Payment { ptr: var_ptr }; + } +} + +impl SseDecode for crate::utils::error::LdkBuilderError { + // 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::utils::error::LdkBuilderError::SocketAddressParseError, + 1 => crate::utils::error::LdkBuilderError::InvalidSeedBytes, + 2 => crate::utils::error::LdkBuilderError::InvalidSeedFile, + 3 => crate::utils::error::LdkBuilderError::InvalidSystemTime, + 4 => crate::utils::error::LdkBuilderError::InvalidChannelMonitor, + 5 => crate::utils::error::LdkBuilderError::InvalidListeningAddress, + 6 => crate::utils::error::LdkBuilderError::ReadFailed, + 7 => crate::utils::error::LdkBuilderError::WriteFailed, + 8 => crate::utils::error::LdkBuilderError::StoragePathAccessFailed, + 9 => crate::utils::error::LdkBuilderError::KVStoreSetupFailed, + 10 => crate::utils::error::LdkBuilderError::WalletSetupFailed, + 11 => crate::utils::error::LdkBuilderError::LoggerSetupFailed, + 12 => crate::utils::error::LdkBuilderError::InvalidPublicKey, + _ => unreachable!("Invalid variant for LdkBuilderError: {}", inner), + }; + } +} + +impl SseDecode for crate::api::builder::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 var_seedPhrase = ::sse_decode(deserializer); + return crate::api::builder::LdkMnemonic { + seed_phrase: var_seedPhrase, + }; + } +} + +impl SseDecode for crate::api::graph::LdkNetworkGraph { + // 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::graph::LdkNetworkGraph { ptr: var_ptr }; + } +} + +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_ptr = >::sse_decode(deserializer); + return crate::api::node::LdkNode { ptr: var_ptr }; + } +} + +impl SseDecode for crate::utils::error::LdkNodeError { + // 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 => { + return crate::utils::error::LdkNodeError::InvalidTxid; + } + 1 => { + return crate::utils::error::LdkNodeError::AlreadyRunning; + } + 2 => { + return crate::utils::error::LdkNodeError::NotRunning; + } + 3 => { + return crate::utils::error::LdkNodeError::OnchainTxCreationFailed; + } + 4 => { + return crate::utils::error::LdkNodeError::ConnectionFailed; + } + 5 => { + return crate::utils::error::LdkNodeError::InvoiceCreationFailed; + } + 6 => { + return crate::utils::error::LdkNodeError::PaymentSendingFailed; + } + 7 => { + return crate::utils::error::LdkNodeError::ProbeSendingFailed; + } + 8 => { + return crate::utils::error::LdkNodeError::ChannelCreationFailed; + } + 9 => { + return crate::utils::error::LdkNodeError::ChannelClosingFailed; + } + 10 => { + return crate::utils::error::LdkNodeError::ChannelConfigUpdateFailed; + } + 11 => { + return crate::utils::error::LdkNodeError::PersistenceFailed; + } + 12 => { + return crate::utils::error::LdkNodeError::WalletOperationFailed; + } + 13 => { + return crate::utils::error::LdkNodeError::OnchainTxSigningFailed; + } + 14 => { + return crate::utils::error::LdkNodeError::MessageSigningFailed; + } + 15 => { + return crate::utils::error::LdkNodeError::TxSyncFailed; + } + 16 => { + return crate::utils::error::LdkNodeError::GossipUpdateFailed; + } + 17 => { + return crate::utils::error::LdkNodeError::InvalidAddress; + } + 18 => { + return crate::utils::error::LdkNodeError::InvalidSocketAddress; + } + 19 => { + return crate::utils::error::LdkNodeError::InvalidPublicKey; + } + 20 => { + return crate::utils::error::LdkNodeError::InvalidSecretKey; + } + 21 => { + return crate::utils::error::LdkNodeError::InvalidPaymentHash; + } + 22 => { + return crate::utils::error::LdkNodeError::InvalidPaymentPreimage; + } + 23 => { + return crate::utils::error::LdkNodeError::InvalidPaymentSecret; + } + 24 => { + return crate::utils::error::LdkNodeError::InvalidAmount; + } + 25 => { + return crate::utils::error::LdkNodeError::InvalidInvoice; + } + 26 => { + return crate::utils::error::LdkNodeError::InvalidChannelId; + } + 27 => { + return crate::utils::error::LdkNodeError::InvalidNetwork; + } + 28 => { + return crate::utils::error::LdkNodeError::DuplicatePayment; + } + 29 => { + return crate::utils::error::LdkNodeError::InsufficientFunds; + } + 30 => { + return crate::utils::error::LdkNodeError::FeerateEstimationUpdateFailed; + } + 31 => { + return crate::utils::error::LdkNodeError::LiquidityRequestFailed; + } + 32 => { + return crate::utils::error::LdkNodeError::LiquiditySourceUnavailable; + } + 33 => { + return crate::utils::error::LdkNodeError::LiquidityFeeTooHigh; + } + 34 => { + return crate::utils::error::LdkNodeError::InvalidPaymentId; + } + 35 => { + let mut var_field0 = ::sse_decode(deserializer); + return crate::utils::error::LdkNodeError::Decode(var_field0); + } + 36 => { + let mut var_field0 = + ::sse_decode(deserializer); + return crate::utils::error::LdkNodeError::Bolt12Parse(var_field0); + } + 37 => { + return crate::utils::error::LdkNodeError::InvoiceRequestCreationFailed; + } + 38 => { + return crate::utils::error::LdkNodeError::OfferCreationFailed; + } + 39 => { + return crate::utils::error::LdkNodeError::RefundCreationFailed; + } + 40 => { + return crate::utils::error::LdkNodeError::FeerateEstimationUpdateTimeout; + } + 41 => { + return crate::utils::error::LdkNodeError::WalletOperationTimeout; + } + 42 => { + return crate::utils::error::LdkNodeError::TxSyncTimeout; + } + 43 => { + return crate::utils::error::LdkNodeError::GossipUpdateTimeout; + } + 44 => { + return crate::utils::error::LdkNodeError::InvalidOfferId; + } + 45 => { + return crate::utils::error::LdkNodeError::InvalidNodeId; + } + 46 => { + return crate::utils::error::LdkNodeError::InvalidOffer; + } + 47 => { + return crate::utils::error::LdkNodeError::InvalidRefund; + } + 48 => { + return crate::utils::error::LdkNodeError::UnsupportedCurrency; + } + _ => { + unimplemented!(""); + } + } + } +} + +impl SseDecode for crate::api::on_chain::LdkOnChainPayment { + // 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::on_chain::LdkOnChainPayment { ptr: var_ptr }; + } +} + +impl SseDecode for crate::api::spontaneous::LdkSpontaneousPayment { + // 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::spontaneous::LdkSpontaneousPayment { ptr: var_ptr }; + } +} + +impl SseDecode for crate::api::types::LightningBalance { + // 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!(""); + } + } + } +} + +impl SseDecode for crate::api::types::LiquiditySourceConfig { + // 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, + }; + } +} + +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 { + 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 { + 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 { + 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 { + 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 { + 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 { + 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 { + 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 { + 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 { + 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 crate::api::types::LogLevel { + // 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::LogLevel::Gossip, + 1 => crate::api::types::LogLevel::Trace, + 2 => crate::api::types::LogLevel::Debug, + 3 => crate::api::types::LogLevel::Info, + 4 => crate::api::types::LogLevel::Warn, + 5 => crate::api::types::LogLevel::Error, + _ => unreachable!("Invalid variant for LogLevel: {}", inner), + }; + } +} + +impl SseDecode for crate::api::types::LSPFeeLimits { + // 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_maxTotalOpeningFeeMsat = >::sse_decode(deserializer); + let mut var_maxProportionalOpeningFeePpmMsat = >::sse_decode(deserializer); + return crate::api::types::LSPFeeLimits { + max_total_opening_fee_msat: var_maxTotalOpeningFeeMsat, + max_proportional_opening_fee_ppm_msat: var_maxProportionalOpeningFeePpmMsat, + }; + } +} + +impl SseDecode for crate::api::types::MaxDustHTLCExposure { + // 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_field0 = ::sse_decode(deserializer); + return crate::api::types::MaxDustHTLCExposure::FixedLimitMsat(var_field0); + } + 1 => { + let mut var_field0 = ::sse_decode(deserializer); + return crate::api::types::MaxDustHTLCExposure::FeeRateMultiplier(var_field0); + } + _ => { + unimplemented!(""); + } + } + } +} + +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 { + let mut inner = ::sse_decode(deserializer); + return match inner { + 0 => crate::api::types::Network::Bitcoin, + 1 => crate::api::types::Network::Testnet, + 2 => crate::api::types::Network::Signet, + 3 => crate::api::types::Network::Regtest, + _ => unreachable!("Invalid variant for Network: {}", inner), + }; + } +} + +impl SseDecode for crate::api::graph::NodeAnnouncementInfo { + // 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_lastUpdate = ::sse_decode(deserializer); + let mut var_alias = ::sse_decode(deserializer); + let mut var_addresses = >::sse_decode(deserializer); + return crate::api::graph::NodeAnnouncementInfo { + last_update: var_lastUpdate, + alias: var_alias, + addresses: var_addresses, + }; + } +} + +impl SseDecode for crate::api::graph::NodeId { + // 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_compressed = >::sse_decode(deserializer); + return crate::api::graph::NodeId { + compressed: var_compressed, + }; + } +} + +impl SseDecode for crate::api::graph::NodeInfo { + // 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_channels = >::sse_decode(deserializer); + let mut var_announcementInfo = + >::sse_decode(deserializer); + return crate::api::graph::NodeInfo { + channels: var_channels, + announcement_info: var_announcementInfo, + }; + } +} + +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, + }; + } +} + +impl SseDecode for crate::api::bolt12::Offer { + // 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_s = ::sse_decode(deserializer); + return crate::api::bolt12::Offer { s: var_s }; + } +} + +impl SseDecode for crate::api::types::OfferId { + // 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 = <[u8; 32]>::sse_decode(deserializer); + return crate::api::types::OfferId(var_field0); + } +} + +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 { + 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 { + 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 { + 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 { + 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 { + 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 { + 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 { + 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 { + 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 crate::api::types::OutPoint { + // 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_txid = ::sse_decode(deserializer); + let mut var_vout = ::sse_decode(deserializer); + return crate::api::types::OutPoint { + txid: var_txid, + vout: var_vout, + }; + } +} + +impl SseDecode for crate::api::types::PaymentDetails { + // 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_id = ::sse_decode(deserializer); + let mut var_kind = ::sse_decode(deserializer); + let mut var_amountMsat = >::sse_decode(deserializer); + let mut var_direction = ::sse_decode(deserializer); + let mut var_status = ::sse_decode(deserializer); + return crate::api::types::PaymentDetails { + id: var_id, + kind: var_kind, + amount_msat: var_amountMsat, + direction: var_direction, + status: var_status, + }; + } +} + +impl SseDecode for crate::api::types::PaymentDirection { + // 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::PaymentDirection::Inbound, + 1 => crate::api::types::PaymentDirection::Outbound, + _ => unreachable!("Invalid variant for PaymentDirection: {}", inner), + }; + } +} + +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 { + let mut var_data = <[u8; 32]>::sse_decode(deserializer); + return crate::api::types::PaymentHash { data: var_data }; + } +} + +impl SseDecode for crate::api::types::PaymentId { + // 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 = <[u8; 32]>::sse_decode(deserializer); + return crate::api::types::PaymentId(var_field0); + } +} + +impl SseDecode for crate::api::types::PaymentKind { + // 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 => { + return crate::api::types::PaymentKind::Onchain; + } + 1 => { + let mut var_hash = ::sse_decode(deserializer); + let mut var_preimage = + >::sse_decode(deserializer); + let mut var_secret = + >::sse_decode(deserializer); + return crate::api::types::PaymentKind::Bolt11 { + hash: var_hash, + preimage: var_preimage, + secret: var_secret, + }; + } + 2 => { + let mut var_hash = ::sse_decode(deserializer); + let mut var_preimage = + >::sse_decode(deserializer); + let mut var_secret = + >::sse_decode(deserializer); + let mut var_lspFeeLimits = + ::sse_decode(deserializer); + return crate::api::types::PaymentKind::Bolt11Jit { + hash: var_hash, + preimage: var_preimage, + secret: var_secret, + lsp_fee_limits: var_lspFeeLimits, + }; + } + 3 => { + let mut var_hash = ::sse_decode(deserializer); + let mut var_preimage = + >::sse_decode(deserializer); + return crate::api::types::PaymentKind::Spontaneous { + hash: var_hash, + preimage: var_preimage, + }; + } + 4 => { + let mut var_hash = + >::sse_decode(deserializer); + let mut var_preimage = + >::sse_decode(deserializer); + let mut var_secret = + >::sse_decode(deserializer); + let mut var_offerId = ::sse_decode(deserializer); + return crate::api::types::PaymentKind::Bolt12Offer { + hash: var_hash, + preimage: var_preimage, + secret: var_secret, + offer_id: var_offerId, + }; + } + 5 => { + let mut var_hash = + >::sse_decode(deserializer); + let mut var_preimage = + >::sse_decode(deserializer); + let mut var_secret = + >::sse_decode(deserializer); + return crate::api::types::PaymentKind::Bolt12Refund { + hash: var_hash, + preimage: var_preimage, + secret: var_secret, + }; + } + _ => { + unimplemented!(""); + } + } + } +} + +impl SseDecode for crate::api::types::PaymentPreimage { + // 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 = <[u8; 32]>::sse_decode(deserializer); + return crate::api::types::PaymentPreimage { data: var_data }; + } +} + +impl SseDecode for crate::api::types::PaymentSecret { + // 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 = <[u8; 32]>::sse_decode(deserializer); + return crate::api::types::PaymentSecret { data: var_data }; + } +} + +impl SseDecode for crate::api::types::PaymentStatus { + // 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::PaymentStatus::Pending, + 1 => crate::api::types::PaymentStatus::Succeeded, + 2 => crate::api::types::PaymentStatus::Failed, + _ => unreachable!("Invalid variant for PaymentStatus: {}", inner), + }; + } +} + +impl SseDecode for crate::api::types::PeerDetails { + // 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_nodeId = ::sse_decode(deserializer); + let mut var_address = ::sse_decode(deserializer); + let mut var_isConnected = ::sse_decode(deserializer); + return crate::api::types::PeerDetails { + node_id: var_nodeId, + address: var_address, + is_connected: var_isConnected, + }; + } +} + +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_hex = ::sse_decode(deserializer); + return crate::api::types::PublicKey { hex: var_hex }; + } +} + +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); + } +} + +impl SseDecode for crate::api::bolt12::Refund { + // 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_s = ::sse_decode(deserializer); + return crate::api::bolt12::Refund { s: var_s }; + } +} + +impl SseDecode for crate::api::graph::RoutingFees { + // 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_baseMsat = ::sse_decode(deserializer); + let mut var_proportionalMillionths = ::sse_decode(deserializer); + return crate::api::graph::RoutingFees { + base_msat: var_baseMsat, + proportional_millionths: var_proportionalMillionths, + }; + } +} + +impl SseDecode for crate::api::types::SocketAddress { + // 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_addr = <[u8; 4]>::sse_decode(deserializer); + let mut var_port = ::sse_decode(deserializer); + return crate::api::types::SocketAddress::TcpIpV4 { + addr: var_addr, + port: var_port, + }; + } + 1 => { + let mut var_addr = <[u8; 16]>::sse_decode(deserializer); + let mut var_port = ::sse_decode(deserializer); + return crate::api::types::SocketAddress::TcpIpV6 { + addr: var_addr, + port: var_port, + }; + } + 2 => { + let mut var_field0 = <[u8; 12]>::sse_decode(deserializer); + return crate::api::types::SocketAddress::OnionV2(var_field0); + } + 3 => { + let mut var_ed25519Pubkey = <[u8; 32]>::sse_decode(deserializer); + let mut var_checksum = ::sse_decode(deserializer); + let mut var_version = ::sse_decode(deserializer); + let mut var_port = ::sse_decode(deserializer); + return crate::api::types::SocketAddress::OnionV3 { + ed25519_pubkey: var_ed25519Pubkey, + checksum: var_checksum, + version: var_version, + port: var_port, + }; + } + 4 => { + let mut var_addr = ::sse_decode(deserializer); + let mut var_port = ::sse_decode(deserializer); + return crate::api::types::SocketAddress::Hostname { + addr: var_addr, + port: var_port, + }; + } + _ => { + unimplemented!(""); + } + } + } +} + +impl SseDecode for crate::api::types::Txid { + // 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_hash = ::sse_decode(deserializer); + return crate::api::types::Txid { hash: var_hash }; + } +} + +impl SseDecode for u16 { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + deserializer.cursor.read_u16::().unwrap() + } +} + +impl SseDecode for u32 { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + deserializer.cursor.read_u32::().unwrap() + } +} + +impl SseDecode for u64 { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + deserializer.cursor.read_u64::().unwrap() + } +} + +impl SseDecode for u8 { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + deserializer.cursor.read_u8().unwrap() + } +} + +impl SseDecode for [u8; 12] { + // 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 flutter_rust_bridge::for_generated::from_vec_to_array(inner); + } +} + +impl SseDecode for [u8; 16] { + // 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 flutter_rust_bridge::for_generated::from_vec_to_array(inner); + } +} + +impl SseDecode for [u8; 32] { + // 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 flutter_rust_bridge::for_generated::from_vec_to_array(inner); + } +} + +impl SseDecode for [u8; 4] { + // 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 flutter_rust_bridge::for_generated::from_vec_to_array(inner); + } +} + +impl SseDecode for [u8; 64] { + // 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 flutter_rust_bridge::for_generated::from_vec_to_array(inner); + } +} + +impl SseDecode for () { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {} +} + +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); + return crate::api::types::UserChannelId { data: var_data }; + } +} + +impl SseDecode for usize { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + deserializer.cursor.read_u64::().unwrap() as _ + } +} + +fn pde_ffi_dispatcher_primary_impl( + func_id: i32, + port: flutter_rust_bridge::for_generated::MessagePort, + ptr: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, + rust_vec_len: i32, + data_len: i32, +) { + // Codec=Pde (Serialization + dispatch), see doc to use other codecs + match func_id { + _ => unreachable!(), + } +} + +fn pde_ffi_dispatcher_sync_impl( + func_id: i32, + ptr: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, + rust_vec_len: i32, + data_len: i32, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartSse { + // Codec=Pde (Serialization + dispatch), see doc to use other codecs + match func_id { + _ => unreachable!(), + } +} + +// Section: rust2dart + +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for FrbWrapper { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self.0) + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for FrbWrapper {} + +impl flutter_rust_bridge::IntoIntoDart> for NodeBuilder { + fn into_into_dart(self) -> FrbWrapper { + self.into() + } +} + +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::Address { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.s.into_into_dart().into_dart()].into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::Address {} +impl flutter_rust_bridge::IntoIntoDart for crate::api::types::Address { + fn into_into_dart(self) -> crate::api::types::Address { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::AnchorChannelsConfig { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [ + self.trusted_peers_no_reserve.into_into_dart().into_dart(), + self.per_channel_reserve_sats.into_into_dart().into_dart(), + ] + .into_dart() } } -impl CstDecode for i32 { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::PaymentStatus { - match self { - 0 => crate::api::types::PaymentStatus::Pending, - 1 => crate::api::types::PaymentStatus::Succeeded, - 2 => crate::api::types::PaymentStatus::Failed, - _ => unreachable!("Invalid variant for PaymentStatus: {}", self), - } - } +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::AnchorChannelsConfig +{ } -impl CstDecode for u16 { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> u16 { +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::AnchorChannelsConfig +{ + fn into_into_dart(self) -> crate::api::types::AnchorChannelsConfig { self } } -impl CstDecode for u32 { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> u32 { - self +// 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 CstDecode for u64 { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> u64 { +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 } } -impl CstDecode for u8 { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> u8 { - 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 CstDecode for usize { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> usize { +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 } } -impl SseDecode for RustOpaqueNom> { - // 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 unsafe { decode_rust_opaque_nom(inner) }; +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::bolt11::Bolt11Invoice { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.signed_raw_invoice.into_into_dart().into_dart()].into_dart() } } - -impl SseDecode for String { - // 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 String::from_utf8(inner).unwrap(); +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::bolt11::Bolt11Invoice +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::bolt11::Bolt11Invoice +{ + fn into_into_dart(self) -> crate::api::bolt11::Bolt11Invoice { + self } } - -impl SseDecode for crate::api::types::Address { - // 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_s = ::sse_decode(deserializer); - return crate::api::types::Address { s: var_s }; +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::bolt12::Bolt12Invoice { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.data.into_into_dart().into_dart()].into_dart() } } - -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 { - let mut var_signedRawInvoice = ::sse_decode(deserializer); - return crate::api::types::Bolt11Invoice { - signed_raw_invoice: var_signedRawInvoice, - }; +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::bolt12::Bolt12Invoice +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::bolt12::Bolt12Invoice +{ + fn into_into_dart(self) -> crate::api::bolt12::Bolt12Invoice { + self } } - -impl SseDecode for bool { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - deserializer.cursor.read_u8().unwrap() != 0 +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::utils::error::Bolt12ParseError { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + match self { + crate::utils::error::Bolt12ParseError::InvalidContinuation => { + [0.into_dart()].into_dart() + } + crate::utils::error::Bolt12ParseError::InvalidBech32Hrp => [1.into_dart()].into_dart(), + crate::utils::error::Bolt12ParseError::Bech32(field0) => { + [2.into_dart(), field0.into_into_dart().into_dart()].into_dart() + } + crate::utils::error::Bolt12ParseError::Decode(field0) => { + [3.into_dart(), field0.into_into_dart().into_dart()].into_dart() + } + crate::utils::error::Bolt12ParseError::InvalidSemantics(field0) => { + [4.into_dart(), field0.into_into_dart().into_dart()].into_dart() + } + crate::utils::error::Bolt12ParseError::InvalidSignature(field0) => { + [5.into_dart(), field0.into_into_dart().into_dart()].into_dart() + } + _ => { + unimplemented!(""); + } + } } } - -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::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), - }; +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::utils::error::Bolt12ParseError +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::utils::error::Bolt12ParseError +{ + fn into_into_dart(self) -> crate::utils::error::Bolt12ParseError { + self } } - -impl SseDecode for crate::api::types::ChainDataSourceConfig { - // 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_field0 = ::sse_decode(deserializer); - return crate::api::types::ChainDataSourceConfig::Esplora(var_field0); +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::ChainDataSourceConfig { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + match self { + crate::api::types::ChainDataSourceConfig::Esplora(field0) => { + [0.into_dart(), field0.into_into_dart().into_dart()].into_dart() } _ => { unimplemented!(""); @@ -1190,726 +4124,863 @@ impl SseDecode for crate::api::types::ChainDataSourceConfig { } } } - -impl SseDecode for crate::api::types::ChannelConfig { - // 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_forwardingFeeProportionalMillionths = ::sse_decode(deserializer); - let mut var_forwardingFeeBaseMsat = ::sse_decode(deserializer); - let mut var_cltvExpiryDelta = ::sse_decode(deserializer); - let mut var_maxDustHtlcExposure = - ::sse_decode(deserializer); - let mut var_forceCloseAvoidanceMaxFeeSatoshis = ::sse_decode(deserializer); - let mut var_acceptUnderpayingHtlcs = ::sse_decode(deserializer); - return crate::api::types::ChannelConfig { - forwarding_fee_proportional_millionths: var_forwardingFeeProportionalMillionths, - forwarding_fee_base_msat: var_forwardingFeeBaseMsat, - cltv_expiry_delta: var_cltvExpiryDelta, - max_dust_htlc_exposure: var_maxDustHtlcExposure, - force_close_avoidance_max_fee_satoshis: var_forceCloseAvoidanceMaxFeeSatoshis, - accept_underpaying_htlcs: var_acceptUnderpayingHtlcs, - }; +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::ChainDataSourceConfig +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::ChainDataSourceConfig +{ + fn into_into_dart(self) -> crate::api::types::ChainDataSourceConfig { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::ChannelConfig { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [ + self.forwarding_fee_proportional_millionths + .into_into_dart() + .into_dart(), + self.forwarding_fee_base_msat.into_into_dart().into_dart(), + self.cltv_expiry_delta.into_into_dart().into_dart(), + self.max_dust_htlc_exposure.into_into_dart().into_dart(), + self.force_close_avoidance_max_fee_satoshis + .into_into_dart() + .into_dart(), + self.accept_underpaying_htlcs.into_into_dart().into_dart(), + ] + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::ChannelConfig +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::ChannelConfig +{ + fn into_into_dart(self) -> crate::api::types::ChannelConfig { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::ChannelDetails { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [ + self.channel_id.into_into_dart().into_dart(), + self.counterparty_node_id.into_into_dart().into_dart(), + self.funding_txo.into_into_dart().into_dart(), + self.channel_value_sats.into_into_dart().into_dart(), + self.unspendable_punishment_reserve + .into_into_dart() + .into_dart(), + self.user_channel_id.into_into_dart().into_dart(), + self.feerate_sat_per_1000_weight + .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(), + self.confirmations.into_into_dart().into_dart(), + self.is_outbound.into_into_dart().into_dart(), + 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() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::ChannelDetails +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::ChannelDetails +{ + fn into_into_dart(self) -> crate::api::types::ChannelDetails { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::ChannelId { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.data.into_into_dart().into_dart()].into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::ChannelId {} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::ChannelId +{ + fn into_into_dart(self) -> crate::api::types::ChannelId { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::graph::ChannelInfo { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [ + self.node_one.into_into_dart().into_dart(), + self.one_to_two.into_into_dart().into_dart(), + self.node_two.into_into_dart().into_dart(), + self.two_to_one.into_into_dart().into_dart(), + self.capacity_sats.into_into_dart().into_dart(), + ] + .into_dart() } } - -impl SseDecode for crate::api::types::ChannelDetails { - // 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_channelId = ::sse_decode(deserializer); - let mut var_counterpartyNodeId = ::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); - let mut var_confirmations = >::sse_decode(deserializer); - let mut var_isOutbound = ::sse_decode(deserializer); - let mut var_isChannelReady = ::sse_decode(deserializer); - let mut var_isUsable = ::sse_decode(deserializer); - let mut var_isPublic = ::sse_decode(deserializer); - return crate::api::types::ChannelDetails { - channel_id: var_channelId, - counterparty_node_id: var_counterpartyNodeId, - funding_txo: var_fundingTxo, - channel_value_sats: var_channelValueSats, - 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, - confirmations: var_confirmations, - is_outbound: var_isOutbound, - is_channel_ready: var_isChannelReady, - is_usable: var_isUsable, - is_public: var_isPublic, - }; - } +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::graph::ChannelInfo +{ } - -impl SseDecode for crate::api::types::ChannelId { - // 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 = <[u8; 32]>::sse_decode(deserializer); - return crate::api::types::ChannelId { data: var_data }; +impl flutter_rust_bridge::IntoIntoDart + for crate::api::graph::ChannelInfo +{ + fn into_into_dart(self) -> crate::api::graph::ChannelInfo { + self } } - -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 { - let mut var_storageDirPath = ::sse_decode(deserializer); - let mut var_logDirPath = >::sse_decode(deserializer); - let mut var_network = ::sse_decode(deserializer); - let mut var_listeningAddresses = - >>::sse_decode(deserializer); - let mut var_defaultCltvExpiryDelta = ::sse_decode(deserializer); - let mut var_onchainWalletSyncIntervalSecs = ::sse_decode(deserializer); - let mut var_walletSyncIntervalSecs = ::sse_decode(deserializer); - let mut var_feeRateCacheUpdateIntervalSecs = ::sse_decode(deserializer); - let mut var_trustedPeers0Conf = - >::sse_decode(deserializer); - let mut var_probingLiquidityLimitMultiplier = ::sse_decode(deserializer); - let mut var_logLevel = ::sse_decode(deserializer); - return crate::api::types::Config { - storage_dir_path: var_storageDirPath, - log_dir_path: var_logDirPath, - network: var_network, - listening_addresses: var_listeningAddresses, - default_cltv_expiry_delta: var_defaultCltvExpiryDelta, - onchain_wallet_sync_interval_secs: var_onchainWalletSyncIntervalSecs, - wallet_sync_interval_secs: var_walletSyncIntervalSecs, - fee_rate_cache_update_interval_secs: var_feeRateCacheUpdateIntervalSecs, - trusted_peers_0conf: var_trustedPeers0Conf, - probing_liquidity_limit_multiplier: var_probingLiquidityLimitMultiplier, - log_level: var_logLevel, - }; +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::graph::ChannelUpdateInfo { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [ + self.last_update.into_into_dart().into_dart(), + self.enabled.into_into_dart().into_dart(), + self.cltv_expiry_delta.into_into_dart().into_dart(), + self.htlc_minimum_msat.into_into_dart().into_dart(), + self.htlc_maximum_msat.into_into_dart().into_dart(), + self.fees.into_into_dart().into_dart(), + ] + .into_dart() } } - -impl SseDecode for crate::api::types::EntropySourceConfig { - // 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_field0 = ::sse_decode(deserializer); - return crate::api::types::EntropySourceConfig::SeedFile(var_field0); - } - 1 => { - let mut var_field0 = <[u8; 64]>::sse_decode(deserializer); - return crate::api::types::EntropySourceConfig::SeedBytes(var_field0); - } - 2 => { - let mut var_mnemonic = ::sse_decode(deserializer); - let mut var_passphrase = >::sse_decode(deserializer); - return crate::api::types::EntropySourceConfig::Bip39Mnemonic { - mnemonic: var_mnemonic, - passphrase: var_passphrase, - }; - } - _ => { - unimplemented!(""); - } - } +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::graph::ChannelUpdateInfo +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::graph::ChannelUpdateInfo +{ + fn into_into_dart(self) -> crate::api::graph::ChannelUpdateInfo { + self } } - -impl SseDecode for crate::api::types::Event { - // 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_paymentHash = - ::sse_decode(deserializer); - return crate::api::types::Event::PaymentSuccessful { - payment_hash: var_paymentHash, - }; +// 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() } - 1 => { - let mut var_paymentHash = - ::sse_decode(deserializer); - return crate::api::types::Event::PaymentFailed { - payment_hash: var_paymentHash, - }; + crate::api::types::ClosureReason::HolderForceClosed => [1.into_dart()].into_dart(), + crate::api::types::ClosureReason::LegacyCooperativeClosure => { + [2.into_dart()].into_dart() } - 2 => { - let mut var_paymentHash = - ::sse_decode(deserializer); - let mut var_amountMsat = ::sse_decode(deserializer); - return crate::api::types::Event::PaymentReceived { - payment_hash: var_paymentHash, - amount_msat: var_amountMsat, - }; + crate::api::types::ClosureReason::CounterpartyInitiatedCooperativeClosure => { + [3.into_dart()].into_dart() } - 3 => { - let mut var_channelId = ::sse_decode(deserializer); - let mut var_userChannelId = - ::sse_decode(deserializer); - let mut var_counterpartyNodeId = - >::sse_decode(deserializer); - return crate::api::types::Event::ChannelReady { - channel_id: var_channelId, - user_channel_id: var_userChannelId, - counterparty_node_id: var_counterpartyNodeId, - }; + crate::api::types::ClosureReason::LocallyInitiatedCooperativeClosure => { + [4.into_dart()].into_dart() } - 4 => { - let mut var_channelId = ::sse_decode(deserializer); - let mut var_userChannelId = - ::sse_decode(deserializer); - let mut var_counterpartyNodeId = - >::sse_decode(deserializer); - return crate::api::types::Event::ChannelClosed { - channel_id: var_channelId, - user_channel_id: var_userChannelId, - counterparty_node_id: var_counterpartyNodeId, - }; + crate::api::types::ClosureReason::CommitmentTxConfirmed => [5.into_dart()].into_dart(), + crate::api::types::ClosureReason::FundingTimedOut => [6.into_dart()].into_dart(), + crate::api::types::ClosureReason::ProcessingError { err } => { + [7.into_dart(), err.into_into_dart().into_dart()].into_dart() } - 5 => { - 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 { - channel_id: var_channelId, - user_channel_id: var_userChannelId, - former_temporary_channel_id: var_formerTemporaryChannelId, - counterparty_node_id: var_counterpartyNodeId, - funding_txo: var_fundingTxo, - }; + crate::api::types::ClosureReason::DisconnectedPeer => [8.into_dart()].into_dart(), + crate::api::types::ClosureReason::OutdatedChannelManager => [9.into_dart()].into_dart(), + crate::api::types::ClosureReason::CounterpartyCoopClosedUnfundedChannel => { + [10.into_dart()].into_dart() } + crate::api::types::ClosureReason::FundingBatchClosure => [11.into_dart()].into_dart(), + crate::api::types::ClosureReason::HTLCsTimedOut => [12.into_dart()].into_dart(), _ => { unimplemented!(""); } } } } - -impl SseDecode for crate::api::types::GossipSourceConfig { - // 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 => { - return crate::api::types::GossipSourceConfig::P2PNetwork; - } - 1 => { - let mut var_field0 = ::sse_decode(deserializer); - return crate::api::types::GossipSourceConfig::RapidGossipSync(var_field0); +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 { + [ + self.storage_dir_path.into_into_dart().into_dart(), + self.log_dir_path.into_into_dart().into_dart(), + self.network.into_into_dart().into_dart(), + self.listening_addresses.into_into_dart().into_dart(), + self.default_cltv_expiry_delta.into_into_dart().into_dart(), + self.onchain_wallet_sync_interval_secs + .into_into_dart() + .into_dart(), + self.wallet_sync_interval_secs.into_into_dart().into_dart(), + self.fee_rate_cache_update_interval_secs + .into_into_dart() + .into_dart(), + self.trusted_peers_0conf.into_into_dart().into_dart(), + self.probing_liquidity_limit_multiplier + .into_into_dart() + .into_dart(), + self.log_level.into_into_dart().into_dart(), + self.anchor_channels_config.into_into_dart().into_dart(), + ] + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::Config {} +impl flutter_rust_bridge::IntoIntoDart for crate::api::types::Config { + fn into_into_dart(self) -> crate::api::types::Config { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::utils::error::DecodeError { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + match self { + crate::utils::error::DecodeError::UnknownVersion => [0.into_dart()].into_dart(), + crate::utils::error::DecodeError::UnknownRequiredFeature => [1.into_dart()].into_dart(), + crate::utils::error::DecodeError::InvalidValue => [2.into_dart()].into_dart(), + crate::utils::error::DecodeError::ShortRead => [3.into_dart()].into_dart(), + crate::utils::error::DecodeError::BadLengthDescriptor => [4.into_dart()].into_dart(), + crate::utils::error::DecodeError::Io(field0) => { + [5.into_dart(), field0.into_into_dart().into_dart()].into_dart() } + crate::utils::error::DecodeError::UnsupportedCompression => [6.into_dart()].into_dart(), + crate::utils::error::DecodeError::DangerousValue => [7.into_dart()].into_dart(), _ => { unimplemented!(""); } } } } - -impl SseDecode for i32 { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - deserializer.cursor.read_i32::().unwrap() +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::utils::error::DecodeError +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::utils::error::DecodeError +{ + fn into_into_dart(self) -> crate::utils::error::DecodeError { + self } } - -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 var_seedPhrase = ::sse_decode(deserializer); - return crate::api::node::LdkMnemonic { - seed_phrase: var_seedPhrase, - }; +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::EntropySourceConfig { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + match self { + crate::api::types::EntropySourceConfig::SeedFile(field0) => { + [0.into_dart(), field0.into_into_dart().into_dart()].into_dart() + } + crate::api::types::EntropySourceConfig::SeedBytes(field0) => { + [1.into_dart(), field0.into_into_dart().into_dart()].into_dart() + } + crate::api::types::EntropySourceConfig::Bip39Mnemonic { + mnemonic, + passphrase, + } => [ + 2.into_dart(), + mnemonic.into_into_dart().into_dart(), + passphrase.into_into_dart().into_dart(), + ] + .into_dart(), + _ => { + unimplemented!(""); + } + } } } - -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_ptr = >>::sse_decode(deserializer); - return crate::api::node::LdkNode { ptr: var_ptr }; +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::EntropySourceConfig +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::EntropySourceConfig +{ + fn into_into_dart(self) -> crate::api::types::EntropySourceConfig { + self } } - -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, - )); +// Codec=Dco (DartCObject based), see doc to use other codecs +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::PaymentClaimable { + payment_id, + payment_hash, + claimable_amount_msat, + claim_deadline, + } => [ + 0.into_dart(), + payment_id.into_into_dart().into_dart(), + payment_hash.into_into_dart().into_dart(), + claimable_amount_msat.into_into_dart().into_dart(), + claim_deadline.into_into_dart().into_dart(), + ] + .into_dart(), + crate::api::types::Event::PaymentSuccessful { + payment_id, + payment_hash, + fee_paid_msat, + } => [ + 1.into_dart(), + payment_id.into_into_dart().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_id, + payment_hash, + reason, + } => [ + 2.into_dart(), + payment_id.into_into_dart().into_dart(), + payment_hash.into_into_dart().into_dart(), + reason.into_into_dart().into_dart(), + ] + .into_dart(), + crate::api::types::Event::PaymentReceived { + payment_id, + payment_hash, + amount_msat, + } => [ + 3.into_dart(), + payment_id.into_into_dart().into_dart(), + payment_hash.into_into_dart().into_dart(), + amount_msat.into_into_dart().into_dart(), + ] + .into_dart(), + crate::api::types::Event::ChannelPending { + channel_id, + user_channel_id, + former_temporary_channel_id, + counterparty_node_id, + funding_txo, + } => [ + 4.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 { + channel_id, + user_channel_id, + counterparty_node_id, + } => [ + 5.into_dart(), + channel_id.into_into_dart().into_dart(), + user_channel_id.into_into_dart().into_dart(), + counterparty_node_id.into_into_dart().into_dart(), + ] + .into_dart(), + crate::api::types::Event::ChannelClosed { + channel_id, + user_channel_id, + counterparty_node_id, + reason, + } => [ + 6.into_dart(), + channel_id.into_into_dart().into_dart(), + user_channel_id.into_into_dart().into_dart(), + counterparty_node_id.into_into_dart().into_dart(), + reason.into_into_dart().into_dart(), + ] + .into_dart(), + _ => { + unimplemented!(""); + } } - 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 { - let mut len_ = ::sse_decode(deserializer); - let mut ans_ = vec![]; - for idx_ in 0..len_ { - ans_.push(::sse_decode( - deserializer, - )); - } - return ans_; +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::Event {} +impl flutter_rust_bridge::IntoIntoDart for crate::api::types::Event { + fn into_into_dart(self) -> crate::api::types::Event { + self } } - -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)); +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::GossipSourceConfig { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + match self { + crate::api::types::GossipSourceConfig::P2PNetwork => [0.into_dart()].into_dart(), + crate::api::types::GossipSourceConfig::RapidGossipSync(field0) => { + [1.into_dart(), field0.into_into_dart().into_dart()].into_dart() + } + _ => { + unimplemented!(""); + } } - 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 { - let mut len_ = ::sse_decode(deserializer); - let mut ans_ = vec![]; - for idx_ in 0..len_ { - ans_.push(::sse_decode(deserializer)); - } - return ans_; +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::GossipSourceConfig +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::GossipSourceConfig +{ + fn into_into_dart(self) -> crate::api::types::GossipSourceConfig { + self } } - -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_; +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::bolt11::LdkBolt11Payment { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.ptr.into_into_dart().into_dart()].into_dart() } } - -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 flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::bolt11::LdkBolt11Payment +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::bolt11::LdkBolt11Payment +{ + fn into_into_dart(self) -> crate::api::bolt11::LdkBolt11Payment { + self } } - -impl SseDecode for crate::api::types::LogLevel { - // 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::LogLevel::Gossip, - 1 => crate::api::types::LogLevel::Trace, - 2 => crate::api::types::LogLevel::Debug, - 3 => crate::api::types::LogLevel::Info, - 4 => crate::api::types::LogLevel::Warn, - 5 => crate::api::types::LogLevel::Error, - _ => unreachable!("Invalid variant for LogLevel: {}", inner), - }; +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::bolt12::LdkBolt12Payment { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.ptr.into_into_dart().into_dart()].into_dart() } } - -impl SseDecode for crate::api::types::MaxDustHTLCExposure { - // 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_field0 = ::sse_decode(deserializer); - return crate::api::types::MaxDustHTLCExposure::FixedLimitMsat(var_field0); - } - 1 => { - let mut var_field0 = ::sse_decode(deserializer); - return crate::api::types::MaxDustHTLCExposure::FeeRateMultiplier(var_field0); - } - _ => { - unimplemented!(""); - } +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::bolt12::LdkBolt12Payment +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::bolt12::LdkBolt12Payment +{ + fn into_into_dart(self) -> crate::api::bolt12::LdkBolt12Payment { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::utils::error::LdkBuilderError { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + match self { + Self::SocketAddressParseError => 0.into_dart(), + Self::InvalidSeedBytes => 1.into_dart(), + Self::InvalidSeedFile => 2.into_dart(), + Self::InvalidSystemTime => 3.into_dart(), + Self::InvalidChannelMonitor => 4.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::InvalidPublicKey => 12.into_dart(), + _ => unreachable!(), } } } - -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 { - let mut inner = ::sse_decode(deserializer); - return match inner { - 0 => crate::api::types::Network::Bitcoin, - 1 => crate::api::types::Network::Testnet, - 2 => crate::api::types::Network::Signet, - 3 => crate::api::types::Network::Regtest, - _ => unreachable!("Invalid variant for Network: {}", inner), - }; +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::utils::error::LdkBuilderError +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::utils::error::LdkBuilderError +{ + fn into_into_dart(self) -> crate::utils::error::LdkBuilderError { + self } } - -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::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), - }; +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::builder::LdkMnemonic { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.seed_phrase.into_into_dart().into_dart()].into_dart() } } - -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 flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::builder::LdkMnemonic +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::builder::LdkMnemonic +{ + fn into_into_dart(self) -> crate::api::builder::LdkMnemonic { + self } } - -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; - } +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::graph::LdkNetworkGraph { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.ptr.into_into_dart().into_dart()].into_dart() } } - -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 flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::graph::LdkNetworkGraph +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::graph::LdkNetworkGraph +{ + fn into_into_dart(self) -> crate::api::graph::LdkNetworkGraph { + self } } - -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; - } +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::node::LdkNode { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.ptr.into_into_dart().into_dart()].into_dart() } } - -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 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 } } - -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; +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::utils::error::LdkNodeError { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + match self { + crate::utils::error::LdkNodeError::InvalidTxid => [0.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::AlreadyRunning => [1.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::NotRunning => [2.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::OnchainTxCreationFailed => { + [3.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::ConnectionFailed => [4.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvoiceCreationFailed => [5.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::PaymentSendingFailed => [6.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::ProbeSendingFailed => [7.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::ChannelCreationFailed => [8.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::ChannelClosingFailed => [9.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::ChannelConfigUpdateFailed => { + [10.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::PersistenceFailed => [11.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::WalletOperationFailed => { + [12.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::OnchainTxSigningFailed => { + [13.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::MessageSigningFailed => [14.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::TxSyncFailed => [15.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::GossipUpdateFailed => [16.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidAddress => [17.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidSocketAddress => [18.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidPublicKey => [19.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidSecretKey => [20.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidPaymentHash => [21.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidPaymentPreimage => { + [22.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::InvalidPaymentSecret => [23.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidAmount => [24.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidInvoice => [25.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidChannelId => [26.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidNetwork => [27.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::DuplicatePayment => [28.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InsufficientFunds => [29.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::FeerateEstimationUpdateFailed => { + [30.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::LiquidityRequestFailed => { + [31.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::LiquiditySourceUnavailable => { + [32.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::LiquidityFeeTooHigh => [33.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidPaymentId => [34.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::Decode(field0) => { + [35.into_dart(), field0.into_into_dart().into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::Bolt12Parse(field0) => { + [36.into_dart(), field0.into_into_dart().into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::InvoiceRequestCreationFailed => { + [37.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::OfferCreationFailed => [38.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::RefundCreationFailed => [39.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::FeerateEstimationUpdateTimeout => { + [40.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::WalletOperationTimeout => { + [41.into_dart()].into_dart() + } + crate::utils::error::LdkNodeError::TxSyncTimeout => [42.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::GossipUpdateTimeout => [43.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidOfferId => [44.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidNodeId => [45.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidOffer => [46.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::InvalidRefund => [47.into_dart()].into_dart(), + crate::utils::error::LdkNodeError::UnsupportedCurrency => [48.into_dart()].into_dart(), + _ => { + unimplemented!(""); + } } } } - -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 flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::utils::error::LdkNodeError +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::utils::error::LdkNodeError +{ + fn into_into_dart(self) -> crate::utils::error::LdkNodeError { + self } } - -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; - } +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::on_chain::LdkOnChainPayment { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.ptr.into_into_dart().into_dart()].into_dart() } } - -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 flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::on_chain::LdkOnChainPayment +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::on_chain::LdkOnChainPayment +{ + fn into_into_dart(self) -> crate::api::on_chain::LdkOnChainPayment { + self } } - -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; - } +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::spontaneous::LdkSpontaneousPayment { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.ptr.into_into_dart().into_dart()].into_dart() } } - -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 flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::spontaneous::LdkSpontaneousPayment +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::spontaneous::LdkSpontaneousPayment +{ + fn into_into_dart(self) -> crate::api::spontaneous::LdkSpontaneousPayment { + self } } - -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; +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::LightningBalance { + 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(), + _ => { + unimplemented!(""); + } } } } - -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 flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::LightningBalance +{ } - -impl SseDecode for crate::api::types::OutPoint { - // 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_txid = ::sse_decode(deserializer); - let mut var_vout = ::sse_decode(deserializer); - return crate::api::types::OutPoint { - txid: var_txid, - vout: var_vout, - }; +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::LightningBalance +{ + fn into_into_dart(self) -> crate::api::types::LightningBalance { + self } } - -impl SseDecode for crate::api::types::PaymentDetails { - // 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_hash = ::sse_decode(deserializer); - let mut var_preimage = - >::sse_decode(deserializer); - let mut var_secret = >::sse_decode(deserializer); - let mut var_amountMsat = >::sse_decode(deserializer); - let mut var_direction = ::sse_decode(deserializer); - let mut var_status = ::sse_decode(deserializer); - return crate::api::types::PaymentDetails { - hash: var_hash, - preimage: var_preimage, - secret: var_secret, - amount_msat: var_amountMsat, - direction: var_direction, - status: var_status, - }; +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::LiquiditySourceConfig { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.lsps2_service.into_into_dart().into_dart()].into_dart() } } - -impl SseDecode for crate::api::types::PaymentDirection { - // 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::PaymentDirection::Inbound, - 1 => crate::api::types::PaymentDirection::Outbound, - _ => unreachable!("Invalid variant for PaymentDirection: {}", inner), - }; - } +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::LiquiditySourceConfig +{ } - -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 { - let mut var_data = <[u8; 32]>::sse_decode(deserializer); - return crate::api::types::PaymentHash { data: var_data }; +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::LiquiditySourceConfig +{ + fn into_into_dart(self) -> crate::api::types::LiquiditySourceConfig { + self } } - -impl SseDecode for crate::api::types::PaymentPreimage { - // 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 = <[u8; 32]>::sse_decode(deserializer); - return crate::api::types::PaymentPreimage { data: var_data }; +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::LogLevel { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + match self { + Self::Gossip => 0.into_dart(), + Self::Trace => 1.into_dart(), + Self::Debug => 2.into_dart(), + Self::Info => 3.into_dart(), + Self::Warn => 4.into_dart(), + Self::Error => 5.into_dart(), + _ => unreachable!(), + } } } - -impl SseDecode for crate::api::types::PaymentSecret { - // 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 = <[u8; 32]>::sse_decode(deserializer); - return crate::api::types::PaymentSecret { data: var_data }; +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::LogLevel {} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::LogLevel +{ + fn into_into_dart(self) -> crate::api::types::LogLevel { + self } } - -impl SseDecode for crate::api::types::PaymentStatus { - // 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::PaymentStatus::Pending, - 1 => crate::api::types::PaymentStatus::Succeeded, - 2 => crate::api::types::PaymentStatus::Failed, - _ => unreachable!("Invalid variant for PaymentStatus: {}", inner), - }; +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::LSPFeeLimits { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [ + self.max_total_opening_fee_msat.into_into_dart().into_dart(), + self.max_proportional_opening_fee_ppm_msat + .into_into_dart() + .into_dart(), + ] + .into_dart() } } - -impl SseDecode for crate::api::types::PeerDetails { - // 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_nodeId = ::sse_decode(deserializer); - let mut var_address = ::sse_decode(deserializer); - let mut var_isConnected = ::sse_decode(deserializer); - return crate::api::types::PeerDetails { - node_id: var_nodeId, - address: var_address, - is_connected: var_isConnected, - }; - } +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::LSPFeeLimits +{ } - -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_hex = ::sse_decode(deserializer); - return crate::api::types::PublicKey { hex: var_hex }; +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::LSPFeeLimits +{ + fn into_into_dart(self) -> crate::api::types::LSPFeeLimits { + self } } - -impl SseDecode for crate::api::types::SocketAddress { - // 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_addr = <[u8; 4]>::sse_decode(deserializer); - let mut var_port = ::sse_decode(deserializer); - return crate::api::types::SocketAddress::TcpIpV4 { - addr: var_addr, - port: var_port, - }; - } - 1 => { - let mut var_addr = <[u8; 16]>::sse_decode(deserializer); - let mut var_port = ::sse_decode(deserializer); - return crate::api::types::SocketAddress::TcpIpV6 { - addr: var_addr, - port: var_port, - }; - } - 2 => { - let mut var_field0 = <[u8; 12]>::sse_decode(deserializer); - return crate::api::types::SocketAddress::OnionV2(var_field0); - } - 3 => { - let mut var_ed25519Pubkey = <[u8; 32]>::sse_decode(deserializer); - let mut var_checksum = ::sse_decode(deserializer); - let mut var_version = ::sse_decode(deserializer); - let mut var_port = ::sse_decode(deserializer); - return crate::api::types::SocketAddress::OnionV3 { - ed25519_pubkey: var_ed25519Pubkey, - checksum: var_checksum, - version: var_version, - port: var_port, - }; +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::MaxDustHTLCExposure { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + match self { + crate::api::types::MaxDustHTLCExposure::FixedLimitMsat(field0) => { + [0.into_dart(), field0.into_into_dart().into_dart()].into_dart() } - 4 => { - let mut var_addr = ::sse_decode(deserializer); - let mut var_port = ::sse_decode(deserializer); - return crate::api::types::SocketAddress::Hostname { - addr: var_addr, - port: var_port, - }; + crate::api::types::MaxDustHTLCExposure::FeeRateMultiplier(field0) => { + [1.into_dart(), field0.into_into_dart().into_dart()].into_dart() } _ => { unimplemented!(""); @@ -1917,889 +4988,1178 @@ impl SseDecode for crate::api::types::SocketAddress { } } } - -impl SseDecode for crate::api::types::Txid { - // 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_hash = ::sse_decode(deserializer); - return crate::api::types::Txid { hash: var_hash }; +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::MaxDustHTLCExposure +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::MaxDustHTLCExposure +{ + fn into_into_dart(self) -> crate::api::types::MaxDustHTLCExposure { + self } } - -impl SseDecode for u16 { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - deserializer.cursor.read_u16::().unwrap() +// 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 { + Self::Bitcoin => 0.into_dart(), + Self::Testnet => 1.into_dart(), + Self::Signet => 2.into_dart(), + Self::Regtest => 3.into_dart(), + _ => unreachable!(), + } } } - -impl SseDecode for u32 { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - deserializer.cursor.read_u32::().unwrap() +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::Network {} +impl flutter_rust_bridge::IntoIntoDart for crate::api::types::Network { + fn into_into_dart(self) -> crate::api::types::Network { + self } } - -impl SseDecode for u64 { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - deserializer.cursor.read_u64::().unwrap() +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::graph::NodeAnnouncementInfo { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [ + self.last_update.into_into_dart().into_dart(), + self.alias.into_into_dart().into_dart(), + self.addresses.into_into_dart().into_dart(), + ] + .into_dart() } } - -impl SseDecode for u8 { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - deserializer.cursor.read_u8().unwrap() +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::graph::NodeAnnouncementInfo +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::graph::NodeAnnouncementInfo +{ + fn into_into_dart(self) -> crate::api::graph::NodeAnnouncementInfo { + self } } - -impl SseDecode for [u8; 12] { - // 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 flutter_rust_bridge::for_generated::from_vec_to_array(inner); +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::graph::NodeId { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.compressed.into_into_dart().into_dart()].into_dart() } } - -impl SseDecode for [u8; 16] { - // 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 flutter_rust_bridge::for_generated::from_vec_to_array(inner); +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::graph::NodeId {} +impl flutter_rust_bridge::IntoIntoDart for crate::api::graph::NodeId { + fn into_into_dart(self) -> crate::api::graph::NodeId { + self } } - -impl SseDecode for [u8; 32] { - // 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 flutter_rust_bridge::for_generated::from_vec_to_array(inner); +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::graph::NodeInfo { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [ + self.channels.into_into_dart().into_dart(), + self.announcement_info.into_into_dart().into_dart(), + ] + .into_dart() } } - -impl SseDecode for [u8; 4] { - // 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 flutter_rust_bridge::for_generated::from_vec_to_array(inner); +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::graph::NodeInfo {} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::graph::NodeInfo +{ + fn into_into_dart(self) -> crate::api::graph::NodeInfo { + self } } - -impl SseDecode for [u8; 64] { - // 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 flutter_rust_bridge::for_generated::from_vec_to_array(inner); +// 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 SseDecode for () { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::NodeStatus {} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::NodeStatus +{ + fn into_into_dart(self) -> crate::api::types::NodeStatus { + self + } } - -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); - return crate::api::types::UserChannelId { data: var_data }; +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::bolt12::Offer { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.s.into_into_dart().into_dart()].into_dart() } } - -impl SseDecode for usize { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - deserializer.cursor.read_u64::().unwrap() as _ +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::bolt12::Offer {} +impl flutter_rust_bridge::IntoIntoDart for crate::api::bolt12::Offer { + fn into_into_dart(self) -> crate::api::bolt12::Offer { + self } } - -fn pde_ffi_dispatcher_primary_impl( - func_id: i32, - port: flutter_rust_bridge::for_generated::MessagePort, - ptr: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, - rust_vec_len: i32, - data_len: i32, -) { - // Codec=Pde (Serialization + dispatch), see doc to use other codecs - match func_id { - _ => unreachable!(), +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::OfferId { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.0.into_into_dart().into_dart()].into_dart() } } - -fn pde_ffi_dispatcher_sync_impl( - func_id: i32, - ptr: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, - rust_vec_len: i32, - data_len: i32, -) -> flutter_rust_bridge::for_generated::WireSyncRust2DartSse { - // Codec=Pde (Serialization + dispatch), see doc to use other codecs - match func_id { - _ => unreachable!(), +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::OfferId {} +impl flutter_rust_bridge::IntoIntoDart for crate::api::types::OfferId { + fn into_into_dart(self) -> crate::api::types::OfferId { + self } } - -// Section: rust2dart - // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::Address { +impl flutter_rust_bridge::IntoDart for crate::api::types::OutPoint { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [self.s.into_into_dart().into_dart()].into_dart() + [ + self.txid.into_into_dart().into_dart(), + self.vout.into_into_dart().into_dart(), + ] + .into_dart() } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::Address {} -impl flutter_rust_bridge::IntoIntoDart for crate::api::types::Address { - fn into_into_dart(self) -> crate::api::types::Address { +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::OutPoint {} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::OutPoint +{ + fn into_into_dart(self) -> crate::api::types::OutPoint { self } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::Bolt11Invoice { +impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentDetails { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [self.signed_raw_invoice.into_into_dart().into_dart()].into_dart() + [ + self.id.into_into_dart().into_dart(), + self.kind.into_into_dart().into_dart(), + self.amount_msat.into_into_dart().into_dart(), + self.direction.into_into_dart().into_dart(), + self.status.into_into_dart().into_dart(), + ] + .into_dart() } } impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::Bolt11Invoice + for crate::api::types::PaymentDetails { } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::Bolt11Invoice +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::PaymentDetails { - fn into_into_dart(self) -> crate::api::types::Bolt11Invoice { + fn into_into_dart(self) -> crate::api::types::PaymentDetails { self } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::error::BuilderException { +impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentDirection { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { match self { - Self::SocketAddressParseError => 0.into_dart(), - Self::InvalidSeedBytes => 1.into_dart(), - Self::InvalidSeedFile => 2.into_dart(), - Self::InvalidSystemTime => 3.into_dart(), - Self::InvalidChannelMonitor => 4.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(), + Self::Inbound => 0.into_dart(), + Self::Outbound => 1.into_dart(), + _ => unreachable!(), } } } impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::error::BuilderException + for crate::api::types::PaymentDirection { } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::error::BuilderException +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::PaymentDirection { - fn into_into_dart(self) -> crate::api::error::BuilderException { + fn into_into_dart(self) -> crate::api::types::PaymentDirection { self } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::ChainDataSourceConfig { +impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentFailureReason { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { match self { - crate::api::types::ChainDataSourceConfig::Esplora(field0) => { - [0.into_dart(), field0.into_into_dart().into_dart()].into_dart() - } + 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(), + _ => unreachable!(), } } } impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::ChainDataSourceConfig + for crate::api::types::PaymentFailureReason { } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::ChainDataSourceConfig +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::PaymentFailureReason { - fn into_into_dart(self) -> crate::api::types::ChainDataSourceConfig { + 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::ChannelConfig { +impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentHash { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [ - self.forwarding_fee_proportional_millionths - .into_into_dart() - .into_dart(), - self.forwarding_fee_base_msat.into_into_dart().into_dart(), - self.cltv_expiry_delta.into_into_dart().into_dart(), - self.max_dust_htlc_exposure.into_into_dart().into_dart(), - self.force_close_avoidance_max_fee_satoshis - .into_into_dart() - .into_dart(), - self.accept_underpaying_htlcs.into_into_dart().into_dart(), - ] - .into_dart() + [self.data.into_into_dart().into_dart()].into_dart() } } impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::ChannelConfig + for crate::api::types::PaymentHash { } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::ChannelConfig +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::PaymentHash { - fn into_into_dart(self) -> crate::api::types::ChannelConfig { + fn into_into_dart(self) -> crate::api::types::PaymentHash { self } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::ChannelDetails { +impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentId { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [ - self.channel_id.into_into_dart().into_dart(), - self.counterparty_node_id.into_into_dart().into_dart(), - self.funding_txo.into_into_dart().into_dart(), - self.channel_value_sats.into_into_dart().into_dart(), - self.unspendable_punishment_reserve - .into_into_dart() - .into_dart(), - self.user_channel_id.into_into_dart().into_dart(), - 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(), - self.confirmations.into_into_dart().into_dart(), - self.is_outbound.into_into_dart().into_dart(), - 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(), - ] - .into_dart() + [self.0.into_into_dart().into_dart()].into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::PaymentId {} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::PaymentId +{ + fn into_into_dart(self) -> crate::api::types::PaymentId { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentKind { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + match self { + crate::api::types::PaymentKind::Onchain => [0.into_dart()].into_dart(), + crate::api::types::PaymentKind::Bolt11 { + hash, + preimage, + secret, + } => [ + 1.into_dart(), + hash.into_into_dart().into_dart(), + preimage.into_into_dart().into_dart(), + secret.into_into_dart().into_dart(), + ] + .into_dart(), + crate::api::types::PaymentKind::Bolt11Jit { + hash, + preimage, + secret, + lsp_fee_limits, + } => [ + 2.into_dart(), + hash.into_into_dart().into_dart(), + preimage.into_into_dart().into_dart(), + secret.into_into_dart().into_dart(), + lsp_fee_limits.into_into_dart().into_dart(), + ] + .into_dart(), + crate::api::types::PaymentKind::Spontaneous { hash, preimage } => [ + 3.into_dart(), + hash.into_into_dart().into_dart(), + preimage.into_into_dart().into_dart(), + ] + .into_dart(), + crate::api::types::PaymentKind::Bolt12Offer { + hash, + preimage, + secret, + offer_id, + } => [ + 4.into_dart(), + hash.into_into_dart().into_dart(), + preimage.into_into_dart().into_dart(), + secret.into_into_dart().into_dart(), + offer_id.into_into_dart().into_dart(), + ] + .into_dart(), + crate::api::types::PaymentKind::Bolt12Refund { + hash, + preimage, + secret, + } => [ + 5.into_dart(), + hash.into_into_dart().into_dart(), + preimage.into_into_dart().into_dart(), + secret.into_into_dart().into_dart(), + ] + .into_dart(), + _ => { + unimplemented!(""); + } + } + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::PaymentKind +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::PaymentKind +{ + fn into_into_dart(self) -> crate::api::types::PaymentKind { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentPreimage { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.data.into_into_dart().into_dart()].into_dart() } } impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::ChannelDetails + for crate::api::types::PaymentPreimage { } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::ChannelDetails +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::PaymentPreimage { - fn into_into_dart(self) -> crate::api::types::ChannelDetails { + fn into_into_dart(self) -> crate::api::types::PaymentPreimage { self } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::ChannelId { +impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentSecret { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { [self.data.into_into_dart().into_dart()].into_dart() } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::ChannelId {} -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::ChannelId +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::PaymentSecret { - fn into_into_dart(self) -> crate::api::types::ChannelId { +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::PaymentSecret +{ + fn into_into_dart(self) -> crate::api::types::PaymentSecret { self } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::Config { +impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentStatus { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [ - self.storage_dir_path.into_into_dart().into_dart(), - self.log_dir_path.into_into_dart().into_dart(), - self.network.into_into_dart().into_dart(), - self.listening_addresses.into_into_dart().into_dart(), - self.default_cltv_expiry_delta.into_into_dart().into_dart(), - self.onchain_wallet_sync_interval_secs - .into_into_dart() - .into_dart(), - self.wallet_sync_interval_secs.into_into_dart().into_dart(), - self.fee_rate_cache_update_interval_secs - .into_into_dart() - .into_dart(), - self.trusted_peers_0conf.into_into_dart().into_dart(), - self.probing_liquidity_limit_multiplier - .into_into_dart() - .into_dart(), - self.log_level.into_into_dart().into_dart(), - ] - .into_dart() + match self { + Self::Pending => 0.into_dart(), + Self::Succeeded => 1.into_dart(), + Self::Failed => 2.into_dart(), + _ => unreachable!(), + } } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::Config {} -impl flutter_rust_bridge::IntoIntoDart for crate::api::types::Config { - fn into_into_dart(self) -> crate::api::types::Config { +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::api::types::PaymentStatus +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::PaymentStatus +{ + fn into_into_dart(self) -> crate::api::types::PaymentStatus { self } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::EntropySourceConfig { +impl flutter_rust_bridge::IntoDart for crate::api::types::PeerDetails { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - match self { - crate::api::types::EntropySourceConfig::SeedFile(field0) => { - [0.into_dart(), field0.into_into_dart().into_dart()].into_dart() - } - crate::api::types::EntropySourceConfig::SeedBytes(field0) => { - [1.into_dart(), field0.into_into_dart().into_dart()].into_dart() - } - crate::api::types::EntropySourceConfig::Bip39Mnemonic { - mnemonic, - passphrase, - } => [ - 2.into_dart(), - mnemonic.into_into_dart().into_dart(), - passphrase.into_into_dart().into_dart(), - ] - .into_dart(), - } + [ + self.node_id.into_into_dart().into_dart(), + self.address.into_into_dart().into_dart(), + self.is_connected.into_into_dart().into_dart(), + ] + .into_dart() } } impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::EntropySourceConfig + for crate::api::types::PeerDetails { } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::EntropySourceConfig +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::PeerDetails { - fn into_into_dart(self) -> crate::api::types::EntropySourceConfig { + fn into_into_dart(self) -> crate::api::types::PeerDetails { self } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::Event { +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::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, - } => [ - 2.into_dart(), - payment_hash.into_into_dart().into_dart(), - amount_msat.into_into_dart().into_dart(), - ] - .into_dart(), - crate::api::types::Event::ChannelReady { + crate::api::types::PendingSweepBalance::PendingBroadcast { channel_id, - user_channel_id, - counterparty_node_id, + amount_satoshis, } => [ - 3.into_dart(), + 0.into_dart(), channel_id.into_into_dart().into_dart(), - user_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::Event::ChannelClosed { + crate::api::types::PendingSweepBalance::BroadcastAwaitingConfirmation { channel_id, - user_channel_id, - counterparty_node_id, + latest_broadcast_height, + latest_spending_txid, + amount_satoshis, } => [ - 4.into_dart(), + 1.into_dart(), channel_id.into_into_dart().into_dart(), - user_channel_id.into_into_dart().into_dart(), - counterparty_node_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::Event::ChannelPending { + crate::api::types::PendingSweepBalance::AwaitingThresholdConfirmations { channel_id, - user_channel_id, - former_temporary_channel_id, - counterparty_node_id, - funding_txo, + latest_spending_txid, + confirmation_hash, + confirmation_height, + amount_satoshis, } => [ - 5.into_dart(), + 2.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(), + 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::Event {} -impl flutter_rust_bridge::IntoIntoDart for crate::api::types::Event { - fn into_into_dart(self) -> crate::api::types::Event { - self - } -} -// Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::GossipSourceConfig { - fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - match self { - crate::api::types::GossipSourceConfig::P2PNetwork => [0.into_dart()].into_dart(), - crate::api::types::GossipSourceConfig::RapidGossipSync(field0) => { - [1.into_dart(), field0.into_into_dart().into_dart()].into_dart() + _ => { + unimplemented!(""); } } } } impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::GossipSourceConfig + for crate::api::types::PendingSweepBalance { } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::GossipSourceConfig +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::PendingSweepBalance { - fn into_into_dart(self) -> crate::api::types::GossipSourceConfig { + 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::node::LdkMnemonic { +impl flutter_rust_bridge::IntoDart for crate::api::types::PublicKey { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [self.seed_phrase.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::node::LdkMnemonic {} -impl flutter_rust_bridge::IntoIntoDart - for crate::api::node::LdkMnemonic +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::PublicKey {} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::PublicKey { - 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::node::LdkNode { - 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::LdkNode {} -impl flutter_rust_bridge::IntoIntoDart for crate::api::node::LdkNode { - fn into_into_dart(self) -> crate::api::node::LdkNode { + fn into_into_dart(self) -> crate::api::types::PublicKey { self } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::LogLevel { +impl flutter_rust_bridge::IntoDart for crate::api::bolt12::Refund { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - match self { - Self::Gossip => 0.into_dart(), - Self::Trace => 1.into_dart(), - Self::Debug => 2.into_dart(), - Self::Info => 3.into_dart(), - Self::Warn => 4.into_dart(), - Self::Error => 5.into_dart(), - } + [self.s.into_into_dart().into_dart()].into_dart() } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::LogLevel {} -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::LogLevel -{ - fn into_into_dart(self) -> crate::api::types::LogLevel { +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::bolt12::Refund {} +impl flutter_rust_bridge::IntoIntoDart for crate::api::bolt12::Refund { + fn into_into_dart(self) -> crate::api::bolt12::Refund { self } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::MaxDustHTLCExposure { +impl flutter_rust_bridge::IntoDart for crate::api::graph::RoutingFees { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - match self { - crate::api::types::MaxDustHTLCExposure::FixedLimitMsat(field0) => { - [0.into_dart(), field0.into_into_dart().into_dart()].into_dart() - } - crate::api::types::MaxDustHTLCExposure::FeeRateMultiplier(field0) => { - [1.into_dart(), field0.into_into_dart().into_dart()].into_dart() - } - } + [ + self.base_msat.into_into_dart().into_dart(), + self.proportional_millionths.into_into_dart().into_dart(), + ] + .into_dart() } } impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::MaxDustHTLCExposure + for crate::api::graph::RoutingFees { } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::MaxDustHTLCExposure +impl flutter_rust_bridge::IntoIntoDart + for crate::api::graph::RoutingFees { - fn into_into_dart(self) -> crate::api::types::MaxDustHTLCExposure { - 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 { - Self::Bitcoin => 0.into_dart(), - Self::Testnet => 1.into_dart(), - Self::Signet => 2.into_dart(), - Self::Regtest => 3.into_dart(), - } - } -} -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::Network {} -impl flutter_rust_bridge::IntoIntoDart for crate::api::types::Network { - fn into_into_dart(self) -> crate::api::types::Network { + fn into_into_dart(self) -> crate::api::graph::RoutingFees { self } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::error::NodeException { +impl flutter_rust_bridge::IntoDart for crate::api::types::SocketAddress { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { match self { - 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(), + crate::api::types::SocketAddress::TcpIpV4 { addr, port } => [ + 0.into_dart(), + addr.into_into_dart().into_dart(), + port.into_into_dart().into_dart(), + ] + .into_dart(), + crate::api::types::SocketAddress::TcpIpV6 { addr, port } => [ + 1.into_dart(), + addr.into_into_dart().into_dart(), + port.into_into_dart().into_dart(), + ] + .into_dart(), + crate::api::types::SocketAddress::OnionV2(field0) => { + [2.into_dart(), field0.into_into_dart().into_dart()].into_dart() + } + crate::api::types::SocketAddress::OnionV3 { + ed25519_pubkey, + checksum, + version, + port, + } => [ + 3.into_dart(), + ed25519_pubkey.into_into_dart().into_dart(), + checksum.into_into_dart().into_dart(), + version.into_into_dart().into_dart(), + port.into_into_dart().into_dart(), + ] + .into_dart(), + crate::api::types::SocketAddress::Hostname { addr, port } => [ + 4.into_dart(), + addr.into_into_dart().into_dart(), + port.into_into_dart().into_dart(), + ] + .into_dart(), + _ => { + unimplemented!(""); + } } } } impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::error::NodeException + for crate::api::types::SocketAddress { } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::error::NodeException +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::SocketAddress { - fn into_into_dart(self) -> crate::api::error::NodeException { + fn into_into_dart(self) -> crate::api::types::SocketAddress { self } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::OutPoint { +impl flutter_rust_bridge::IntoDart for crate::api::types::Txid { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [ - self.txid.into_into_dart().into_dart(), - self.vout.into_into_dart().into_dart(), - ] - .into_dart() + [self.hash.into_into_dart().into_dart()].into_dart() } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::OutPoint {} -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::OutPoint -{ - fn into_into_dart(self) -> crate::api::types::OutPoint { +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::Txid {} +impl flutter_rust_bridge::IntoIntoDart for crate::api::types::Txid { + fn into_into_dart(self) -> crate::api::types::Txid { self } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentDetails { +impl flutter_rust_bridge::IntoDart for crate::api::types::UserChannelId { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [ - self.hash.into_into_dart().into_dart(), - self.preimage.into_into_dart().into_dart(), - self.secret.into_into_dart().into_dart(), - self.amount_msat.into_into_dart().into_dart(), - self.direction.into_into_dart().into_dart(), - self.status.into_into_dart().into_dart(), - ] - .into_dart() + [self.data.into_into_dart().into_dart()].into_dart() } } impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::PaymentDetails + for crate::api::types::UserChannelId { } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::PaymentDetails +impl flutter_rust_bridge::IntoIntoDart + for crate::api::types::UserChannelId { - fn into_into_dart(self) -> crate::api::types::PaymentDetails { + fn into_into_dart(self) -> crate::api::types::UserChannelId { self } } -// Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentDirection { - fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - match self { - Self::Inbound => 0.into_dart(), - Self::Outbound => 1.into_dart(), - } + +impl SseEncode for NodeBuilder { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + >>::sse_encode(flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self), serializer); } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::PaymentDirection -{ + +impl SseEncode for RustOpaqueNom> { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::PaymentDirection + +impl SseEncode for RustOpaqueNom { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode + for RustOpaqueNom> { - fn into_into_dart(self) -> crate::api::types::PaymentDirection { - self + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); } } -// 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() + +impl SseEncode for RustOpaqueNom { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::PaymentHash -{ + +impl SseEncode for RustOpaqueNom { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::PaymentHash -{ - fn into_into_dart(self) -> crate::api::types::PaymentHash { - self + +impl SseEncode for RustOpaqueNom { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); } } -// Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentPreimage { - fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [self.data.into_into_dart().into_dart()].into_dart() + +impl SseEncode for RustOpaqueNom { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::PaymentPreimage -{ + +impl SseEncode for RustOpaqueNom { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::PaymentPreimage -{ - fn into_into_dart(self) -> crate::api::types::PaymentPreimage { - self + +impl SseEncode for String { + // 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.into_bytes(), serializer); } } -// Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentSecret { - fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [self.data.into_into_dart().into_dart()].into_dart() + +impl SseEncode for crate::api::types::Address { + // 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.s, serializer); } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::PaymentSecret -{ + +impl SseEncode for crate::api::types::AnchorChannelsConfig { + // 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.trusted_peers_no_reserve, serializer); + ::sse_encode(self.per_channel_reserve_sats, serializer); + } } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::PaymentSecret -{ - fn into_into_dart(self) -> crate::api::types::PaymentSecret { - self + +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, + ); } } -// Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentStatus { - fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + +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::bolt11::Bolt11Invoice { + // 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.signed_raw_invoice, serializer); + } +} + +impl SseEncode for crate::api::bolt12::Bolt12Invoice { + // 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); + } +} + +impl SseEncode for crate::utils::error::Bolt12ParseError { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { match self { - Self::Pending => 0.into_dart(), - Self::Succeeded => 1.into_dart(), - Self::Failed => 2.into_dart(), + crate::utils::error::Bolt12ParseError::InvalidContinuation => { + ::sse_encode(0, serializer); + } + crate::utils::error::Bolt12ParseError::InvalidBech32Hrp => { + ::sse_encode(1, serializer); + } + crate::utils::error::Bolt12ParseError::Bech32(field0) => { + ::sse_encode(2, serializer); + ::sse_encode(field0, serializer); + } + crate::utils::error::Bolt12ParseError::Decode(field0) => { + ::sse_encode(3, serializer); + ::sse_encode(field0, serializer); + } + crate::utils::error::Bolt12ParseError::InvalidSemantics(field0) => { + ::sse_encode(4, serializer); + ::sse_encode(field0, serializer); + } + crate::utils::error::Bolt12ParseError::InvalidSignature(field0) => { + ::sse_encode(5, serializer); + ::sse_encode(field0, serializer); + } + _ => { + unimplemented!(""); + } } } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::PaymentStatus -{ + +impl SseEncode for bool { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + serializer.cursor.write_u8(self as _).unwrap(); + } } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::PaymentStatus -{ - fn into_into_dart(self) -> crate::api::types::PaymentStatus { - self + +impl SseEncode for crate::api::types::ChainDataSourceConfig { + // 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::ChainDataSourceConfig::Esplora(field0) => { + ::sse_encode(0, serializer); + ::sse_encode(field0, serializer); + } + _ => { + unimplemented!(""); + } + } } } -// Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::PeerDetails { - fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [ - self.node_id.into_into_dart().into_dart(), - self.address.into_into_dart().into_dart(), - self.is_connected.into_into_dart().into_dart(), - ] - .into_dart() + +impl SseEncode for crate::api::types::ChannelConfig { + // 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.forwarding_fee_proportional_millionths, serializer); + ::sse_encode(self.forwarding_fee_base_msat, serializer); + ::sse_encode(self.cltv_expiry_delta, serializer); + >::sse_encode( + self.max_dust_htlc_exposure, + serializer, + ); + ::sse_encode(self.force_close_avoidance_max_fee_satoshis, serializer); + ::sse_encode(self.accept_underpaying_htlcs, serializer); } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::PeerDetails -{ + +impl SseEncode for crate::api::types::ChannelDetails { + // 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.channel_id, serializer); + ::sse_encode(self.counterparty_node_id, 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.outbound_capacity_msat, serializer); + ::sse_encode(self.inbound_capacity_msat, serializer); + >::sse_encode(self.confirmations_required, serializer); + >::sse_encode(self.confirmations, serializer); + ::sse_encode(self.is_outbound, serializer); + ::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); + } } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::PeerDetails -{ - fn into_into_dart(self) -> crate::api::types::PeerDetails { - self + +impl SseEncode for crate::api::types::ChannelId { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + <[u8; 32]>::sse_encode(self.data, serializer); } } -// 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.into_into_dart().into_dart()].into_dart() + +impl SseEncode for crate::api::graph::ChannelInfo { + // 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.node_one, serializer); + >::sse_encode(self.one_to_two, serializer); + ::sse_encode(self.node_two, serializer); + >::sse_encode(self.two_to_one, serializer); + >::sse_encode(self.capacity_sats, serializer); } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::PublicKey {} -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::PublicKey -{ - fn into_into_dart(self) -> crate::api::types::PublicKey { - self + +impl SseEncode for crate::api::graph::ChannelUpdateInfo { + // 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.last_update, serializer); + ::sse_encode(self.enabled, serializer); + ::sse_encode(self.cltv_expiry_delta, serializer); + ::sse_encode(self.htlc_minimum_msat, serializer); + ::sse_encode(self.htlc_maximum_msat, serializer); + ::sse_encode(self.fees, serializer); } } -// Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::SocketAddress { - fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + +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::SocketAddress::TcpIpV4 { addr, port } => [ - 0.into_dart(), - addr.into_into_dart().into_dart(), - port.into_into_dart().into_dart(), - ] - .into_dart(), - crate::api::types::SocketAddress::TcpIpV6 { addr, port } => [ - 1.into_dart(), - addr.into_into_dart().into_dart(), - port.into_into_dart().into_dart(), - ] - .into_dart(), - crate::api::types::SocketAddress::OnionV2(field0) => { - [2.into_dart(), field0.into_into_dart().into_dart()].into_dart() + 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::LegacyCooperativeClosure => { + ::sse_encode(2, serializer); + } + crate::api::types::ClosureReason::CounterpartyInitiatedCooperativeClosure => { + ::sse_encode(3, serializer); + } + crate::api::types::ClosureReason::LocallyInitiatedCooperativeClosure => { + ::sse_encode(4, serializer); + } + crate::api::types::ClosureReason::CommitmentTxConfirmed => { + ::sse_encode(5, serializer); + } + crate::api::types::ClosureReason::FundingTimedOut => { + ::sse_encode(6, serializer); + } + crate::api::types::ClosureReason::ProcessingError { err } => { + ::sse_encode(7, serializer); + ::sse_encode(err, serializer); + } + crate::api::types::ClosureReason::DisconnectedPeer => { + ::sse_encode(8, serializer); + } + crate::api::types::ClosureReason::OutdatedChannelManager => { + ::sse_encode(9, serializer); + } + crate::api::types::ClosureReason::CounterpartyCoopClosedUnfundedChannel => { + ::sse_encode(10, serializer); + } + crate::api::types::ClosureReason::FundingBatchClosure => { + ::sse_encode(11, serializer); + } + crate::api::types::ClosureReason::HTLCsTimedOut => { + ::sse_encode(12, serializer); + } + _ => { + unimplemented!(""); } - crate::api::types::SocketAddress::OnionV3 { - ed25519_pubkey, - checksum, - version, - port, - } => [ - 3.into_dart(), - ed25519_pubkey.into_into_dart().into_dart(), - checksum.into_into_dart().into_dart(), - version.into_into_dart().into_dart(), - port.into_into_dart().into_dart(), - ] - .into_dart(), - crate::api::types::SocketAddress::Hostname { addr, port } => [ - 4.into_dart(), - addr.into_into_dart().into_dart(), - port.into_into_dart().into_dart(), - ] - .into_dart(), } } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::SocketAddress -{ -} -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::SocketAddress -{ - fn into_into_dart(self) -> crate::api::types::SocketAddress { - self - } -} -// Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::Txid { - fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [self.hash.into_into_dart().into_dart()].into_dart() - } -} -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::Txid {} -impl flutter_rust_bridge::IntoIntoDart for crate::api::types::Txid { - fn into_into_dart(self) -> crate::api::types::Txid { - self + +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) { + ::sse_encode(self.storage_dir_path, serializer); + >::sse_encode(self.log_dir_path, serializer); + ::sse_encode(self.network, serializer); + >>::sse_encode( + self.listening_addresses, + serializer, + ); + ::sse_encode(self.default_cltv_expiry_delta, serializer); + ::sse_encode(self.onchain_wallet_sync_interval_secs, serializer); + ::sse_encode(self.wallet_sync_interval_secs, serializer); + ::sse_encode(self.fee_rate_cache_update_interval_secs, serializer); + >::sse_encode(self.trusted_peers_0conf, serializer); + ::sse_encode(self.probing_liquidity_limit_multiplier, serializer); + ::sse_encode(self.log_level, serializer); + >::sse_encode( + self.anchor_channels_config, + serializer, + ); } } -// Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::UserChannelId { - fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [self.data.into_into_dart().into_dart()].into_dart() + +impl SseEncode for crate::utils::error::DecodeError { + // 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::utils::error::DecodeError::UnknownVersion => { + ::sse_encode(0, serializer); + } + crate::utils::error::DecodeError::UnknownRequiredFeature => { + ::sse_encode(1, serializer); + } + crate::utils::error::DecodeError::InvalidValue => { + ::sse_encode(2, serializer); + } + crate::utils::error::DecodeError::ShortRead => { + ::sse_encode(3, serializer); + } + crate::utils::error::DecodeError::BadLengthDescriptor => { + ::sse_encode(4, serializer); + } + crate::utils::error::DecodeError::Io(field0) => { + ::sse_encode(5, serializer); + ::sse_encode(field0, serializer); + } + crate::utils::error::DecodeError::UnsupportedCompression => { + ::sse_encode(6, serializer); + } + crate::utils::error::DecodeError::DangerousValue => { + ::sse_encode(7, serializer); + } + _ => { + unimplemented!(""); + } + } } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::UserChannelId -{ -} -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::UserChannelId -{ - fn into_into_dart(self) -> crate::api::types::UserChannelId { - self + +impl SseEncode for crate::api::types::EntropySourceConfig { + // 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::EntropySourceConfig::SeedFile(field0) => { + ::sse_encode(0, serializer); + ::sse_encode(field0, serializer); + } + crate::api::types::EntropySourceConfig::SeedBytes(field0) => { + ::sse_encode(1, serializer); + <[u8; 64]>::sse_encode(field0, serializer); + } + crate::api::types::EntropySourceConfig::Bip39Mnemonic { + mnemonic, + passphrase, + } => { + ::sse_encode(2, serializer); + ::sse_encode(mnemonic, serializer); + >::sse_encode(passphrase, serializer); + } + _ => { + unimplemented!(""); + } + } } } -impl SseEncode for RustOpaqueNom> { +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) { - let (ptr, size) = self.sse_encode_raw(); - ::sse_encode(ptr, serializer); - ::sse_encode(size, serializer); + match self { + crate::api::types::Event::PaymentClaimable { + payment_id, + payment_hash, + claimable_amount_msat, + claim_deadline, + } => { + ::sse_encode(0, serializer); + ::sse_encode(payment_id, serializer); + ::sse_encode(payment_hash, serializer); + ::sse_encode(claimable_amount_msat, serializer); + >::sse_encode(claim_deadline, serializer); + } + crate::api::types::Event::PaymentSuccessful { + payment_id, + payment_hash, + fee_paid_msat, + } => { + ::sse_encode(1, serializer); + >::sse_encode(payment_id, serializer); + ::sse_encode(payment_hash, serializer); + >::sse_encode(fee_paid_msat, serializer); + } + crate::api::types::Event::PaymentFailed { + payment_id, + payment_hash, + reason, + } => { + ::sse_encode(2, serializer); + >::sse_encode(payment_id, serializer); + ::sse_encode(payment_hash, serializer); + >::sse_encode(reason, serializer); + } + crate::api::types::Event::PaymentReceived { + payment_id, + payment_hash, + amount_msat, + } => { + ::sse_encode(3, serializer); + >::sse_encode(payment_id, serializer); + ::sse_encode(payment_hash, serializer); + ::sse_encode(amount_msat, serializer); + } + crate::api::types::Event::ChannelPending { + channel_id, + user_channel_id, + former_temporary_channel_id, + counterparty_node_id, + funding_txo, + } => { + ::sse_encode(4, 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); + } + crate::api::types::Event::ChannelReady { + channel_id, + user_channel_id, + counterparty_node_id, + } => { + ::sse_encode(5, serializer); + ::sse_encode(channel_id, serializer); + ::sse_encode(user_channel_id, serializer); + >::sse_encode( + counterparty_node_id, + serializer, + ); + } + crate::api::types::Event::ChannelClosed { + channel_id, + user_channel_id, + counterparty_node_id, + reason, + } => { + ::sse_encode(6, serializer); + ::sse_encode(channel_id, serializer); + ::sse_encode(user_channel_id, serializer); + >::sse_encode( + counterparty_node_id, + serializer, + ); + >::sse_encode(reason, serializer); + } + _ => { + unimplemented!(""); + } + } } } -impl SseEncode for String { +impl SseEncode for crate::api::types::GossipSourceConfig { // 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.into_bytes(), serializer); + match self { + crate::api::types::GossipSourceConfig::P2PNetwork => { + ::sse_encode(0, serializer); + } + crate::api::types::GossipSourceConfig::RapidGossipSync(field0) => { + ::sse_encode(1, serializer); + ::sse_encode(field0, serializer); + } + _ => { + unimplemented!(""); + } + } } } -impl SseEncode for crate::api::types::Address { +impl SseEncode for i32 { // 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.s, serializer); + serializer.cursor.write_i32::(self).unwrap(); } } -impl SseEncode for crate::api::types::Bolt11Invoice { +impl SseEncode for crate::api::bolt11::LdkBolt11Payment { // 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.signed_raw_invoice, serializer); + >::sse_encode(self.ptr, serializer); } } -impl SseEncode for bool { +impl SseEncode for crate::api::bolt12::LdkBolt12Payment { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - serializer.cursor.write_u8(self as _).unwrap(); + >>::sse_encode(self.ptr, serializer); } } -impl SseEncode for crate::api::error::BuilderException { +impl SseEncode for crate::utils::error::LdkBuilderError { // 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::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, + crate::utils::error::LdkBuilderError::SocketAddressParseError => 0, + crate::utils::error::LdkBuilderError::InvalidSeedBytes => 1, + crate::utils::error::LdkBuilderError::InvalidSeedFile => 2, + crate::utils::error::LdkBuilderError::InvalidSystemTime => 3, + crate::utils::error::LdkBuilderError::InvalidChannelMonitor => 4, + crate::utils::error::LdkBuilderError::InvalidListeningAddress => 5, + crate::utils::error::LdkBuilderError::ReadFailed => 6, + crate::utils::error::LdkBuilderError::WriteFailed => 7, + crate::utils::error::LdkBuilderError::StoragePathAccessFailed => 8, + crate::utils::error::LdkBuilderError::KVStoreSetupFailed => 9, + crate::utils::error::LdkBuilderError::WalletSetupFailed => 10, + crate::utils::error::LdkBuilderError::LoggerSetupFailed => 11, + crate::utils::error::LdkBuilderError::InvalidPublicKey => 12, _ => { unimplemented!(""); } @@ -2809,232 +6169,365 @@ impl SseEncode for crate::api::error::BuilderException { } } -impl SseEncode for crate::api::types::ChainDataSourceConfig { +impl SseEncode for crate::api::builder::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::ChainDataSourceConfig::Esplora(field0) => { - ::sse_encode(0, serializer); - ::sse_encode(field0, serializer); - } - } + ::sse_encode(self.seed_phrase, serializer); } } -impl SseEncode for crate::api::types::ChannelConfig { +impl SseEncode for crate::api::graph::LdkNetworkGraph { // 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.forwarding_fee_proportional_millionths, serializer); - ::sse_encode(self.forwarding_fee_base_msat, serializer); - ::sse_encode(self.cltv_expiry_delta, serializer); - ::sse_encode( - self.max_dust_htlc_exposure, - serializer, - ); - ::sse_encode(self.force_close_avoidance_max_fee_satoshis, serializer); - ::sse_encode(self.accept_underpaying_htlcs, serializer); + >::sse_encode(self.ptr, serializer); } } -impl SseEncode for crate::api::types::ChannelDetails { +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) { - ::sse_encode(self.channel_id, serializer); - ::sse_encode(self.counterparty_node_id, 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); - >::sse_encode(self.confirmations, serializer); - ::sse_encode(self.is_outbound, serializer); - ::sse_encode(self.is_channel_ready, serializer); - ::sse_encode(self.is_usable, serializer); - ::sse_encode(self.is_public, serializer); + >::sse_encode(self.ptr, serializer); } } -impl SseEncode for crate::api::types::ChannelId { +impl SseEncode for crate::utils::error::LdkNodeError { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - <[u8; 32]>::sse_encode(self.data, serializer); + match self { + crate::utils::error::LdkNodeError::InvalidTxid => { + ::sse_encode(0, serializer); + } + crate::utils::error::LdkNodeError::AlreadyRunning => { + ::sse_encode(1, serializer); + } + crate::utils::error::LdkNodeError::NotRunning => { + ::sse_encode(2, serializer); + } + crate::utils::error::LdkNodeError::OnchainTxCreationFailed => { + ::sse_encode(3, serializer); + } + crate::utils::error::LdkNodeError::ConnectionFailed => { + ::sse_encode(4, serializer); + } + crate::utils::error::LdkNodeError::InvoiceCreationFailed => { + ::sse_encode(5, serializer); + } + crate::utils::error::LdkNodeError::PaymentSendingFailed => { + ::sse_encode(6, serializer); + } + crate::utils::error::LdkNodeError::ProbeSendingFailed => { + ::sse_encode(7, serializer); + } + crate::utils::error::LdkNodeError::ChannelCreationFailed => { + ::sse_encode(8, serializer); + } + crate::utils::error::LdkNodeError::ChannelClosingFailed => { + ::sse_encode(9, serializer); + } + crate::utils::error::LdkNodeError::ChannelConfigUpdateFailed => { + ::sse_encode(10, serializer); + } + crate::utils::error::LdkNodeError::PersistenceFailed => { + ::sse_encode(11, serializer); + } + crate::utils::error::LdkNodeError::WalletOperationFailed => { + ::sse_encode(12, serializer); + } + crate::utils::error::LdkNodeError::OnchainTxSigningFailed => { + ::sse_encode(13, serializer); + } + crate::utils::error::LdkNodeError::MessageSigningFailed => { + ::sse_encode(14, serializer); + } + crate::utils::error::LdkNodeError::TxSyncFailed => { + ::sse_encode(15, serializer); + } + crate::utils::error::LdkNodeError::GossipUpdateFailed => { + ::sse_encode(16, serializer); + } + crate::utils::error::LdkNodeError::InvalidAddress => { + ::sse_encode(17, serializer); + } + crate::utils::error::LdkNodeError::InvalidSocketAddress => { + ::sse_encode(18, serializer); + } + crate::utils::error::LdkNodeError::InvalidPublicKey => { + ::sse_encode(19, serializer); + } + crate::utils::error::LdkNodeError::InvalidSecretKey => { + ::sse_encode(20, serializer); + } + crate::utils::error::LdkNodeError::InvalidPaymentHash => { + ::sse_encode(21, serializer); + } + crate::utils::error::LdkNodeError::InvalidPaymentPreimage => { + ::sse_encode(22, serializer); + } + crate::utils::error::LdkNodeError::InvalidPaymentSecret => { + ::sse_encode(23, serializer); + } + crate::utils::error::LdkNodeError::InvalidAmount => { + ::sse_encode(24, serializer); + } + crate::utils::error::LdkNodeError::InvalidInvoice => { + ::sse_encode(25, serializer); + } + crate::utils::error::LdkNodeError::InvalidChannelId => { + ::sse_encode(26, serializer); + } + crate::utils::error::LdkNodeError::InvalidNetwork => { + ::sse_encode(27, serializer); + } + crate::utils::error::LdkNodeError::DuplicatePayment => { + ::sse_encode(28, serializer); + } + crate::utils::error::LdkNodeError::InsufficientFunds => { + ::sse_encode(29, serializer); + } + crate::utils::error::LdkNodeError::FeerateEstimationUpdateFailed => { + ::sse_encode(30, serializer); + } + crate::utils::error::LdkNodeError::LiquidityRequestFailed => { + ::sse_encode(31, serializer); + } + crate::utils::error::LdkNodeError::LiquiditySourceUnavailable => { + ::sse_encode(32, serializer); + } + crate::utils::error::LdkNodeError::LiquidityFeeTooHigh => { + ::sse_encode(33, serializer); + } + crate::utils::error::LdkNodeError::InvalidPaymentId => { + ::sse_encode(34, serializer); + } + crate::utils::error::LdkNodeError::Decode(field0) => { + ::sse_encode(35, serializer); + ::sse_encode(field0, serializer); + } + crate::utils::error::LdkNodeError::Bolt12Parse(field0) => { + ::sse_encode(36, serializer); + ::sse_encode(field0, serializer); + } + crate::utils::error::LdkNodeError::InvoiceRequestCreationFailed => { + ::sse_encode(37, serializer); + } + crate::utils::error::LdkNodeError::OfferCreationFailed => { + ::sse_encode(38, serializer); + } + crate::utils::error::LdkNodeError::RefundCreationFailed => { + ::sse_encode(39, serializer); + } + crate::utils::error::LdkNodeError::FeerateEstimationUpdateTimeout => { + ::sse_encode(40, serializer); + } + crate::utils::error::LdkNodeError::WalletOperationTimeout => { + ::sse_encode(41, serializer); + } + crate::utils::error::LdkNodeError::TxSyncTimeout => { + ::sse_encode(42, serializer); + } + crate::utils::error::LdkNodeError::GossipUpdateTimeout => { + ::sse_encode(43, serializer); + } + crate::utils::error::LdkNodeError::InvalidOfferId => { + ::sse_encode(44, serializer); + } + crate::utils::error::LdkNodeError::InvalidNodeId => { + ::sse_encode(45, serializer); + } + crate::utils::error::LdkNodeError::InvalidOffer => { + ::sse_encode(46, serializer); + } + crate::utils::error::LdkNodeError::InvalidRefund => { + ::sse_encode(47, serializer); + } + crate::utils::error::LdkNodeError::UnsupportedCurrency => { + ::sse_encode(48, serializer); + } + _ => { + unimplemented!(""); + } + } } } -impl SseEncode for crate::api::types::Config { +impl SseEncode for crate::api::on_chain::LdkOnChainPayment { // 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.storage_dir_path, serializer); - >::sse_encode(self.log_dir_path, serializer); - ::sse_encode(self.network, serializer); - >>::sse_encode( - self.listening_addresses, - serializer, - ); - ::sse_encode(self.default_cltv_expiry_delta, serializer); - ::sse_encode(self.onchain_wallet_sync_interval_secs, serializer); - ::sse_encode(self.wallet_sync_interval_secs, serializer); - ::sse_encode(self.fee_rate_cache_update_interval_secs, serializer); - >::sse_encode(self.trusted_peers_0conf, serializer); - ::sse_encode(self.probing_liquidity_limit_multiplier, serializer); - ::sse_encode(self.log_level, serializer); + >::sse_encode(self.ptr, serializer); } } -impl SseEncode for crate::api::types::EntropySourceConfig { +impl SseEncode for crate::api::spontaneous::LdkSpontaneousPayment { // 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::EntropySourceConfig::SeedFile(field0) => { - ::sse_encode(0, serializer); - ::sse_encode(field0, serializer); - } - crate::api::types::EntropySourceConfig::SeedBytes(field0) => { - ::sse_encode(1, serializer); - <[u8; 64]>::sse_encode(field0, serializer); - } - crate::api::types::EntropySourceConfig::Bip39Mnemonic { - mnemonic, - passphrase, - } => { - ::sse_encode(2, serializer); - ::sse_encode(mnemonic, serializer); - >::sse_encode(passphrase, serializer); - } - } + >::sse_encode(self.ptr, serializer); } } -impl SseEncode for crate::api::types::Event { +impl SseEncode for crate::api::types::LightningBalance { // 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 } => { + crate::api::types::LightningBalance::ClaimableOnChannelClose { + channel_id, + counterparty_node_id, + amount_satoshis, + } => { ::sse_encode(0, serializer); - ::sse_encode(payment_hash, serializer); + ::sse_encode(channel_id, serializer); + ::sse_encode(counterparty_node_id, serializer); + ::sse_encode(amount_satoshis, serializer); } - crate::api::types::Event::PaymentFailed { payment_hash } => { + crate::api::types::LightningBalance::ClaimableAwaitingConfirmations { + channel_id, + counterparty_node_id, + amount_satoshis, + confirmation_height, + } => { ::sse_encode(1, serializer); - ::sse_encode(payment_hash, 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::Event::PaymentReceived { + crate::api::types::LightningBalance::ContentiousClaimable { + channel_id, + counterparty_node_id, + amount_satoshis, + timeout_height, payment_hash, - amount_msat, + 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(amount_msat, serializer); + ::sse_encode(payment_preimage, serializer); } - crate::api::types::Event::ChannelReady { + crate::api::types::LightningBalance::MaybeTimeoutClaimableHTLC { channel_id, - user_channel_id, counterparty_node_id, + amount_satoshis, + claimable_height, + payment_hash, } => { ::sse_encode(3, serializer); ::sse_encode(channel_id, serializer); - ::sse_encode(user_channel_id, serializer); - >::sse_encode( - counterparty_node_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::Event::ChannelClosed { + crate::api::types::LightningBalance::MaybePreimageClaimableHTLC { channel_id, - user_channel_id, counterparty_node_id, + amount_satoshis, + expiry_height, + payment_hash, } => { ::sse_encode(4, serializer); ::sse_encode(channel_id, serializer); - ::sse_encode(user_channel_id, serializer); - >::sse_encode( - counterparty_node_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::Event::ChannelPending { + crate::api::types::LightningBalance::CounterpartyRevokedOutputClaimable { channel_id, - user_channel_id, - former_temporary_channel_id, counterparty_node_id, - funding_txo, + amount_satoshis, } => { ::sse_encode(5, 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(amount_satoshis, serializer); + } + _ => { + unimplemented!(""); } } } } -impl SseEncode for crate::api::types::GossipSourceConfig { +impl SseEncode for crate::api::types::LiquiditySourceConfig { // 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::GossipSourceConfig::P2PNetwork => { - ::sse_encode(0, serializer); - } - crate::api::types::GossipSourceConfig::RapidGossipSync(field0) => { - ::sse_encode(1, serializer); - ::sse_encode(field0, serializer); - } + <( + crate::api::types::SocketAddress, + crate::api::types::PublicKey, + Option, + )>::sse_encode(self.lsps2_service, 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) { + ::sse_encode(self.len() as _, serializer); + for item in self { + ::sse_encode(item, serializer); } } } -impl SseEncode for i32 { +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) { - serializer.cursor.write_i32::(self).unwrap(); + ::sse_encode(self.len() as _, serializer); + for item in self { + ::sse_encode(item, serializer); + } } } -impl SseEncode for crate::api::node::LdkMnemonic { +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.seed_phrase, serializer); + ::sse_encode(self.len() as _, serializer); + for item in self { + ::sse_encode(item, serializer); + } } } -impl SseEncode for crate::api::node::LdkNode { +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.ptr, serializer); + ::sse_encode(self.len() as _, serializer); + for item in self { + ::sse_encode(item, serializer); + } } } -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); + ::sse_encode(item, serializer); } } } -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); + ::sse_encode(item, serializer); } } } -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); + ::sse_encode(item, serializer); } } } @@ -3089,6 +6582,14 @@ impl SseEncode for crate::api::types::LogLevel { } } +impl SseEncode for crate::api::types::LSPFeeLimits { + // 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.max_total_opening_fee_msat, serializer); + >::sse_encode(self.max_proportional_opening_fee_ppm_msat, serializer); + } +} + impl SseEncode for crate::api::types::MaxDustHTLCExposure { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -3101,6 +6602,9 @@ impl SseEncode for crate::api::types::MaxDustHTLCExposure { ::sse_encode(1, serializer); ::sse_encode(field0, serializer); } + _ => { + unimplemented!(""); + } } } } @@ -3123,51 +6627,64 @@ impl SseEncode for crate::api::types::Network { } } -impl SseEncode for crate::api::error::NodeException { +impl SseEncode for crate::api::graph::NodeAnnouncementInfo { // 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::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!(""); - } - }, + ::sse_encode(self.last_update, serializer); + ::sse_encode(self.alias, serializer); + >::sse_encode(self.addresses, serializer); + } +} + +impl SseEncode for crate::api::graph::NodeId { + // 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.compressed, serializer); + } +} + +impl SseEncode for crate::api::graph::NodeInfo { + // 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.channels, serializer); + >::sse_encode( + self.announcement_info, + serializer, + ); + } +} + +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 crate::api::bolt12::Offer { + // 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.s, serializer); + } +} + +impl SseEncode for crate::api::types::OfferId { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + <[u8; 32]>::sse_encode(self.0, 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) { @@ -3178,6 +6695,16 @@ 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) { @@ -3198,6 +6725,46 @@ 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) { + ::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) { @@ -3228,6 +6795,56 @@ 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) { + ::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) { @@ -3238,6 +6855,36 @@ 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) { @@ -3268,6 +6915,16 @@ 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) { @@ -3309,9 +6966,8 @@ impl SseEncode for crate::api::types::OutPoint { impl SseEncode for crate::api::types::PaymentDetails { // 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.hash, serializer); - >::sse_encode(self.preimage, serializer); - >::sse_encode(self.secret, serializer); + ::sse_encode(self.id, serializer); + ::sse_encode(self.kind, serializer); >::sse_encode(self.amount_msat, serializer); ::sse_encode(self.direction, serializer); ::sse_encode(self.status, serializer); @@ -3334,6 +6990,26 @@ 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) { @@ -3341,6 +7017,76 @@ impl SseEncode for crate::api::types::PaymentHash { } } +impl SseEncode for crate::api::types::PaymentId { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + <[u8; 32]>::sse_encode(self.0, serializer); + } +} + +impl SseEncode for crate::api::types::PaymentKind { + // 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::PaymentKind::Onchain => { + ::sse_encode(0, serializer); + } + crate::api::types::PaymentKind::Bolt11 { + hash, + preimage, + secret, + } => { + ::sse_encode(1, serializer); + ::sse_encode(hash, serializer); + >::sse_encode(preimage, serializer); + >::sse_encode(secret, serializer); + } + crate::api::types::PaymentKind::Bolt11Jit { + hash, + preimage, + secret, + lsp_fee_limits, + } => { + ::sse_encode(2, serializer); + ::sse_encode(hash, serializer); + >::sse_encode(preimage, serializer); + >::sse_encode(secret, serializer); + ::sse_encode(lsp_fee_limits, serializer); + } + crate::api::types::PaymentKind::Spontaneous { hash, preimage } => { + ::sse_encode(3, serializer); + ::sse_encode(hash, serializer); + >::sse_encode(preimage, serializer); + } + crate::api::types::PaymentKind::Bolt12Offer { + hash, + preimage, + secret, + offer_id, + } => { + ::sse_encode(4, serializer); + >::sse_encode(hash, serializer); + >::sse_encode(preimage, serializer); + >::sse_encode(secret, serializer); + ::sse_encode(offer_id, serializer); + } + crate::api::types::PaymentKind::Bolt12Refund { + hash, + preimage, + secret, + } => { + ::sse_encode(5, serializer); + >::sse_encode(hash, serializer); + >::sse_encode(preimage, serializer); + >::sse_encode(secret, serializer); + } + _ => { + unimplemented!(""); + } + } + } +} + impl SseEncode for crate::api::types::PaymentPreimage { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -3381,6 +7127,51 @@ 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); + } + _ => { + unimplemented!(""); + } + } + } +} + 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) { @@ -3388,6 +7179,36 @@ impl SseEncode for crate::api::types::PublicKey { } } +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); + } +} + +impl SseEncode for crate::api::bolt12::Refund { + // 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.s, serializer); + } +} + +impl SseEncode for crate::api::graph::RoutingFees { + // 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.base_msat, serializer); + ::sse_encode(self.proportional_millionths, serializer); + } +} + impl SseEncode for crate::api::types::SocketAddress { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -3423,6 +7244,9 @@ impl SseEncode for crate::api::types::SocketAddress { ::sse_encode(addr, serializer); ::sse_encode(port, serializer); } + _ => { + unimplemented!(""); + } } } } @@ -3535,7 +7359,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); } } @@ -3554,10 +7378,3 @@ impl SseEncode for usize { mod io; #[cfg(not(target_family = "wasm"))] pub use io::*; - -/// cbindgen:ignore -#[cfg(target_family = "wasm")] -#[path = "frb_generated.web.rs"] -mod web; -#[cfg(target_family = "wasm")] -pub use web::*; diff --git a/rust/src/frb_generated.web.rs b/rust/src/frb_generated.web.rs index 1785bd2..e91baec 100644 --- a/rust/src/frb_generated.web.rs +++ b/rust/src/frb_generated.web.rs @@ -1,14 +1,16 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. +// Generated by `flutter_rust_bridge`@ 2.0.0. // Section: imports use super::*; +use crate::api::builder::*; use crate::api::node::*; +use crate::*; use flutter_rust_bridge::for_generated::byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt}; -use flutter_rust_bridge::for_generated::transform_result_dco; use flutter_rust_bridge::for_generated::wasm_bindgen; use flutter_rust_bridge::for_generated::wasm_bindgen::prelude::*; +use flutter_rust_bridge::for_generated::{transform_result_dco, Lifetimeable, Lockable}; use flutter_rust_bridge::{Handler, IntoIntoDart}; // Section: boilerplate @@ -42,6 +44,69 @@ 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::AnchorChannelsConfig { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 2, + "Expected 2 elements, got {}", + self_.length() + ); + crate::api::types::AnchorChannelsConfig { + trusted_peers_no_reserve: self_.get(0).cst_decode(), + per_channel_reserve_sats: self_.get(1).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::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 { @@ -61,6 +126,23 @@ 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::utils::error::Bolt12ParseError { + let self_ = self.unchecked_into::(); + match self_.get(0).unchecked_into_f64() as _ { + 0 => crate::utils::error::Bolt12ParseError::InvalidContinuation, + 1 => crate::utils::error::Bolt12ParseError::InvalidBech32Hrp, + 2 => crate::utils::error::Bolt12ParseError::Bech32(self_.get(1).cst_decode()), + 3 => crate::utils::error::Bolt12ParseError::Decode(self_.get(1).cst_decode()), + 4 => crate::utils::error::Bolt12ParseError::InvalidSemantics(self_.get(1).cst_decode()), + 5 => crate::utils::error::Bolt12ParseError::InvalidSignature(self_.get(1).cst_decode()), + _ => unreachable!(), + } + } +} impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { @@ -107,8 +189,8 @@ impl CstDecode .unwrap(); assert_eq!( self_.length(), - 16, - "Expected 16 elements, got {}", + 28, + "Expected 28 elements, got {}", self_.length() ); crate::api::types::ChannelDetails { @@ -119,15 +201,27 @@ 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(), - 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(), + 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(), } } } @@ -150,6 +244,81 @@ 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::graph::ChannelInfo { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 5, + "Expected 5 elements, got {}", + self_.length() + ); + crate::api::graph::ChannelInfo { + node_one: self_.get(0).cst_decode(), + one_to_two: self_.get(1).cst_decode(), + node_two: self_.get(2).cst_decode(), + two_to_one: self_.get(3).cst_decode(), + capacity_sats: 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::graph::ChannelUpdateInfo { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 6, + "Expected 6 elements, got {}", + self_.length() + ); + crate::api::graph::ChannelUpdateInfo { + last_update: self_.get(0).cst_decode(), + enabled: self_.get(1).cst_decode(), + cltv_expiry_delta: self_.get(2).cst_decode(), + htlc_minimum_msat: self_.get(3).cst_decode(), + htlc_maximum_msat: self_.get(4).cst_decode(), + fees: self_.get(5).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::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::LegacyCooperativeClosure, + 3 => crate::api::types::ClosureReason::CounterpartyInitiatedCooperativeClosure, + 4 => crate::api::types::ClosureReason::LocallyInitiatedCooperativeClosure, + 5 => crate::api::types::ClosureReason::CommitmentTxConfirmed, + 6 => crate::api::types::ClosureReason::FundingTimedOut, + 7 => crate::api::types::ClosureReason::ProcessingError { + err: self_.get(1).cst_decode(), + }, + 8 => crate::api::types::ClosureReason::DisconnectedPeer, + 9 => crate::api::types::ClosureReason::OutdatedChannelManager, + 10 => crate::api::types::ClosureReason::CounterpartyCoopClosedUnfundedChannel, + 11 => crate::api::types::ClosureReason::FundingBatchClosure, + 12 => crate::api::types::ClosureReason::HTLCsTimedOut, + _ => unreachable!(), + } + } +} impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { @@ -160,8 +329,8 @@ impl CstDecode .unwrap(); assert_eq!( self_.length(), - 11, - "Expected 11 elements, got {}", + 12, + "Expected 12 elements, got {}", self_.length() ); crate::api::types::Config { @@ -176,6 +345,26 @@ impl CstDecode trusted_peers_0conf: self_.get(8).cst_decode(), probing_liquidity_limit_multiplier: self_.get(9).cst_decode(), log_level: self_.get(10).cst_decode(), + anchor_channels_config: self_.get(11).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::utils::error::DecodeError { + let self_ = self.unchecked_into::(); + match self_.get(0).unchecked_into_f64() as _ { + 0 => crate::utils::error::DecodeError::UnknownVersion, + 1 => crate::utils::error::DecodeError::UnknownRequiredFeature, + 2 => crate::utils::error::DecodeError::InvalidValue, + 3 => crate::utils::error::DecodeError::ShortRead, + 4 => crate::utils::error::DecodeError::BadLengthDescriptor, + 5 => crate::utils::error::DecodeError::Io(self_.get(1).cst_decode()), + 6 => crate::utils::error::DecodeError::UnsupportedCompression, + 7 => crate::utils::error::DecodeError::DangerousValue, + _ => unreachable!(), } } } @@ -203,32 +392,44 @@ impl CstDecode fn cst_decode(self) -> crate::api::types::Event { let self_ = self.unchecked_into::(); match self_.get(0).unchecked_into_f64() as _ { - 0 => crate::api::types::Event::PaymentSuccessful { - payment_hash: self_.get(1).cst_decode(), + 0 => crate::api::types::Event::PaymentClaimable { + payment_id: self_.get(1).cst_decode(), + payment_hash: self_.get(2).cst_decode(), + claimable_amount_msat: self_.get(3).cst_decode(), + claim_deadline: self_.get(4).cst_decode(), + }, + 1 => crate::api::types::Event::PaymentSuccessful { + payment_id: self_.get(1).cst_decode(), + payment_hash: self_.get(2).cst_decode(), + fee_paid_msat: self_.get(3).cst_decode(), }, - 1 => crate::api::types::Event::PaymentFailed { - payment_hash: self_.get(1).cst_decode(), + 2 => crate::api::types::Event::PaymentFailed { + payment_id: self_.get(1).cst_decode(), + payment_hash: self_.get(2).cst_decode(), + reason: self_.get(3).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::PaymentReceived { + payment_id: self_.get(1).cst_decode(), + payment_hash: self_.get(2).cst_decode(), + amount_msat: self_.get(3).cst_decode(), }, - 3 => crate::api::types::Event::ChannelReady { + 4 => 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(), + former_temporary_channel_id: self_.get(3).cst_decode(), + counterparty_node_id: self_.get(4).cst_decode(), + funding_txo: self_.get(5).cst_decode(), }, - 4 => crate::api::types::Event::ChannelClosed { + 5 => crate::api::types::Event::ChannelReady { 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::ChannelPending { + 6 => crate::api::types::Event::ChannelClosed { 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(), + reason: self_.get(4).cst_decode(), }, _ => unreachable!(), } @@ -247,11 +448,11 @@ 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::node::LdkMnemonic { + fn cst_decode(self) -> crate::api::bolt11::LdkBolt11Payment { let self_ = self .dyn_into::() .unwrap(); @@ -261,16 +462,16 @@ impl CstDecode "Expected 1 elements, got {}", self_.length() ); - crate::api::node::LdkMnemonic { - seed_phrase: self_.get(0).cst_decode(), + crate::api::bolt11::LdkBolt11Payment { + ptr: 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::node::LdkNode { + fn cst_decode(self) -> crate::api::bolt12::LdkBolt12Payment { let self_ = self .dyn_into::() .unwrap(); @@ -280,147 +481,54 @@ impl CstDecode "Expected 1 elements, got {}", self_.length() ); - crate::api::node::LdkNode { + crate::api::bolt12::LdkBolt12Payment { 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) -> Vec { - self.dyn_into::() - .unwrap() - .iter() - .map(CstDecode::cst_decode) - .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 -{ - // 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 { - self.into_vec() - } -} -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 -{ - // 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 -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::MaxDustHTLCExposure { - let self_ = self.unchecked_into::(); - match self_.get(0).unchecked_into_f64() as _ { - 0 => crate::api::types::MaxDustHTLCExposure::FixedLimitMsat(self_.get(1).cst_decode()), - 1 => { - crate::api::types::MaxDustHTLCExposure::FeeRateMultiplier(self_.get(1).cst_decode()) - } - _ => unreachable!(), - } - } -} -impl CstDecode> for Option { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> Option { - self.map(CstDecode::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::OutPoint { + fn cst_decode(self) -> crate::api::builder::LdkMnemonic { let self_ = self .dyn_into::() .unwrap(); assert_eq!( self_.length(), - 2, - "Expected 2 elements, got {}", + 1, + "Expected 1 elements, got {}", self_.length() ); - crate::api::types::OutPoint { - txid: self_.get(0).cst_decode(), - vout: self_.get(1).cst_decode(), + crate::api::builder::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::PaymentDetails { + fn cst_decode(self) -> crate::api::graph::LdkNetworkGraph { let self_ = self .dyn_into::() .unwrap(); assert_eq!( self_.length(), - 6, - "Expected 6 elements, got {}", + 1, + "Expected 1 elements, got {}", self_.length() ); - crate::api::types::PaymentDetails { - hash: self_.get(0).cst_decode(), - preimage: self_.get(1).cst_decode(), - secret: self_.get(2).cst_decode(), - amount_msat: self_.get(3).cst_decode(), - direction: self_.get(4).cst_decode(), - status: self_.get(5).cst_decode(), + crate::api::graph::LdkNetworkGraph { + inner: 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::PaymentHash { + fn cst_decode(self) -> crate::api::node::LdkNode { let self_ = self .dyn_into::() .unwrap(); @@ -430,16 +538,76 @@ impl CstDecode "Expected 1 elements, got {}", self_.length() ); - crate::api::types::PaymentHash { - data: self_.get(0).cst_decode(), + crate::api::node::LdkNode { + ptr: 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::PaymentPreimage { + fn cst_decode(self) -> crate::utils::error::LdkNodeError { + let self_ = self.unchecked_into::(); + match self_.get(0).unchecked_into_f64() as _ { + 0 => crate::utils::error::LdkNodeError::InvalidTxid, + 1 => crate::utils::error::LdkNodeError::AlreadyRunning, + 2 => crate::utils::error::LdkNodeError::NotRunning, + 3 => crate::utils::error::LdkNodeError::OnchainTxCreationFailed, + 4 => crate::utils::error::LdkNodeError::ConnectionFailed, + 5 => crate::utils::error::LdkNodeError::InvoiceCreationFailed, + 6 => crate::utils::error::LdkNodeError::PaymentSendingFailed, + 7 => crate::utils::error::LdkNodeError::ProbeSendingFailed, + 8 => crate::utils::error::LdkNodeError::ChannelCreationFailed, + 9 => crate::utils::error::LdkNodeError::ChannelClosingFailed, + 10 => crate::utils::error::LdkNodeError::ChannelConfigUpdateFailed, + 11 => crate::utils::error::LdkNodeError::PersistenceFailed, + 12 => crate::utils::error::LdkNodeError::WalletOperationFailed, + 13 => crate::utils::error::LdkNodeError::OnchainTxSigningFailed, + 14 => crate::utils::error::LdkNodeError::MessageSigningFailed, + 15 => crate::utils::error::LdkNodeError::TxSyncFailed, + 16 => crate::utils::error::LdkNodeError::GossipUpdateFailed, + 17 => crate::utils::error::LdkNodeError::InvalidAddress, + 18 => crate::utils::error::LdkNodeError::InvalidSocketAddress, + 19 => crate::utils::error::LdkNodeError::InvalidPublicKey, + 20 => crate::utils::error::LdkNodeError::InvalidSecretKey, + 21 => crate::utils::error::LdkNodeError::InvalidPaymentHash, + 22 => crate::utils::error::LdkNodeError::InvalidPaymentPreimage, + 23 => crate::utils::error::LdkNodeError::InvalidPaymentSecret, + 24 => crate::utils::error::LdkNodeError::InvalidAmount, + 25 => crate::utils::error::LdkNodeError::InvalidInvoice, + 26 => crate::utils::error::LdkNodeError::InvalidChannelId, + 27 => crate::utils::error::LdkNodeError::InvalidNetwork, + 28 => crate::utils::error::LdkNodeError::DuplicatePayment, + 29 => crate::utils::error::LdkNodeError::InsufficientFunds, + 30 => crate::utils::error::LdkNodeError::FeerateEstimationUpdateFailed, + 31 => crate::utils::error::LdkNodeError::LiquidityRequestFailed, + 32 => crate::utils::error::LdkNodeError::LiquiditySourceUnavailable, + 33 => crate::utils::error::LdkNodeError::LiquidityFeeTooHigh, + 34 => crate::utils::error::LdkNodeError::InvalidPaymentId, + 35 => crate::utils::error::LdkNodeError::Decode(self_.get(1).cst_decode()), + 36 => crate::utils::error::LdkNodeError::Bolt12Parse(self_.get(1).cst_decode()), + 37 => crate::utils::error::LdkNodeError::InvoiceRequestCreationFailed, + 38 => crate::utils::error::LdkNodeError::OfferCreationFailed, + 39 => crate::utils::error::LdkNodeError::RefundCreationFailed, + 40 => crate::utils::error::LdkNodeError::FeerateEstimationUpdateTimeout, + 41 => crate::utils::error::LdkNodeError::WalletOperationTimeout, + 42 => crate::utils::error::LdkNodeError::TxSyncTimeout, + 43 => crate::utils::error::LdkNodeError::GossipUpdateTimeout, + 44 => crate::utils::error::LdkNodeError::InvalidOfferId, + 45 => crate::utils::error::LdkNodeError::InvalidNodeId, + 46 => crate::utils::error::LdkNodeError::InvalidOffer, + 47 => crate::utils::error::LdkNodeError::InvalidRefund, + 48 => crate::utils::error::LdkNodeError::UnsupportedCurrency, + _ => unreachable!(), + } + } +} +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::on_chain::LdkOnChainPayment { let self_ = self .dyn_into::() .unwrap(); @@ -449,16 +617,16 @@ impl CstDecode "Expected 1 elements, got {}", self_.length() ); - crate::api::types::PaymentPreimage { - data: self_.get(0).cst_decode(), + crate::api::on_chain::LdkOnChainPayment { + ptr: 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::PaymentSecret { + fn cst_decode(self) -> crate::api::spontaneous::LdkSpontaneousPayment { let self_ = self .dyn_into::() .unwrap(); @@ -468,23 +636,457 @@ impl CstDecode "Expected 1 elements, got {}", self_.length() ); - crate::api::types::PaymentSecret { - data: self_.get(0).cst_decode(), + crate::api::spontaneous::LdkSpontaneousPayment { + ptr: 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::PeerDetails { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 3, - "Expected 3 elements, got {}", + 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!(), + } + } +} +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 { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 1, + "Expected 1 elements, got {}", + self_.length() + ); + crate::api::types::LiquiditySourceConfig { + lsps2_service: 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) -> Vec { + self.dyn_into::() + .unwrap() + .iter() + .map(CstDecode::cst_decode) + .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 +{ + // 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 +{ + // 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 +{ + // 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 +{ + // 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<[u64]> { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Vec { + self.into_vec() + } +} +impl CstDecode> for Box<[u8]> { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Vec { + self.into_vec() + } +} +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 +{ + // 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 +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::types::LSPFeeLimits { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 2, + "Expected 2 elements, got {}", + self_.length() + ); + crate::api::types::LSPFeeLimits { + max_total_opening_fee_msat: self_.get(0).cst_decode(), + max_proportional_opening_fee_ppm_msat: self_.get(1).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::MaxDustHTLCExposure { + let self_ = self.unchecked_into::(); + match self_.get(0).unchecked_into_f64() as _ { + 0 => crate::api::types::MaxDustHTLCExposure::FixedLimitMsat(self_.get(1).cst_decode()), + 1 => { + crate::api::types::MaxDustHTLCExposure::FeeRateMultiplier(self_.get(1).cst_decode()) + } + _ => unreachable!(), + } + } +} +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::graph::NodeId { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 1, + "Expected 1 elements, got {}", + self_.length() + ); + crate::api::graph::NodeId { + compressed: 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 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::OfferId { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 1, + "Expected 1 elements, got {}", + self_.length() + ); + crate::api::types::OfferId(self_.get(0).cst_decode()) + } +} +impl CstDecode> for Option { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Option { + self.map(CstDecode::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::OutPoint { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 2, + "Expected 2 elements, got {}", + self_.length() + ); + crate::api::types::OutPoint { + txid: self_.get(0).cst_decode(), + vout: self_.get(1).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::PaymentDetails { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 5, + "Expected 5 elements, got {}", + self_.length() + ); + crate::api::types::PaymentDetails { + id: self_.get(0).cst_decode(), + kind: self_.get(1).cst_decode(), + amount_msat: self_.get(2).cst_decode(), + direction: self_.get(3).cst_decode(), + status: 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::PaymentHash { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 1, + "Expected 1 elements, got {}", + self_.length() + ); + crate::api::types::PaymentHash { + data: 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::PaymentId { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 1, + "Expected 1 elements, got {}", + self_.length() + ); + crate::api::types::PaymentId(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::PaymentKind { + let self_ = self.unchecked_into::(); + match self_.get(0).unchecked_into_f64() as _ { + 0 => crate::api::types::PaymentKind::Onchain, + 1 => crate::api::types::PaymentKind::Bolt11 { + hash: self_.get(1).cst_decode(), + preimage: self_.get(2).cst_decode(), + secret: self_.get(3).cst_decode(), + }, + 2 => crate::api::types::PaymentKind::Bolt11Jit { + hash: self_.get(1).cst_decode(), + preimage: self_.get(2).cst_decode(), + secret: self_.get(3).cst_decode(), + lsp_fee_limits: self_.get(4).cst_decode(), + }, + 3 => crate::api::types::PaymentKind::Spontaneous { + hash: self_.get(1).cst_decode(), + preimage: self_.get(2).cst_decode(), + }, + 4 => crate::api::types::PaymentKind::Bolt12Offer { + hash: self_.get(1).cst_decode(), + preimage: self_.get(2).cst_decode(), + secret: self_.get(3).cst_decode(), + offer_id: self_.get(4).cst_decode(), + }, + 5 => crate::api::types::PaymentKind::Bolt12Refund { + hash: self_.get(1).cst_decode(), + preimage: self_.get(2).cst_decode(), + secret: self_.get(3).cst_decode(), + }, + _ => unreachable!(), + } + } +} +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::PaymentPreimage { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 1, + "Expected 1 elements, got {}", + self_.length() + ); + crate::api::types::PaymentPreimage { + data: 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::PaymentSecret { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 1, + "Expected 1 elements, got {}", + self_.length() + ); + crate::api::types::PaymentSecret { + data: 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::PeerDetails { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 3, + "Expected 3 elements, got {}", self_.length() ); crate::api::types::PeerDetails { @@ -494,6 +1096,34 @@ 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 { @@ -513,6 +1143,57 @@ impl CstDecode } } } +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 +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::api::graph::RoutingFees { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 2, + "Expected 2 elements, got {}", + self_.length() + ); + crate::api::graph::RoutingFees { + base_msat: self_.get(0).cst_decode(), + proportional_millionths: self_.get(1).cst_decode(), + } + } +} impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { @@ -616,11 +1297,105 @@ 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) -> NodeBuilder { + flutter_rust_bridge::for_generated::rust_auto_opaque_decode_owned(CstDecode::< + RustOpaqueNom>, + >::cst_decode( + self + )) + } +} +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) -> RustOpaqueNom> { + #[cfg(target_pointer_width = "64")] + { + compile_error!("64-bit pointers are not supported."); + } + unsafe { decode_rust_opaque_nom((self.as_f64().unwrap() as usize) as _) } + } +} +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) -> RustOpaqueNom { + #[cfg(target_pointer_width = "64")] + { + compile_error!("64-bit pointers are not supported."); + } + unsafe { decode_rust_opaque_nom((self.as_f64().unwrap() as usize) as _) } + } +} +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, + ) -> RustOpaqueNom> { + #[cfg(target_pointer_width = "64")] + { + compile_error!("64-bit pointers are not supported."); + } + unsafe { decode_rust_opaque_nom((self.as_f64().unwrap() as usize) as _) } + } +} +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) -> RustOpaqueNom { + #[cfg(target_pointer_width = "64")] + { + compile_error!("64-bit pointers are not supported."); + } + unsafe { decode_rust_opaque_nom((self.as_f64().unwrap() as usize) as _) } + } +} +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) -> RustOpaqueNom { + #[cfg(target_pointer_width = "64")] + { + compile_error!("64-bit pointers are not supported."); + } + unsafe { decode_rust_opaque_nom((self.as_f64().unwrap() as usize) as _) } + } +} +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) -> RustOpaqueNom { + #[cfg(target_pointer_width = "64")] + { + compile_error!("64-bit pointers are not supported."); + } + unsafe { decode_rust_opaque_nom((self.as_f64().unwrap() as usize) as _) } + } +} +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) -> RustOpaqueNom { + #[cfg(target_pointer_width = "64")] + { + compile_error!("64-bit pointers are not supported."); + } + unsafe { decode_rust_opaque_nom((self.as_f64().unwrap() as usize) as _) } + } +} +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) -> RustOpaqueNom> { + fn cst_decode(self) -> RustOpaqueNom { #[cfg(target_pointer_width = "64")] { compile_error!("64-bit pointers are not supported."); @@ -640,18 +1415,28 @@ 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) -> i32 { + self.unchecked_into_f64() as _ + } +} +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::BuilderException { + fn cst_decode(self) -> crate::utils::error::LdkBuilderError { (self.unchecked_into_f64() as i32).cst_decode() } } -impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { +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) -> i32 { - self.unchecked_into_f64() as _ + fn cst_decode(self) -> Vec { + let buf = self + .dyn_into::() + .unwrap(); + let buf = flutter_rust_bridge::for_generated::js_sys::Uint8Array::new(&buf.buffer()); + flutter_rust_bridge::for_generated::slice_from_byte_buffer(buf.to_vec()).into() } } impl CstDecode> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { @@ -678,19 +1463,19 @@ 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::NodeException { + fn cst_decode(self) -> crate::api::types::PaymentDirection { (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::types::PaymentDirection { + fn cst_decode(self) -> crate::api::types::PaymentFailureReason { (self.unchecked_into_f64() as i32).cst_decode() } } @@ -714,119 +1499,320 @@ impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValu self.unchecked_into_f64() as _ } } -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) -> u64 { - ::std::convert::TryInto::try_into( - self.dyn_into::() - .unwrap(), - ) - .unwrap() - } +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) -> u64 { + ::std::convert::TryInto::::try_into(self).unwrap() as _ + } +} +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) -> u8 { + self.unchecked_into_f64() as _ + } +} +impl CstDecode<[u8; 12]> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> [u8; 12] { + let vec: Vec = self.cst_decode(); + flutter_rust_bridge::for_generated::from_vec_to_array(vec) + } +} +impl CstDecode<[u8; 16]> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> [u8; 16] { + let vec: Vec = self.cst_decode(); + flutter_rust_bridge::for_generated::from_vec_to_array(vec) + } +} +impl CstDecode<[u8; 32]> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> [u8; 32] { + let vec: Vec = self.cst_decode(); + flutter_rust_bridge::for_generated::from_vec_to_array(vec) + } +} +impl CstDecode<[u8; 4]> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> [u8; 4] { + let vec: Vec = self.cst_decode(); + flutter_rust_bridge::for_generated::from_vec_to_array(vec) + } +} +impl CstDecode<[u8; 64]> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> [u8; 64] { + let vec: Vec = self.cst_decode(); + flutter_rust_bridge::for_generated::from_vec_to_array(vec) + } +} +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) -> usize { + ::std::convert::TryInto::::try_into(self).unwrap() as _ + } +} + +#[wasm_bindgen] +pub fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + amount_msat: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + description: String, + expiry_secs: u32, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_impl( + port_, + that, + amount_msat, + description, + expiry_secs, + ) +} + +#[wasm_bindgen] +pub fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + description: String, + expiry_secs: u32, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_impl( + port_, + that, + description, + expiry_secs, + ) +} + +#[wasm_bindgen] +pub fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel( + 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__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel_impl( + port_, + that, + description, + expiry_secs, + max_proportional_lsp_fee_limit_ppm_msat, + ) +} + +#[wasm_bindgen] +pub fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + amount_msat: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + description: String, + expiry_secs: u32, + max_total_lsp_fee_limit_msat: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel_impl( + port_, + that, + amount_msat, + description, + expiry_secs, + max_total_lsp_fee_limit_msat, + ) +} + +#[wasm_bindgen] +pub fn wire__crate__api__bolt11__ldk_bolt_11_payment_send( + 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__crate__api__bolt11__ldk_bolt_11_payment_send_impl(port_, that, invoice) } -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) -> u8 { - self.unchecked_into_f64() as _ - } + +#[wasm_bindgen] +pub fn wire__crate__api__bolt11__ldk_bolt_11_payment_send_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__crate__api__bolt11__ldk_bolt_11_payment_send_probes_impl(port_, that, invoice) } -impl CstDecode<[u8; 12]> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> [u8; 12] { - let vec: Vec = self.cst_decode(); - flutter_rust_bridge::for_generated::from_vec_to_array(vec) - } + +#[wasm_bindgen] +pub fn wire__crate__api__bolt11__ldk_bolt_11_payment_send_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: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount_impl( + port_, + that, + invoice, + amount_msat, + ) } -impl CstDecode<[u8; 16]> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> [u8; 16] { - let vec: Vec = self.cst_decode(); - flutter_rust_bridge::for_generated::from_vec_to_array(vec) - } + +#[wasm_bindgen] +pub fn wire__crate__api__bolt11__ldk_bolt_11_payment_send_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: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount_impl( + port_, + that, + invoice, + amount_msat, + ) } -impl CstDecode<[u8; 32]> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> [u8; 32] { - let vec: Vec = self.cst_decode(); - flutter_rust_bridge::for_generated::from_vec_to_array(vec) - } + +#[wasm_bindgen] +pub fn wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder( + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder_impl(that) } -impl CstDecode<[u8; 4]> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> [u8; 4] { - let vec: Vec = self.cst_decode(); - flutter_rust_bridge::for_generated::from_vec_to_array(vec) - } + +#[wasm_bindgen] +pub fn wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder( + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + builder: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder_impl(that, builder) } -impl CstDecode<[u8; 64]> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> [u8; 64] { - let vec: Vec = self.cst_decode(); - flutter_rust_bridge::for_generated::from_vec_to_array(vec) - } + +#[wasm_bindgen] +pub fn wire__crate__api__builder__NodeBuilder_build( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire__crate__api__builder__NodeBuilder_build_impl(port_, that) } -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) -> usize { - self.unchecked_into_f64() as _ - } + +#[wasm_bindgen] +pub fn wire__crate__api__builder__NodeBuilder_build_with_fs_store( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire__crate__api__builder__NodeBuilder_build_with_fs_store_impl(port_, that) } #[wasm_bindgen] -pub fn wire_build_with_sqlite_store( +pub fn wire__crate__api__builder__NodeBuilder_create_builder( 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, ) { - wire_build_with_sqlite_store_impl( + wire__crate__api__builder__NodeBuilder_create_builder_impl( port_, config, chain_data_source_config, entropy_source_config, gossip_source_config, + liquidity_source_config, ) } #[wasm_bindgen] -pub fn wire_ldk_mnemonic_generate(port_: flutter_rust_bridge::for_generated::MessagePort) { - wire_ldk_mnemonic_generate_impl(port_) +pub fn wire__crate__api__builder__ldk_mnemonic_generate( + port_: flutter_rust_bridge::for_generated::MessagePort, +) { + wire__crate__api__builder__ldk_mnemonic_generate_impl(port_) +} + +#[wasm_bindgen] +pub fn wire__crate__api__graph__ldk_network_graph_channel( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + short_channel_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire__crate__api__graph__ldk_network_graph_channel_impl(port_, that, short_channel_id) +} + +#[wasm_bindgen] +pub fn wire__crate__api__graph__ldk_network_graph_list_channels( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire__crate__api__graph__ldk_network_graph_list_channels_impl(port_, that) +} + +#[wasm_bindgen] +pub fn wire__crate__api__graph__ldk_network_graph_list_nodes( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire__crate__api__graph__ldk_network_graph_list_nodes_impl(port_, that) +} + +#[wasm_bindgen] +pub fn wire__crate__api__node__ldk_node_bolt11_payment( + port_: flutter_rust_bridge::for_generated::MessagePort, + ptr: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire__crate__api__node__ldk_node_bolt11_payment_impl(port_, ptr) } #[wasm_bindgen] -pub fn wire_ldk_node_close_channel( +pub fn wire__crate__api__node__ldk_node_bolt12_payment( + port_: flutter_rust_bridge::for_generated::MessagePort, + ptr: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire__crate__api__node__ldk_node_bolt12_payment_impl(port_, ptr) +} + +#[wasm_bindgen] +pub fn wire__crate__api__node__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, + user_channel_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, counterparty_node_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_close_channel_impl(port_, that, channel_id, counterparty_node_id) + wire__crate__api__node__ldk_node_close_channel_impl( + port_, + that, + user_channel_id, + counterparty_node_id, + ) +} + +#[wasm_bindgen] +pub fn wire__crate__api__node__ldk_node_config( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire__crate__api__node__ldk_node_config_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_connect( +pub fn wire__crate__api__node__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_ldk_node_connect_impl(port_, that, node_id, address, persist) + wire__crate__api__node__ldk_node_connect_impl(port_, that, node_id, address, persist) } #[wasm_bindgen] -pub fn wire_ldk_node_connect_open_channel( +pub fn wire__crate__api__node__ldk_node_connect_open_channel( port_: flutter_rust_bridge::for_generated::MessagePort, that: 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, + channel_amount_sats: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, 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_ldk_node_connect_open_channel_impl( + wire__crate__api__node__ldk_node_connect_open_channel_impl( port_, that, socket_address, @@ -839,322 +1825,423 @@ pub fn wire_ldk_node_connect_open_channel( } #[wasm_bindgen] -pub fn wire_ldk_node_disconnect( +pub fn wire__crate__api__node__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_ldk_node_disconnect_impl(port_, that, counterparty_node_id) + wire__crate__api__node__ldk_node_disconnect_impl(port_, that, counterparty_node_id) } #[wasm_bindgen] -pub fn wire_ldk_node_event_handled( +pub fn wire__crate__api__node__ldk_node_event_handled( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_event_handled_impl(port_, that) + wire__crate__api__node__ldk_node_event_handled_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_is_running( +pub fn wire__crate__api__node__ldk_node_force_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_ldk_node_is_running_impl(port_, that) + wire__crate__api__node__ldk_node_force_close_channel_impl( + port_, + that, + user_channel_id, + counterparty_node_id, + ) } #[wasm_bindgen] -pub fn wire_ldk_node_list_channels( +pub fn wire__crate__api__node__ldk_node_list_balances( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_list_channels_impl(port_, that) + wire__crate__api__node__ldk_node_list_balances_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_list_payments( +pub fn wire__crate__api__node__ldk_node_list_channels( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_list_payments_impl(port_, that) + wire__crate__api__node__ldk_node_list_channels_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_list_payments_with_filter( +pub fn wire__crate__api__node__ldk_node_list_payments( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - payment_direction: i32, ) { - wire_ldk_node_list_payments_with_filter_impl(port_, that, payment_direction) + wire__crate__api__node__ldk_node_list_payments_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_list_peers( +pub fn wire__crate__api__node__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_ldk_node_list_peers_impl(port_, that) + wire__crate__api__node__ldk_node_list_payments_with_filter_impl(port_, that, payment_direction) } #[wasm_bindgen] -pub fn wire_ldk_node_listening_addresses( +pub fn wire__crate__api__node__ldk_node_list_peers( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_listening_addresses_impl(port_, that) + wire__crate__api__node__ldk_node_list_peers_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_new_onchain_address( +pub fn wire__crate__api__node__ldk_node_listening_addresses( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_new_onchain_address_impl(port_, that) + wire__crate__api__node__ldk_node_listening_addresses_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_next_event( +pub fn wire__crate__api__node__ldk_node_network_graph( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_next_event_impl(port_, that) + wire__crate__api__node__ldk_node_network_graph_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_node_id( +pub fn wire__crate__api__node__ldk_node_next_event( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_node_id_impl(port_, that) + wire__crate__api__node__ldk_node_next_event_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_payment( +pub fn wire__crate__api__node__ldk_node_next_event_async( 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_ldk_node_payment_impl(port_, that, payment_hash) + wire__crate__api__node__ldk_node_next_event_async_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_receive_payment( +pub fn wire__crate__api__node__ldk_node_node_id( 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_ldk_node_receive_payment_impl(port_, that, amount_msat, description, expiry_secs) + wire__crate__api__node__ldk_node_node_id_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_receive_variable_amount_payment( +pub fn wire__crate__api__node__ldk_node_on_chain_payment( port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - description: String, - expiry_secs: u32, + ptr: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_receive_variable_amount_payment_impl(port_, that, description, expiry_secs) + wire__crate__api__node__ldk_node_on_chain_payment_impl(port_, ptr) } #[wasm_bindgen] -pub fn wire_ldk_node_remove_payment( +pub fn wire__crate__api__node__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, + payment_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_remove_payment_impl(port_, that, payment_hash) + wire__crate__api__node__ldk_node_payment_impl(port_, that, payment_id) } #[wasm_bindgen] -pub fn wire_ldk_node_send_all_to_onchain_address( +pub fn wire__crate__api__node__ldk_node_remove_payment( 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, + payment_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_send_all_to_onchain_address_impl(port_, that, address) + wire__crate__api__node__ldk_node_remove_payment_impl(port_, that, payment_id) } #[wasm_bindgen] -pub fn wire_ldk_node_send_payment( +pub fn wire__crate__api__node__ldk_node_sign_message( 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, + msg: Box<[u8]>, ) { - wire_ldk_node_send_payment_impl(port_, that, invoice) + wire__crate__api__node__ldk_node_sign_message_impl(port_, that, msg) } #[wasm_bindgen] -pub fn wire_ldk_node_send_payment_probes( +pub fn wire__crate__api__node__ldk_node_spontaneous_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, + ptr: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_send_payment_probes_impl(port_, that, invoice) + wire__crate__api__node__ldk_node_spontaneous_payment_impl(port_, ptr) } #[wasm_bindgen] -pub fn wire_ldk_node_send_payment_probes_using_amount( +pub fn wire__crate__api__node__ldk_node_start( 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_ldk_node_send_payment_probes_using_amount_impl(port_, that, invoice, amount_msat) + wire__crate__api__node__ldk_node_start_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_send_payment_using_amount( +pub fn wire__crate__api__node__ldk_node_status( 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_ldk_node_send_payment_using_amount_impl(port_, that, invoice, amount_msat) + wire__crate__api__node__ldk_node_status_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_send_spontaneous_payment( +pub fn wire__crate__api__node__ldk_node_stop( 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_ldk_node_send_spontaneous_payment_impl(port_, that, amount_msat, node_id) + wire__crate__api__node__ldk_node_stop_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_send_spontaneous_payment_probes( +pub fn wire__crate__api__node__ldk_node_sync_wallets( 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_ldk_node_send_spontaneous_payment_probes_impl(port_, that, amount_msat, node_id) + wire__crate__api__node__ldk_node_sync_wallets_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_send_to_onchain_address( +pub fn wire__crate__api__node__ldk_node_update_channel_config( 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, + user_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_ldk_node_send_to_onchain_address_impl(port_, that, address, amount_sats) + wire__crate__api__node__ldk_node_update_channel_config_impl( + port_, + that, + user_channel_id, + counterparty_node_id, + channel_config, + ) } #[wasm_bindgen] -pub fn wire_ldk_node_sign_message( +pub fn wire__crate__api__node__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, + public_key: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_sign_message_impl(port_, that, msg) + wire__crate__api__node__ldk_node_verify_signature_impl(port_, that, msg, sig, public_key) } #[wasm_bindgen] -pub fn wire_ldk_node_spendable_onchain_balance_sats( +pub fn wire__crate__api__node__ldk_node_wait_next_event( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_spendable_onchain_balance_sats_impl(port_, that) + wire__crate__api__node__ldk_node_wait_next_event_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_start( +pub fn wire__crate__api__on_chain__ldk_on_chain_payment_new_address( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_start_impl(port_, that) + wire__crate__api__on_chain__ldk_on_chain_payment_new_address_impl(port_, that) } #[wasm_bindgen] -pub fn wire_ldk_node_stop( +pub fn wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_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_ldk_node_stop_impl(port_, that) + wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address_impl(port_, that, address) } #[wasm_bindgen] -pub fn wire_ldk_node_sync_wallets( +pub fn wire__crate__api__on_chain__ldk_on_chain_payment_send_to_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: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_sync_wallets_impl(port_, that) + wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address_impl( + port_, + that, + address, + amount_sats, + ) } #[wasm_bindgen] -pub fn wire_ldk_node_total_onchain_balance_sats( +pub fn wire__crate__api__spontaneous__ldk_spontaneous_payment_send( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + amount_msat: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + node_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_total_onchain_balance_sats_impl(port_, that) + wire__crate__api__spontaneous__ldk_spontaneous_payment_send_impl( + port_, + that, + amount_msat, + node_id, + ) } #[wasm_bindgen] -pub fn wire_ldk_node_update_channel_config( +pub fn wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes( 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, + amount_msat: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + node_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_ldk_node_update_channel_config_impl( + wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes_impl( port_, that, - channel_id, - counterparty_node_id, - channel_config, + amount_msat, + node_id, ) } #[wasm_bindgen] -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, +pub fn rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ptr: *const std::ffi::c_void, ) { - wire_ldk_node_verify_signature_impl(port_, that, msg, sig, pkey) + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } } #[wasm_bindgen] -pub fn wire_ldk_node_wait_next_event( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +pub fn rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment( + ptr: *const std::ffi::c_void, ) { - wire_ldk_node_wait_next_event_impl(port_, that) + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } } #[wasm_bindgen] -pub fn wire_socket_address_as_string( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +pub fn rust_arc_increment_strong_count_RustOpaque_Node(ptr: *const std::ffi::c_void) { + unsafe { + StdArc::::increment_strong_count(ptr as _); + } +} + +#[wasm_bindgen] +pub fn rust_arc_decrement_strong_count_RustOpaque_Node(ptr: *const std::ffi::c_void) { + unsafe { + StdArc::::decrement_strong_count(ptr as _); + } +} + +#[wasm_bindgen] +pub fn rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + ptr: *const std::ffi::c_void, ) { - wire_socket_address_as_string_impl(port_, that) + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } } #[wasm_bindgen] -pub fn wire_socket_address_from_str( - port_: flutter_rust_bridge::for_generated::MessagePort, - address: String, +pub fn rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } +} + +#[wasm_bindgen] +pub fn rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilder(ptr: *const std::ffi::c_void) { + unsafe { + StdArc::::increment_strong_count(ptr as _); + } +} + +#[wasm_bindgen] +pub fn rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilder(ptr: *const std::ffi::c_void) { + unsafe { + StdArc::::decrement_strong_count(ptr as _); + } +} + +#[wasm_bindgen] +pub fn rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraph( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::::increment_strong_count(ptr as _); + } +} + +#[wasm_bindgen] +pub fn rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraph( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::::decrement_strong_count(ptr as _); + } +} + +#[wasm_bindgen] +pub fn rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::::increment_strong_count(ptr as _); + } +} + +#[wasm_bindgen] +pub fn rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( + ptr: *const std::ffi::c_void, ) { - wire_socket_address_from_str_impl(port_, address) + unsafe { + StdArc::::decrement_strong_count(ptr as _); + } +} + +#[wasm_bindgen] +pub fn rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::::increment_strong_count(ptr as _); + } } #[wasm_bindgen] -pub fn rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore(ptr: *const std::ffi::c_void) { +pub fn rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::::decrement_strong_count(ptr as _); + } +} + +#[wasm_bindgen] +pub fn rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( + ptr: *const std::ffi::c_void, +) { unsafe { - StdArc::>::increment_strong_count(ptr as _); + StdArc::::increment_strong_count(ptr as _); } } #[wasm_bindgen] -pub fn rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore(ptr: *const std::ffi::c_void) { +pub fn rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( + ptr: *const std::ffi::c_void, +) { unsafe { - StdArc::>::decrement_strong_count(ptr as _); + StdArc::::decrement_strong_count(ptr as _); } } diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 0458c57..bdb0d23 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -1,3 +1,4 @@ mod frb_generated; /* AUTO INJECTED BY flutter_rust_bridge. This line may not be accurate, and you can change it according to your needs. */ pub mod api; +pub mod utils; diff --git a/rust/src/utils/error.rs b/rust/src/utils/error.rs new file mode 100644 index 0000000..a988553 --- /dev/null +++ b/rust/src/utils/error.rs @@ -0,0 +1,289 @@ +use ldk_node::{BuildError, NodeError}; + +#[derive(Debug, PartialEq)] +pub enum LdkNodeError { + InvalidTxid, + /// Returned when trying to start [Node] while it is already running. + AlreadyRunning, + /// Returned when trying to stop [Node] while it is not running. + NotRunning, + /// An on-chain transaction could not be created. + OnchainTxCreationFailed, + /// A network connection has been closed. + ConnectionFailed, + /// Invoice creation failed. + InvoiceCreationFailed, + /// Sending a payment has failed. + PaymentSendingFailed, + /// Sending a payment probe has failed. + ProbeSendingFailed, + /// A channel could not be opened. + ChannelCreationFailed, + /// A channel could not be closed. + ChannelClosingFailed, + /// A channel config could not be updated. + ChannelConfigUpdateFailed, + /// Persistence failed. + PersistenceFailed, + /// A wallet operation failed. + WalletOperationFailed, + /// A signing operation for transaction failed. + OnchainTxSigningFailed, + /// A signing operation for message failed. + MessageSigningFailed, + /// A transaction sync operation failed. + TxSyncFailed, + /// A gossip updating operation failed. + GossipUpdateFailed, + /// The given address is invalid. + InvalidAddress, + /// The given network address is invalid. + InvalidSocketAddress, + /// The given public key is invalid. + InvalidPublicKey, + /// The given secret key is invalid. + InvalidSecretKey, + /// The given payment hash is invalid. + InvalidPaymentHash, + /// The given payment preimage is invalid. + InvalidPaymentPreimage, + /// The given payment secret is invalid. + InvalidPaymentSecret, + /// The given amount is invalid. + InvalidAmount, + /// The given invoice is invalid. + InvalidInvoice, + /// The given channel ID is invalid. + InvalidChannelId, + /// The given network is invalid. + InvalidNetwork, + /// A payment with the given hash has already been initiated. + DuplicatePayment, + /// There are insufficient funds to complete the given operation. + InsufficientFunds, + ///A fee rate estimation update failed. + FeerateEstimationUpdateFailed, + ///A liquidity request operation failed. + LiquidityRequestFailed, + ///The given operation failed due to the required liquidity source being unavailable. + LiquiditySourceUnavailable, + ///The given operation failed due to the LSP's required opening fee being too high. + LiquidityFeeTooHigh, + ///The given payment id is invalid. + InvalidPaymentId, + ///An error in decoding a message or struct. + Decode(DecodeError), + ///An error in decoding the Bolt12 offer. + Bolt12Parse(Bolt12ParseError), + ///Invoice request creation failed. + InvoiceRequestCreationFailed, + ///Offer creation failed. + OfferCreationFailed, + ///Refund creation failed. + RefundCreationFailed, + ///A fee rate estimation update timed out. + FeerateEstimationUpdateTimeout, + ///A wallet operation timed out. + WalletOperationTimeout, + ///A transaction sync operation timed out. + TxSyncTimeout, + ///A gossip updating operation timed out. + GossipUpdateTimeout, + ///The given offer id is invalid. + InvalidOfferId, + ///The given node id is invalid. + InvalidNodeId, + ///The given offer is invalid. + InvalidOffer, + ///The given refund is invalid. + InvalidRefund, + ///The provided offer was denominated in an unsupported currency. + UnsupportedCurrency, +} +#[allow(dead_code)] +#[derive(Debug)] +pub enum LdkBuilderError { + SocketAddressParseError, + /// The given seed bytes are invalid, e.g., have invalid length. + InvalidSeedBytes, + /// The given seed file is invalid, e.g., has invalid length, or could not be read. + InvalidSeedFile, + /// The current system time is invalid, clocks might have gone backwards. + InvalidSystemTime, + /// The a read channel monitor is invalid. + InvalidChannelMonitor, + /// The given listening addresses are invalid, e.g. too many were passed. + InvalidListeningAddress, + /// We failed to read data from the [`KVStore`]. + ReadFailed, + /// We failed to write data to the [`KVStore`]. + WriteFailed, + /// We failed to access the given `storage_dir_path`. + StoragePathAccessFailed, + /// We failed to setup our [`KVStore`]. + KVStoreSetupFailed, + /// We failed to setup the onchain wallet. + WalletSetupFailed, + /// We failed to setup the logger. + LoggerSetupFailed, + + InvalidPublicKey, +} + +impl From for LdkNodeError { + fn from(value: NodeError) -> Self { + match value { + NodeError::AlreadyRunning => LdkNodeError::AlreadyRunning, + NodeError::NotRunning => LdkNodeError::NotRunning, + NodeError::OnchainTxCreationFailed => LdkNodeError::OnchainTxCreationFailed, + NodeError::ConnectionFailed => LdkNodeError::ConnectionFailed, + NodeError::InvoiceCreationFailed => LdkNodeError::InvoiceCreationFailed, + NodeError::PaymentSendingFailed => LdkNodeError::PaymentSendingFailed, + NodeError::ProbeSendingFailed => LdkNodeError::ProbeSendingFailed, + NodeError::ChannelCreationFailed => LdkNodeError::ChannelCreationFailed, + NodeError::ChannelClosingFailed => LdkNodeError::ChannelClosingFailed, + NodeError::ChannelConfigUpdateFailed => LdkNodeError::ChannelConfigUpdateFailed, + NodeError::PersistenceFailed => LdkNodeError::PersistenceFailed, + NodeError::WalletOperationFailed => LdkNodeError::WalletOperationFailed, + NodeError::OnchainTxSigningFailed => LdkNodeError::OnchainTxSigningFailed, + NodeError::MessageSigningFailed => LdkNodeError::MessageSigningFailed, + NodeError::TxSyncFailed => LdkNodeError::TxSyncFailed, + NodeError::GossipUpdateFailed => LdkNodeError::GossipUpdateFailed, + NodeError::InvalidAddress => LdkNodeError::InvalidAddress, + NodeError::InvalidSocketAddress => LdkNodeError::InvalidSocketAddress, + NodeError::InvalidPublicKey => LdkNodeError::InvalidPublicKey, + NodeError::InvalidSecretKey => LdkNodeError::InvalidSecretKey, + NodeError::InvalidPaymentHash => LdkNodeError::InvalidPaymentHash, + NodeError::InvalidPaymentPreimage => LdkNodeError::InvalidPaymentPreimage, + NodeError::InvalidPaymentSecret => LdkNodeError::InvalidPaymentSecret, + NodeError::InvalidAmount => LdkNodeError::InvalidAmount, + NodeError::InvalidInvoice => LdkNodeError::InvalidInvoice, + NodeError::InvalidChannelId => LdkNodeError::InvalidChannelId, + NodeError::InvalidNetwork => LdkNodeError::InvalidNetwork, + NodeError::DuplicatePayment => LdkNodeError::DuplicatePayment, + NodeError::InsufficientFunds => LdkNodeError::InsufficientFunds, + NodeError::FeerateEstimationUpdateFailed => LdkNodeError::FeerateEstimationUpdateFailed, + NodeError::LiquidityRequestFailed => LdkNodeError::LiquidityRequestFailed, + NodeError::LiquiditySourceUnavailable => LdkNodeError::LiquiditySourceUnavailable, + NodeError::LiquidityFeeTooHigh => LdkNodeError::LiquidityFeeTooHigh, + NodeError::InvalidPaymentId => LdkNodeError::InvalidPaymentId, + NodeError::InvoiceRequestCreationFailed => LdkNodeError::InvoiceRequestCreationFailed, + NodeError::OfferCreationFailed => LdkNodeError::OfferCreationFailed, + NodeError::RefundCreationFailed => LdkNodeError::RefundCreationFailed, + NodeError::FeerateEstimationUpdateTimeout => { + LdkNodeError::FeerateEstimationUpdateTimeout + } + NodeError::WalletOperationTimeout => LdkNodeError::WalletOperationTimeout, + NodeError::TxSyncTimeout => LdkNodeError::TxSyncTimeout, + NodeError::GossipUpdateTimeout => LdkNodeError::GossipUpdateTimeout, + NodeError::InvalidOfferId => LdkNodeError::InvalidOfferId, + NodeError::InvalidNodeId => LdkNodeError::InvalidNodeId, + NodeError::InvalidOffer => LdkNodeError::InvalidOffer, + NodeError::InvalidRefund => LdkNodeError::InvalidRefund, + NodeError::UnsupportedCurrency => LdkNodeError::UnsupportedCurrency, + } + } +} +impl From for LdkBuilderError { + fn from(value: BuildError) -> Self { + match value { + BuildError::InvalidSeedBytes => LdkBuilderError::InvalidSeedBytes, + BuildError::InvalidSeedFile => LdkBuilderError::InvalidSeedFile, + BuildError::InvalidSystemTime => LdkBuilderError::InvalidSystemTime, + BuildError::ReadFailed => LdkBuilderError::ReadFailed, + BuildError::WriteFailed => LdkBuilderError::WriteFailed, + BuildError::StoragePathAccessFailed => LdkBuilderError::StoragePathAccessFailed, + BuildError::WalletSetupFailed => LdkBuilderError::WalletSetupFailed, + BuildError::LoggerSetupFailed => LdkBuilderError::LoggerSetupFailed, + BuildError::InvalidChannelMonitor => LdkBuilderError::InvalidChannelMonitor, + BuildError::KVStoreSetupFailed => LdkBuilderError::KVStoreSetupFailed, + BuildError::InvalidListeningAddresses => LdkBuilderError::InvalidListeningAddress, + } + } +} + +impl From for LdkBuilderError { + fn from(value: ldk_node::bip39::Error) -> Self { + match value { + ldk_node::bip39::Error::BadWordCount(_) => LdkBuilderError::InvalidSeedBytes, + ldk_node::bip39::Error::UnknownWord(_) => LdkBuilderError::InvalidSeedBytes, + ldk_node::bip39::Error::BadEntropyBitCount(_) => LdkBuilderError::InvalidSeedBytes, + ldk_node::bip39::Error::InvalidChecksum => LdkBuilderError::InvalidSeedBytes, + ldk_node::bip39::Error::AmbiguousLanguages(_) => LdkBuilderError::InvalidSeedBytes, + } + } +} +impl From for LdkNodeError { + fn from(value: ldk_node::lightning::ln::msgs::DecodeError) -> Self { + LdkNodeError::Decode(value.into()) + } +} +impl From for DecodeError { + fn from(e: ldk_node::lightning::ln::msgs::DecodeError) -> Self { + match e { + ldk_node::lightning::ln::msgs::DecodeError::UnknownVersion => { + DecodeError::UnknownVersion + } + ldk_node::lightning::ln::msgs::DecodeError::UnknownRequiredFeature => { + DecodeError::UnknownRequiredFeature + } + ldk_node::lightning::ln::msgs::DecodeError::InvalidValue => DecodeError::InvalidValue, + ldk_node::lightning::ln::msgs::DecodeError::ShortRead => DecodeError::ShortRead, + ldk_node::lightning::ln::msgs::DecodeError::BadLengthDescriptor => { + DecodeError::BadLengthDescriptor + } + ldk_node::lightning::ln::msgs::DecodeError::Io(e) => DecodeError::Io(e.to_string()), + ldk_node::lightning::ln::msgs::DecodeError::UnsupportedCompression => { + DecodeError::UnsupportedCompression + } + ldk_node::lightning::ln::msgs::DecodeError::DangerousValue => { + DecodeError::DangerousValue + } + } + } +} +#[derive(Debug, PartialEq)] +pub enum DecodeError { + UnknownVersion, + UnknownRequiredFeature, + InvalidValue, + ShortRead, + BadLengthDescriptor, + Io(String), + UnsupportedCompression, + DangerousValue, +} + +#[derive(Debug, PartialEq)] +pub enum Bolt12ParseError { + InvalidContinuation, + InvalidBech32Hrp, + Bech32(String), + Decode(DecodeError), + InvalidSemantics(String), + InvalidSignature(String), +} +impl From for LdkNodeError { + fn from(value: ldk_node::lightning::offers::parse::Bolt12ParseError) -> Self { + match value { + ldk_node::lightning::offers::parse::Bolt12ParseError::InvalidContinuation => { + LdkNodeError::Bolt12Parse(Bolt12ParseError::InvalidContinuation) + } + ldk_node::lightning::offers::parse::Bolt12ParseError::InvalidBech32Hrp => { + LdkNodeError::Bolt12Parse(Bolt12ParseError::InvalidBech32Hrp) + } + ldk_node::lightning::offers::parse::Bolt12ParseError::Bech32(e) => { + LdkNodeError::Bolt12Parse(Bolt12ParseError::Bech32(e.to_string())) + } + ldk_node::lightning::offers::parse::Bolt12ParseError::Decode(e) => { + LdkNodeError::Bolt12Parse(Bolt12ParseError::Decode(e.into())) + } + ldk_node::lightning::offers::parse::Bolt12ParseError::InvalidSemantics(e) => { + LdkNodeError::Bolt12Parse(Bolt12ParseError::InvalidSemantics(format!("{:?}", e))) + } + ldk_node::lightning::offers::parse::Bolt12ParseError::InvalidSignature(e) => { + LdkNodeError::Bolt12Parse(Bolt12ParseError::InvalidSignature(e.to_string())) + } + } + } +} diff --git a/rust/src/utils/mod.rs b/rust/src/utils/mod.rs new file mode 100644 index 0000000..a91e735 --- /dev/null +++ b/rust/src/utils/mod.rs @@ -0,0 +1 @@ +pub mod error; From 8f7eb621964c27dc0f58f24acc95d0ca38727c2d Mon Sep 17 00:00:00 2001 From: StaxoLotl Date: Sat, 6 Jul 2024 11:29:00 -0400 Subject: [PATCH 45/48] dio and integration_test added --- example/ios/Podfile.lock | 8 +++++++- example/lib/main.dart | 43 ++++++++++++++++++---------------------- example/pubspec.lock | 16 +++++++++++++++ example/pubspec.yaml | 1 + 4 files changed, 43 insertions(+), 25 deletions(-) diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 4c8d391..f5e3f3f 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1,5 +1,7 @@ PODS: - Flutter (1.0.0) + - integration_test (0.0.1): + - Flutter - ldk_node (0.3.0): - Flutter - path_provider_foundation (0.0.1): @@ -8,12 +10,15 @@ PODS: DEPENDENCIES: - Flutter (from `Flutter`) + - integration_test (from `.symlinks/plugins/integration_test/ios`) - ldk_node (from `.symlinks/plugins/ldk_node/ios`) - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) EXTERNAL SOURCES: Flutter: :path: Flutter + integration_test: + :path: ".symlinks/plugins/integration_test/ios" ldk_node: :path: ".symlinks/plugins/ldk_node/ios" path_provider_foundation: @@ -21,7 +26,8 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 - ldk_node: 4a64d0c424f716c522130b900a00405f5b2df367 + integration_test: ce0a3ffa1de96d1a89ca0ac26fca7ea18a749ef4 + ldk_node: fffac5d5afd55ed30034da12cdaca29f41b3fdd2 path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 PODFILE CHECKSUM: 4e8f8b2be68aeea4c0d5beb6ff1e79fface1d048 diff --git a/example/lib/main.dart b/example/lib/main.dart index ca531cc..8097cd2 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; @@ -26,14 +28,14 @@ class _MyAppState extends State { ldk.Bolt11Invoice? invoice; ldk.UserChannelId? userChannelId; - String esploraUrl = "https://mutinynet.ltbl.io/api"; - /* - // For local esplora server - String esploraUrl = Platform.isAndroid - ? - //10.0.2.2 to access the AVD - 'http://10.0.2.2:30000' - : 'http://127.0.0.1:30000';*/ + // Replace this with your local esplora url + String esploraUrl = + // "https://testnet-electrs.ltbl.io:3004"; + Platform.isAndroid + ? + //10.0.2.2 to access the AVD + 'http://10.0.2.2:30000' + : 'http://127.0.0.1:30000'; @override void initState() { @@ -65,7 +67,7 @@ class _MyAppState extends State { } Future initAliceNode() async { - final aliceConfig = await initLdkConfig('alice_mutinynet', + final aliceConfig = await initLdkConfig('alice_regtest', ldk.SocketAddress.hostname(addr: "0.0.0.0", port: 3003)); ldk.Builder aliceBuilder = ldk.Builder.fromConfig(config: aliceConfig); aliceNode = await aliceBuilder @@ -92,13 +94,15 @@ class _MyAppState extends State { } initBobNode() async { - ldk.Builder bobBuilder = ldk.Builder - .mutinynet(); // For a node on the mutiny network with default config and services + final bobConfig = await initLdkConfig( + "bob_regtest", ldk.SocketAddress.hostname(addr: "0.0.0.0", port: 3001)); + ldk.Builder bobBuilder = ldk.Builder.fromConfig(config: bobConfig); bobNode = await bobBuilder .setEntropyBip39Mnemonic( mnemonic: ldk.Mnemonic( seedPhrase: 'puppy interest whip tonight dad never sudden response push zone pig patch')) + .setEsploraServer(esploraUrl) .build(); await startNode(bobNode); final res = await bobNode.nodeId(); @@ -209,25 +213,16 @@ class _MyAppState extends State { userChannelId = await aliceNode.connectOpenChannel( channelAmountSats: BigInt.from(funding_amount_sat), announceChannel: true, - socketAddress: ldk.SocketAddress.hostname( - addr: '45.79.52.207', - port: 9735, - ), + socketAddress: bobAddr!, pushToCounterpartyMsat: BigInt.from(push_msat), - nodeId: ldk.PublicKey( - hex: - '02465ed5be53d04fde66c9418ff14a5f2267723810176c9212b722e542dc1afb1b', - )); + nodeId: bobNodeId!); } receiveAndSendPayments() async { final bobBolt11Handler = await bobNode.bolt11Payment(); final aliceBolt11Handler = await aliceNode.bolt11Payment(); - // Bob doesn't have a channel yet, so he can't receive normal payments, - // but he can receive payments via JIT channels through an LSP configured - // in its node. - invoice = await bobBolt11Handler.receiveViaJitChannel( - amountMsat: BigInt.from(25000 * 1000), + invoice = await bobBolt11Handler.receive( + amountMsat: BigInt.from(2500000), description: 'asdf', expirySecs: 9217); setState(() { diff --git a/example/pubspec.lock b/example/pubspec.lock index da2e496..61d8efa 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -73,6 +73,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.8" + dio: + dependency: "direct main" + description: + name: dio + sha256: e17f6b3097b8c51b72c74c9f071a605c47bcc8893839bd66732457a5ebe73714 + url: "https://pub.dev" + source: hosted + version: "5.5.0+1" + dio_web_adapter: + dependency: transitive + description: + name: dio_web_adapter + sha256: "36c5b2d79eb17cdae41e974b7a8284fec631651d2a6f39a8a2ff22327e90aeac" + url: "https://pub.dev" + source: hosted + version: "1.0.1" fake_async: dependency: transitive description: diff --git a/example/pubspec.yaml b/example/pubspec.yaml index db48300..1892133 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -13,6 +13,7 @@ dependencies: cupertino_icons: ^1.0.2 path_provider: ^2.0.14 google_fonts: ^4.0.4 + dio: ^5.5.0+1 dev_dependencies: flutter_test: sdk: flutter From 49f7021f9f9eb40ace3b4a445069c5fc288e352b Mon Sep 17 00:00:00 2001 From: StaxoLotl Date: Sun, 7 Jul 2024 13:54:00 -0400 Subject: [PATCH 46/48] code cleanup --- example/lib/main.dart | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/example/lib/main.dart b/example/lib/main.dart index 8097cd2..75a5b47 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -29,13 +29,11 @@ class _MyAppState extends State { ldk.UserChannelId? userChannelId; // Replace this with your local esplora url - String esploraUrl = - // "https://testnet-electrs.ltbl.io:3004"; - Platform.isAndroid - ? - //10.0.2.2 to access the AVD - 'http://10.0.2.2:30000' - : 'http://127.0.0.1:30000'; + String esploraUrl = Platform.isAndroid + ? + //10.0.2.2 to access the AVD + 'http://10.0.2.2:30000' + : 'http://127.0.0.1:30000'; @override void initState() { From 23919deafcb3466b602c4a733f3db38c5dfc00ac Mon Sep 17 00:00:00 2001 From: kumulynja Date: Sun, 7 Jul 2024 22:41:55 +0200 Subject: [PATCH 47/48] export U8Array types to be able to form payment Id's etc. --- lib/ldk_node.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ldk_node.dart b/lib/ldk_node.dart index 10af5cc..b74ebe2 100644 --- a/lib/ldk_node.dart +++ b/lib/ldk_node.dart @@ -29,5 +29,6 @@ export './src/generated/api/types.dart' GossipSourceConfig, EntropySourceConfig_SeedFile; export 'src/root.dart'; +export 'src/generated/lib.dart' show U8Array4, U8Array12, U8Array64, U8Array32; export 'src/utils/utils.dart' hide ExceptionBase, mapLdkBuilderError, mapLdkNodeError, Frb; From 7b4055f1f8433c1d92738ef8eb03d48232bc5d97 Mon Sep 17 00:00:00 2001 From: StaxoLotl Date: Mon, 8 Jul 2024 01:22:00 -0400 Subject: [PATCH 48/48] bolt11 & bolt12 integration tests added --- ...lt11_and_12_test.dart => bolt11_test.dart} | 5 +- example/integration_test/bolt12_test.dart | 302 ++++++++++++++++++ 2 files changed, 304 insertions(+), 3 deletions(-) rename example/integration_test/{bolt11_and_12_test.dart => bolt11_test.dart} (94%) create mode 100644 example/integration_test/bolt12_test.dart diff --git a/example/integration_test/bolt11_and_12_test.dart b/example/integration_test/bolt11_test.dart similarity index 94% rename from example/integration_test/bolt11_and_12_test.dart rename to example/integration_test/bolt11_test.dart index 463bae8..d5476f5 100644 --- a/example/integration_test/bolt11_and_12_test.dart +++ b/example/integration_test/bolt11_test.dart @@ -6,12 +6,11 @@ import 'package:path_provider/path_provider.dart'; void main() { BigInt satsToMsats(int sats) => BigInt.from(sats * 1000); - String mSatsToSats(BigInt mSats) => '${mSats.toInt() ~/ 1000}sats'; IntegrationTestWidgetsFlutterBinding.ensureInitialized(); - group('bolt11_&_bolt12', () { + group('bolt11_integration', () { setUp(() async {}); - testWidgets('bolt11_full_cycle', (WidgetTester tester) async { + testWidgets('full_cycle', (WidgetTester tester) async { final directory = await getApplicationDocumentsDirectory(); final ldkCache = "${directory.path}/ldk_cache"; final aliceStoragePath = "$ldkCache/integration/alice"; diff --git a/example/integration_test/bolt12_test.dart b/example/integration_test/bolt12_test.dart new file mode 100644 index 0000000..af1ca93 --- /dev/null +++ b/example/integration_test/bolt12_test.dart @@ -0,0 +1,302 @@ +import 'dart:convert'; +import 'dart:io'; + +import 'package:dio/dio.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:integration_test/integration_test.dart'; +import 'package:ldk_node/ldk_node.dart' as ldk; +import 'package:path_provider/path_provider.dart'; + +void main() { + String esploraUrl = Platform.isAndroid + ? + //10.0.2.2 to access the AVD + 'http://10.0.2.2:30000' + : 'http://127.0.0.1:30000'; + final regTestClient = BtcClient(""); + Future initLdkConfig( + String path, ldk.SocketAddress address) async { + final directory = await getApplicationDocumentsDirectory(); + final nodePath = "${directory.path}/ldk_cache/integration/regtest/$path"; + final config = ldk.Config( + probingLiquidityLimitMultiplier: BigInt.from(3), + trustedPeers0Conf: [], + storageDirPath: nodePath, + network: ldk.Network.regtest, + listeningAddresses: [address], + onchainWalletSyncIntervalSecs: BigInt.from(60), + walletSyncIntervalSecs: BigInt.from(20), + feeRateCacheUpdateIntervalSecs: BigInt.from(600), + logLevel: ldk.LogLevel.debug, + defaultCltvExpiryDelta: 144); + return config; + } + + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + testWidgets('full_cycle', (WidgetTester tester) async { + final aliceConfig = await initLdkConfig( + 'alice', ldk.SocketAddress.hostname(addr: "0.0.0.0", port: 3003)); + final alice_builder = ldk.Builder.fromConfig(config: aliceConfig) + .setEntropyBip39Mnemonic( + mnemonic: ldk.Mnemonic( + seedPhrase: + "replace force spring cruise nothing select glass erupt medal raise consider pull")) + .setEsploraServer(esploraUrl); + final aliceNode = await alice_builder.build(); + await aliceNode.start(); + final bobConfig = await initLdkConfig( + 'bob', ldk.SocketAddress.hostname(addr: "0.0.0.0", port: 3004)); + + final bob_builder = ldk.Builder.fromConfig(config: bobConfig) + .setEntropyBip39Mnemonic( + mnemonic: ldk.Mnemonic( + seedPhrase: + "skin hospital fee risk health theory actor kiwi solution desert unhappy hello")) + .setEsploraServer(esploraUrl); + final bobNode = await bob_builder.build(); + await bobNode.start(); + // loading bitcoin core wallet + await regTestClient.loadWallet(); + debugPrint("Manually syncing Alice's node"); + await Future.wait([aliceNode.syncWallets()]); + + debugPrint("Manually syncing Bob's node"); + await Future.wait([bobNode.syncWallets()]); + + debugPrint("syncing complete"); + + final aliceNodeAddress = + await (await aliceNode.onChainPayment()).newAddress(); + final bobNodeAddress = await (await bobNode.onChainPayment()).newAddress(); + debugPrint(aliceNodeAddress.s); + debugPrint(bobNodeAddress.s); + await regTestClient.generate(11, aliceNodeAddress.s); + await regTestClient.generate(11, bobNodeAddress.s); + debugPrint("Manually syncing Alice's node"); + await Future.wait([aliceNode.syncWallets()]); + + debugPrint("Manually syncing Bob's node"); + await Future.wait([bobNode.syncWallets()]); + debugPrint("syncing complete"); + debugPrint( + "Alice's onChain Balance:${(await aliceNode.listBalances()).spendableOnchainBalanceSats}"); + debugPrint( + "Bob's onChain Balance:${(await bobNode.listBalances()).spendableOnchainBalanceSats}"); + + debugPrint("Opening channel from aliceNode to bobNode"); + final bobNodeId = await bobNode.nodeId(); + final funding_amount_sat = 10000; + final push_msat = (funding_amount_sat / 2) * 1000; + final userChannelId = await aliceNode.connectOpenChannel( + socketAddress: (await bobNode.listeningAddresses())!.first, + nodeId: bobNodeId, + channelAmountSats: BigInt.from(funding_amount_sat), + pushToCounterpartyMsat: BigInt.from(push_msat), + announceChannel: true); + debugPrint("Channel created; id: ${userChannelId.data}"); + final alicePeers = await aliceNode.listPeers(); + final aliceChannels = await aliceNode.listChannels(); + expect( + (alicePeers.where((e) => e.nodeId.hex == bobNodeId.hex)).toList() != [], + true); + + await regTestClient.generate(11, aliceNodeAddress.s); + expect( + (aliceChannels.where((e) => e.counterpartyNodeId.hex == bobNodeId.hex)) + .where((f) => f.isUsable && f.isChannelReady) + .toList() != + [], + true); + + debugPrint("waiting for latest node announcement broadcast timestamp"); + while ((await bobNode.status()).latestNodeAnnouncementBroadcastTimestamp == + null) { + await Future.delayed(Duration(milliseconds: 5)); + } + final payment1ExpectedAmountMsat = BigInt.from(1000000000); + final bobNodeBol12Handler = await bobNode.bolt12Payment(); + final aliceNodeBol12Handler = await aliceNode.bolt12Payment(); + + final offer1 = await bobNodeBol12Handler.receive( + amountMsat: payment1ExpectedAmountMsat, description: "payment_1"); + final payment1Id = await aliceNodeBol12Handler.send(offer: offer1); + debugPrint("payment_1 successful: ${payment1Id.field0}"); + expect((await aliceNode.listPayments()).length == 1, true); + final offerAmountMsat = 100000000; + + final payment2ExpectedAmountMsat = offerAmountMsat + 10000; + final offer2 = await bobNodeBol12Handler.receive( + amountMsat: BigInt.from(offerAmountMsat), description: "payment_2"); + final payment2Id = await aliceNodeBol12Handler.sendUsingAmount( + offer: offer2, amountMsat: BigInt.from(payment2ExpectedAmountMsat)); + debugPrint("payment_2 successful: ${payment2Id.field0}"); + expect( + ((await aliceNode.listPayments()) + .where((e) => listEquals(e.id.field0, payment2Id.field0))) + .length == + 1, + true); + // Now bobNode refunds the amount aliceNode just overpaid. + final overPaidAmount = payment2ExpectedAmountMsat - offerAmountMsat; + final payment2Refund = await bobNodeBol12Handler.initiateRefund( + amountMsat: BigInt.from(overPaidAmount), expirySecs: 3600); + final payment2RefundInvoice = await aliceNodeBol12Handler + .requestRefundPayment(refund: payment2Refund); + debugPrint("payment_2 refund successful: ${payment2RefundInvoice.data}"); + final bobNodePayment3Id = (await bobNode.listPayments()) + .firstWhere((p) => p.amountMsat == BigInt.from(overPaidAmount)) + .id; + expect( + ((await bobNode.listPayments()).where( + (e) => listEquals(e.id.field0, bobNodePayment3Id.field0))) + .length == + 1, + true); + await aliceNode.closeChannel( + counterpartyNodeId: bobNodeId, userChannelId: userChannelId); + await aliceNode.stop(); + await bobNode.stop(); + expect((await aliceNode.status()).isRunning, false); + expect((await bobNode.status()).isRunning, false); + }); +} + +class BtcClient { + // Bitcoin core credentials + String rpcUser = "admin1"; + String rpcPassword = "123"; + int rpcPort = 18443; + + Dio? _dioClient; + late Map _headers; + late String _url; + final String wallet; + + String getConnectionString(String host, int port, String wallet) { + return 'http://$host:$port/wallet/$wallet'; + } + + BtcClient(this.wallet) { + _headers = { + 'Content-Type': 'application/json', + 'authorization': + 'Basic ${base64.encode(utf8.encode("$rpcUser:$rpcPassword"))}' + }; + _url = getConnectionString( + Platform.isAndroid ? "10.0.2.2" : "0.0.0.0", rpcPort, wallet); + _dioClient = Dio(); + } + + Future loadWallet() async { + try { + var params = [wallet]; + await call("loadwallet", params); + } on Exception catch (e) { + if (e.toString().contains("-4")) { + debugPrint(" $wallet already loaded!"); + } else if (e.toString().contains("-18")) { + debugPrint("$wallet doesn't exist!"); + var params = [wallet]; + await call("createwallet", params); + } + } + } + + Future> generate(int nblocks, String address) async { + var params = [ + nblocks, + address, + ]; + final res = await call("generatetoaddress", params); + return res; + } + + Future sendToAddress(String address, int amount) async { + var params = [address, amount]; + final res = await call("sendtoaddress", params); + return res; + } + + Future getBlockCount() async { + var params = []; + final res = await call("getblockcount", params); + return res; + } + + Future call(var methodName, [var params]) async { + var body = { + 'jsonrpc': '2.0', + 'method': methodName, + 'params': params ?? [], + 'id': '1' + }; + + try { + var response = await _dioClient!.post( + _url, + data: body, + options: Options( + headers: _headers, + ), + ); + if (response.statusCode == HttpStatus.ok) { + var body = response.data as Map; + if (body.containsKey('error') && body["error"] != null) { + var error = body['error']; + + if (error["message"] is Map) { + error = error['message']; + } + + throw Exception( + "errorCode: ${error['code']},errorMsg: ${error['message']}", + ); + } + return body['result']; + } + } on DioException catch (e) { + if (e.type == DioExceptionType.badResponse) { + var errorResponseBody = e.response!.data; + + switch (e.response!.statusCode) { + case 401: + throw Exception( + " code: 401, message: Unauthorized", + ); + case 403: + throw Exception( + "code: 403,message: Forbidden", + ); + case 404: + if (errorResponseBody['error'] != null) { + var error = errorResponseBody['error']; + throw Exception( + "errorCode: ${error['code']},errorMsg: ${error['message']}", + ); + } + throw Exception( + "code: 500, message: Internal Server Error", + ); + default: + if (errorResponseBody['error'] != null) { + var error = errorResponseBody['error']; + throw Exception( + "errorCode: ${error['code']},errorMsg: ${error['message']}", + ); + } + throw Exception( + "code: 500, message: 'Internal Server Error'", + ); + } + } else if (e.type == DioExceptionType.connectionError) { + throw Exception( + "code: 500,message: e.message ?? 'Connection Error'", + ); + } + throw Exception( + "code: 500, message: e.message ?? 'Unknown Error'", + ); + } + } +}